]> git.saurik.com Git - wxWidgets.git/blame - interface/panel.h
fixed links to global variables; fixed categories; use @see instead of @seealso
[wxWidgets.git] / interface / panel.h
CommitLineData
23324ae1
FM
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}
7c913512 12
23324ae1
FM
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).
7c913512 18
23324ae1
FM
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.
7c913512 23
23324ae1 24 @e Note: if not all characters are being intercepted by your OnKeyDown or
7c913512 25 OnChar handler, it may be because you are using the wxTAB_TRAVERSAL style,
23324ae1 26 which grabs some keypresses for use by child controls.
7c913512 27
23324ae1
FM
28 @library{wxbase}
29 @category{miscwnd}
7c913512 30
23324ae1
FM
31 @seealso
32 wxDialog
33*/
34class wxPanel : public wxWindow
35{
36public:
37 //@{
38 /**
39 Constructor.
40
7c913512 41 @param parent
4cc4bfaf 42 The parent window.
7c913512 43 @param id
4cc4bfaf 44 An identifier for the panel. A value of -1 is taken to mean a default.
7c913512 45 @param pos
4cc4bfaf
FM
46 The panel position. The value wxDefaultPosition indicates a default position,
47 chosen by
48 either the windowing system or wxWidgets, depending on platform.
7c913512 49 @param size
4cc4bfaf
FM
50 The panel size. The value wxDefaultSize indicates a default size, chosen by
51 either the windowing system or wxWidgets, depending on platform.
7c913512 52 @param style
4cc4bfaf 53 The window style. See wxPanel.
7c913512 54 @param name
4cc4bfaf
FM
55 Used to associate a name with the window,
56 allowing the application user to set Motif resource values for
57 individual dialog boxes.
23324ae1 58
4cc4bfaf 59 @see Create()
23324ae1
FM
60 */
61 wxPanel();
7c913512
FM
62 wxPanel(wxWindow* parent, wxWindowID id = wxID_ANY,
63 const wxPoint& pos = wxDefaultPosition,
64 const wxSize& size = wxDefaultSize,
65 long style = wxTAB_TRAVERSAL,
66 const wxString& name = "panel");
23324ae1
FM
67 //@}
68
69 /**
70 Destructor. Deletes any child windows before deleting the physical window.
71 */
72 ~wxPanel();
73
74 /**
75 This method is overridden from wxWindow::AcceptsFocus
76 and returns @true only if there is no child window in the panel which
77 can accept the focus. This is reevaluated each time a child
78 window is added or removed from the panel.
79 */
328f5751 80 bool AcceptsFocus() const;
23324ae1
FM
81
82 /**
83 Used for two-step panel construction. See wxPanel()
84 for details.
85 */
86 bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
87 const wxPoint& pos = wxDefaultPosition,
88 const wxSize& size = wxDefaultSize,
89 long style = wxTAB_TRAVERSAL,
90 const wxString& name = "panel");
91
92 /**
93 Sends a wxInitDialogEvent, which
94 in turn transfers data to the dialog via validators.
95
4cc4bfaf 96 @see wxInitDialogEvent
23324ae1
FM
97 */
98 void InitDialog();
99
100 /**
101 The default handler for wxEVT_SYS_COLOUR_CHANGED.
102
7c913512 103 @param event
4cc4bfaf 104 The colour change event.
23324ae1
FM
105
106 @remarks Changes the panel's colour to conform to the current settings
4cc4bfaf
FM
107 (Windows only). Add an event table entry for your panel
108 class if you wish the behaviour to be different (such
109 as keeping a user-defined background colour). If you do
110 override this function, call wxEvent::Skip to propagate
111 the notification to child windows and controls.
23324ae1 112
4cc4bfaf 113 @see wxSysColourChangedEvent
23324ae1
FM
114 */
115 void OnSysColourChanged(wxSysColourChangedEvent& event);
116
117 /**
118 Overrides wxWindow::SetFocus. This method
119 uses the (undocumented) mix-in class wxControlContainer which manages
120 the focus and TAB logic for controls which usually have child controls.
121 In practice, if you call this method and the control has at least
122 one child window, the focus will be given to the child window.
123
4cc4bfaf 124 @see wxFocusEvent, wxWindow::SetFocus
23324ae1
FM
125 */
126 virtual void SetFocus();
127
128 /**
129 In contrast to SetFocus() (see above)
130 this will set the focus to the panel even if there are child windows
131 in the panel. This is only rarely needed.
132 */
133 virtual void SetFocusIgnoringChildren();
134};