本文整理汇总了C++中wxColour::GetAsString方法的典型用法代码示例。如果您正苦于以下问题:C++ wxColour::GetAsString方法的具体用法?C++ wxColour::GetAsString怎么用?C++ wxColour::GetAsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxColour
的用法示例。
在下文中一共展示了wxColour::GetAsString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
bool wxColourPickerCtrl::Create( wxWindow *parent, wxWindowID id,
const wxColour &col,
const wxPoint &pos, const wxSize &size,
long style, const wxValidator& validator,
const wxString &name )
{
if (!wxPickerBase::CreateBase(parent, id, col.GetAsString(), pos, size,
style, validator, name))
return false;
// we are not interested to the ID of our picker as we connect
// to its "changed" event dynamically...
m_picker = new wxColourPickerWidget(this, wxID_ANY, col,
wxDefaultPosition, wxDefaultSize,
GetPickerStyle(style));
// complete sizer creation
wxPickerBase::PostCreation();
m_picker->Connect(wxEVT_COMMAND_COLOURPICKER_CHANGED,
wxColourPickerEventHandler(wxColourPickerCtrl::OnColourChange),
NULL, this);
return true;
}
示例2: SetLineNumbersFgColour
void LexerConf::SetLineNumbersFgColour(const wxColour& colour)
{
StyleProperty& style = GetProperty(LINE_NUMBERS_ATTR_ID);
if(!style.IsNull()) {
style.SetFgColour(colour.GetAsString(wxC2S_HTML_SYNTAX));
}
}
示例3: SetDefaultFgColour
void LexerConf::SetDefaultFgColour(const wxColour& colour)
{
StyleProperty& style = GetProperty(0);
if(!style.IsNull()) {
style.SetFgColour(colour.GetAsString(wxC2S_HTML_SYNTAX));
}
}
示例4: SetBookmarkBgColour
void OptionsConfig::SetBookmarkBgColour(wxColour c, size_t index)
{
wxArrayString arr = wxSplit(m_bookmarkBgColours, ';');
if(index < arr.GetCount()) {
arr.Item(index) = c.GetAsString(wxC2S_HTML_SYNTAX);
m_bookmarkBgColours = wxJoin(arr, ';');
}
}
示例5: AddTColor
void HTMLButcherMaskAreaImageFormatDialog::AddTColor(const wxColour &color)
{
wxSimpleHtmlListBox *tcolorsctrl=(wxSimpleHtmlListBox*)FindWindow(ID_TRANSPARENTCOLOR);
// dont allow duplicates
for (unsigned int i=0; i<tcolorsctrl->GetCount(); i++)
{
if (static_cast<ButcherColorClientData*>(tcolorsctrl->GetClientObject(i))->GetColor()==color)
return;
}
// some combinations of the fg/bg colours may be unreadable, so we invert
// the colour to make sure fg colour is different enough from m_colour
wxColour colFg(~color.Red(), ~color.Green(), ~color.Blue());
tcolorsctrl->Append(wxString::Format(wxT("<table bgcolor=\"%s\" width=\"100%%\"><tr><td><font color=\"%s\">%s</font></td></tr></table>"),
color.GetAsString(wxC2S_HTML_SYNTAX).c_str(),
colFg.GetAsString(wxC2S_HTML_SYNTAX).c_str(),
color.GetAsString(wxC2S_HTML_SYNTAX).c_str()),
new ButcherColorClientData(color));
}
示例6: SetGroupHLColor
void UserActions::SetGroupHLColor(const wxColour& color, const wxString& group)
{
cfg().Write(_T( "/Groups/" ) + group + _T( "/Opts/HLColor" ), color.GetAsString(wxC2S_HTML_SYNTAX));
}
示例7: wxStringWriteValue
template<> void wxStringWriteValue(wxString &s , const wxColour &data )
{
s = data.GetAsString(wxC2S_HTML_SYNTAX);
}
示例8: ColorToString
// wxColour
static wxString ColorToString(const wxColour & color)
{ return color.GetAsString(); }
示例9: getColourIconKey
wxString getColourIconKey( const wxColour& colour )
{
return colour.GetAsString(wxC2S_HTML_SYNTAX).AfterFirst('#');
}
示例10: MakeString
wxString Variant::MakeString (const wxColour & colour)
{
return colour.GetAsString(wxC2S_HTML_SYNTAX);
}
示例11: CheckBox
void ClippingBoxTestCaseBase::CheckBox(int x, int y, int width, int height)
{
// Check clipping box boundaries.
int clipX, clipY, clipW, clipH;
m_dc->GetClippingBox(&clipX, &clipY, &clipW, &clipH);
wxString msgPos;
if ( x != clipX || y != clipY )
{
msgPos =
wxString::Format(wxS("Invalid position: Actual: (%i, %i) Expected: (%i, %i)"),
clipX, clipY, x, y);
}
wxString msgDim;
if ( width != clipW || height != clipH )
{
msgDim =
wxString::Format(wxS("Invalid dimension: Actual: %i x %i Expected: %i x %i"),
clipW, clipH, width, height);
}
wxString msg;
if ( !msgPos.empty() )
{
msg = msgPos;
if ( !msgDim.empty() )
{
msg += wxS("\n- ");
msg += msgDim;
}
}
else if ( !msgDim.empty() )
{
msg = msgDim;
}
// We will examine pixels directly in the underlying bitmap
// so we need to get device coordinates of examined area.
x = m_dc->LogicalToDeviceX(x);
y = m_dc->LogicalToDeviceY(y);
width = m_dc->LogicalToDeviceXRel(width);
height = m_dc->LogicalToDeviceYRel(height);
// Update wxDC contents.
FlushDC();
// Check whether diagonal corners of the clipping box
// are actually drawn at the edge of the clipping region.
#if wxUSE_IMAGE
// For some renderers it's not possible to get pixels
// value from wxDC so we would have to examine pixels
// in the underlying bitmap.
wxImage img;
img = m_bmp.ConvertToImage();
#else
return;
#endif // wxUSE_IMAGE
// Check area near the top-left corner
int ymin = y-1;
int xmin = x-1;
int ymax = y+1;
int xmax = x+1;
ymin = wxMin(wxMax(ymin, 0), s_dcSize.GetHeight()-1);
xmin = wxMin(wxMax(xmin, 0), s_dcSize.GetWidth()-1);
ymax = wxMin(wxMax(ymax, 0), s_dcSize.GetHeight()-1);
xmax = wxMin(wxMax(xmax, 0), s_dcSize.GetWidth()-1);
for( int py = ymin; py <= ymax; py++ )
for( int px = xmin; px <= xmax; px++ )
{
wxColour c;
#if wxUSE_IMAGE
unsigned char r = img.GetRed(px, py);
unsigned char g = img.GetGreen(px, py);
unsigned char b = img.GetBlue(px, py);
c.Set(r, g, b);
#else
// We cannot get pixel value
break;
#endif // wxUSE_IMAGE / !wxUSE_IMAGE
wxString msgColour;
if ( px >= x && px <= x + (width-1) &&
py >= y && py <= y + (height-1) )
{
// Pixel inside the box.
if ( c != s_fgColour )
{
msgColour =
wxString::Format(wxS("Invalid colour drawn at (%i, %i): Actual: %s Expected: %s"),
px, py, c.GetAsString().mbc_str(), s_fgColour.GetAsString().mbc_str());
}
}
else
{
// Pixel outside the box.
if ( c != s_bgColour )
{
//.........这里部分代码省略.........