int GetMarginX() const { return m_marginX; }
int GetMarginY() const { return m_marginY; }
- virtual bool CanApplyParentThemeBackground() const { return true; }
+ virtual void ApplyParentThemeBackground(const wxColour& bg)
+ { SetBackgroundColour(bg); }
+
protected:
// function called when any of the bitmaps changes
}
}
+ virtual void ApplyParentThemeBackground(const wxColour& bg)
+ { SetBackgroundColour(bg); }
+
protected:
// remove the page and return a pointer to it
virtual wxWindow *DoRemovePage(size_t page) = 0;
return HasFlag(wxCHK_ALLOW_3RD_STATE_FOR_USER);
}
- virtual bool CanApplyParentThemeBackground() const { return true; }
+ virtual void ApplyParentThemeBackground(const wxColour& bg)
+ { SetBackgroundColour(bg); }
protected:
virtual void DoSet3StateValue(wxCheckBoxState WXUNUSED(state)) { wxFAIL; }
virtual bool ProvidesBackground() const { return TRUE; }
#endif
- virtual bool CanApplyParentThemeBackground() const { return true; }
+ virtual void ApplyParentThemeBackground(const wxColour& bg)
+ { SetBackgroundColour(bg); }
+
WX_DECLARE_CONTROL_CONTAINER();
void SelectAll();
#endif
- virtual bool CanApplyParentThemeBackground() const { return false; }
+ virtual void ApplyParentThemeBackground(const wxColour& WXUNUSED(bg))
+ { /* do nothing */ }
protected:
void Init();
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWCommand(WXUINT param, WXWORD id);
+ virtual void ApplyParentThemeBackground(const wxColour& bg)
+ {
+ // avoide switching into owner-drawn mode
+ wxControl::SetBackgroundColour(bg);
+ }
+
#ifdef __WIN32__
// coloured buttons support
virtual bool SetBackgroundColour(const wxColour &colour);
int GetNumVer() const;
int GetNumHor() const;
+ virtual void ApplyParentThemeBackground(const wxColour& bg)
+ { SetBackgroundColour(bg); }
+
protected:
// subclass one radio button
void SubclassRadioButton(WXHWND hWndBtn);
// implementation only from now on
virtual bool MSWCommand(WXUINT param, WXWORD id);
virtual void Command(wxCommandEvent& event);
- virtual bool CanApplyParentThemeBackground() const { return true; }
+ virtual void ApplyParentThemeBackground(const wxColour& bg)
+ { SetBackgroundColour(bg); }
+
protected:
virtual wxSize DoGetBestSize() const;
// implement some base class functions
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const;
- virtual bool CanApplyParentThemeBackground() const { return true; }
protected:
DECLARE_NO_COPY_CLASS(wxNotebookBase)
// return the item above/below/to the left/right of the given one
int GetNextItem(int item, wxDirection dir, long style) const;
- virtual bool CanApplyParentThemeBackground() const { return true; }
-
// for compatibility only, don't use these methods in new code!
#if WXWIN_COMPATIBILITY_2_2
int Number() const { return GetCount(); }
virtual void SetSelection(int WXUNUSED(min), int WXUNUSED(max)) { }
- virtual bool CanApplyParentThemeBackground() const { return true; }
+ virtual void ApplyParentThemeBackground(const wxColour& bg)
+ { SetBackgroundColour(bg); }
+
private:
DECLARE_NO_COPY_CLASS(wxSliderBase)
// overriden base class virtuals
virtual bool AcceptsFocus() const { return false; }
- virtual bool CanApplyParentThemeBackground() const { return true; }
+ virtual void ApplyParentThemeBackground(const wxColour& bg)
+ { SetBackgroundColour(bg); }
private:
DECLARE_NO_COPY_CLASS(wxStaticBoxBase)
// overriden base class virtuals
virtual bool AcceptsFocus() const { return false; }
- virtual bool CanApplyParentThemeBackground() const { return true; }
+ virtual void ApplyParentThemeBackground(const wxColour& bg)
+ { SetBackgroundColour(bg); }
protected:
// set the right size for the right dimension
// overriden base virtuals
virtual bool AcceptsFocus() const { return false; }
- virtual bool CanApplyParentThemeBackground() const { return true; }
+ virtual void ApplyParentThemeBackground(const wxColour& bg)
+ { SetBackgroundColour(bg); }
private:
DECLARE_NO_COPY_CLASS(wxStaticTextBase)
void SetSelectionBackground(const wxColour& col);
- virtual bool CanApplyParentThemeBackground() const { return false; }
+ virtual void ApplyParentThemeBackground(const wxColour& WXUNUSED(bg))
+ { /* do nothing */ }
+
protected:
// the derived class must implement this function to actually draw the item
// page is added to a notebook it and it's children may need to have
// the colours adjusted depending on the current theme settings, but
// not all windows/controls can do this without looking wrong.
- virtual bool CanApplyParentThemeBackground() const { return false; }
+ virtual void ApplyParentThemeBackground(const wxColour& WXUNUSED(bg))
+ { /* do nothing */ }
// returns true if this window should inherit its parent colours on
// creation
#endif
{
#if wxUSE_UXTHEME
- // Special case for wxButton: Don't set the background for buttons since
- // this will switch it into ownerdraw mode
- if (window->IsKindOf(CLASSINFO(wxButton)) && !window->IsKindOf(CLASSINFO(wxBitmapButton)))
- // This is essential, otherwise you'll see dark grey
- // corners in the buttons.
- ((wxButton*)window)->wxControl::SetBackgroundColour(colour);
-
- // for all other classes let them decide
- else if ((window != this) && window->CanApplyParentThemeBackground())
- {
- window->SetBackgroundColour(colour);
- }
+ window->ApplyParentThemeBackground(colour);
+
for ( wxWindowList::compatibility_iterator node = window->GetChildren().GetFirst(); node; node = node->GetNext() )
{
wxWindow *child = node->GetData();