]> git.saurik.com Git - wxWidgets.git/blob - src/generic/panelg.cpp
a couple of "const" mistakenly removed restored
[wxWidgets.git] / src / generic / panelg.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: panelg.cpp
3 // Purpose: wxPanel
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 04/01/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 #pragma implementation "panelg.h"
14 #endif
15
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
18
19 #ifdef __BORLANDC__
20 #pragma hdrstop
21 #endif
22
23 #ifndef WX_PRECOMP
24 #include "wx/settings.h"
25 #endif
26
27 #include "wx/generic/panelg.h"
28
29 #if !USE_SHARED_LIBRARY
30 IMPLEMENT_DYNAMIC_CLASS(wxPanel, wxWindow)
31
32 BEGIN_EVENT_TABLE(wxPanel, wxWindow)
33 EVT_SYS_COLOUR_CHANGED(wxPanel::OnSysColourChanged)
34 END_EVENT_TABLE()
35
36 #endif
37
38 wxPanel::wxPanel(void)
39 {
40 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
41 SetDefaultBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
42 }
43
44 bool wxPanel::Create(wxWindow *parent, wxWindowID id,
45 const wxPoint& pos,
46 const wxSize& size,
47 long style,
48 const wxString& name)
49 {
50 bool ret = wxWindow::Create(parent, id, pos, size, style, name);
51
52 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
53 SetDefaultBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
54 SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
55 return ret;
56 }
57
58 void wxPanel::OnPaint(wxPaintEvent& WXUNUSED(event))
59 {
60 // No: if you call the default procedure, it makes
61 // the following painting code not work.
62 // wxWindow::OnPaint(event);
63 }
64
65 void wxPanel::InitDialog(void)
66 {
67 wxInitDialogEvent event(GetId());
68 event.SetEventObject(this);
69 GetEventHandler()->ProcessEvent(event);
70 }
71
72 // Responds to colour changes, and passes event on to children.
73 void wxPanel::OnSysColourChanged(wxSysColourChangedEvent& event)
74 {
75 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
76 SetDefaultBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
77 Refresh();
78
79 // Propagate the event to the non-top-level children
80 wxWindow::OnSysColourChanged(event);
81 }
82