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
;
18 #if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__)
19 class WXDLLIMPEXP_FWD_CORE wxDisclosureTriangle
;
22 #include "wx/containr.h"
24 // ----------------------------------------------------------------------------
25 // wxGenericCollapsiblePane
26 // ----------------------------------------------------------------------------
28 class WXDLLIMPEXP_CORE wxGenericCollapsiblePane
: public wxCollapsiblePaneBase
31 wxGenericCollapsiblePane() { Init(); }
33 wxGenericCollapsiblePane(wxWindow
*parent
,
35 const wxString
& label
,
36 const wxPoint
& pos
= wxDefaultPosition
,
37 const wxSize
& size
= wxDefaultSize
,
38 long style
= wxCP_DEFAULT_STYLE
,
39 const wxValidator
& val
= wxDefaultValidator
,
40 const wxString
& name
= wxCollapsiblePaneNameStr
)
44 Create(parent
, winid
, label
, pos
, size
, style
, val
, name
);
47 virtual ~wxGenericCollapsiblePane();
49 bool Create(wxWindow
*parent
,
51 const wxString
& label
,
52 const wxPoint
& pos
= wxDefaultPosition
,
53 const wxSize
& size
= wxDefaultSize
,
54 long style
= wxCP_DEFAULT_STYLE
,
55 const wxValidator
& val
= wxDefaultValidator
,
56 const wxString
& name
= wxCollapsiblePaneNameStr
);
58 // public wxCollapsiblePane API
59 virtual void Collapse(bool collapse
= true);
60 virtual void SetLabel(const wxString
&label
);
62 virtual bool IsCollapsed() const
63 { return m_pPane
==NULL
|| !m_pPane
->IsShown(); }
64 virtual wxWindow
*GetPane() const
66 virtual wxString
GetLabel() const
67 { return m_strLabel
; }
69 virtual bool Layout();
72 // for the generic collapsible pane only:
73 wxControl
* GetControlWidget() const
74 { return (wxControl
*)m_pButton
; }
76 // implementation only, don't use
77 void OnStateChange(const wxSize
& sizeNew
);
81 virtual wxSize
DoGetBestSize() const;
83 wxString
GetBtnLabel() const;
84 int GetBorder() const;
87 #if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__)
88 wxDisclosureTriangle
*m_pButton
;
92 wxStaticLine
*m_pStaticLine
;
96 // the button label without ">>" or "<<"
103 void OnButton(wxCommandEvent
&ev
);
104 void OnSize(wxSizeEvent
&ev
);
106 WX_DECLARE_CONTROL_CONTAINER();
107 DECLARE_DYNAMIC_CLASS(wxGenericCollapsiblePane
)
108 DECLARE_EVENT_TABLE()
111 #endif // _WX_COLLAPSABLE_PANE_H_GENERIC_