]>
git.saurik.com Git - wxWidgets.git/blob - src/generic/panelg.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "panelg.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
24 #include "wx/settings.h"
27 #include "wx/generic/panelg.h"
29 #if !USE_SHARED_LIBRARY
30 IMPLEMENT_DYNAMIC_CLASS(wxPanel
, wxWindow
)
32 BEGIN_EVENT_TABLE(wxPanel
, wxWindow
)
33 EVT_SYS_COLOUR_CHANGED(wxPanel::OnSysColourChanged
)
38 wxPanel::wxPanel(void)
40 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE
));
41 SetDefaultBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE
));
44 bool wxPanel::Create(wxWindow
*parent
, const wxWindowID id
,
50 bool ret
= wxWindow::Create(parent
, id
, pos
, size
, style
, name
);
52 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE
));
53 SetDefaultBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE
));
54 SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT
));
58 void wxPanel::OnPaint(wxPaintEvent
& WXUNUSED(event
))
60 // No: if you call the default procedure, it makes
61 // the following painting code not work.
62 // wxWindow::OnPaint(event);
65 void wxPanel::InitDialog(void)
67 wxInitDialogEvent
event(GetId());
68 event
.SetEventObject(this);
69 GetEventHandler()->ProcessEvent(event
);
72 // Responds to colour changes, and passes event on to children.
73 void wxPanel::OnSysColourChanged(wxSysColourChangedEvent
& event
)
75 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE
));
76 SetDefaultBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE
));
79 // Propagate the event to the non-top-level children
80 wxWindow::OnSysColourChanged(event
);