]>
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 | 14 | |
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
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 | 25 | |
456bc6d9 | 26 | class WXDLLEXPORT wxControlContainer; |
c801d85f | 27 | |
908d4516 | 28 | WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr; |
c801d85f | 29 | |
f6bcfd97 BP |
30 | // ---------------------------------------------------------------------------- |
31 | // wxPanel contains other controls and implements TAB traversal between them | |
32 | // ---------------------------------------------------------------------------- | |
33 | ||
06b57134 | 34 | class WXDLLEXPORT wxPanel : public wxWindow |
c801d85f | 35 | { |
c801d85f | 36 | public: |
9948d31f | 37 | wxPanel() { Init(); } |
27dc7e21 | 38 | |
341c92a8 VZ |
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 | { | |
edccf428 VZ |
46 | Init(); |
47 | ||
341c92a8 VZ |
48 | Create(parent, -1, wxPoint(x, y), wxSize(width, height), style, name); |
49 | } | |
27dc7e21 | 50 | |
341c92a8 VZ |
51 | // Constructor |
52 | wxPanel(wxWindow *parent, | |
d9e2e4c2 | 53 | wxWindowID winid = -1, |
341c92a8 VZ |
54 | const wxPoint& pos = wxDefaultPosition, |
55 | const wxSize& size = wxDefaultSize, | |
56 | long style = wxTAB_TRAVERSAL | wxNO_BORDER, | |
57 | const wxString& name = wxPanelNameStr) | |
58 | { | |
d220ae32 VZ |
59 | Init(); |
60 | ||
d9e2e4c2 | 61 | Create(parent, winid, pos, size, style, name); |
341c92a8 | 62 | } |
c801d85f | 63 | |
341c92a8 | 64 | // Pseudo ctor |
d9e2e4c2 | 65 | bool Create(wxWindow *parent, wxWindowID winid, |
341c92a8 VZ |
66 | const wxPoint& pos = wxDefaultPosition, |
67 | const wxSize& size = wxDefaultSize, | |
68 | long style = wxTAB_TRAVERSAL | wxNO_BORDER, | |
69 | const wxString& name = wxPanelNameStr); | |
27dc7e21 | 70 | |
456bc6d9 | 71 | virtual ~wxPanel(); |
edccf428 VZ |
72 | |
73 | // implementation from now on | |
74 | // -------------------------- | |
75 | ||
341c92a8 VZ |
76 | // responds to colour changes |
77 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
27dc7e21 | 78 | |
3da17724 | 79 | // calls layout for layout constraints and sizers |
27dc7e21 RD |
80 | void OnSize(wxSizeEvent& event); |
81 | ||
19193a2c KB |
82 | virtual void InitDialog(); |
83 | ||
5f517075 | 84 | #ifdef __WXUNIVERSAL__ |
2b5f62a0 VZ |
85 | virtual bool IsCanvasWindow() const { return TRUE; } |
86 | virtual bool ProvidesBackground() const { return TRUE; } | |
193e19cf RR |
87 | #endif |
88 | ||
cc0bffac RD |
89 | virtual void ApplyParentThemeBackground(const wxColour& bg) |
90 | { SetBackgroundColour(bg); } | |
91 | ||
bd507486 | 92 | |
456bc6d9 | 93 | WX_DECLARE_CONTROL_CONTAINER(); |
ada8f807 | 94 | |
341c92a8 | 95 | protected: |
edccf428 VZ |
96 | // common part of all ctors |
97 | void Init(); | |
98 | ||
06b57134 | 99 | private: |
fc7a2a60 | 100 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxPanel) |
06b57134 | 101 | DECLARE_EVENT_TABLE() |
c801d85f KB |
102 | }; |
103 | ||
104 | #endif | |
678cd6de | 105 | // _WX_GENERIC_PANEL_H_ |