2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: panel.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxPanel
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 13:29:13 +00:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxPanel
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00: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
|
|
|
|
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).
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-06 16:19:04 +00: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 14:43:31 +00:00
|
|
|
|
2008-04-06 16:19:04 +00: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 14:43:31 +00:00
|
|
|
|
2009-02-18 17:58:51 +00:00
|
|
|
@beginEventEmissionTable{wxNavigationKeyEvent}
|
|
|
|
@event{EVT_NAVIGATION_KEY(func)}
|
|
|
|
Process a navigation key event.
|
|
|
|
@endEventTable
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxbase}
|
|
|
|
@category{miscwnd}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
@see wxDialog
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxPanel : public wxWindow
|
|
|
|
{
|
|
|
|
public:
|
2008-04-06 12:52:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Default constructor.
|
|
|
|
*/
|
|
|
|
wxPanel();
|
2008-04-06 16:19:04 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
Constructor.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parent
|
2008-03-09 12:33:59 +00:00
|
|
|
The parent window.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-04-06 12:52:58 +00:00
|
|
|
An identifier for the panel. @c wxID_ANY is taken to mean a default.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pos
|
2009-03-14 00:49:24 +00:00
|
|
|
The panel position. The value ::wxDefaultPosition indicates a default position,
|
2008-04-06 16:19:04 +00:00
|
|
|
chosen by either the windowing system or wxWidgets, depending on platform.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param size
|
2009-03-14 00:49:24 +00:00
|
|
|
The panel size. The value ::wxDefaultSize indicates a default size, chosen by
|
2008-03-09 12:33:59 +00:00
|
|
|
either the windowing system or wxWidgets, depending on platform.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-09 12:33:59 +00:00
|
|
|
The window style. See wxPanel.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-04-06 16:19:04 +00:00
|
|
|
Window name.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see Create()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-08 14:43:31 +00:00
|
|
|
wxPanel(wxWindow* parent, wxWindowID id = wxID_ANY,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxTAB_TRAVERSAL,
|
2008-11-10 21:33:25 +00:00
|
|
|
const wxString& name = wxPanelNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor. Deletes any child windows before deleting the physical window.
|
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual ~wxPanel();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-06 12:52:58 +00:00
|
|
|
This method is overridden from wxWindow::AcceptsFocus()
|
2008-03-08 13:52:38 +00: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 16:24:26 +00:00
|
|
|
bool AcceptsFocus() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-06 12:52:58 +00:00
|
|
|
Used for two-step panel construction. See wxPanel() for details.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxTAB_TRAVERSAL,
|
2008-10-28 15:36:26 +00:00
|
|
|
const wxString& name = wxPanelNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-06 12:52:58 +00:00
|
|
|
Sends a wxInitDialogEvent, which in turn transfers data to the dialog via
|
|
|
|
validators.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see wxInitDialogEvent
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual void InitDialog();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
2008-11-22 12:29:09 +00: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 13:52:38 +00:00
|
|
|
/**
|
|
|
|
The default handler for wxEVT_SYS_COLOUR_CHANGED.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param event
|
2008-03-09 12:33:59 +00:00
|
|
|
The colour change event.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@remarks Changes the panel's colour to conform to the current settings
|
2008-03-09 12:33:59 +00: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 12:52:58 +00:00
|
|
|
override this function, call wxEvent::Skip() to propagate
|
2008-03-09 12:33:59 +00:00
|
|
|
the notification to child windows and controls.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see wxSysColourChangedEvent
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
|
|
|
|
|
|
|
/**
|
2008-04-06 16:19:04 +00:00
|
|
|
Overrides wxWindow::SetFocus().
|
|
|
|
|
|
|
|
This method uses the (undocumented) mix-in class wxControlContainer which manages
|
2008-03-08 13:52:38 +00:00
|
|
|
the focus and TAB logic for controls which usually have child controls.
|
2008-04-06 16:19:04 +00:00
|
|
|
|
2008-03-08 13:52:38 +00: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 13:45:17 +00:00
|
|
|
|
2008-04-06 12:52:58 +00:00
|
|
|
@see wxFocusEvent, wxWindow::SetFocus()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
virtual void SetFocus();
|
|
|
|
|
|
|
|
/**
|
2008-04-06 16:19:04 +00: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 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
void SetFocusIgnoringChildren();
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|