]>
git.saurik.com Git - wxWidgets.git/blob - interface/collpane.h
1be941d5b80a86567ae3eb99d424fd541140c730
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxCollapsiblePaneEvent class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxCollapsiblePaneEvent
13 This event class is used for the events generated by
22 class wxCollapsiblePaneEvent
: public wxCommandEvent
26 The constructor is not normally used by the user code.
28 wxCollapsiblePaneEvent(wxObject
* generator
, int id
,
32 Returns @true if the pane has been collapsed.
34 bool GetCollapsed() const;
37 Sets this as a collapsed pane event (if @a collapsed is @true) or as an
39 pane event (if @a collapsed is @false).
41 void SetCollapsed(bool collapsed
);
46 @class wxCollapsiblePane
49 A collapsible pane is a container with an embedded button-like control which
51 used by the user to collapse or expand the pane's contents.
53 Once constructed you should use the wxCollapsiblePane::GetPane
54 function to access the pane and add your controls inside it (i.e. use the
55 wxCollapsiblePane::GetPane's returned pointer as parent for the
56 controls which must go in the pane, NOT the wxCollapsiblePane itself!).
58 Note that because of its nature of control which can dynamically (and
60 change its size at run-time under user-input, when putting wxCollapsiblePane
62 a wxSizer you should be careful to add it with a proportion value
63 of zero; this is because otherwise all other windows with non-null proportion
65 would automatically get resized each time the user expands or collapse the pane
67 resulting usually in a weird, flickering effect.
72 wxCollapsiblePane *collpane = new wxCollapsiblePane(this, wxID_ANY,
75 // add the pane with a zero proportion value to the 'sz' sizer which
77 sz-Add(collpane, 0, wxGROW|wxALL, 5);
79 // now add a test label in the collapsible pane using a sizer to layout it:
80 wxWindow *win = collpane-GetPane();
81 wxSizer *paneSz = new wxBoxSizer(wxVERTICAL);
82 paneSz-Add(new wxStaticText(win, wxID_ANY, wxT("test!")), 1, wxGROW|wxALL,
85 paneSz-SetSizeHints(win);
88 It is only available if @c wxUSE_COLLPANE is set to 1 (the default).
91 @style{wxCP_DEFAULT_STYLE}:
97 @appearance{collapsiblepane.png}
100 wxPanel, wxCollapsiblePaneEvent
102 class wxCollapsiblePane
: public wxControl
106 Initializes the object and calls Create() with
109 wxCollapsiblePane(wxWindow
* parent
, wxWindowID id
,
110 const wxString
& label
,
111 const wxPoint
& pos
= wxDefaultPosition
,
112 const wxSize
& size
= wxDefaultSize
,
113 long style
= wxCP_DEFAULT_STYLE
,
114 const wxValidator
& validator
= wxDefaultValidator
,
115 const wxString
& name
= "collapsiblePane");
118 Collapses or expands the pane window.
120 void Collapse(bool collapse
= true);
124 Parent window, must not be non-@NULL.
126 The identifier for the control.
128 The initial label shown in the button which allows the user to expand or
129 collapse the pane window.
135 The window style, see wxCP_* flags.
137 Validator which can be used for additional date checks.
141 @returns @true if the control was successfully created or @false if
144 bool Create(wxWindow
* parent
, wxWindowID id
,
145 const wxString
& label
,
146 const wxPoint
& pos
= wxDefaultPosition
,
147 const wxSize
& size
= wxDefaultSize
,
148 long style
= wxCP_DEFAULT_STYLE
,
149 const wxValidator
& validator
= wxDefaultValidator
,
150 const wxString
& name
= "collapsiblePane");
153 Same as @c wxCollapsiblePane::Collapse(@false).
158 Returns a pointer to the pane window. Add controls to the returned wxWindow
159 to make them collapsible.
161 wxWindow
* GetPane() const;
164 Returns @true if the pane window is currently hidden.
166 bool IsCollapsed() const;
169 Returns @true if the pane window is currently shown.
171 bool IsExpanded() const;