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 WXDLLEXPORT wxButton
;
17 class WXDLLEXPORT wxStaticLine
;
20 extern WXDLLEXPORT_DATA(const wxChar
) wxGenericCollapsiblePaneNameStr
[];
23 // ----------------------------------------------------------------------------
24 // wxGenericCollapsiblePane
25 // ----------------------------------------------------------------------------
27 class WXDLLEXPORT wxGenericCollapsiblePane
: public wxCollapsiblePaneBase
30 wxGenericCollapsiblePane() { Init(); }
32 wxGenericCollapsiblePane(wxWindow
*parent
,
34 const wxString
& label
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
,
37 long style
= wxTAB_TRAVERSAL
| wxNO_BORDER
,
38 const wxValidator
& val
= wxDefaultValidator
,
39 const wxString
& name
= wxGenericCollapsiblePaneNameStr
)
43 Create(parent
, winid
, label
, pos
, size
, style
, val
, name
);
53 bool Create(wxWindow
*parent
,
55 const wxString
& label
,
56 const wxPoint
& pos
= wxDefaultPosition
,
57 const wxSize
& size
= wxDefaultSize
,
58 long style
= wxTAB_TRAVERSAL
| wxNO_BORDER
,
59 const wxValidator
& val
= wxDefaultValidator
,
60 const wxString
& name
= wxGenericCollapsiblePaneNameStr
);
63 // public wxCollapsiblePane API
64 virtual void Collapse(bool collapse
= true);
65 virtual void SetLabel(const wxString
&label
);
67 virtual bool IsCollapsed() const
68 { return m_pPane
==NULL
|| !m_pPane
->IsShown(); }
69 virtual wxWindow
*GetPane() const
71 virtual wxString
GetLabel() const
72 { return m_strLabel
; }
75 // implementation only, don't use
76 void OnStateChange(const wxSize
& sizeNew
);
80 virtual wxSize
DoGetBestSize() const;
83 void LayoutChildren();
85 wxString
GetBtnLabel() const;
90 wxStaticLine
*m_pStatLine
;
93 // the button label without ">>" or "<<"
98 void OnButton(wxCommandEvent
&ev
);
99 void OnSize(wxSizeEvent
&ev
);
101 DECLARE_DYNAMIC_CLASS(wxGenericCollapsiblePane
)
102 DECLARE_EVENT_TABLE()
106 #endif // _WX_COLLAPSABLE_PANE_H_GENERIC_