#include </home/zeitlin/src/wx/github/interface/wx/panel.h>
A panel is a window on which controls are placed.
It is usually placed within a frame. Its main feature over its parent class wxWindow is code for handling child windows and TAB traversal. Since wxWidgets 2.9, there is support both for TAB traversal implemented by wxWidgets itself as well as native TAB traversal (such as for GTK 2.0).
wx/containr.h
and wx/panel.h
to find out how this is achieved.wxTAB_TRAVERSAL
style, which grabs some keypresses for use by child controls.The following event handler macros redirect the events to member function handlers 'func' with prototypes like:
Event macros for events emitted by this class:
Public Member Functions | |
wxPanel () | |
Default constructor. | |
wxPanel (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxPanelNameStr) | |
Constructor. | |
virtual | ~wxPanel () |
Destructor. | |
bool | AcceptsFocus () const |
This method is overridden from wxWindow::AcceptsFocus() and returns true only if there is no child window in the panel which can accept the focus. | |
bool | Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxPanelNameStr) |
Used for two-step panel construction. | |
virtual void | InitDialog () |
Sends a wxInitDialogEvent, which in turn transfers data to the dialog via validators. | |
virtual bool | Layout () |
See wxWindow::SetAutoLayout(): when auto layout is on, this function gets called automatically when the window is resized. | |
void | OnSysColourChanged (wxSysColourChangedEvent &event) |
The default handler for wxEVT_SYS_COLOUR_CHANGED . | |
virtual void | SetFocus () |
Overrides wxWindow::SetFocus(). | |
void | SetFocusIgnoringChildren () |
In contrast to SetFocus() (see above) this will set the focus to the panel even if there are child windows in the panel. |
wxPanel::wxPanel | ( | ) |
Default constructor.
wxPanel::wxPanel | ( | wxWindow * | parent, |
wxWindowID | id = wxID_ANY , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = wxTAB_TRAVERSAL , |
||
const wxString & | name = wxPanelNameStr |
||
) |
Constructor.
parent | The parent window. |
id | An identifier for the panel. wxID_ANY is taken to mean a default. |
pos | The panel position. The value wxDefaultPosition indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform. |
size | The panel size. The value wxDefaultSize indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform. |
style | The window style. See wxPanel. |
name | Window name. |
virtual wxPanel::~wxPanel | ( | ) | [virtual] |
Destructor.
Deletes any child windows before deleting the physical window.
bool wxPanel::AcceptsFocus | ( | ) | const [virtual] |
This method is overridden from wxWindow::AcceptsFocus() and returns true only if there is no child window in the panel which can accept the focus.
This is reevaluated each time a child window is added or removed from the panel.
Reimplemented from wxWindow.
bool wxPanel::Create | ( | wxWindow * | parent, |
wxWindowID | id = wxID_ANY , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = wxTAB_TRAVERSAL , |
||
const wxString & | name = wxPanelNameStr |
||
) |
Used for two-step panel construction.
See wxPanel() for details.
Reimplemented from wxWindow.
Reimplemented in wxHtmlListBox, wxPropertyGridManager, wxVListBox, wxVScrolledWindow, wxHScrolledWindow, and wxHVScrolledWindow.
virtual void wxPanel::InitDialog | ( | ) | [virtual] |
Sends a wxInitDialogEvent, which in turn transfers data to the dialog via validators.
Reimplemented from wxWindow.
virtual bool wxPanel::Layout | ( | ) | [virtual] |
See wxWindow::SetAutoLayout(): when auto layout is on, this function gets called automatically when the window is resized.
Reimplemented from wxWindow.
void wxPanel::OnSysColourChanged | ( | wxSysColourChangedEvent & | event | ) |
The default handler for wxEVT_SYS_COLOUR_CHANGED
.
event | The colour change event. |
virtual void wxPanel::SetFocus | ( | ) | [virtual] |
Overrides wxWindow::SetFocus().
This method uses the (undocumented) mix-in class wxControlContainer which manages the focus and TAB logic for controls which usually have child controls.
In practice, if you call this method and the control has at least one child window, the focus will be given to the child window.
Reimplemented from wxWindow.
void wxPanel::SetFocusIgnoringChildren | ( | ) |
In contrast to SetFocus() (see above) this will set the focus to the panel even if there are child windows in the panel.
This is only rarely needed.