]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/panel.h | |
3 | // Purpose: Base header for wxPanel | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
9 | // (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org> | |
10 | // Licence: wxWindows Licence | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | #ifndef _WX_PANEL_H_BASE_ | |
14 | #define _WX_PANEL_H_BASE_ | |
15 | ||
16 | // ---------------------------------------------------------------------------- | |
17 | // headers and forward declarations | |
18 | // ---------------------------------------------------------------------------- | |
19 | ||
20 | #include "wx/window.h" | |
21 | #include "wx/containr.h" | |
22 | ||
23 | class WXDLLIMPEXP_FWD_CORE wxControlContainer; | |
24 | ||
25 | extern WXDLLIMPEXP_DATA_CORE(const char) wxPanelNameStr[]; | |
26 | ||
27 | // ---------------------------------------------------------------------------- | |
28 | // wxPanel contains other controls and implements TAB traversal between them | |
29 | // ---------------------------------------------------------------------------- | |
30 | ||
31 | class WXDLLIMPEXP_CORE wxPanelBase : public wxWindow | |
32 | { | |
33 | public: | |
34 | wxPanelBase(); | |
35 | ||
36 | // Derived classes should also provide this constructor: | |
37 | /* | |
38 | wxPanelBase(wxWindow *parent, | |
39 | wxWindowID winid = wxID_ANY, | |
40 | const wxPoint& pos = wxDefaultPosition, | |
41 | const wxSize& size = wxDefaultSize, | |
42 | long style = wxTAB_TRAVERSAL | wxNO_BORDER, | |
43 | const wxString& name = wxPanelNameStr); | |
44 | */ | |
45 | ||
46 | // Pseudo ctor | |
47 | bool Create(wxWindow *parent, | |
48 | wxWindowID winid = wxID_ANY, | |
49 | const wxPoint& pos = wxDefaultPosition, | |
50 | const wxSize& size = wxDefaultSize, | |
51 | long style = wxTAB_TRAVERSAL | wxNO_BORDER, | |
52 | const wxString& name = wxPanelNameStr); | |
53 | ||
54 | ||
55 | // Use the given bitmap to tile the background of this panel. This bitmap | |
56 | // will show through any transparent children. | |
57 | // | |
58 | // Notice that you must not prevent the base class EVT_ERASE_BACKGROUND | |
59 | // handler from running (i.e. not to handle this event yourself) for this | |
60 | // to work. | |
61 | void SetBackgroundBitmap(const wxBitmap& bmp) | |
62 | { | |
63 | DoSetBackgroundBitmap(bmp); | |
64 | } | |
65 | ||
66 | ||
67 | // implementation from now on | |
68 | // -------------------------- | |
69 | ||
70 | virtual void InitDialog(); | |
71 | ||
72 | WX_DECLARE_CONTROL_CONTAINER(); | |
73 | ||
74 | protected: | |
75 | virtual void DoSetBackgroundBitmap(const wxBitmap& bmp) = 0; | |
76 | ||
77 | private: | |
78 | wxDECLARE_EVENT_TABLE(); | |
79 | ||
80 | wxDECLARE_NO_COPY_CLASS(wxPanelBase); | |
81 | }; | |
82 | ||
83 | #if defined(__WXUNIVERSAL__) | |
84 | #include "wx/univ/panel.h" | |
85 | #elif defined(__WXMSW__) | |
86 | #include "wx/msw/panel.h" | |
87 | #else | |
88 | #define wxHAS_GENERIC_PANEL | |
89 | #include "wx/generic/panelg.h" | |
90 | #endif | |
91 | ||
92 | #endif // _WX_PANELH_BASE_ |