]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/panelg.h
wxTreeCtrl::GetBoundRect() implemented
[wxWidgets.git] / include / wx / generic / panelg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: panelg.h
3 // Purpose: wxPanel: similar to wxWindows but is coloured as for a dialog
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __PANELH_G__
13 #define __PANELH_G__
14
15 #ifdef __GNUG__
16 #pragma interface "panelg.h"
17 #endif
18
19 #include "wx/window.h"
20
21 WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr;
22
23
24 class WXDLLEXPORT wxPanel : public wxWindow
25 {
26 public:
27 wxPanel();
28
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)
35 {
36 Create(parent, -1, wxPoint(x, y), wxSize(width, height), style, name);
37 }
38
39 // Constructor
40 wxPanel(wxWindow *parent,
41 wxWindowID id = -1,
42 const wxPoint& pos = wxDefaultPosition,
43 const wxSize& size = wxDefaultSize,
44 long style = wxTAB_TRAVERSAL | wxNO_BORDER,
45 const wxString& name = wxPanelNameStr)
46 {
47 Create(parent, id, pos, size, style, name);
48 }
49
50 // Pseudo ctor
51 bool Create(wxWindow *parent, wxWindowID id,
52 const wxPoint& pos = wxDefaultPosition,
53 const wxSize& size = wxDefaultSize,
54 long style = wxTAB_TRAVERSAL | wxNO_BORDER,
55 const wxString& name = wxPanelNameStr);
56
57 // Sends an OnInitDialog event, which in turns transfers data to
58 // to the dialog via validators.
59 virtual void InitDialog();
60
61 // implementation
62 // responds to colour changes
63 void OnSysColourChanged(wxSysColourChangedEvent& event);
64
65 // process a keyboard navigation message (Tab traversal)
66 void OnNavigationKey(wxNavigationKeyEvent& event);
67
68 // set the focus to the first child if we get it
69 void OnFocus(wxFocusEvent& event);
70
71 // called by wxWindow whenever it gets focus
72 void SetLastFocus(long focus) { m_lastFocus = focus; }
73 long GetLastFocus() const { return m_lastFocus; }
74
75 protected:
76 // the child which had the focus last time this panel was activated
77 long m_lastFocus;
78
79 private:
80 DECLARE_DYNAMIC_CLASS(wxPanel)
81 DECLARE_EVENT_TABLE()
82 };
83
84 #endif
85 // __PANELH_G__