本文整理汇总了C++中wxColour::GetRGB方法的典型用法代码示例。如果您正苦于以下问题:C++ wxColour::GetRGB方法的具体用法?C++ wxColour::GetRGB怎么用?C++ wxColour::GetRGB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxColour
的用法示例。
在下文中一共展示了wxColour::GetRGB方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnableAlternateRowColours
void wxListCtrlBase::EnableAlternateRowColours(bool enable)
{
if ( enable )
{
// This code is copied from wxDataViewMainWindow::OnPaint()
// Determine the alternate rows colour automatically from the
// background colour.
const wxColour bgColour = GetBackgroundColour();
// Depending on the background, alternate row color
// will be 3% more dark or 50% brighter.
int alpha = bgColour.GetRGB() > 0x808080 ? 97 : 150;
SetAlternateRowColour(bgColour.ChangeLightness(alpha));
}
else // Disable striping by setting invalid alternative colour.
{
SetAlternateRowColour(wxColour());
}
}
示例2: EnableAlternateRowColours
void wxTrunkListView::EnableAlternateRowColours(bool enable)
{
if (enable)
{
// Determine the alternate rows colour automatically from the
// background colour.
const wxColour bgColour = GetBackgroundColour();
// Depending on the background, alternate row color
// will be 3% more dark or 50% brighter.
#if (wxVERSION_NUMBER >= 2900)
int alpha = (bgColour.GetRGB() > 0x808080) ? 97 : 150;
m_alternateRowColour.SetBackgroundColour(bgColour.ChangeLightness(alpha));
#else
int alpha = ((bgColour.Red() | (bgColour.Green() << 8) | (bgColour.Blue() << 16)) > 0x808080) ? 97 : 150;
m_alternateRowColour.SetBackgroundColour(wxColourBase_ChangeLightness(bgColour, alpha));
#endif
}
else
{
m_alternateRowColour.SetBackgroundColour(wxColour());
}
}
示例3: SetPatternColor
void wxExcelInterior::SetPatternColor(const wxColour& patternColor)
{
InvokePutProperty(wxS("PatternColor"), (long)patternColor.GetRGB());
}
示例4: SetColor
void wxExcelInterior::SetColor(const wxColour& color)
{
InvokePutProperty(wxS("Color"), (long)color.GetRGB());
}
示例5: Create
//.........这里部分代码省略.........
if (!IsWindowOnScreen(oTempPoint.x, oTempPoint.y, oTempSize.GetWidth(), oTempSize.GetHeight())) {
oTempPoint.y = oTempPoint.x = 30;
}
#endif // ! __WXMAC__
} else {
oTempPoint = pos;
oTempSize = size;
}
DlgEventLogBase::Create( parent, id, caption, oTempPoint, oTempSize, style );
SetSizeHints(DLGEVENTLOG_MIN_WIDTH, DLGEVENTLOG_MIN_HEIGHT);
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
// Initialize Application Title
wxString strCaption = caption;
if (strCaption.IsEmpty()) {
strCaption.Printf(_("%s - Event Log"), pSkinAdvanced->GetApplicationName().c_str());
}
SetTitle(strCaption);
// Initialize Application Icon
SetIcons(*pSkinAdvanced->GetApplicationIcon());
CreateControls();
// Create List Pane Items
m_pList->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 109);
m_pList->InsertColumn(COLUMN_TIME, _("Time"), wxLIST_FORMAT_LEFT, 130);
m_pList->InsertColumn(COLUMN_MESSAGE, _("Message"), wxLIST_FORMAT_LEFT, 378);
m_pMessageInfoAttr = new wxListItemAttr(
wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT),
wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW),
wxNullFont
);
m_pMessageErrorAttr = new wxListItemAttr(
*wxRED,
wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW),
wxNullFont
);
#if EVENT_LOG_STRIPES
m_pList->EnableAlternateRowColours();
wxColour stripe_color;
#if wxCHECK_VERSION(3, 1, 0)
stripe_color = m_pList->GetAlternateRowColour();
if (!stripe_color.IsOk())
#endif
{
// copied from wxListCtrlBase::EnableAlternateRowColours(bool)
// Determine the alternate rows colour automatically from the
// background colour.
const wxColour bgColour = m_pList->GetBackgroundColour();
// Depending on the background, alternate row color
// will be 3% more dark or 50% brighter.
int alpha = bgColour.GetRGB() > 0x808080 ? 97 : 150;
stripe_color = bgColour.ChangeLightness(alpha);
}
#ifdef __WXMSW__
// work around a bug in wxWidgets 3.1 and earlier
// if row background color is wxSYS_COLOR_BTNFACE selected unfocused row is drawn with wrong colors
if (stripe_color == wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)) {
// adjust the color just enough to make it different
stripe_color.SetRGB(stripe_color.GetRGB() + 1);
}
#endif
m_pMessageInfoGrayAttr = new wxListItemAttr(
wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT),
stripe_color,
wxNullFont
);
m_pMessageErrorGrayAttr = new wxListItemAttr(
*wxRED,
stripe_color,
wxNullFont
);
#else
m_pMessageInfoGrayAttr = new wxListItemAttr(*m_pMessageInfoAttr);
m_pMessageErrorGrayAttr = new wxListItemAttr(*m_pMessageErrorAttr);
#endif
SetTextColor();
RestoreState();
OnRefresh();
// Register that we had the Event Log open immediately
SaveState();
m_Shortcuts[0].Set(wxACCEL_CTRL|wxACCEL_SHIFT, (int)'F', ID_SGDIAGNOSTICLOGFLAGS);
m_pAccelTable = new wxAcceleratorTable(1, m_Shortcuts);
SetAcceleratorTable(*m_pAccelTable);
return true;
}