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
:
29 public wxNavigationEnabled
<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
= wxCP_DEFAULT_STYLE
,
40 const wxValidator
& val
= wxDefaultValidator
,
41 const wxString
& name
= wxCollapsiblePaneNameStr
)
45 Create(parent
, winid
, label
, pos
, size
, style
, val
, name
);
48 virtual ~wxGenericCollapsiblePane();
50 bool Create(wxWindow
*parent
,
52 const wxString
& label
,
53 const wxPoint
& pos
= wxDefaultPosition
,
54 const wxSize
& size
= wxDefaultSize
,
55 long style
= wxCP_DEFAULT_STYLE
,
56 const wxValidator
& val
= wxDefaultValidator
,
57 const wxString
& name
= wxCollapsiblePaneNameStr
);
59 // public wxCollapsiblePane API
60 virtual void Collapse(bool collapse
= true);
61 virtual void SetLabel(const wxString
&label
);
63 virtual bool IsCollapsed() const
64 { return m_pPane
==NULL
|| !m_pPane
->IsShown(); }
65 virtual wxWindow
*GetPane() const
67 virtual wxString
GetLabel() const
68 { return m_strLabel
; }
70 virtual bool Layout();
73 // for the generic collapsible pane only:
74 wxControl
* GetControlWidget() const
75 { return (wxControl
*)m_pButton
; }
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;
88 #if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__)
89 wxDisclosureTriangle
*m_pButton
;
93 wxStaticLine
*m_pStaticLine
;
97 // the button label without ">>" or "<<"
104 void OnButton(wxCommandEvent
&ev
);
105 void OnSize(wxSizeEvent
&ev
);
107 DECLARE_DYNAMIC_CLASS(wxGenericCollapsiblePane
)
108 DECLARE_EVENT_TABLE()
111 #endif // _WX_COLLAPSABLE_PANE_H_GENERIC_