1 \section{\class{wxPanel
}}\label{wxpanel
}
3 A panel is a window on which controls are placed. It is usually placed within a frame.
4 It contains minimal extra functionality over and above its parent class wxWindow; its main
5 purpose is to be similar in appearance and functionality to a dialog, but with the flexibility of
6 having any window as a parent.
8 {\it Note:
} if not all characters are being intercepted by your OnKeyDown or OnChar handler,
9 it may be because you are using the wxTAB
\_TRAVERSAL style, which grabs some keypresses for use
12 \wxheading{Derived from
}
14 \helpref{wxWindow
}{wxwindow
}\\
15 \helpref{wxEvtHandler
}{wxevthandler
}\\
16 \helpref{wxObject
}{wxobject
}
18 \wxheading{Include files
}
22 \wxheading{Window styles
}
24 There are no specific styles for this window.
26 See also
\helpref{window styles overview
}{windowstyles
}.
30 By default, a panel has the same colouring as a dialog.
34 \helpref{wxDialog
}{wxdialog
}
36 \latexignore{\rtfignore{\wxheading{Members
}}}
38 \membersection{wxPanel::wxPanel
}\label{wxpanelctor
}
40 \func{}{wxPanel
}{\void}
44 \func{}{wxPanel
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id =
\texttt{wxID
\_ANY}},
\rtfsp
45 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
46 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
47 \param{long
}{ style = wxTAB
\_TRAVERSAL},
\rtfsp
48 \param{const wxString\&
}{name = ``panel"
}}
52 \wxheading{Parameters
}
54 \docparam{parent
}{The parent window.
}
56 \docparam{id
}{An identifier for the panel. A value of -
1 is taken to mean a default.
}
58 \docparam{pos
}{The panel position. A value of (-
1, -
1) indicates a default position, chosen by
59 either the windowing system or wxWidgets, depending on platform.
}
61 \docparam{size
}{The panel size. A value of (-
1, -
1) indicates a default size, chosen by
62 either the windowing system or wxWidgets, depending on platform.
}
64 \docparam{style
}{The window style. See
\helpref{wxPanel
}{wxpanel
}.
}
66 \docparam{name
}{Used to associate a name with the window,
67 allowing the application user to set Motif resource values for
68 individual dialog boxes.
}
72 \helpref{wxPanel::Create
}{wxpanelcreate
}
74 \membersection{wxPanel::
\destruct{wxPanel
}}\label{wxpaneldtor
}
76 \func{}{\destruct{wxPanel
}}{\void}
78 Destructor. Deletes any child windows before deleting the physical window.
80 \membersection{wxPanel::Create
}\label{wxpanelcreate
}
82 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id =
\texttt{wxID
\_ANY}},
\rtfsp
83 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
84 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
85 \param{long
}{ style = wxTAB
\_TRAVERSAL},
\rtfsp
86 \param{const wxString\&
}{name = ``panel"
}}
88 Used for two-step panel construction. See
\helpref{wxPanel::wxPanel
}{wxpanelctor
}\rtfsp
91 \membersection{wxPanel::InitDialog
}\label{wxpanelinitdialog
}
93 \func{void
}{InitDialog
}{\void}
95 Sends a
\helpref{wxInitDialogEvent
}{wxinitdialogevent
}, which
96 in turn transfers data to the dialog via validators.
100 \helpref{wxInitDialogEvent
}{wxinitdialogevent
}
102 \membersection{wxPanel::OnSysColourChanged
}\label{wxpanelonsyscolourchanged
}
104 \func{void
}{OnSysColourChanged
}{\param{wxSysColourChangedEvent\&
}{event
}}
106 The default handler for wxEVT
\_SYS\_COLOUR\_CHANGED.
108 \wxheading{Parameters
}
110 \docparam{event
}{The colour change event.
}
114 Changes the panel's colour to conform to the current settings (Windows only).
115 Add an event table entry for your panel class if you wish the behaviour
116 to be different (such as keeping a user-defined
117 background colour). If you do override this function, call wxEvent::Skip to
118 propagate the notification to child windows and controls.
122 \helpref{wxSysColourChangedEvent
}{wxsyscolourchangedevent
}
125 \membersection{wxPanel::SetFocus
}\label{wxpanelsetfocus
}
127 \func{virtual void
}{SetFocus
}{\void}
129 Overrides
\helpref{wxWindow::SetFocus
}{wxwindowsetfocus
}. This method
130 uses the (undocumented) mix-in class wxControlContainer which manages
131 the focus and TAB logic for controls which usually have child controls.
132 In practice, if you call this method and the control has at least
133 one child window, the focus will be given to the child window.
137 \helpref{wxFocusEvent
}{wxfocusevent
}
138 \helpref{wxWindow::SetFocus
}{wxwindowsetfocus
}
141 \membersection{wxPanel::SetFocusIgnoringChildren
}\label{wxpanelsetfocusignoringchildren
}
143 \func{virtual void
}{SetFocusIgnoringChildren
}{\void}
145 In contrast to
\helpref{wxPanel::SetFocus
}{wxpanelsetfocus
} (see above)
146 this will set the focus to the panel even of there are child windows
147 in the panel. This is only rarely needed.
151 \helpref{wxFocusEvent
}{wxfocusevent
}
152 \helpref{wxPanel::SetFocus
}{wxpanelsetfocus
}