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 // ----------------------------------------------------------------------------
20 // wxGenericCollapsiblePane
21 // ----------------------------------------------------------------------------
23 class WXDLLIMPEXP_CORE wxGenericCollapsiblePane
: public wxCollapsiblePaneBase
26 wxGenericCollapsiblePane() { Init(); }
28 wxGenericCollapsiblePane(wxWindow
*parent
,
30 const wxString
& label
,
31 const wxPoint
& pos
= wxDefaultPosition
,
32 const wxSize
& size
= wxDefaultSize
,
33 long style
= wxCP_DEFAULT_STYLE
,
34 const wxValidator
& val
= wxDefaultValidator
,
35 const wxString
& name
= wxCollapsiblePaneNameStr
)
39 Create(parent
, winid
, label
, pos
, size
, style
, val
, name
);
50 ~wxGenericCollapsiblePane();
52 bool Create(wxWindow
*parent
,
54 const wxString
& label
,
55 const wxPoint
& pos
= wxDefaultPosition
,
56 const wxSize
& size
= wxDefaultSize
,
57 long style
= wxCP_DEFAULT_STYLE
,
58 const wxValidator
& val
= wxDefaultValidator
,
59 const wxString
& name
= wxCollapsiblePaneNameStr
);
61 // public wxCollapsiblePane API
62 virtual void Collapse(bool collapse
= true);
63 virtual void SetLabel(const wxString
&label
);
65 virtual bool IsCollapsed() const
66 { return m_pPane
==NULL
|| !m_pPane
->IsShown(); }
67 virtual wxWindow
*GetPane() const
69 virtual wxString
GetLabel() const
70 { return m_strLabel
; }
72 virtual bool Layout();
74 // implementation only, don't use
75 void OnStateChange(const wxSize
& sizeNew
);
79 virtual wxSize
DoGetBestSize() const;
81 wxString
GetBtnLabel() const;
82 int GetBorder() const;
86 wxStaticLine
*m_pStaticLine
;
90 // the button label without ">>" or "<<"
95 void OnButton(wxCommandEvent
&ev
);
96 void OnSize(wxSizeEvent
&ev
);
98 DECLARE_DYNAMIC_CLASS(wxGenericCollapsiblePane
)
102 #endif // _WX_COLLAPSABLE_PANE_H_GENERIC_