本文整理汇总了C++中wxColor函数的典型用法代码示例。如果您正苦于以下问题:C++ wxColor函数的具体用法?C++ wxColor怎么用?C++ wxColor使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wxColor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: streamOut
/// Tests Serialization
/// @return True if all tests were executed, false if not
bool FontSettingTestSuite::TestCaseSerialize()
{
//------Last Checked------//
// - Dec 6, 2004
bool ok = false;
TestStream testStream;
PowerTabOutputStream streamOut(testStream.GetOutputStream());
// Write test data to stream
FontSetting fontSettingOut(wxT("Arial"), 12, FontSetting::weightBold, true,
true, true, wxColor(255,0,0));
fontSettingOut.Serialize(streamOut);
// Output must be OK before using input
if (testStream.CheckOutputState())
{
PowerTabInputStream streamIn(testStream.GetInputStream());
// Read test data back from stream
FontSetting fontSettingIn;
fontSettingIn.Deserialize(streamIn,
PowerTabFileHeader::FILEVERSION_CURRENT);
// Validate the data
ok = ((fontSettingIn == fontSettingOut)
&& (streamIn.CheckState()));
}
TEST(wxT("Serialize"), ok);
return (true);
}
示例2: render
void GraphMemory::render(wxDC &dc) {
colors::rgb tmp = colors::rgb(color);
dc.SetBrush(wxBrush(wxColor(tmp.r, tmp.g, tmp.b)));
dc.DrawRectangle(0,0,GRAPH_MEMORY_SIZE, GRAPH_MEMORY_SIZE);
}
示例3: GetTooltipColors
static void GetTooltipColors()
{
GtkWidget* widget = gtk_window_new(GTK_WINDOW_POPUP);
const char* name = "gtk-tooltip";
if (gtk_check_version(2, 11, 0))
name = "gtk-tooltips";
gtk_widget_set_name(widget, name);
gtk_widget_ensure_style(widget);
GdkColor c = widget->style->bg[GTK_STATE_NORMAL];
gs_objects.m_colTooltip = wxColor(c);
c = widget->style->fg[GTK_STATE_NORMAL];
gs_objects.m_colTooltipText = wxColor(c);
gtk_widget_destroy(widget);
}
示例4: wxColor
void BetProcedureFrame::DoGoInInitialState() {
state_ = STATE_INITIAL;
m_buttonSTART->SetBackgroundColour( wxColor(0, 255, 0));
//set buttons status
m_buttonSTART->SetLabel("START");
m_buttonSTART->Enable();
m_buttonSTOP->Disable();
m_butVoltage1->Disable();
m_button5->Disable(); //-5
m_butVoltagem1->Disable();
m_txtVoltage->Disable();
m_txtCurrent->Enable();
m_txtDuration->Enable();
m_button31->Disable();
m_button41->Disable();
m_button32->Disable();
m_button42->Disable();
m_txtLimitCur1->Enable();
m_txtLimitCur2->Enable();
m_txtLimitCur3->Enable();
m_txtLimitCur4->Enable();
m_txtLimitCur5->Enable();
m_txtLimitCur6->Enable();
m_button8->Enable();
r_min_value_ = options_[std::string("r_min_value")].as<unsigned int>();
alarm_time_ = options_[std::string("alarm_time")].as<unsigned int>() * 60; //convert to seconds
r_alarm_value_ = options_[std::string("r_alarm_value")].as<unsigned int>();
r_max_value_ = options_[std::string("r_max_value")].as<unsigned int>();
r_max_hist_value_ = options_[std::string("r_max_hist_value")].as<unsigned int>();
v_check_value_ = options_[std::string("v_check_value")].as<unsigned int>();
DoZeroSwitches();
}
示例5: GUIFrameWEnum
propgridtest03Frame::propgridtest03Frame(wxFrame *frame): GUIFrameWEnum(frame)
{
m_CodeLog->StyleSetForeground(wxSTC_C_COMMENT, wxColor(0,128,0));
m_CodeLog->Show(false);
m_mgr.DetachPane(m_CodeLog);
}
示例6: GetAttrByRow
virtual bool GetAttrByRow( unsigned int row, unsigned int col,
wxDataViewItemAttr &attr ) const
{
wxColour colors[]={*wxWHITE,wxColor(230,230,230)};
attr.SetBackgroundColour(colors[(row)%(sizeof(colors)/sizeof(colors[0]))]);
return true;
}
示例7: Create
ImagePanel::ImagePanel(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& sz)
{
// create panel
Create(parent, id, pos, sz, wxTAB_TRAVERSAL, _T("_imgpanel"));
// stop auto erase background
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
// memorydc for double buffer draw
wxInt32 iScrW = wxSystemSettings::GetMetric(wxSYS_SCREEN_X, this);
wxInt32 iScrH = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, this);
wxBitmap bmp(iScrW, iScrH);
m_dcMem.SelectObject(bmp);
m_dcMem.SetBackground(wxBrush(wxColor(0x00606060)));
m_dcMem.Clear();
// Event process
Connect(wxEVT_PAINT, (wxObjectEventFunction)&ImagePanel::OnPaint);
Connect(wxEVT_ERASE_BACKGROUND, (wxObjectEventFunction)&ImagePanel::OnErase);
Connect(wxEVT_SIZE, (wxObjectEventFunction)&ImagePanel::OnSize);
Connect(wxEVT_CONTEXT_MENU, (wxObjectEventFunction)&ImagePanel::OnContextMenu);
Connect(wxEVT_KILL_FOCUS, (wxObjectEventFunction)&ImagePanel::OnKillFocus);
// mouse event
Connect(wxEVT_LEFT_DOWN, (wxObjectEventFunction)&ImagePanel::OnMouseLD);
Connect(wxEVT_LEFT_UP, (wxObjectEventFunction)&ImagePanel::OnMouseLU);
Connect(wxEVT_MOTION, (wxObjectEventFunction)&ImagePanel::OnMouseMove);
// menu or tool-button command
Connect(ID_CMENU_SAVE, wxEVT_MENU, (wxObjectEventFunction)&ImagePanel::OnCmenuSave);
}
示例8: dc
void
ChessboardFrame::paintNIGGER(void)
{
wxPaintDC dc(drawPane);
dc.SetPen( wxPen( wxColor(0,0,0), 1 ) );
int k = GetVirtualSize().GetWidth()/2 - myCB->getNumCells()/2*CELL_WIDTH;
int k1 = GetVirtualSize().GetHeight()/2 - myCB->getNumCells()/2*CELL_HEIGHT;
ButtonSetBomb->SetPosition( wxPoint(GetVirtualSize().GetWidth()/2 + myCB->getNumCells()/2*CELL_WIDTH + CELL_WIDTH*2, GetVirtualSize().GetHeight()/2 - myCB->getNumCells()/2*CELL_HEIGHT) );
ButtonShowBomb->SetPosition( wxPoint(GetVirtualSize().GetWidth()/2 + myCB->getNumCells()/2*CELL_WIDTH + CELL_WIDTH*2, GetVirtualSize().GetHeight()/2 - myCB->getNumCells()/2*CELL_HEIGHT+30) );
ButtonHideBomb->SetPosition( wxPoint(GetVirtualSize().GetWidth()/2 + myCB->getNumCells()/2*CELL_WIDTH + CELL_WIDTH*2, GetVirtualSize().GetHeight()/2 - myCB->getNumCells()/2*CELL_HEIGHT+60) );
ButtonChangeColors->SetPosition( wxPoint(GetVirtualSize().GetWidth()/2 + myCB->getNumCells()/2*CELL_WIDTH + CELL_WIDTH*2, GetVirtualSize().GetHeight()/2 - myCB->getNumCells()/2*CELL_HEIGHT+90 ) );
ButtonTimer->SetPosition( wxPoint(GetVirtualSize().GetWidth()/2 + myCB->getNumCells()/2*CELL_WIDTH + CELL_WIDTH*2, GetVirtualSize().GetHeight()/2 - myCB->getNumCells()/2*CELL_HEIGHT+120 ) );
ButtonSetBomb->Show();
ButtonShowBomb->Show();
ButtonHideBomb->Show();
ButtonChangeColors->Show();
ButtonTimer->Show();
Colors color;
for (unsigned int i = 0; i < myCB->getNumCells(); i++) {
for (unsigned int j = 0; j < myCB->getNumCells(); j++) {
color = myCB->getCellColor(i,j);
dc.SetBrush( *getBrushColor(color) );
dc.DrawRectangle(i*CELL_WIDTH+k, j*CELL_HEIGHT+k1, CELL_WIDTH, CELL_HEIGHT);
if(!myCB->isBombHidden()) {
drawBomb();
}
}
}
}
示例9: onActiveToggle
void onActiveToggle(bool state)
{
if (state)
{
m_colNormal = wxColor(GetGCThemeManager()->getColor("itemToolBar", "fg"));
m_szImage = "#playlist_button_normal";
}
else
{
m_colNormal = wxColor(GetGCThemeManager()->getColor("itemToolBar", "na-fg"));
m_szImage = "#playlist_button_nonactive";
}
refreshImage(true);
invalidatePaint();
}
示例10: Freeze
void ProcList::showList(int highlight)
{
int c = 0;
Freeze();
DeleteAllItems();
for (std::vector<Database::Item>::const_iterator i = list.items.begin(); i != list.items.end(); i++)
{
const Database::Symbol *sym = i->symbol;
double inclusive = i->inclusive;
double exclusive = i->exclusive;
float inclusivepercent = i->inclusive * 100.0f / list.totalcount;
float exclusivepercent = i->exclusive * 100.0f / list.totalcount;
InsertItem(c, sym->procname.c_str(), -1);
if(sym->isCollapseFunction || sym->isCollapseModule) {
SetItemTextColour(c,wxColor(0,128,0));
}
setColumnValue(c, COL_EXCLUSIVE, wxString::Format("%0.2fs",exclusive));
setColumnValue(c, COL_INCLUSIVE, wxString::Format("%0.2fs",inclusive));
setColumnValue(c, COL_EXCLUSIVEPCT, wxString::Format("%0.2f%%",exclusivepercent));
setColumnValue(c, COL_INCLUSIVEPCT, wxString::Format("%0.2f%%",inclusivepercent));
setColumnValue(c, COL_SAMPLES, wxString::Format("%0.2fs",exclusive));
setColumnValue(c, COL_CALLSPCT, wxString::Format("%0.2f%%",exclusivepercent));
setColumnValue(c, COL_MODULE, sym->module.c_str());
setColumnValue(c, COL_SOURCEFILE, sym->sourcefile.c_str());
setColumnValue(c, COL_SOURCELINE, ::toString(sym->sourceline).c_str());
c++;
}
this->SetItemState(highlight, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
Thaw();
EnsureVisible(highlight);
}
示例11: GetClientSize
void AngularMeter::DrawSectors(wxDC &dc)
{
int w,h ;
GetClientSize(&w,&h);
int hOffset = 0;
int wOffset = 0;
if (w > h) wOffset = (w - h) / 2;
if (h > w) hOffset = (h - w) / 2;
//square out the size
if (w > h) w=h;
if (h > w) h=w;
//Draw the dial
dc.SetPen(*wxThePenList->FindOrCreatePen(_dialColor,1 , wxSOLID));
dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(_dialColor,wxSOLID));
dc.DrawEllipticArc(0 + wOffset, 0 + hOffset, w, h, 0, 360);
dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(*wxBLACK, wxTRANSPARENT));
dc.SetPen(*wxThePenList->FindOrCreatePen(wxColor(0x25,0x25,0x25), 2, wxSOLID));
dc.DrawEllipticArc(0 + wOffset, 0 + hOffset, w, h, 45, -135);
dc.SetPen(*wxThePenList->FindOrCreatePen(wxColor(0x55,0x55,0x55), 2, wxSOLID));
dc.DrawEllipticArc(0 + wOffset, 0 + hOffset, w, h, -135, 45);
//Done drawing dial
//Draw warning range
if (_realWarningValue > 0){
dc.SetPen(*wxThePenList->FindOrCreatePen(_warningColor,2, wxSOLID));
dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(_warningColor, wxFDIAGONAL_HATCH));
double warningEnd = _angleEnd - _scaledWarningValue;
double warningStart = (_realAlertValue > 0 ? _angleEnd - _scaledAlertValue : _angleStart);
dc.DrawEllipticArc(0 + wOffset + 1, 0 + hOffset + 1, w - 2, h - 2, warningStart, warningEnd);
}
if (_realAlertValue > 0){
dc.SetPen(*wxThePenList->FindOrCreatePen(_alertColor, 3, wxSOLID));
dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(_alertColor, wxBDIAGONAL_HATCH));
dc.DrawEllipticArc(0 + wOffset + 1, 0 + hOffset + 1, w - 2, h - 2, _angleStart, _angleEnd - _scaledAlertValue);
}
}
示例12: m_ImageList
wxPageContainer::wxPageContainer(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
: m_ImageList(NULL)
, m_iActivePage(-1)
, m_pDropTarget(NULL)
, m_nLeftClickZone(wxFNB_NOWHERE)
, m_customizeOptions(wxFNB_CUSTOM_ALL)
, m_fixedTabWidth(wxNOT_FOUND)
{
m_pRightClickMenu = NULL;
m_nXButtonStatus = wxFNB_BTN_NONE;
m_nArrowDownButtonStatus = wxFNB_BTN_NONE;
m_pParent = parent;
m_nRightButtonStatus = wxFNB_BTN_NONE;
m_nLeftButtonStatus = wxFNB_BTN_NONE;
m_nTabXButtonStatus = wxFNB_BTN_NONE;
m_customMenu = NULL;
m_colorTo = wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
m_colorFrom = wxColor(*wxWHITE);
m_activeTabColor = wxColor(*wxWHITE);
m_activeTextColor = wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT));
m_nonActiveTextColor = wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT));
m_tabAreaColor = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
m_tabAreaColor = wxFNBRenderer::DarkColour(m_tabAreaColor, 12);
// Set default page height, this is done according to the system font
wxMemoryDC memDc;
wxBitmap bmp(10, 10);
memDc.SelectObject(bmp);
int width, height;
#ifdef __WXGTK__
wxFont normalFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
wxFont boldFont = normalFont;
boldFont.SetWeight(wxBOLD);
memDc.SetFont( boldFont );
#endif
memDc.GetTextExtent(wxT("Tp"), &width, &height);
int tabHeight = height + wxFNB_HEIGHT_SPACER; // We use 10 pixels as padding
wxWindow::Create(parent, id, pos, wxSize(size.x, tabHeight), style | wxNO_BORDER | wxNO_FULL_REPAINT_ON_RESIZE);
m_pDropTarget = new wxFNBDropTarget<wxPageContainer>(this, &wxPageContainer::OnDropTarget);
SetDropTarget(m_pDropTarget);
}
示例13: wxCHECK
/// Updates the contents of the FontSetting object using a delimited string containing the font settings
/// @param string Comma delimited string containing the font settings (FaceName,PointSize,Weight,Italic(T/F),Underline(T/F),StrikeOut(T/F),Color)
/// @return success or failure
bool FontSetting::SetFontSettingFromString(const wxChar* string)
{
//------Last Checked------//
// - Dec 6, 2004
wxCHECK(string != NULL, false);
wxString temp;
// Extract the face name
wxExtractSubString(temp, string, 0, wxT(','));
temp.Trim(false);
temp.Trim();
m_faceName = temp;
if (m_faceName.IsEmpty())
m_faceName = DEFAULT_FACENAME;
// Extract the point size
wxExtractSubString(temp, string, 1, wxT(','));
temp.Trim(false);
temp.Trim();
m_pointSize = wxAtoi(temp);
if (m_pointSize == 0)
m_pointSize = DEFAULT_POINTSIZE;
// Extract the weight
wxExtractSubString(temp, string, 2, wxT(','));
temp.Trim(false);
temp.Trim();
m_weight = wxAtoi(temp);
if ((m_weight % 100) != 0)
m_weight = DEFAULT_WEIGHT;
// Extract the italic setting
wxExtractSubString(temp, string, 3, wxT(','));
temp.Trim(false);
temp.Trim();
m_italic = (wxByte)((::wxStricmp(temp, wxT("T")) == 0) ? true : false);
// Extract the underline setting
wxExtractSubString(temp, string, 4, wxT(','));
temp.Trim(false);
temp.Trim();
m_underline = (wxByte)((::wxStricmp(temp, wxT("T")) == 0) ? true : false);
// Extract the strikeout setting
wxExtractSubString(temp, string, 5, wxT(','));
temp.Trim(false);
temp.Trim();
m_strikeOut = (wxByte)((::wxStricmp(temp, wxT("T")) == 0) ? true : false);
// Extract the color
wxExtractSubString(temp, string, 6, wxT(','));
temp.Trim(false);
temp.Trim();
wxUint32 color = wxAtoi(temp);
m_color = wxColor(LOBYTE(LOWORD(color)), HIBYTE(LOWORD(color)), LOBYTE(HIWORD(color)));
return (true);
}
示例14: BEATS_ASSERT
void CGradientCtrl::OnSliderScroll(wxScrollEvent& event)
{
BEATS_ASSERT(m_pSelectedCursor != nullptr);
BEATS_ASSERT(m_pSelectedCursor->GetType() == eCT_Alpha);
int value = event.GetPosition();
m_pSelectedCursor->SetColor(wxColor(value, value, value));
Refresh(true);
}
示例15: get
wxColor SkinConfig::get(skin_color_t item) const
{
if (item<=COLOR_CONFIG_MAX)
{
return color[item].IsOk()?color[item]:wxColor(0x111111);
}
return 1;
}