1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxCollapsiblePane documentation
4 %% Author: Francesco Montorsi
7 %% Copyright: (c) 2006 Francesco Montorsi
8 %% License: wxWindows license
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11 \section{\class{wxCollapsiblePane
}}\label{wxcollapsiblepane
}
13 A collapsible pane is a container with an embedded button-like control which can be
14 used by the user to collapse or expand the pane's contents.
16 Once constructed you should use the
\helpref{GetPane
}{wxcollapsiblepanegetpane
}
17 function to access the pane and add your controls inside it (i.e. use the
18 \helpref{GetPane
}{wxcollapsiblepanegetpane
}'s returned pointer as parent for the
19 controls which must go in the pane, NOT the wxCollapsiblePane itself!).
21 Note that because of its nature of control which can dynamically (and drastically)
22 change its size at run-time under user-input, when putting wxCollapsiblePane inside
23 a
\helpref{wxSizer
}{wxsizer
} you should be careful to add it with a proportion value
24 of zero; this is because otherwise all other windows with non-null proportion values
25 would automatically get resized each time the user expands or collapse the pane window
26 resulting usually in a weird, flickering effect.
31 wxCollapsiblePane *collpane = new wxCollapsiblePane(this, wxID_ANY, wxT("Details:"));
33 // add the pane with a zero proportion value to the 'sz' sizer which contains it
34 sz->Add(collpane,
0, wxGROW|wxALL,
5);
36 // now add a test label in the collapsible pane using a sizer to layout it:
37 wxWindow *win = collpane->GetPane();
38 wxSizer *paneSz = new wxBoxSizer(wxVERTICAL);
39 paneSz->Add(new wxStaticText(win, wxID_ANY, wxT("test!")),
1, wxGROW|wxALL,
2);
40 win->SetSizer(paneSz);
41 paneSz->SetSizeHints(win);
46 It is only available if
\texttt{wxUSE
\_COLLPANE} is set to $
1$ (the default).
48 \wxheading{Derived from
}
50 \helpref{wxControl
}{wxcontrol
}\\
51 \helpref{wxWindow
}{wxwindow
}\\
52 \helpref{wxEvtHandler
}{wxevthandler
}\\
53 \helpref{wxObject
}{wxobject
}
55 \wxheading{Include files
}
61 \helpref{wxCore
}{librarieslist
}
63 \wxheading{Window styles
}
66 \begin{twocollist
}\itemsep=
0pt
67 \twocolitem{\windowstyle{wxCP
\_DEFAULT\_STYLE}}{The default style:
0.
}
70 \wxheading{Event handling
}
72 To process a collapsible pane event, use these event handler macros to direct input to member
73 functions that take a
\helpref{wxCollapsiblePaneEvent
}{wxcollapsiblepaneevent
} argument.
76 \begin{twocollist
}\itemsep=
0pt
77 \twocolitem{{\bf EVT
\_COLLAPSIBLEPANE\_CHANGED(id, func)
}}{The user showed or hidden the collapsible pane.
}
83 \helpref{wxPanel
}{wxpanel
},\\
84 \helpref{wxCollapsiblePaneEvent
}{wxcollapsiblepaneevent
}
86 \latexignore{\rtfignore{\wxheading{Members
}}}
90 \membersection{wxCollapsiblePane::wxCollapsiblePane
}\label{wxcollapsiblepanector
}
92 \func{}{wxCollapsiblePane
}{\param{wxWindow *
}{parent
},
\rtfsp
93 \param{wxWindowID
}{ id
},
\rtfsp
94 \param{const wxString\&
}{label
},
\rtfsp
95 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
96 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
97 \param{long
}{ style = wxCP
\_DEFAULT\_STYLE},
\rtfsp
98 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
99 \param{const wxString\&
}{name = ``collapsiblePane"
}}
101 Initializes the object and calls
\helpref{Create
}{wxcollapsiblepanecreate
} with
105 \membersection{wxCollapsiblePane::Create
}\label{wxcollapsiblepanecreate
}
107 \func{bool
}{Create
}{\param{wxWindow *
}{parent
},
\rtfsp
108 \param{wxWindowID
}{ id
},
\rtfsp
109 \param{const wxString\&
}{label
},
\rtfsp
110 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
111 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
112 \param{long
}{ style = wxCP
\_DEFAULT\_STYLE},
\rtfsp
113 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
114 \param{const wxString\&
}{name = ``collapsiblePane"
}}
116 \wxheading{Parameters
}
118 \docparam{parent
}{Parent window, must not be non-
\texttt{NULL
}.
}
120 \docparam{id
}{The identifier for the control.
}
122 \docparam{label
}{The initial label shown in the button which allows the user to expand or collapse the pane window.
}
124 \docparam{pos
}{Initial position.
}
126 \docparam{size
}{Initial size.
}
128 \docparam{style
}{The window style, see
{\tt wxCP
\_*
} flags.
}
130 \docparam{validator
}{Validator which can be used for additional date checks.
}
132 \docparam{name
}{Control name.
}
134 \wxheading{Return value
}
136 \true if the control was successfully created or
\false if creation failed.
139 \membersection{wxCollapsiblePane::IsCollapsed
}\label{wxcollapsiblepaneiscollapsed
}
141 \constfunc{bool
}{IsCollapsed
}{\void}
143 Returns
\true if the pane window is currently hidden.
146 \membersection{wxCollapsiblePane::IsExpanded
}\label{wxcollapsiblepaneisexpanded
}
148 \constfunc{bool
}{IsExpanded
}{\void}
150 Returns
\true if the pane window is currently shown.
153 \membersection{wxCollapsiblePane::Collapse
}\label{wxcollapsiblepanecollapse
}
155 \func{void
}{Collapse
}{\param{bool
}{collapse = true
}}
157 Collapses or expands the pane window.
160 \membersection{wxCollapsiblePane::Expand
}\label{wxcollapsiblepaneexpand
}
162 \func{void
}{Expand
}{\void}
164 Same as
\texttt{\helpref{Collapse
}{wxcollapsiblepanecollapse
}(false)
}.
167 \membersection{wxCollapsiblePane::GetPane
}\label{wxcollapsiblepanegetpane
}
169 \constfunc{wxWindow *
}{GetPane
}{\void}
171 Returns a pointer to the pane window. Add controls to the returned
\helpref{wxWindow
}{wxwindow
}
172 to make them collapsible.
178 %% wxCollapsiblePaneEvent documentation
180 \section{\class{wxCollapsiblePaneEvent
}}\label{wxcollapsiblepaneevent
}
182 This event class is used for the events generated by
183 \helpref{wxCollapsiblePane
}{wxcollapsiblepane
}.
185 \wxheading{Derived from
}
187 \helpref{wxCommandEvent
}{wxcommandevent
}\\
188 \helpref{wxEvent
}{wxevent
}\\
189 \helpref{wxObject
}{wxobject
}
191 \wxheading{Include files
}
197 \helpref{wxCore
}{librarieslist
}
199 \wxheading{Event handling
}
201 To process input from a wxCollapsiblePane, use one of these event handler macros to
202 direct input to member function that take a
203 \helpref{wxCollapsiblePaneEvent
}{wxcollapsiblepaneevent
} argument:
207 \twocolitem{{\bf EVT
\_COLLAPSIBLEPANE\_CHANGED(id, func)
}}{The user showed or hidden the collapsible pane.
}
213 \helpref{wxCollapsiblePane
}{wxcollapsiblepane
}
215 \latexignore{\rtfignore{\wxheading{Members
}}}
217 \membersection{wxCollapsiblePaneEvent::wxCollapsiblePaneEvent
}\label{wxcollapsiblepaneeventctor
}
219 \func{}{wxCollapsiblePaneEvent
}{\param{wxObject *
}{ generator
},
\param{int
}{ id
},
\param{bool
}{ collapsed
}}
221 The constructor is not normally used by the user code.
224 \membersection{wxCollapsiblePaneEvent::GetCollapsed
}\label{wxcollapsiblepaneeventgetcollapsed
}
226 \constfunc{bool
}{GetCollapsed
}{\void}
228 Returns
\true if the pane has been collapsed.
231 \membersection{wxCollapsiblePaneEvent::SetCollapsed
}\label{wxcollapsiblepaneeventsetcollapsed
}
233 \func{void
}{SetCollapsed
}{\param{bool
}{ collapsed
}}
235 Sets this as a collapsed pane event (if
\arg{collapsed
} is
\true) or as an expanded
236 pane event (if
\arg{collapsed
} is
\false).