]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
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 | ||
b292e2f5 | 23 | |
06b57134 | 24 | class WXDLLEXPORT wxPanel : public wxWindow |
c801d85f | 25 | { |
c801d85f | 26 | public: |
341c92a8 VZ |
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 | } | |
c801d85f | 49 | |
341c92a8 VZ |
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(); | |
c801d85f | 60 | |
341c92a8 VZ |
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); | |
c801d85f | 70 | |
341c92a8 VZ |
71 | // called by wxWindow whenever it gets focus |
72 | void SetLastFocus(wxWindow *focus) { m_lastFocus = focus; } | |
1f916a19 | 73 | wxWindow* GetLastFocus() const { return m_lastFocus; } |
c801d85f | 74 | |
341c92a8 VZ |
75 | protected: |
76 | // the child which had the focus last time this panel was activated | |
77 | wxWindow *m_lastFocus; | |
06b57134 VZ |
78 | |
79 | private: | |
80 | DECLARE_DYNAMIC_CLASS(wxPanel) | |
81 | DECLARE_EVENT_TABLE() | |
c801d85f KB |
82 | }; |
83 | ||
84 | #endif | |
85 | // __PANELH_G__ |