added OnSysColourChanged() (modified patch 1103439)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2005-02-20 00:12:01 +00:00
parent 0f35356305
commit afad4a880e
2 changed files with 17 additions and 1 deletions

View 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);

View 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