]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/panelg.h
Fixed to work with the new wxMacControl system.
[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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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() { 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 {
46 Init();
47
48 Create(parent, wxID_ANY, wxPoint(x, y), wxSize(width, height), style, name);
49 }
50
51 // Constructor
52 wxPanel(wxWindow *parent,
53 wxWindowID winid = wxID_ANY,
54 const wxPoint& pos = wxDefaultPosition,
55 const wxSize& size = wxDefaultSize,
56 long style = wxTAB_TRAVERSAL | wxNO_BORDER,
57 const wxString& name = wxPanelNameStr)
58 {
59 Init();
60
61 Create(parent, winid, pos, size, style, name);
62 }
63
64 // Pseudo ctor
65 bool Create(wxWindow *parent, wxWindowID winid,
66 const wxPoint& pos = wxDefaultPosition,
67 const wxSize& size = wxDefaultSize,
68 long style = wxTAB_TRAVERSAL | wxNO_BORDER,
69 const wxString& name = wxPanelNameStr);
70
71 virtual ~wxPanel();
72
73 // implementation from now on
74 // --------------------------
75
76 // responds to colour changes
77 void OnSysColourChanged(wxSysColourChangedEvent& event);
78
79 // calls layout for layout constraints and sizers
80 void OnSize(wxSizeEvent& event);
81
82 virtual void InitDialog();
83
84 #ifdef __WXUNIVERSAL__
85 virtual bool IsCanvasWindow() const { return true; }
86 virtual bool ProvidesBackground() const { return true; }
87 #endif
88
89 virtual void ApplyParentThemeBackground(const wxColour& bg)
90 { SetBackgroundColour(bg); }
91
92
93 WX_DECLARE_CONTROL_CONTAINER();
94
95 protected:
96 // common part of all ctors
97 void Init();
98
99 private:
100 DECLARE_DYNAMIC_CLASS_NO_COPY(wxPanel)
101 DECLARE_EVENT_TABLE()
102 };
103
104 #endif
105 // _WX_GENERIC_PANEL_H_