本文整理汇总了C++中SetForegroundColour函数的典型用法代码示例。如果您正苦于以下问题:C++ SetForegroundColour函数的具体用法?C++ SetForegroundColour怎么用?C++ SetForegroundColour使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetForegroundColour函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetScreenRect
void StripMenuButton::updateMouse()
{
wxRect panelRec = GetScreenRect();
panelRec.x += 2;
panelRec.y += 2;
panelRec.width -= 4;
panelRec.height -= 4;
wxPoint mousePoint = wxGetMousePosition();
bool t1 = panelRec.x <= mousePoint.x;
bool t2 = panelRec.y <= mousePoint.y;
bool t3 = (panelRec.x + panelRec.width ) >= mousePoint.x;
bool t4 = (panelRec.y + panelRec.height) >= mousePoint.y;
if (t1 && t2 && t3 && t4)
{
if (!m_bHovering)
{
SetForegroundColour( m_colHover );
m_bHovering = true;
invalidatePaint();
this->Refresh();
}
}
else if (m_bHovering)
{
SetForegroundColour( m_colNormal );
m_bHovering = false;
invalidatePaint();
this->Refresh();
}
}
示例2: SetForegroundColour
void wxHyperLink::SetVisitedColour (wxColour colour) {
m_VisitedColour = colour;
if (!m_Visited) {
SetForegroundColour (m_NormalColour);
}else{
SetForegroundColour (m_VisitedColour);
}
Refresh();
}
示例3: GetParent
void DlgSaveLayout::CreateControls()
{
////@begin DlgSaveLayout content construction
// Generated by DialogBlocks, 01/19/06 21:43:54 (unregistered)
wxXmlResource::Get()->LoadDialog(this, GetParent(), _T("ID_DIALOG_SAVE_LAYOUT"));
m_ComboLayout = XRCCTRL(*this, "ID_COMBOBOX_LAYOUT", wxComboBox);
////@end DlgSaveLayout content construction
// Create custom windows not generated automatically here.
////@begin DlgSaveLayout content initialisation
////@end DlgSaveLayout content initialisation
wxStringList layoutList(wxMainFrame::Get()->GetLayoutControl()->GetLayoutList());
for(int i = 0; i < layoutList.size(); i++)
{
wxString name(layoutList[i]);
if(name != wxMainFrame::Get()->GetLayoutControl()->getDefaultString())
{
m_ComboLayout->Append(name);
}
}
SetBackgroundColour(wxBackground_Pen);
SetForegroundColour(colorCaptionText);
m_ComboLayout->SetBackgroundColour(colorBgContent);
}
示例4: SetForegroundColour
void wxComboCtrl::OnThemeChange()
{
// there doesn't seem to be any way to get the text colour using themes
// API: TMT_TEXTCOLOR doesn't work neither for EDIT nor COMBOBOX
SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
#if wxUSE_UXTHEME
wxUxThemeEngine * const theme = wxUxThemeEngine::GetIfActive();
if ( theme )
{
// NB: use EDIT, not COMBOBOX (the latter works in XP but not Vista)
wxUxThemeHandle hTheme(this, L"EDIT");
COLORREF col;
HRESULT hr = theme->GetThemeColor
(
hTheme,
EP_EDITTEXT,
ETS_NORMAL,
TMT_FILLCOLOR,
&col
);
if ( SUCCEEDED(hr) )
{
SetBackgroundColour(wxRGBToColour(col));
// skip the call below
return;
}
wxLogApiError(_T("GetThemeColor(EDIT, ETS_NORMAL, TMT_FILLCOLOR)"), hr);
}
#endif
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
}
示例5: wxTextCtrl
wxInitialTipTextCtrl::wxInitialTipTextCtrl(wxWindow* parent, wxWindowID id)
: wxTextCtrl(parent, id, wxT("")),
myInitialTipShowing(false),
myDuringInitialTipChange(false)
{
SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
}
示例6: empty
void wxGenericColourButton::UpdateColour()
{
if ( !m_colour.Ok() )
{
#if wxCLRBTN_USES_BMP_BUTTON
wxBitmap empty(1,1);
SetBitmapLabel(empty);
#else
if ( HasFlag(wxCLRP_SHOW_LABEL) )
SetLabel(wxEmptyString);
#endif
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(~m_colour.Red(), ~m_colour.Green(), ~m_colour.Blue());
#if wxCLRBTN_USES_BMP_BUTTON
wxSize sz = GetSize();
sz.x -= 2*GetMarginX();
sz.y -= 2*GetMarginY();
wxPoint topleft;
if ( sz.x < 1 )
sz.x = 1;
else
if ( sz.y < 1 )
sz.y = 1;
wxBitmap bmp(sz.x, sz.y);
{
wxMemoryDC memdc(bmp);
memdc.SetPen(colFg);
memdc.SetBrush(m_colour);
memdc.DrawRectangle(topleft,sz);
if ( HasFlag(wxCLRP_SHOW_LABEL) )
{
int x, y, leading, desc;
wxString label = m_colour.GetAsString(wxC2S_HTML_SYNTAX);
memdc.GetTextExtent(label,&x,&y,&desc,&leading);
if ( x <= sz.x && y <= sz.y )
{
topleft.x += (sz.x-x)/2;
topleft.y += (sz.y-y)/2;
memdc.SetTextForeground(colFg);
memdc.DrawText(label,topleft);
}
}
}
SetBitmapLabel(bmp);
#else
SetForegroundColour(colFg);
SetBackgroundColour(m_colour);
if ( HasFlag(wxCLRP_SHOW_LABEL) )
SetLabel(m_colour.GetAsString(wxC2S_HTML_SYNTAX));
#endif
}
示例7: wxASSERT_MSG
bool wxHyperLink::Create (wxWindow *parent,
wxWindowID id,
const wxString &label,
const wxPoint &pos,
const wxSize &size,
long style,
const wxString &name) {
bool okay = FALSE;
// create static text
okay = wxStaticText::Create (parent, id, label, pos, size, style, name);
wxASSERT_MSG (okay, wxT("Failed to create wxStaticText, needed by wxHyperLink!"));
// initialize variables
m_URL = wxEmptyString;
m_Marked = false;
m_Visited = false;
m_MarkedColour = wxColour (wxT("DARK GREY"));
m_NormalColour = wxColour (wxT("BLUE"));
m_VisitedColour = wxColour (wxT("PURPLE"));
m_HoverCursor = wxCursor (wxCURSOR_HAND);
// set foreground colour
SetForegroundColour (m_NormalColour);
wxFont font = GetFont();
font.SetUnderlined (true);
SetFont (font);
// get background colour
m_BackgroundColour = GetBackgroundColour ();
return okay;
} // Create
示例8: m_pEngineData
CStatusLineCtrl::CStatusLineCtrl(CQueueView* pParent, const t_EngineData* const pEngineData, const wxRect& initialPosition)
: m_pEngineData(pEngineData)
{
m_mdc = 0;
m_pPreviousStatusText = 0;
m_last_elapsed_seconds = 0;
m_last_left = 0;
m_last_bar_split = -1;
m_last_permill = -1;
wxASSERT(pEngineData);
#ifdef __WXMSW__
Create(pParent, wxID_ANY, initialPosition.GetPosition(), initialPosition.GetSize());
#else
Create(pParent->GetMainWindow(), wxID_ANY, initialPosition.GetPosition(), initialPosition.GetSize());
#endif
SetOwnFont(pParent->GetFont());
SetForegroundColour(pParent->GetForegroundColour());
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
SetBackgroundColour(pParent->GetBackgroundColour());
m_transferStatusTimer.SetOwner(this);
m_pParent = pParent;
m_pStatus = 0;
m_lastOffset = -1;
m_gcLastTimeStamp = wxDateTime::Now();
m_gcLastOffset = -1;
m_gcLastSpeed = -1;
SetTransferStatus(0);
// Calculate field widths so that the contents fit under every language.
if (!m_initialized)
{
m_initialized = true;
wxClientDC dc(this);
dc.SetFont(GetFont());
wxCoord w, h;
wxTimeSpan elapsed(100, 0, 0);
dc.GetTextExtent(elapsed.Format(_("%H:%M:%S elapsed")), &w, &h);
m_textHeight = h;
m_fieldOffsets[0] = 50 + w;
dc.GetTextExtent(elapsed.Format(_("%H:%M:%S left")), &w, &h);
m_fieldOffsets[1] = m_fieldOffsets[0] + 20 + w;
m_fieldOffsets[2] = m_fieldOffsets[1] + 20;
m_fieldOffsets[3] = m_fieldOffsets[2] + PROGRESSBAR_WIDTH + 20;
}
#ifdef __WXGTK__
ResetCursor(this);
#endif
}
示例9: Create
moPreviewFrame::moPreviewFrame(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
m_pGLCanvas = NULL;
m_pSizer = NULL;
//Create(parent, wxID_ANY, _("Moldeo output"), pos, size, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY"));
//(*Initialize(moPreviewFrame)
Create(parent, wxID_ANY, _("Moldeo output"), pos, size, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY"));
SetClientSize(wxSize(400,300));
SetForegroundColour(wxColour(255,255,255));
SetBackgroundColour(wxColour(0,0,0));
/*
ToolBar1 = new wxToolBar(this, ID_TOOLBAR1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxNO_BORDER, _T("ID_TOOLBAR1"));
ToolBar1->SetToolBitmapSize(wxSize(32,32));
ToolBarItem1 = ToolBar1->AddTool(TOOLPLAY, _("Play"), wxBitmap(wxImage(_T(MOLDEODATADIR"/icons/play32.png"))), wxBitmap(wxImage(_T(MOLDEODATADIR"/icons/play32dis.png"))), wxITEM_NORMAL, _("Play syncro"), _("Help text"));
ToolBarItem2 = ToolBar1->AddTool(TOOLPAUSE, _("Pause"), wxBitmap(wxImage(_T(MOLDEODATADIR"/icons/pause32.png"))), wxBitmap(wxImage(_T(MOLDEODATADIR"/icons/pause32.png"))), wxITEM_NORMAL, _("Pause"), _("Pause"));
ToolBarItem3 = ToolBar1->AddTool(TOOLFULLSCREEN, _("Fullscreen"), wxBitmap(wxImage(_T(MOLDEODATADIR"/icons/onofficon32.png"))), wxNullBitmap, wxITEM_NORMAL, _("Fullscreen"), _("Fullscreen"));
ToolBar1->Realize();
SetToolBar(ToolBar1);
*/
Connect(wxID_ANY,wxEVT_CLOSE_WINDOW,(wxObjectEventFunction)&moPreviewFrame::OnClose);
//*)
//ToolBar1->Hide();
}
示例10: SetWindowStyle
// class constructor
Resound::MonitorNodeWidget::MonitorNodeWidget(wxWindow* parent, int id, ParameterAddress _addr)
: Resound::ParameterAddressWidgetBase(parent,id,_addr)
{
SetWindowStyle(wxSIMPLE_BORDER | wxCLIP_CHILDREN);
SetBackgroundColour(wxColour(30,100,150));
SetForegroundColour(wxColour(255,255,255));
wxSize size(45,45);
SetSize(size);
SetMinSize(size);
SetMaxSize(size);
// construct the sub objects and sizer
wxBoxSizer *topSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer *leftSizer = new wxBoxSizer( wxVERTICAL );
SetToolTip(wxConvertMB2WX(addr.get_address().c_str()));
//leftSizer->Add(new wxStaticText(this,MNW_LABEL,label, wxPoint(0,0),wxSize(40,18),wxALIGN_CENTRE),wxSizerFlags(0).Align(0).Border(wxALL,0));
//leftSizer->Add(new wxToggleButton(this,MNW_LOCKBUTTON,_("L"), wxPoint(0,0),wxSize(20,20)),wxSizerFlags(0).Center().Border(wxALL,0));
topSizer->Add(leftSizer);
meter = new Resound::ParameterVUMeterWidget(this,MNW_METER,rand() % 128,0,128,_(RESOURCE_DIR "/image/smMeterOff.png"),_(RESOURCE_DIR "/image/smMeterOn.png"));
meter->SetTarget(addr);
topSizer->Add(meter,wxSizerFlags(0).Align(0).Border(wxALL,0)); //meter1
SetSizer(topSizer);
//topSizer->SetSizeHints(this); // set size hints to honour minimum size
topSizer->Layout();
}
示例11: BaseMenuButton
StripMenuButton::StripMenuButton(wxWindow *parent, wxString text, const wxSize &size) : gcFlickerFreePaint<wxPanel>(parent, wxID_ANY, wxDefaultPosition, size, wxFULL_REPAINT_ON_RESIZE|wxWANTS_CHARS), BaseMenuButton((wxPanel*)this)
{
SetSize(size);
SetMinSize(size);
Bind( wxEVT_LEFT_DCLICK, &StripMenuButton::onMouseEvent, this);
Bind( wxEVT_MOTION, &StripMenuButton::onMouseEvent, this);
Bind( wxEVT_LEFT_DOWN, &StripMenuButton::onMouseDown, this);
Bind( wxEVT_LEFT_UP, &StripMenuButton::onMouseUp, this);
Bind( wxEVT_ENTER_WINDOW, &StripMenuButton::onMouseOver, this);
Bind( wxEVT_LEAVE_WINDOW, &StripMenuButton::onMouseOut, this);
Bind( wxEVT_UPDATE_UI, &StripMenuButton::onUpdateUI, this);
GetParent()->Bind( wxEVT_MOTION, &StripMenuButton::onMouseEvent, this);
m_bHovering = false;
m_bBold = false;
m_bHasFocus = false;
m_bUsesFocus = false;
m_uiOffset = 0;
m_colHover = wxColor(GetGCThemeManager()->getColor("hyperlinkmenu", "hov-fg"));
m_colNormal = wxColor(GetGCThemeManager()->getColor("hyperlinkmenu", "fg"));
SetForegroundColour( m_colNormal );
m_szLabel = text;
}
示例12: SetBackgroundColour
bool wxMenuButton::Create( wxWindow* parent, wxWindowID id,
const wxString &label,
const wxBitmap &bitmap,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& val,
const wxString& name)
{
m_style = style;
long flat = style & wxMENUBUT_FLAT;
wxControl::Create(parent,id,pos,size,wxNO_BORDER|wxCLIP_CHILDREN,val,name);
wxControl::SetLabel(label);
SetBackgroundColour(parent->GetBackgroundColour());
SetForegroundColour(parent->GetForegroundColour());
SetFont(parent->GetFont());
m_labelButton = new MenuLabelButton(this, id, label, bitmap, wxCUSTBUT_BUTTON|flat);
m_dropdownButton = new MenuDropButton(this, IDD_DROPDOWN_BUTTON, wxCUSTBUT_BUTTON|flat);
wxSize bestSize = DoGetBestSize();
SetSize( wxSize(size.x < 0 ? bestSize.x : size.x,
size.y < 0 ? bestSize.y : size.y) );
#if (wxMINOR_VERSION<8)
SetBestSize(GetSize());
#else
SetInitialSize(GetSize());
#endif
return TRUE;
}
示例13: wxInitAllImageHandlers
moPreviewWindow::moPreviewWindow(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
wxInitAllImageHandlers();
//(*Initialize(moPreviewWindow)
Create(parent, id, wxDefaultPosition, wxSize(401,336), wxTAB_TRAVERSAL, _T("id"));
SetForegroundColour(wxColour(255,255,255));
SetBackgroundColour(wxColour(0,0,0));
BitmapButtonPlay = new wxBitmapButton(this, ID_BITMAPBUTTONPLAY, wxBitmap(wxImage(_T("../../doc/icons/play32.png"))), wxPoint(0,0), wxSize(32,32), wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTONPLAY"));
BitmapButtonPlay->SetDefault();
BitmapButtonPause = new wxBitmapButton(this, ID_BITMAPBUTTONPAUSE, wxBitmap(wxImage(_T("../../doc/icons/pause32.png"))), wxPoint(32,0), wxSize(32,32), wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTONPAUSE"));
BitmapButtonPause->SetDefault();
ButtonFullSCreen = new wxBitmapButton(this, ID_BITMAPBUTTONFULLSCREEN, wxBitmap(wxImage(_T("../../doc/icons/fullscreen32.png"))), wxPoint(96,0), wxSize(32,32), wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTONFULLSCREEN"));
ButtonFullSCreen->SetDefault();
BitmapButtonScreenshot = new wxBitmapButton(this, ID_BITMAPBUTTONSCREENSHOT, wxBitmap(wxImage(_T("../../doc/icons/screenshot32.png"))), wxPoint(312,0), wxSize(32,32), wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTONSCREENSHOT"));
BitmapButtonScreenshot->SetDefault();
BitmapButtonSaveVideo = new wxBitmapButton(this, ID_BITMAPBUTTONSAVEVIDEO, wxBitmap(wxImage(_T("../../doc/icons/savevideo32.png"))), wxPoint(344,0), wxSize(32,32), wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTONSAVEVIDEO"));
BitmapButtonSaveVideo->SetDefault();
BitmapButtonSaveSession = new wxBitmapButton(this, ID_BITMAPBUTTONSAVESESSION, wxBitmap(wxImage(_T("../../doc/icons/savesession32.png"))), wxPoint(64,0), wxSize(32,32), wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTONSAVESESSION"));
BitmapButtonFocusOutput = new wxBitmapButton(this, ID_BITMAPBUTTONFOCUSOUTPUT, wxNullBitmap, wxPoint(136,5), wxSize(24,23), wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTONFOCUSOUTPUT"));
BitmapButtonFocusOutput->SetDefault();
Connect(ID_BITMAPBUTTONFULLSCREEN,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&moPreviewWindow::OnButtonFullSCreenClick);
Connect(ID_BITMAPBUTTONFOCUSOUTPUT,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&moPreviewWindow::OnBitmapButtonFocusAndActivate);
//*)
m_pGLCanvas = NULL;
}
示例14: wxPanel
FOOTPRINT_PREVIEW_WIDGET::FOOTPRINT_PREVIEW_WIDGET( wxWindow* aParent, KIWAY& aKiway ):
wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxFULL_REPAINT_ON_RESIZE | wxSUNKEN_BORDER | wxTAB_TRAVERSAL ),
m_prev_panel( nullptr ),
m_status_label( nullptr ),
m_sizer( nullptr )
{
m_prev_panel = FOOTPRINT_PREVIEW_PANEL_BASE::Create( this, aKiway );
if( !m_prev_panel )
return;
SetBackgroundColour( *wxBLACK );
SetForegroundColour( *wxWHITE );
m_status_label = new wxStaticText( this, -1, wxEmptyString );
m_sizer = new wxBoxSizer( wxVERTICAL );
m_sizer->Add( 0, 0, 1 );
m_sizer->Add( m_status_label, 0, wxALL | wxALIGN_CENTER, 0 );
m_sizer->Add( 0, 0, 1 );
auto outer_sizer = new wxBoxSizer( wxVERTICAL );
outer_sizer->Add( m_prev_panel->GetWindow(), 1, wxALL | wxEXPAND, 0 );
outer_sizer->Add( m_sizer, 1, wxALL | wxALIGN_CENTER, 0 );
m_sizer->ShowItems( false );
m_prev_panel->SetStatusHandler( [this]( FOOTPRINT_STATUS s ){ this->OnStatusChange( s ); } );
SetSizer( outer_sizer );
}
示例15: SetBackgroundColour
bool CTransparentStaticText::Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) {
bool bRetVal = wxStaticText::Create(parent, id, label, pos, size, style|wxTRANSPARENT_WINDOW, name);
SetBackgroundColour(parent->GetBackgroundColour());
SetForegroundColour(parent->GetForegroundColour());
return bRetVal;
}