]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/panel.tex
fix ReceiveTimeout() reference
[wxWidgets.git] / docs / latex / wx / panel.tex
1 \section{\class{wxPanel}}\label{wxpanel}
2
3 A panel is a window on which controls are placed. It is usually placed within
4 a frame. Its main feature over its parent class wxWindow is code for handling
5 child windows and TAB traversal. Since wxWidgets 2.9, there is support both
6 for TAB traversal implemented by wxWidgets itself as well as native TAB
7 traversal (such as for GTK 2.0).
8
9 {\it Note:} Tab traversal is implemented through an otherwise undocumented
10 intermediate wxControlContainer class from which any class can derive
11 in addition to the normal wxWindow base class. Please see <wx/containr.h>
12 and <wx/panel.h> to find out how this is achieved.
13
14 {\it Note:} if not all characters are being intercepted by your OnKeyDown or
15 OnChar handler, it may be because you are using the wxTAB\_TRAVERSAL style,
16 which grabs some keypresses for use by child controls.
17
18 \wxheading{Derived from}
19
20 \helpref{wxWindow}{wxwindow}\\
21 \helpref{wxEvtHandler}{wxevthandler}\\
22 \helpref{wxObject}{wxobject}
23
24 \wxheading{Include files}
25
26 <wx/panel.h>
27
28 \wxheading{Window styles}
29
30 There are no specific styles for this window.
31
32 See also \helpref{window styles overview}{windowstyles}.
33
34 \wxheading{Remarks}
35
36 By default, a panel has the same colouring as a dialog.
37
38 \wxheading{See also}
39
40 \helpref{wxDialog}{wxdialog}
41
42 \latexignore{\rtfignore{\wxheading{Members}}}
43
44 \membersection{wxPanel::wxPanel}\label{wxpanelctor}
45
46 \func{}{wxPanel}{\void}
47
48 Default constructor.
49
50 \func{}{wxPanel}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = \texttt{wxID\_ANY}},\rtfsp
51 \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
52 \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
53 \param{long}{ style = wxTAB\_TRAVERSAL},\rtfsp
54 \param{const wxString\& }{name = ``panel"}}
55
56 Constructor.
57
58 \wxheading{Parameters}
59
60 \docparam{parent}{The parent window.}
61
62 \docparam{id}{An identifier for the panel. A value of -1 is taken to mean a default.}
63
64 \docparam{pos}{The panel position. A value of (-1, -1) indicates a default position, chosen by
65 either the windowing system or wxWidgets, depending on platform.}
66
67 \docparam{size}{The panel size. A value of (-1, -1) indicates a default size, chosen by
68 either the windowing system or wxWidgets, depending on platform.}
69
70 \docparam{style}{The window style. See \helpref{wxPanel}{wxpanel}.}
71
72 \docparam{name}{Used to associate a name with the window,
73 allowing the application user to set Motif resource values for
74 individual dialog boxes.}
75
76 \wxheading{See also}
77
78 \helpref{wxPanel::Create}{wxpanelcreate}
79
80 \membersection{wxPanel::\destruct{wxPanel}}\label{wxpaneldtor}
81
82 \func{}{\destruct{wxPanel}}{\void}
83
84 Destructor. Deletes any child windows before deleting the physical window.
85
86 \membersection{wxPanel::Create}\label{wxpanelcreate}
87
88 \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = \texttt{wxID\_ANY}},\rtfsp
89 \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
90 \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
91 \param{long}{ style = wxTAB\_TRAVERSAL},\rtfsp
92 \param{const wxString\& }{name = ``panel"}}
93
94 Used for two-step panel construction. See \helpref{wxPanel::wxPanel}{wxpanelctor}\rtfsp
95 for details.
96
97
98 \membersection{wxPanel::AcceptsFocus}\label{wxpanelacceptsfocus}
99
100 \constfunc{bool}{AcceptsFocus}{\void}
101
102 This method is overridden from \helpref{wxWindow::AcceptsFocus}{wxwindowacceptsfocus}
103 and returns true only if there is no child window in the panel which
104 can accept the focus. This is reevaluated each time a child
105 window is added or removed from the panel.
106
107
108 \membersection{wxPanel::InitDialog}\label{wxpanelinitdialog}
109
110 \func{void}{InitDialog}{\void}
111
112 Sends a \helpref{wxInitDialogEvent}{wxinitdialogevent}, which
113 in turn transfers data to the dialog via validators.
114
115 \wxheading{See also}
116
117 \helpref{wxInitDialogEvent}{wxinitdialogevent}
118
119 \membersection{wxPanel::OnSysColourChanged}\label{wxpanelonsyscolourchanged}
120
121 \func{void}{OnSysColourChanged}{\param{wxSysColourChangedEvent\& }{event}}
122
123 The default handler for wxEVT\_SYS\_COLOUR\_CHANGED.
124
125 \wxheading{Parameters}
126
127 \docparam{event}{The colour change event.}
128
129 \wxheading{Remarks}
130
131 Changes the panel's colour to conform to the current settings (Windows only).
132 Add an event table entry for your panel class if you wish the behaviour
133 to be different (such as keeping a user-defined
134 background colour). If you do override this function, call wxEvent::Skip to
135 propagate the notification to child windows and controls.
136
137 \wxheading{See also}
138
139 \helpref{wxSysColourChangedEvent}{wxsyscolourchangedevent}
140
141
142 \membersection{wxPanel::SetFocus}\label{wxpanelsetfocus}
143
144 \func{virtual void}{SetFocus}{\void}
145
146 Overrides \helpref{wxWindow::SetFocus}{wxwindowsetfocus}. This method
147 uses the (undocumented) mix-in class wxControlContainer which manages
148 the focus and TAB logic for controls which usually have child controls.
149 In practice, if you call this method and the control has at least
150 one child window, the focus will be given to the child window.
151
152 \wxheading{See also}
153
154 \helpref{wxFocusEvent}{wxfocusevent}
155 \helpref{wxWindow::SetFocus}{wxwindowsetfocus}
156
157
158 \membersection{wxPanel::SetFocusIgnoringChildren}\label{wxpanelsetfocusignoringchildren}
159
160 \func{virtual void}{SetFocusIgnoringChildren}{\void}
161
162 In contrast to \helpref{wxPanel::SetFocus}{wxpanelsetfocus} (see above)
163 this will set the focus to the panel even if there are child windows
164 in the panel. This is only rarely needed.
165
166 \wxheading{See also}
167
168 \helpref{wxFocusEvent}{wxfocusevent}
169 \helpref{wxPanel::SetFocus}{wxpanelsetfocus}
170