2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: panel.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxPanel
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxPanel
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
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
|
2014-02-24 15:54:44 -05:00
|
|
|
child windows and TAB traversal, which is implemented natively if possible
|
|
|
|
(e.g. in wxGTK) or by wxWidgets itself otherwise.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-06 12:19:04 -04:00
|
|
|
@note Tab traversal is implemented through an otherwise undocumented
|
|
|
|
intermediate wxControlContainer class from which any class can derive
|
|
|
|
in addition to the normal wxWindow base class. Please see @c wx/containr.h
|
|
|
|
and @c wx/panel.h to find out how this is achieved.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-06 12:19:04 -04:00
|
|
|
@note if not all characters are being intercepted by your OnKeyDown or
|
|
|
|
OnChar handler, it may be because you are using the @c wxTAB_TRAVERSAL style,
|
|
|
|
which grabs some keypresses for use by child controls.
|
|
|
|
|
|
|
|
@remarks By default, a panel has the same colouring as a dialog.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2009-02-18 12:58:51 -05:00
|
|
|
@beginEventEmissionTable{wxNavigationKeyEvent}
|
|
|
|
@event{EVT_NAVIGATION_KEY(func)}
|
|
|
|
Process a navigation key event.
|
|
|
|
@endEventTable
|
|
|
|
|
2012-10-26 21:27:23 -04:00
|
|
|
@library{wxcore}
|
2008-03-08 08:52:38 -05:00
|
|
|
@category{miscwnd}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxDialog
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxPanel : public wxWindow
|
|
|
|
{
|
|
|
|
public:
|
2008-04-06 08:52:58 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Default constructor.
|
|
|
|
*/
|
|
|
|
wxPanel();
|
2008-04-06 12:19:04 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Constructor.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
The parent window.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-04-06 08:52:58 -04:00
|
|
|
An identifier for the panel. @c wxID_ANY is taken to mean a default.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2009-03-13 20:49:24 -04:00
|
|
|
The panel position. The value ::wxDefaultPosition indicates a default position,
|
2008-04-06 12:19:04 -04:00
|
|
|
chosen by either the windowing system or wxWidgets, depending on platform.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2009-03-13 20:49:24 -04:00
|
|
|
The panel size. The value ::wxDefaultSize indicates a default size, chosen by
|
2008-03-09 08:33:59 -04:00
|
|
|
either the windowing system or wxWidgets, depending on platform.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
The window style. See wxPanel.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-04-06 12:19:04 -04:00
|
|
|
Window name.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see Create()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxPanel(wxWindow* parent, wxWindowID id = wxID_ANY,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxTAB_TRAVERSAL,
|
2008-11-10 16:33:25 -05:00
|
|
|
const wxString& name = wxPanelNameStr);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor. Deletes any child windows before deleting the physical window.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual ~wxPanel();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-06 08:52:58 -04:00
|
|
|
This method is overridden from wxWindow::AcceptsFocus()
|
2008-03-08 08:52:38 -05:00
|
|
|
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.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool AcceptsFocus() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-06 08:52:58 -04:00
|
|
|
Used for two-step panel construction. See wxPanel() for details.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxTAB_TRAVERSAL,
|
2008-10-28 11:36:26 -04:00
|
|
|
const wxString& name = wxPanelNameStr);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-06 08:52:58 -04:00
|
|
|
Sends a wxInitDialogEvent, which in turn transfers data to the dialog via
|
|
|
|
validators.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see wxInitDialogEvent
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void InitDialog();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-11-22 07:29:09 -05:00
|
|
|
/**
|
|
|
|
See wxWindow::SetAutoLayout(): when auto layout is on, this function gets
|
|
|
|
called automatically when the window is resized.
|
|
|
|
*/
|
|
|
|
virtual bool Layout();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2011-01-06 14:52:14 -05:00
|
|
|
The default handler for @c wxEVT_SYS_COLOUR_CHANGED.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param event
|
2008-03-09 08:33:59 -04:00
|
|
|
The colour change event.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks Changes the panel's colour to conform to the current settings
|
2008-03-09 08:33:59 -04:00
|
|
|
(Windows only). Add an event table entry for your panel
|
|
|
|
class if you wish the behaviour to be different (such
|
|
|
|
as keeping a user-defined background colour). If you do
|
2008-04-06 08:52:58 -04:00
|
|
|
override this function, call wxEvent::Skip() to propagate
|
2008-03-09 08:33:59 -04:00
|
|
|
the notification to child windows and controls.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see wxSysColourChangedEvent
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
|
|
|
|
|
|
|
/**
|
2008-04-06 12:19:04 -04:00
|
|
|
Overrides wxWindow::SetFocus().
|
|
|
|
|
|
|
|
This method uses the (undocumented) mix-in class wxControlContainer which manages
|
2008-03-08 08:52:38 -05:00
|
|
|
the focus and TAB logic for controls which usually have child controls.
|
2008-04-06 12:19:04 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
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.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-04-06 08:52:58 -04:00
|
|
|
@see wxFocusEvent, wxWindow::SetFocus()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual void SetFocus();
|
|
|
|
|
|
|
|
/**
|
2008-04-06 12:19:04 -04:00
|
|
|
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.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
void SetFocusIgnoringChildren();
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|