1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCollapsiblePane
4 // Author: Francesco Montorsi
8 // Copyright: (c) Francesco Montorsi
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_COLLAPSABLE_PANE_H_BASE_
13 #define _WX_COLLAPSABLE_PANE_H_BASE_
15 #include "wx/control.h"
18 // ----------------------------------------------------------------------------
19 // wxCollapsiblePaneBase: interface for wxCollapsiblePane
20 // ----------------------------------------------------------------------------
22 #define wxCP_DEFAULT_STYLE (0)
24 class WXDLLEXPORT wxCollapsiblePaneBase
: public wxControl
27 wxCollapsiblePaneBase() {}
32 virtual void Collapse(bool collapse
= true) = 0;
33 virtual bool IsCollapsed() const = 0;
34 virtual wxWindow
*GetPane() const = 0;
36 virtual wxString
GetLabel() const = 0;
37 virtual void SetLabel(const wxString
&label
) = 0;
41 // ----------------------------------------------------------------------------
42 // event types and macros
43 // ----------------------------------------------------------------------------
45 BEGIN_DECLARE_EVENT_TYPES()
46 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_CORE
, wxEVT_COMMAND_COLLPANE_CHANGED
, 1102)
47 END_DECLARE_EVENT_TYPES()
49 class WXDLLIMPEXP_CORE wxCollapsiblePaneEvent
: public wxCommandEvent
52 wxCollapsiblePaneEvent() {}
53 wxCollapsiblePaneEvent(wxObject
*generator
, int id
, bool collapsed
)
54 : wxCommandEvent(wxEVT_COMMAND_COLLPANE_CHANGED
, id
),
55 m_bCollapsed(collapsed
)
57 SetEventObject(generator
);
60 bool GetCollapsed() const { return m_bCollapsed
; }
61 void SetCollapsed(bool c
) { m_bCollapsed
= c
; }
64 // default copy ctor, assignment operator and dtor are ok
65 virtual wxEvent
*Clone() const { return new wxCollapsiblePaneEvent(*this); }
70 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCollapsiblePaneEvent
)
73 // ----------------------------------------------------------------------------
74 // event types and macros
75 // ----------------------------------------------------------------------------
77 typedef void (wxEvtHandler::*wxCollapsiblePaneEventFunction
)(wxCollapsiblePaneEvent
&);
79 #define wxCollapsiblePaneEventHandler(func) \
80 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCollapsiblePaneEventFunction, &func)
82 #define EVT_COLLAPSIBLEPANE_CHANGED(id, fn) \
83 wx__DECLARE_EVT1(wxEVT_COMMAND_COLLPANE_CHANGED, id, wxCollapsiblePaneEventFunction(fn))
86 #if defined(__WXGTK24__)
87 #include "wx/gtk/collpane.h"
89 #include "wx/generic/collpaneg.h"
90 #define wxCollapsiblePane wxGenericCollapsiblePane
94 // _WX_COLLAPSABLE_PANE_H_BASE_