Use const wxWindow in wxSystemSettings::GetMetric
This commit is contained in:
@@ -216,7 +216,7 @@ public:
|
||||
static wxFont GetFont(wxSystemFont index);
|
||||
|
||||
// get a system-dependent metric
|
||||
static int GetMetric(wxSystemMetric index, wxWindow * win = NULL);
|
||||
static int GetMetric(wxSystemMetric index, const wxWindow* win = NULL);
|
||||
|
||||
// get the object describing the current system appearance
|
||||
static wxSystemAppearance GetAppearance();
|
||||
@@ -240,7 +240,7 @@ public:
|
||||
|
||||
// some metrics are toolkit-dependent and provided by wxUniv, some are
|
||||
// lowlevel
|
||||
static int GetMetric(wxSystemMetric index, wxWindow *win = NULL);
|
||||
static int GetMetric(wxSystemMetric index, const wxWindow* win = NULL);
|
||||
#endif // __WXUNIVERSAL__
|
||||
|
||||
// Get system screen design (desktop, pda, ..) used for
|
||||
|
@@ -804,7 +804,7 @@ double wxWindowBase::GetContentScaleFactor() const
|
||||
static int wxGetMetricOrDefault(wxSystemMetric what, const wxWindowBase* win)
|
||||
{
|
||||
int rc = wxSystemSettings::GetMetric(
|
||||
what, static_cast<wxWindow*>(const_cast<wxWindowBase*>(win)));
|
||||
what, static_cast<const wxWindow*>(win));
|
||||
if ( rc == -1 )
|
||||
{
|
||||
switch ( what )
|
||||
|
@@ -63,7 +63,7 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
|
||||
}
|
||||
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index,
|
||||
wxWindow* WXUNUSED(win))
|
||||
const wxWindow* WXUNUSED(win))
|
||||
{
|
||||
int val;
|
||||
|
||||
|
@@ -1553,12 +1553,11 @@ wxSize wxScrolledT_Helper::FilterBestSize(const wxWindow *win,
|
||||
|
||||
wxSize minSize = win->GetMinSize();
|
||||
|
||||
wxWindow* window = const_cast<wxWindow*>(win);
|
||||
if ( ppuX > 0 )
|
||||
best.x = minSize.x + wxSystemSettings::GetMetric(wxSYS_VSCROLL_X, window);
|
||||
best.x = minSize.x + wxSystemSettings::GetMetric(wxSYS_VSCROLL_X, win);
|
||||
|
||||
if ( ppuY > 0 )
|
||||
best.y = minSize.y + wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y, window);
|
||||
best.y = minSize.y + wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y, win);
|
||||
}
|
||||
|
||||
return best;
|
||||
|
@@ -839,7 +839,7 @@ static GtkSettings *GetSettingsForWindowScreen(GdkWindow *window)
|
||||
: gtk_settings_get_default();
|
||||
}
|
||||
|
||||
static int GetBorderWidth(wxSystemMetric index, wxWindow* win)
|
||||
static int GetBorderWidth(wxSystemMetric index, const wxWindow* win)
|
||||
{
|
||||
if (win->m_wxwindow)
|
||||
{
|
||||
@@ -912,7 +912,7 @@ static int GetScrollbarWidth()
|
||||
return width;
|
||||
}
|
||||
|
||||
int wxSystemSettingsNative::GetMetric( wxSystemMetric index, wxWindow* win )
|
||||
int wxSystemSettingsNative::GetMetric( wxSystemMetric index, const wxWindow* win )
|
||||
{
|
||||
GdkWindow *window = NULL;
|
||||
if (win)
|
||||
|
@@ -358,7 +358,7 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index )
|
||||
}
|
||||
|
||||
int
|
||||
wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win))
|
||||
wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* WXUNUSED(win))
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
|
@@ -196,7 +196,7 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
|
||||
}
|
||||
|
||||
// Get a system metric, e.g. scrollbar size
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win))
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* WXUNUSED(win))
|
||||
{
|
||||
int return_value = 0;
|
||||
|
||||
|
@@ -262,7 +262,7 @@ static const int gs_metricsMap[] =
|
||||
};
|
||||
|
||||
// Get a system metric, e.g. scrollbar size
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* win)
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* win)
|
||||
{
|
||||
wxCHECK_MSG( index > 0 && (size_t)index < WXSIZEOF(gs_metricsMap), 0,
|
||||
wxT("invalid metric") );
|
||||
|
@@ -217,7 +217,7 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Get a system metric, e.g. scrollbar size
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow *WXUNUSED(win))
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* WXUNUSED(win))
|
||||
{
|
||||
int value;
|
||||
|
||||
|
@@ -155,7 +155,7 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Get a system metric, e.g. scrollbar size
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow *WXUNUSED(win))
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* WXUNUSED(win))
|
||||
{
|
||||
int value;
|
||||
|
||||
|
@@ -163,7 +163,7 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
|
||||
|
||||
}
|
||||
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow * WXUNUSED(win))
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* WXUNUSED(win))
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
|
@@ -2718,8 +2718,7 @@ PRectangle wxSTCListBox::GetDesiredRect() const
|
||||
|
||||
// Add space for a scrollbar if needed.
|
||||
if ( count > desiredVisibleRows )
|
||||
maxw += wxSystemSettings::GetMetric(wxSYS_VSCROLL_X,
|
||||
const_cast<wxWindow*>(wxDynamicCast(this, wxWindow)));
|
||||
maxw += wxSystemSettings::GetMetric(wxSYS_VSCROLL_X, this);
|
||||
|
||||
// Add borders.
|
||||
maxw += 2 * m_borderSize;
|
||||
|
@@ -96,7 +96,7 @@ wxColour wxSystemSettings::GetColour(wxSystemColour index)
|
||||
return wxTheme::Get()->GetColourScheme()->Get(col);
|
||||
}
|
||||
|
||||
int wxSystemSettings::GetMetric(wxSystemMetric index, wxWindow *win)
|
||||
int wxSystemSettings::GetMetric(wxSystemMetric index, const wxWindow* win)
|
||||
{
|
||||
switch ( index )
|
||||
{
|
||||
|
@@ -56,7 +56,7 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
|
||||
}
|
||||
|
||||
// Get a system metric, e.g. scrollbar size
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win))
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* WXUNUSED(win))
|
||||
{
|
||||
switch ( index)
|
||||
{
|
||||
|
Reference in New Issue
Block a user