]> git.saurik.com Git - wxWidgets.git/blob - interface/panel.h
make it callable from any path
[wxWidgets.git] / interface / panel.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: panel.h
3 // Purpose: documentation for wxPanel class
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxPanel
11 @wxheader{panel.h}
12
13 A panel is a window on which controls are placed. It is usually placed within
14 a frame. Its main feature over its parent class wxWindow is code for handling
15 child windows and TAB traversal. Since wxWidgets 2.9, there is support both
16 for TAB traversal implemented by wxWidgets itself as well as native TAB
17 traversal (such as for GTK 2.0).
18
19 @e Note: Tab traversal is implemented through an otherwise undocumented
20 intermediate wxControlContainer class from which any class can derive
21 in addition to the normal wxWindow base class. Please see wx/containr.h
22 and wx/panel.h to find out how this is achieved.
23
24 @e Note: if not all characters are being intercepted by your OnKeyDown or
25 OnChar handler, it may be because you are using the wxTAB_TRAVERSAL style,
26 which grabs some keypresses for use by child controls.
27
28 @library{wxbase}
29 @category{miscwnd}
30
31 @seealso
32 wxDialog
33 */
34 class wxPanel : public wxWindow
35 {
36 public:
37 //@{
38 /**
39 Constructor.
40
41 @param parent
42 The parent window.
43
44 @param id
45 An identifier for the panel. A value of -1 is taken to mean a default.
46
47 @param pos
48 The panel position. The value wxDefaultPosition indicates a default position, chosen by
49 either the windowing system or wxWidgets, depending on platform.
50
51 @param size
52 The panel size. The value wxDefaultSize indicates a default size, chosen by
53 either the windowing system or wxWidgets, depending on platform.
54
55 @param style
56 The window style. See wxPanel.
57
58 @param name
59 Used to associate a name with the window,
60 allowing the application user to set Motif resource values for
61 individual dialog boxes.
62
63 @sa Create()
64 */
65 wxPanel();
66 wxPanel(wxWindow* parent, wxWindowID id = wxID_ANY,
67 const wxPoint& pos = wxDefaultPosition,
68 const wxSize& size = wxDefaultSize,
69 long style = wxTAB_TRAVERSAL,
70 const wxString& name = "panel");
71 //@}
72
73 /**
74 Destructor. Deletes any child windows before deleting the physical window.
75 */
76 ~wxPanel();
77
78 /**
79 This method is overridden from wxWindow::AcceptsFocus
80 and returns @true only if there is no child window in the panel which
81 can accept the focus. This is reevaluated each time a child
82 window is added or removed from the panel.
83 */
84 bool AcceptsFocus();
85
86 /**
87 Used for two-step panel construction. See wxPanel()
88 for details.
89 */
90 bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
91 const wxPoint& pos = wxDefaultPosition,
92 const wxSize& size = wxDefaultSize,
93 long style = wxTAB_TRAVERSAL,
94 const wxString& name = "panel");
95
96 /**
97 Sends a wxInitDialogEvent, which
98 in turn transfers data to the dialog via validators.
99
100 @sa wxInitDialogEvent
101 */
102 void InitDialog();
103
104 /**
105 The default handler for wxEVT_SYS_COLOUR_CHANGED.
106
107 @param event
108 The colour change event.
109
110 @remarks Changes the panel's colour to conform to the current settings
111 (Windows only). Add an event table entry for your
112 panel class if you wish the behaviour to be different
113 (such as keeping a user-defined background colour).
114 If you do override this function, call wxEvent::Skip
115 to propagate the notification to child windows and
116 controls.
117
118 @sa wxSysColourChangedEvent
119 */
120 void OnSysColourChanged(wxSysColourChangedEvent& event);
121
122 /**
123 Overrides wxWindow::SetFocus. This method
124 uses the (undocumented) mix-in class wxControlContainer which manages
125 the focus and TAB logic for controls which usually have child controls.
126 In practice, if you call this method and the control has at least
127 one child window, the focus will be given to the child window.
128
129 @sa wxFocusEvent, wxWindow::SetFocus
130 */
131 virtual void SetFocus();
132
133 /**
134 In contrast to SetFocus() (see above)
135 this will set the focus to the panel even if there are child windows
136 in the panel. This is only rarely needed.
137 */
138 virtual void SetFocusIgnoringChildren();
139 };