]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
f6bcfd97 BP |
2 | // Name: wx/generic/panelg.h |
3 | // Purpose: wxPanel: a container for child controls | |
c801d85f KB |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) | |
678cd6de | 9 | // Licence: wxWindows licence |
c801d85f KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
678cd6de VZ |
12 | #ifndef _WX_GENERIC_PANEL_H_ |
13 | #define _WX_GENERIC_PANEL_H_ | |
c801d85f KB |
14 | |
15 | #ifdef __GNUG__ | |
f6bcfd97 | 16 | #pragma interface "panelg.h" |
c801d85f KB |
17 | #endif |
18 | ||
f6bcfd97 BP |
19 | // ---------------------------------------------------------------------------- |
20 | // headers and forward declarations | |
21 | // ---------------------------------------------------------------------------- | |
22 | ||
c801d85f | 23 | #include "wx/window.h" |
456bc6d9 | 24 | #include "wx/containr.h" |
f6bcfd97 BP |
25 | |
26 | class WXDLLEXPORT wxButton; | |
456bc6d9 | 27 | class WXDLLEXPORT wxControlContainer; |
c801d85f | 28 | |
908d4516 | 29 | WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr; |
c801d85f | 30 | |
f6bcfd97 BP |
31 | // ---------------------------------------------------------------------------- |
32 | // wxPanel contains other controls and implements TAB traversal between them | |
33 | // ---------------------------------------------------------------------------- | |
34 | ||
06b57134 | 35 | class WXDLLEXPORT wxPanel : public wxWindow |
c801d85f | 36 | { |
c801d85f | 37 | public: |
edccf428 | 38 | wxPanel() { Init(); } |
27dc7e21 | 39 | |
341c92a8 VZ |
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 | { | |
edccf428 VZ |
47 | Init(); |
48 | ||
341c92a8 VZ |
49 | Create(parent, -1, wxPoint(x, y), wxSize(width, height), style, name); |
50 | } | |
27dc7e21 | 51 | |
341c92a8 VZ |
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 | { | |
d220ae32 VZ |
60 | Init(); |
61 | ||
341c92a8 VZ |
62 | Create(parent, id, pos, size, style, name); |
63 | } | |
c801d85f | 64 | |
341c92a8 VZ |
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); | |
27dc7e21 | 71 | |
456bc6d9 | 72 | virtual ~wxPanel(); |
edccf428 VZ |
73 | |
74 | // implementation from now on | |
75 | // -------------------------- | |
76 | ||
456bc6d9 VZ |
77 | // Sends an OnInitDialog event, which in turns transfers data to |
78 | // to the dialog via validators. | |
79 | virtual void InitDialog(); | |
80 | ||
341c92a8 VZ |
81 | // responds to colour changes |
82 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
27dc7e21 | 83 | |
3da17724 | 84 | // calls layout for layout constraints and sizers |
27dc7e21 RD |
85 | void OnSize(wxSizeEvent& event); |
86 | ||
456bc6d9 | 87 | WX_DECLARE_CONTROL_CONTAINER(); |
ada8f807 | 88 | |
341c92a8 | 89 | protected: |
edccf428 VZ |
90 | // common part of all ctors |
91 | void Init(); | |
92 | ||
456bc6d9 VZ |
93 | // the object which implements the TAB traversal logic |
94 | wxControlContainer *m_container; | |
edccf428 | 95 | |
06b57134 VZ |
96 | private: |
97 | DECLARE_DYNAMIC_CLASS(wxPanel) | |
98 | DECLARE_EVENT_TABLE() | |
c801d85f KB |
99 | }; |
100 | ||
101 | #endif | |
678cd6de | 102 | // _WX_GENERIC_PANEL_H_ |