1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/collpaneg.h
3 // Purpose: wxGenericCollapsiblePane
4 // Author: Francesco Montorsi
8 // Copyright: (c) Francesco Montorsi
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_COLLAPSABLE_PANE_H_GENERIC_
13 #define _WX_COLLAPSABLE_PANE_H_GENERIC_
15 #if wxUSE_BUTTON && wxUSE_STATLINE
18 class WXDLLEXPORT wxButton
;
19 class WXDLLEXPORT wxStaticLine
;
22 extern WXDLLIMPEXP_DATA_CORE(const wxChar
) wxCollapsiblePaneNameStr
[];
24 // ----------------------------------------------------------------------------
25 // wxGenericCollapsiblePane
26 // ----------------------------------------------------------------------------
28 class WXDLLIMPEXP_CORE wxGenericCollapsiblePane
: public wxCollapsiblePaneBase
31 wxGenericCollapsiblePane() { Init(); }
33 wxGenericCollapsiblePane(wxWindow
*parent
,
35 const wxString
& label
,
36 const wxPoint
& pos
= wxDefaultPosition
,
37 const wxSize
& size
= wxDefaultSize
,
38 long style
= wxCP_DEFAULT_STYLE
,
39 const wxValidator
& val
= wxDefaultValidator
,
40 const wxString
& name
= wxCollapsiblePaneNameStr
)
44 Create(parent
, winid
, label
, pos
, size
, style
, val
, name
);
55 ~wxGenericCollapsiblePane();
57 bool Create(wxWindow
*parent
,
59 const wxString
& label
,
60 const wxPoint
& pos
= wxDefaultPosition
,
61 const wxSize
& size
= wxDefaultSize
,
62 long style
= wxCP_DEFAULT_STYLE
,
63 const wxValidator
& val
= wxDefaultValidator
,
64 const wxString
& name
= wxCollapsiblePaneNameStr
);
66 // public wxCollapsiblePane API
67 virtual void Collapse(bool collapse
= true);
68 virtual void SetLabel(const wxString
&label
);
70 virtual bool IsCollapsed() const
71 { return m_pPane
==NULL
|| !m_pPane
->IsShown(); }
72 virtual wxWindow
*GetPane() const
74 virtual wxString
GetLabel() const
75 { return m_strLabel
; }
77 virtual bool Layout();
79 // implementation only, don't use
80 void OnStateChange(const wxSize
& sizeNew
);
84 virtual wxSize
DoGetBestSize() const;
86 wxString
GetBtnLabel() const;
87 int GetBorder() const;
91 wxStaticLine
*m_pStaticLine
;
95 // the button label without ">>" or "<<"
100 void OnButton(wxCommandEvent
&ev
);
101 void OnSize(wxSizeEvent
&ev
);
103 DECLARE_DYNAMIC_CLASS(wxGenericCollapsiblePane
)
104 DECLARE_EVENT_TABLE()
107 #endif // wxUSE_BUTTON && wxUSE_STATLINE
108 #endif // _WX_COLLAPSABLE_PANE_H_GENERIC_