]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/frame.cpp
fix for wxSYS_COLOUR_LISTBOX representation
[wxWidgets.git] / src / msw / frame.cpp
index 814f3bd2544317516a62ef0abd0eebe12b660bcb..1bf777979befb06acb6e62f1290e5dcff4264cf6 100644 (file)
@@ -128,7 +128,7 @@ bool wxFrame::Create(wxWindow *parent,
     if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
         return FALSE;
 
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
+    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
 
     wxModelessWindows.Append(this);
 
@@ -157,6 +157,11 @@ void wxFrame::DoSetClientSize(int width, int height)
     }
 #endif // wxUSE_STATUSBAR
 
+    // call GetClientAreaOrigin() to take the toolbar into account
+    wxPoint pt = GetClientAreaOrigin();
+    width += pt.x;
+    height += pt.y;
+
     wxTopLevelWindow::DoSetClientSize(width, height);
 }
 
@@ -165,6 +170,14 @@ void wxFrame::DoGetClientSize(int *x, int *y) const
 {
     wxTopLevelWindow::DoGetClientSize(x, y);
 
+    // account for the possible toolbar
+    wxPoint pt = GetClientAreaOrigin();
+    if ( x )
+        *x -= pt.x;
+
+    if ( y )
+        *y -= pt.y;
+
 #if wxUSE_STATUSBAR
     // adjust client area height to take the status bar into account
     if ( y )
@@ -294,7 +307,7 @@ void wxFrame::InternalSetMenuBar()
 // Responds to colour changes, and passes event on to children.
 void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
 {
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
+    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
     Refresh();
 
 #if wxUSE_STATUSBAR