wxFlatButtonBar::wxFlatButtonBar(wxWindow* parent, const wxFlatButton::eTheme theme, int flags) : wxFlatButtonBarBase(parent) , m_theme(theme) , m_style(flags) { SetBackgroundStyle(wxBG_STYLE_PAINT); // Colours - dark theme SetBgColour(wxFlatButton::GetBarBgColour(theme)); SetPenColour(wxFlatButton::GetBarBgColour(theme)); AddSpacer(2); }
wxFlatButtonBar::wxFlatButtonBar(wxWindow* parent, const wxFlatButton::eTheme theme, int rows, int cols) : wxFlatButtonBarBase(parent) , m_theme(theme) { SetBackgroundStyle(wxBG_STYLE_PAINT); m_mainSizer = new wxFlexGridSizer(rows, cols, 0, 0); SetSizer(m_mainSizer); SetBgColour(wxFlatButton::GetBarBgColour(theme)); SetPenColour(wxFlatButton::GetBarBgColour(theme)); }
wxFlatButton::wxFlatButton(wxWindow* parent, const wxString& label, const wxFlatButton::eTheme theme, const wxBitmap& bmp, const wxSize& size, int style) : wxFlatButtonBase(parent) , m_theme(theme) , m_state(kStateNormal) , m_text(label) , m_bmp(bmp) , m_accelIndex(wxNOT_FOUND) , m_kind(kKindNormal) , m_isChecked(false) , m_contextMenu(NULL) , m_isDisabled(false) , m_style(style) { SetBackgroundStyle(wxBG_STYLE_PAINT); // Parse the label wxString tmpLabel; m_text.Replace("&&", "@@"); // Parse the label for(size_t i = 0; i < m_text.length(); ++i) { if(m_accelIndex == wxNOT_FOUND && m_text.GetChar(i) == '&') { m_accelIndex = i; continue; } else { tmpLabel << m_text.GetChar(i); } } tmpLabel.Replace("@@", "&"); m_text.swap(tmpLabel); // Colours - dark theme if(m_theme == kThemeDark) { SetPenNormalColour("rgb(48, 48, 48)"); SetPenPressedColour("rgb(125, 125, 125)"); SetBgPressedColour("rgb(48, 48, 48)"); SetBgHoverColour("rgb(80, 80, 80)"); SetBgColour("rgb(65, 65, 65)"); m_penHoverColourInner = "rgb(160, 160, 160)"; m_penHoverOuterColour = GetPenNormalColour(); SetTextColour("rgb(248, 248, 242)"); SetTextColourDisabled("rgb(109, 109, 109)"); if(m_bmp.IsOk()) { m_bmpDisabled = m_bmp.ConvertToDisabled(100); } } else { wxColour paneColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); wxColour bgColour = paneColour.ChangeLightness(150); wxColour penColour = paneColour.ChangeLightness(90); SetPenNormalColour(penColour); SetBgColour(bgColour); SetPenPressedColour("rgb(90, 90, 90)"); SetBgPressedColour("rgb(120, 120, 120)"); SetBgHoverColour(bgColour); m_penHoverColourInner = "WHITE"; m_penHoverOuterColour = "TURQUOISE"; SetTextColour("rgb(15, 15, 15)"); SetTextColourDisabled(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT)); if(m_bmp.IsOk()) { m_bmpDisabled = m_bmp.ConvertToDisabled(); } } SetTextFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); if(size != wxDefaultSize) { SetMinSize(size); } else { SetMinSize(GetBestSize()); } }
LRESULT CTextProgressCtrl::OnSetBkColor(WPARAM, LPARAM Colour) { return (LRESULT)SetBgColour((COLORREF)Colour); }