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
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxPanel
|
|
|
|
@wxheader{panel.h}
|
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
|
|
|
|
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 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@e 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 wx/containr.h
|
|
|
|
and wx/panel.h to find out how this is achieved.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@e Note: if not all characters are being intercepted by your OnKeyDown or
|
2008-03-08 09:43:31 -05:00
|
|
|
OnChar handler, it may be because you are using the wxTAB_TRAVERSAL style,
|
2008-03-08 08:52:38 -05:00
|
|
|
which grabs some keypresses for use by child controls.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxbase}
|
|
|
|
@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:
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
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-03-09 08:33:59 -04:00
|
|
|
An identifier for the panel. A value of -1 is taken to mean a default.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
The panel position. The value wxDefaultPosition indicates a default position,
|
|
|
|
chosen by
|
|
|
|
either the windowing system or wxWidgets, depending on platform.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2008-03-09 08:33:59 -04:00
|
|
|
The panel size. The value wxDefaultSize indicates a default size, chosen by
|
|
|
|
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-03-09 08:33:59 -04:00
|
|
|
Used to associate a name with the window,
|
|
|
|
allowing the application user to set Motif resource values for
|
|
|
|
individual dialog boxes.
|
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
|
|
|
*/
|
|
|
|
wxPanel();
|
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,
|
|
|
|
const wxString& name = "panel");
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor. Deletes any child windows before deleting the physical window.
|
|
|
|
*/
|
|
|
|
~wxPanel();
|
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool AcceptsFocus() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Used for two-step panel construction. See wxPanel()
|
|
|
|
for details.
|
|
|
|
*/
|
|
|
|
bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxTAB_TRAVERSAL,
|
|
|
|
const wxString& name = "panel");
|
|
|
|
|
|
|
|
/**
|
|
|
|
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
|
|
|
*/
|
|
|
|
void InitDialog();
|
|
|
|
|
|
|
|
/**
|
|
|
|
The default handler for 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
|
|
|
|
override this function, call wxEvent::Skip to propagate
|
|
|
|
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);
|
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see wxFocusEvent, wxWindow::SetFocus
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual void SetFocus();
|
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
virtual void SetFocusIgnoringChildren();
|
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|