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_
16 class WXDLLIMPEXP_FWD_CORE wxButton
;
17 class WXDLLIMPEXP_FWD_CORE wxStaticLine
;
19 class WXDLLIMPEXP_FWD_CORE wxDisclosureTriangle
;
22 // ----------------------------------------------------------------------------
23 // wxGenericCollapsiblePane
24 // ----------------------------------------------------------------------------
26 class WXDLLIMPEXP_CORE wxGenericCollapsiblePane
: public wxCollapsiblePaneBase
29 wxGenericCollapsiblePane() { Init(); }
31 wxGenericCollapsiblePane(wxWindow
*parent
,
33 const wxString
& label
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
36 long style
= wxCP_DEFAULT_STYLE
,
37 const wxValidator
& val
= wxDefaultValidator
,
38 const wxString
& name
= wxCollapsiblePaneNameStr
)
42 Create(parent
, winid
, label
, pos
, size
, style
, val
, name
);
53 ~wxGenericCollapsiblePane();
55 bool Create(wxWindow
*parent
,
57 const wxString
& label
,
58 const wxPoint
& pos
= wxDefaultPosition
,
59 const wxSize
& size
= wxDefaultSize
,
60 long style
= wxCP_DEFAULT_STYLE
,
61 const wxValidator
& val
= wxDefaultValidator
,
62 const wxString
& name
= wxCollapsiblePaneNameStr
);
64 // public wxCollapsiblePane API
65 virtual void Collapse(bool collapse
= true);
66 virtual void SetLabel(const wxString
&label
);
68 virtual bool IsCollapsed() const
69 { return m_pPane
==NULL
|| !m_pPane
->IsShown(); }
70 virtual wxWindow
*GetPane() const
72 virtual wxString
GetLabel() const
73 { return m_strLabel
; }
75 virtual bool Layout();
77 // implementation only, don't use
78 void OnStateChange(const wxSize
& sizeNew
);
82 virtual wxSize
DoGetBestSize() const;
84 wxString
GetBtnLabel() const;
85 int GetBorder() const;
89 wxDisclosureTriangle
*m_pButton
;
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 // _WX_COLLAPSABLE_PANE_H_GENERIC_