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
[];
25 // ----------------------------------------------------------------------------
26 // wxGenericCollapsiblePane
27 // ----------------------------------------------------------------------------
29 class WXDLLIMPEXP_CORE wxGenericCollapsiblePane
: public wxCollapsiblePaneBase
32 wxGenericCollapsiblePane() { Init(); }
34 wxGenericCollapsiblePane(wxWindow
*parent
,
36 const wxString
& label
,
37 const wxPoint
& pos
= wxDefaultPosition
,
38 const wxSize
& size
= wxDefaultSize
,
39 long style
= wxCP_DEFAULT_STYLE
,
40 const wxValidator
& val
= wxDefaultValidator
,
41 const wxString
& name
= wxCollapsiblePaneNameStr
)
45 Create(parent
, winid
, label
, pos
, size
, style
, val
, name
);
56 ~wxGenericCollapsiblePane();
58 bool Create(wxWindow
*parent
,
60 const wxString
& label
,
61 const wxPoint
& pos
= wxDefaultPosition
,
62 const wxSize
& size
= wxDefaultSize
,
63 long style
= wxCP_DEFAULT_STYLE
,
64 const wxValidator
& val
= wxDefaultValidator
,
65 const wxString
& name
= wxCollapsiblePaneNameStr
);
68 // public wxCollapsiblePane API
69 virtual void Collapse(bool collapse
= true);
70 virtual void SetLabel(const wxString
&label
);
72 virtual bool IsCollapsed() const
73 { return m_pPane
==NULL
|| !m_pPane
->IsShown(); }
74 virtual wxWindow
*GetPane() const
76 virtual wxString
GetLabel() const
77 { return m_strLabel
; }
80 // implementation only, don't use
81 void OnStateChange(const wxSize
& sizeNew
);
85 virtual wxSize
DoGetBestSize() const;
88 wxString
GetBtnLabel() const;
89 int GetBorder() const;
93 wxStaticLine
*m_pStaticLine
;
97 // the button label without ">>" or "<<"
102 void OnButton(wxCommandEvent
&ev
);
103 void OnSize(wxSizeEvent
&ev
);
105 DECLARE_DYNAMIC_CLASS(wxGenericCollapsiblePane
)
106 DECLARE_EVENT_TABLE()
109 #endif // wxUSE_BUTTON && wxUSE_STATLINE
112 #endif // _WX_COLLAPSABLE_PANE_H_GENERIC_