]> git.saurik.com Git - wxWidgets.git/commitdiff
added OnSysColourChanged() (modified patch 1103439)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 Feb 2005 00:12:01 +0000 (00:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 Feb 2005 00:12:01 +0000 (00:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/univ/frame.h
src/univ/framuniv.cpp

index 8a5617f53e393636cc4e7c23e861fb61ce4085aa..03f550957e305690104de4bf80502e3b9109fc06 100644 (file)
@@ -69,6 +69,7 @@ public:
 
 protected:
     void OnSize(wxSizeEvent& event);
+    void OnSysColourChanged(wxSysColourChangedEvent& event);
 
     virtual void DoGetClientSize(int *width, int *height) const;
     virtual void DoSetClientSize(int width, int height);
index f2fe6fdc373007c856e120fb9c0b459b3eb057b7..7f179b0eeed275ea678e5735f7168db5c242ca2d 100644 (file)
@@ -32,6 +32,7 @@
 #ifndef WX_PRECOMP
     #include "wx/frame.h"
     #include "wx/statusbr.h"
+    #include "wx/settings.h"
     #include "wx/toolbar.h"
 #endif // WX_PRECOMP
 
@@ -41,6 +42,7 @@
 
 BEGIN_EVENT_TABLE(wxFrame, wxFrameBase)
     EVT_SIZE(wxFrame::OnSize)
+    EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
 END_EVENT_TABLE()
 
 IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow)
@@ -57,9 +59,22 @@ bool wxFrame::Create(wxWindow *parent,
                 long style,
                 const wxString& name)
 {
-    return wxTopLevelWindow::Create(parent, id, title, pos, size, style, name);
+    if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
+        return false;
+
+    SetOwnBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
+
+    return true;
 }
 
+// Responds to colour changes, and passes event on to children.
+void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
+{
+    SetOwnBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
+    Refresh();
+
+    event.Skip();
+}
 
 // ----------------------------------------------------------------------------
 // menu support