1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/panelg.h
3 // Purpose: wxPanel: a container for child controls
4 // Author: Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GENERIC_PANEL_H_
13 #define _WX_GENERIC_PANEL_H_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "panelg.h"
19 // ----------------------------------------------------------------------------
20 // headers and forward declarations
21 // ----------------------------------------------------------------------------
23 #include "wx/window.h"
24 #include "wx/containr.h"
26 class WXDLLEXPORT wxControlContainer
;
28 WXDLLEXPORT_DATA(extern const wxChar
*) wxPanelNameStr
;
30 // ----------------------------------------------------------------------------
31 // wxPanel contains other controls and implements TAB traversal between them
32 // ----------------------------------------------------------------------------
34 class WXDLLEXPORT wxPanel
: public wxWindow
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
)
48 Create(parent
, wxID_ANY
, wxPoint(x
, y
), wxSize(width
, height
), style
, name
);
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
)
61 Create(parent
, winid
, pos
, size
, style
, name
);
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
);
73 // implementation from now on
74 // --------------------------
76 // calls layout for layout constraints and sizers
77 void OnSize(wxSizeEvent
& event
);
79 virtual void InitDialog();
81 #ifdef __WXUNIVERSAL__
82 virtual bool IsCanvasWindow() const { return true; }
83 virtual bool ProvidesBackground() const { return true; }
86 virtual void ApplyParentThemeBackground(const wxColour
& bg
)
87 { SetBackgroundColour(bg
); }
90 WX_DECLARE_CONTROL_CONTAINER();
93 // common part of all ctors
97 DECLARE_DYNAMIC_CLASS_NO_COPY(wxPanel
)
102 // _WX_GENERIC_PANEL_H_