1. slightly changed how wxControlContainer is used
[wxWidgets.git] / include / wx / generic / panelg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/panelg.h
3 // Purpose: wxPanel: a container for child controls
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_GENERIC_PANEL_H_
13 #define _WX_GENERIC_PANEL_H_
14
15 #ifdef __GNUG__
16 #pragma interface "panelg.h"
17 #endif
18
19 // ----------------------------------------------------------------------------
20 // headers and forward declarations
21 // ----------------------------------------------------------------------------
22
23 #include "wx/window.h"
24 #include "wx/containr.h"
25
26 class WXDLLEXPORT wxControlContainer;
27
28 WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
29
30 // ----------------------------------------------------------------------------
31 // wxPanel contains other controls and implements TAB traversal between them
32 // ----------------------------------------------------------------------------
33
34 class WXDLLEXPORT wxPanel : public wxWindow
35 {
36 public:
37 wxPanel() : m_container(this) { Init(); }
38
39 // Old-style constructor (no default values for coordinates to avoid
40 // ambiguity with the new one)
41 wxPanel(wxWindow *parent,
42 int x, int y, int width, int height,
43 long style = wxTAB_TRAVERSAL | wxNO_BORDER,
44 const wxString& name = wxPanelNameStr)
45 : m_container(this)
46 {
47 Init();
48
49 Create(parent, -1, wxPoint(x, y), wxSize(width, height), style, name);
50 }
51
52 // Constructor
53 wxPanel(wxWindow *parent,
54 wxWindowID id = -1,
55 const wxPoint& pos = wxDefaultPosition,
56 const wxSize& size = wxDefaultSize,
57 long style = wxTAB_TRAVERSAL | wxNO_BORDER,
58 const wxString& name = wxPanelNameStr)
59 : m_container(this)
60 {
61 Init();
62
63 Create(parent, id, pos, size, style, name);
64 }
65
66 // Pseudo ctor
67 bool Create(wxWindow *parent, wxWindowID id,
68 const wxPoint& pos = wxDefaultPosition,
69 const wxSize& size = wxDefaultSize,
70 long style = wxTAB_TRAVERSAL | wxNO_BORDER,
71 const wxString& name = wxPanelNameStr);
72
73 virtual ~wxPanel();
74
75 // implementation from now on
76 // --------------------------
77
78 // Sends an OnInitDialog event, which in turns transfers data to
79 // to the dialog via validators.
80 virtual void InitDialog();
81
82 // responds to colour changes
83 void OnSysColourChanged(wxSysColourChangedEvent& event);
84
85 // calls layout for layout constraints and sizers
86 void OnSize(wxSizeEvent& event);
87
88 WX_DECLARE_CONTROL_CONTAINER();
89
90 protected:
91 // common part of all ctors
92 void Init();
93
94 private:
95 DECLARE_DYNAMIC_CLASS(wxPanel)
96 DECLARE_EVENT_TABLE()
97 };
98
99 #endif
100 // _WX_GENERIC_PANEL_H_