moved knd handling logic from wxPanel to wxControlContainer (sorry for
[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 wxButton;
27 class WXDLLEXPORT wxControlContainer;
28
29 WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
30
31 // ----------------------------------------------------------------------------
32 // wxPanel contains other controls and implements TAB traversal between them
33 // ----------------------------------------------------------------------------
34
35 class WXDLLEXPORT wxPanel : public wxWindow
36 {
37 public:
38 wxPanel() { Init(); }
39
40 // Old-style constructor (no default values for coordinates to avoid
41 // ambiguity with the new one)
42 wxPanel(wxWindow *parent,
43 int x, int y, int width, int height,
44 long style = wxTAB_TRAVERSAL | wxNO_BORDER,
45 const wxString& name = wxPanelNameStr)
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 {
60 Init();
61
62 Create(parent, id, pos, size, style, name);
63 }
64
65 // Pseudo ctor
66 bool Create(wxWindow *parent, wxWindowID id,
67 const wxPoint& pos = wxDefaultPosition,
68 const wxSize& size = wxDefaultSize,
69 long style = wxTAB_TRAVERSAL | wxNO_BORDER,
70 const wxString& name = wxPanelNameStr);
71
72 virtual ~wxPanel();
73
74 // implementation from now on
75 // --------------------------
76
77 // Sends an OnInitDialog event, which in turns transfers data to
78 // to the dialog via validators.
79 virtual void InitDialog();
80
81 // responds to colour changes
82 void OnSysColourChanged(wxSysColourChangedEvent& event);
83
84 // calls layout for layout constraints and sizers
85 void OnSize(wxSizeEvent& event);
86
87 WX_DECLARE_CONTROL_CONTAINER();
88
89 protected:
90 // common part of all ctors
91 void Init();
92
93 // the object which implements the TAB traversal logic
94 wxControlContainer *m_container;
95
96 private:
97 DECLARE_DYNAMIC_CLASS(wxPanel)
98 DECLARE_EVENT_TABLE()
99 };
100
101 #endif
102 // _WX_GENERIC_PANEL_H_