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_ADV(const wxChar
) wxGenericCollapsiblePaneNameStr
[];
25 // ----------------------------------------------------------------------------
26 // wxGenericCollapsiblePane
27 // ----------------------------------------------------------------------------
29 class WXDLLIMPEXP_ADV 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
= wxTAB_TRAVERSAL
| wxNO_BORDER
,
40 const wxValidator
& val
= wxDefaultValidator
,
41 const wxString
& name
= wxGenericCollapsiblePaneNameStr
)
45 Create(parent
, winid
, label
, pos
, size
, style
, val
, name
);
55 bool Create(wxWindow
*parent
,
57 const wxString
& label
,
58 const wxPoint
& pos
= wxDefaultPosition
,
59 const wxSize
& size
= wxDefaultSize
,
60 long style
= wxTAB_TRAVERSAL
| wxNO_BORDER
,
61 const wxValidator
& val
= wxDefaultValidator
,
62 const wxString
& name
= wxGenericCollapsiblePaneNameStr
);
65 // public wxCollapsiblePane API
66 virtual void Collapse(bool collapse
= true);
67 virtual void SetLabel(const wxString
&label
);
69 virtual bool IsCollapsed() const
70 { return m_pPane
==NULL
|| !m_pPane
->IsShown(); }
71 virtual wxWindow
*GetPane() const
73 virtual wxString
GetLabel() const
74 { return m_strLabel
; }
77 // implementation only, don't use
78 void OnStateChange(const wxSize
& sizeNew
);
82 virtual wxSize
DoGetBestSize() const;
85 void LayoutChildren();
87 wxString
GetBtnLabel() const;
92 wxStaticLine
*m_pStatLine
;
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
110 #endif // _WX_COLLAPSABLE_PANE_H_GENERIC_