pass window parameter to wxSystemSettings::GetMetric() so wxGTK can get the value right more often

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56392 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2008-10-17 04:36:25 +00:00
parent 53357e241e
commit d45a01e049

View File

@@ -624,9 +624,10 @@ wxSize wxWindowBase::DoGetBestSize() const
// helper of GetWindowBorderSize(): as many ports don't implement support for // helper of GetWindowBorderSize(): as many ports don't implement support for
// wxSYS_BORDER/EDGE_X/Y metrics in their wxSystemSettings, use hard coded // wxSYS_BORDER/EDGE_X/Y metrics in their wxSystemSettings, use hard coded
// fallbacks in this case // fallbacks in this case
static int wxGetMetricOrDefault(wxSystemMetric what) static int wxGetMetricOrDefault(wxSystemMetric what, const wxWindowBase* win)
{ {
int rc = wxSystemSettings::GetMetric(what); int rc = wxSystemSettings::GetMetric(
what, static_cast<wxWindow*>(const_cast<wxWindowBase*>(win)));
if ( rc == -1 ) if ( rc == -1 )
{ {
switch ( what ) switch ( what )
@@ -664,23 +665,23 @@ wxSize wxWindowBase::GetWindowBorderSize() const
case wxBORDER_SIMPLE: case wxBORDER_SIMPLE:
case wxBORDER_STATIC: case wxBORDER_STATIC:
size.x = wxGetMetricOrDefault(wxSYS_BORDER_X); size.x = wxGetMetricOrDefault(wxSYS_BORDER_X, this);
size.y = wxGetMetricOrDefault(wxSYS_BORDER_Y); size.y = wxGetMetricOrDefault(wxSYS_BORDER_Y, this);
break; break;
case wxBORDER_SUNKEN: case wxBORDER_SUNKEN:
case wxBORDER_RAISED: case wxBORDER_RAISED:
size.x = wxMax(wxGetMetricOrDefault(wxSYS_EDGE_X), size.x = wxMax(wxGetMetricOrDefault(wxSYS_EDGE_X, this),
wxGetMetricOrDefault(wxSYS_BORDER_X)); wxGetMetricOrDefault(wxSYS_BORDER_X, this));
size.y = wxMax(wxGetMetricOrDefault(wxSYS_EDGE_Y), size.y = wxMax(wxGetMetricOrDefault(wxSYS_EDGE_Y, this),
wxGetMetricOrDefault(wxSYS_BORDER_Y)); wxGetMetricOrDefault(wxSYS_BORDER_Y, this));
break; break;
case wxBORDER_DOUBLE: case wxBORDER_DOUBLE:
size.x = wxGetMetricOrDefault(wxSYS_EDGE_X) + size.x = wxGetMetricOrDefault(wxSYS_EDGE_X, this) +
wxGetMetricOrDefault(wxSYS_BORDER_X); wxGetMetricOrDefault(wxSYS_BORDER_X, this);
size.y = wxGetMetricOrDefault(wxSYS_EDGE_Y) + size.y = wxGetMetricOrDefault(wxSYS_EDGE_Y, this) +
wxGetMetricOrDefault(wxSYS_BORDER_Y); wxGetMetricOrDefault(wxSYS_BORDER_Y, this);
break; break;
default: default: