]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/panel.tex
wxRichTextAttr does not exist anymore - document instead wxTextAttr
[wxWidgets.git] / docs / latex / wx / panel.tex
... / ...
CommitLineData
1\section{\class{wxPanel}}\label{wxpanel}
2
3A panel is a window on which controls are placed. It is usually placed within
4a frame. Its main feature over its parent class wxWindow is code for handling
5child windows and TAB traversal. Since wxWidgets 2.9, there is support both
6for TAB traversal implemented by wxWidgets itself as well as native TAB
7traversal (such as for GTK 2.0).
8
9{\it Note:} Tab traversal is implemented through an otherwise undocumented
10intermediate wxControlContainer class from which any class can derive
11in addition to the normal wxWindow base class. Please see <wx/containr.h>
12and <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
15OnChar handler, it may be because you are using the wxTAB\_TRAVERSAL style,
16which 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
30There are no specific styles for this window.
31
32See also \helpref{window styles overview}{windowstyles}.
33
34\wxheading{Remarks}
35
36By 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
48Default 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
56Constructor.
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
65either 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
68either 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,
73allowing the application user to set Motif resource values for
74individual 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
84Destructor. 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
94Used for two-step panel construction. See \helpref{wxPanel::wxPanel}{wxpanelctor}\rtfsp
95for details.
96
97
98\membersection{wxPanel::AcceptsFocus}\label{wxpanelacceptsfocus}
99
100\constfunc{bool}{AcceptsFocus}{\void}
101
102This method is overridden from \helpref{wxWindow::AcceptsFocus}{wxwindowacceptsfocus}
103and returns true only if there is no child window in the panel which
104can accept the focus. This is reevaluated each time a child
105window is added or removed from the panel.
106
107
108\membersection{wxPanel::InitDialog}\label{wxpanelinitdialog}
109
110\func{void}{InitDialog}{\void}
111
112Sends a \helpref{wxInitDialogEvent}{wxinitdialogevent}, which
113in 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
123The default handler for wxEVT\_SYS\_COLOUR\_CHANGED.
124
125\wxheading{Parameters}
126
127\docparam{event}{The colour change event.}
128
129\wxheading{Remarks}
130
131Changes the panel's colour to conform to the current settings (Windows only).
132Add an event table entry for your panel class if you wish the behaviour
133to be different (such as keeping a user-defined
134background colour). If you do override this function, call wxEvent::Skip to
135propagate 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
146Overrides \helpref{wxWindow::SetFocus}{wxwindowsetfocus}. This method
147uses the (undocumented) mix-in class wxControlContainer which manages
148the focus and TAB logic for controls which usually have child controls.
149In practice, if you call this method and the control has at least
150one 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
162In contrast to \helpref{wxPanel::SetFocus}{wxpanelsetfocus} (see above)
163this will set the focus to the panel even if there are child windows
164in the panel. This is only rarely needed.
165
166\wxheading{See also}
167
168\helpref{wxFocusEvent}{wxfocusevent}
169\helpref{wxPanel::SetFocus}{wxpanelsetfocus}
170