]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/gtk/collpane.h | |
3 | // Purpose: wxCollapsiblePane | |
4 | // Author: Francesco Montorsi | |
5 | // Modified by: | |
6 | // Created: 8/10/2006 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Francesco Montorsi | |
9 | // Licence: wxWindows Licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_COLLAPSABLE_PANEL_H_GTK_ | |
13 | #define _WX_COLLAPSABLE_PANEL_H_GTK_ | |
14 | ||
15 | // ---------------------------------------------------------------------------- | |
16 | // wxCollapsiblePane | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
19 | class WXDLLIMPEXP_CORE wxCollapsiblePane : public wxCollapsiblePaneBase | |
20 | { | |
21 | public: | |
22 | wxCollapsiblePane() { Init(); } | |
23 | ||
24 | wxCollapsiblePane(wxWindow *parent, | |
25 | wxWindowID winid, | |
26 | const wxString& label, | |
27 | const wxPoint& pos = wxDefaultPosition, | |
28 | const wxSize& size = wxDefaultSize, | |
29 | long style = wxCP_DEFAULT_STYLE, | |
30 | const wxValidator& val = wxDefaultValidator, | |
31 | const wxString& name = wxCollapsiblePaneNameStr) | |
32 | { | |
33 | Init(); | |
34 | ||
35 | Create(parent, winid, label, pos, size, style, val, name); | |
36 | } | |
37 | ||
38 | void Init() | |
39 | { | |
40 | m_bIgnoreNextChange = false; | |
41 | } | |
42 | ||
43 | bool Create(wxWindow *parent, | |
44 | wxWindowID winid, | |
45 | const wxString& label, | |
46 | const wxPoint& pos = wxDefaultPosition, | |
47 | const wxSize& size = wxDefaultSize, | |
48 | long style = wxCP_DEFAULT_STYLE, | |
49 | const wxValidator& val = wxDefaultValidator, | |
50 | const wxString& name = wxCollapsiblePaneNameStr); | |
51 | ||
52 | virtual void Collapse(bool collapse = true); | |
53 | virtual bool IsCollapsed() const; | |
54 | virtual void SetLabel(const wxString& str); | |
55 | ||
56 | virtual wxWindow *GetPane() const { return m_pPane; } | |
57 | virtual wxString GetLabel() const { return m_strLabel; } | |
58 | ||
59 | protected: | |
60 | virtual wxSize DoGetBestSize() const; | |
61 | ||
62 | public: // used by GTK callbacks | |
63 | bool m_bIgnoreNextChange; | |
64 | wxSize m_szCollapsed; | |
65 | ||
66 | wxWindow *m_pPane; | |
67 | ||
68 | // the button label without ">>" or "<<" | |
69 | wxString m_strLabel; | |
70 | ||
71 | private: | |
72 | void OnSize(wxSizeEvent&); | |
73 | ||
74 | DECLARE_DYNAMIC_CLASS(wxCollapsiblePane) | |
75 | DECLARE_EVENT_TABLE() | |
76 | }; | |
77 | ||
78 | #endif // _WX_COLLAPSABLE_PANEL_H_GTK_ |