Move wxControl::GetCompositeControlsDefaultAttributes() from MSW to common.
This function is not MSW-specific and should be used in generic implementation of controls such as wxListCtrl, wxTreeCtrl and wxDataViewCtrl. Even if it is needed by MSW only now, move it to the common code to avoid #ifdefs in these controls code. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62151 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -131,6 +131,13 @@ public:
|
||||
static int FindAccelIndex(const wxString& label,
|
||||
wxString *labelOnly = NULL);
|
||||
|
||||
// this is a helper for the derived class GetClassDefaultAttributes()
|
||||
// implementation: it returns the right colours for the classes which
|
||||
// contain something else (e.g. wxListBox, wxTextCtrl, ...) instead of
|
||||
// being simple controls (such as wxButton, wxCheckBox, ...)
|
||||
static wxVisualAttributes
|
||||
GetCompositeControlsDefaultAttributes(wxWindowVariant variant);
|
||||
|
||||
protected:
|
||||
// choose the default border for this window
|
||||
virtual wxBorder GetDefaultBorder() const;
|
||||
|
@@ -122,13 +122,6 @@ protected:
|
||||
// one
|
||||
virtual WXHBRUSH DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd);
|
||||
|
||||
// this is a helper for the derived class GetClassDefaultAttributes()
|
||||
// implementation: it returns the right colours for the classes which
|
||||
// contain something else (e.g. wxListBox, wxTextCtrl, ...) instead of
|
||||
// being simple controls (such as wxButton, wxCheckBox, ...)
|
||||
static wxVisualAttributes
|
||||
GetCompositeControlsDefaultAttributes(wxWindowVariant variant);
|
||||
|
||||
// for controls like radiobuttons which are really composite this array
|
||||
// holds the ids (not HWNDs!) of the sub controls
|
||||
wxArrayLong m_subControls;
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include "wx/statbmp.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/utils.h" // for wxStripMenuCodes()
|
||||
#include "wx/settings.h"
|
||||
#endif
|
||||
|
||||
const char wxControlNameStr[] = "control";
|
||||
@@ -217,6 +218,17 @@ wxBorder wxControlBase::GetDefaultBorder() const
|
||||
return wxBORDER_THEME;
|
||||
}
|
||||
|
||||
/* static */ wxVisualAttributes
|
||||
wxControlBase::GetCompositeControlsDefaultAttributes(wxWindowVariant WXUNUSED(variant))
|
||||
{
|
||||
wxVisualAttributes attrs;
|
||||
attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
||||
attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
|
||||
attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
|
||||
|
||||
return attrs;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxControlBase - ellipsization code
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -303,18 +303,6 @@ wxControl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
|
||||
return attrs;
|
||||
}
|
||||
|
||||
// another version for the "composite", i.e. non simple controls
|
||||
/* static */ wxVisualAttributes
|
||||
wxControl::GetCompositeControlsDefaultAttributes(wxWindowVariant WXUNUSED(variant))
|
||||
{
|
||||
wxVisualAttributes attrs;
|
||||
attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
||||
attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
|
||||
attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
|
||||
|
||||
return attrs;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// message handling
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user