]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/panelg.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxPanel: similar to wxWindows but is coloured as for a dialog
4 // Author: Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "panelg.h"
19 #include "wx/window.h"
20 #include "wx/button.h"
22 WXDLLEXPORT_DATA(extern const wxChar
*) wxPanelNameStr
;
24 class WXDLLEXPORT wxPanel
: public wxWindow
29 // Old-style constructor (no default values for coordinates to avoid
30 // ambiguity with the new one)
31 wxPanel(wxWindow
*parent
,
32 int x
, int y
, int width
, int height
,
33 long style
= wxTAB_TRAVERSAL
| wxNO_BORDER
,
34 const wxString
& name
= wxPanelNameStr
)
38 Create(parent
, -1, wxPoint(x
, y
), wxSize(width
, height
), style
, name
);
42 wxPanel(wxWindow
*parent
,
44 const wxPoint
& pos
= wxDefaultPosition
,
45 const wxSize
& size
= wxDefaultSize
,
46 long style
= wxTAB_TRAVERSAL
| wxNO_BORDER
,
47 const wxString
& name
= wxPanelNameStr
)
49 Create(parent
, id
, pos
, size
, style
, name
);
53 bool Create(wxWindow
*parent
, wxWindowID id
,
54 const wxPoint
& pos
= wxDefaultPosition
,
55 const wxSize
& size
= wxDefaultSize
,
56 long style
= wxTAB_TRAVERSAL
| wxNO_BORDER
,
57 const wxString
& name
= wxPanelNameStr
);
59 // Sends an OnInitDialog event, which in turns transfers data to
60 // to the dialog via validators.
61 virtual void InitDialog();
63 // a default button is activated when Enter is pressed
64 wxButton
*GetDefaultItem() const { return m_btnDefault
; }
65 void SetDefaultItem(wxButton
*btn
) { m_btnDefault
= btn
; }
67 // implementation from now on
68 // --------------------------
70 // responds to colour changes
71 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
73 // process a keyboard navigation message (Tab traversal)
74 void OnNavigationKey(wxNavigationKeyEvent
& event
);
76 // set the focus to the first child if we get it
77 void OnFocus(wxFocusEvent
& event
);
79 // called by wxWindow whenever it gets focus
80 void SetLastFocus(long focus
) { m_lastFocus
= focus
; }
81 long GetLastFocus() const { return m_lastFocus
; }
84 // common part of all ctors
87 // the child which had the focus last time this panel was activated
90 // a default button or NULL
91 wxButton
*m_btnDefault
;
94 DECLARE_DYNAMIC_CLASS(wxPanel
)