]> git.saurik.com Git - wxWidgets.git/commitdiff
pass window parameter to wxSystemSettings::GetMetric() so wxGTK can get the value...
authorPaul Cornett <paulcor@bullseye.com>
Fri, 17 Oct 2008 04:36:25 +0000 (04:36 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Fri, 17 Oct 2008 04:36:25 +0000 (04:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56392 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/wincmn.cpp

index 03e49a2a0c49e9461eb0cd78e6abbc223b5110a8..1de80827bd160f6277872a916ff877b746fc7766 100644 (file)
@@ -624,9 +624,10 @@ wxSize wxWindowBase::DoGetBestSize() const
 // helper of GetWindowBorderSize(): as many ports don't implement support for
 // wxSYS_BORDER/EDGE_X/Y metrics in their wxSystemSettings, use hard coded
 // 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 )
     {
         switch ( what )
@@ -664,23 +665,23 @@ wxSize wxWindowBase::GetWindowBorderSize() const
 
         case wxBORDER_SIMPLE:
         case wxBORDER_STATIC:
-            size.x = wxGetMetricOrDefault(wxSYS_BORDER_X);
-            size.y = wxGetMetricOrDefault(wxSYS_BORDER_Y);
+            size.x = wxGetMetricOrDefault(wxSYS_BORDER_X, this);
+            size.y = wxGetMetricOrDefault(wxSYS_BORDER_Y, this);
             break;
 
         case wxBORDER_SUNKEN:
         case wxBORDER_RAISED:
-            size.x = wxMax(wxGetMetricOrDefault(wxSYS_EDGE_X),
-                           wxGetMetricOrDefault(wxSYS_BORDER_X));
-            size.y = wxMax(wxGetMetricOrDefault(wxSYS_EDGE_Y),
-                           wxGetMetricOrDefault(wxSYS_BORDER_Y));
+            size.x = wxMax(wxGetMetricOrDefault(wxSYS_EDGE_X, this),
+                           wxGetMetricOrDefault(wxSYS_BORDER_X, this));
+            size.y = wxMax(wxGetMetricOrDefault(wxSYS_EDGE_Y, this),
+                           wxGetMetricOrDefault(wxSYS_BORDER_Y, this));
             break;
 
         case wxBORDER_DOUBLE:
-            size.x = wxGetMetricOrDefault(wxSYS_EDGE_X) +
-                        wxGetMetricOrDefault(wxSYS_BORDER_X);
-            size.y = wxGetMetricOrDefault(wxSYS_EDGE_Y) +
-                        wxGetMetricOrDefault(wxSYS_BORDER_Y);
+            size.x = wxGetMetricOrDefault(wxSYS_EDGE_X, this) +
+                        wxGetMetricOrDefault(wxSYS_BORDER_X, this);
+            size.y = wxGetMetricOrDefault(wxSYS_EDGE_Y, this) +
+                        wxGetMetricOrDefault(wxSYS_BORDER_Y, this);
             break;
 
         default: