]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/collpane.tex
Added logic, API and docs for wxDataViewModel::HasDefaultCompare indicating a compare...
[wxWidgets.git] / docs / latex / wx / collpane.tex
CommitLineData
3c1f8cb1
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: collpane.tex
3%% Purpose: wxCollapsiblePane documentation
4%% Author: Francesco Montorsi
5%% Created: 2006-10-14
6%% RCS-ID: $Id$
7%% Copyright: (c) 2006 Francesco Montorsi
8%% License: wxWindows license
9%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
3c1f8cb1
VZ
11\section{\class{wxCollapsiblePane}}\label{wxcollapsiblepane}
12
044bb772 13A collapsible pane is a container with an embedded button-like control which can be
3c1f8cb1
VZ
14used by the user to collapse or expand the pane's contents.
15
044bb772
RD
16Once constructed you should use the \helpref{GetPane}{wxcollapsiblepanegetpane}
17function 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
19controls which must go in the pane, NOT the wxCollapsiblePane itself!).
20
912c3932
VZ
21Note that because of its nature of control which can dynamically (and drastically)
22change its size at run-time under user-input, when putting wxCollapsiblePane inside
23a \helpref{wxSizer}{wxsizer} you should be careful to add it with a proportion value
24of zero; this is because otherwise all other windows with non-null proportion values
044bb772
RD
25would automatically get resized each time the user expands or collapse the pane window
26resulting usually in a weird, flickering effect.
27
28Usage sample:
8ffbb0f8 29
044bb772
RD
30\begin{verbatim}
31 wxCollapsiblePane *collpane = new wxCollapsiblePane(this, wxID_ANY, wxT("Details:"));
32
33 // add the pane with a zero proportion value to the 'sz' sizer which contains it
34 sz->Add(collpane, 0, wxGROW|wxALL, 5);
35
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);
42
43\end{verbatim}
44
912c3932
VZ
45
46It is only available if \texttt{wxUSE\_COLLPANE} is set to $1$ (the default).
47
3c1f8cb1
VZ
48\wxheading{Derived from}
49
50\helpref{wxControl}{wxcontrol}\\
51\helpref{wxWindow}{wxwindow}\\
52\helpref{wxEvtHandler}{wxevthandler}\\
53\helpref{wxObject}{wxobject}
54
55\wxheading{Include files}
56
57<wx/collpane.h>
58
a7af285d
VZ
59\wxheading{Library}
60
61\helpref{wxCore}{librarieslist}
62
3c1f8cb1
VZ
63\wxheading{Window styles}
64
912c3932
VZ
65\twocolwidtha{5cm}%
66\begin{twocollist}\itemsep=0pt
67\twocolitem{\windowstyle{wxCP\_DEFAULT\_STYLE}}{The default style: 0.}
68\end{twocollist}
69
70\wxheading{Event handling}
71
c8743553
RR
72To process a collapsible pane event, use these event handler macros to direct input to member
73functions that take a \helpref{wxCollapsiblePaneEvent}{wxcollapsiblepaneevent} argument.
74
912c3932
VZ
75\twocolwidtha{7cm}%
76\begin{twocollist}\itemsep=0pt
77\twocolitem{{\bf EVT\_COLLAPSIBLEPANE\_CHANGED(id, func)}}{The user showed or hidden the collapsible pane. }
78\end{twocollist}
3c1f8cb1 79
3c1f8cb1
VZ
80
81\wxheading{See also}
82
c8743553
RR
83\helpref{wxPanel}{wxpanel},\\
84\helpref{wxCollapsiblePaneEvent}{wxcollapsiblepaneevent}
3c1f8cb1
VZ
85
86\latexignore{\rtfignore{\wxheading{Members}}}
87
88
89
90\membersection{wxCollapsiblePane::wxCollapsiblePane}\label{wxcollapsiblepane}
91
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"}}
100
101Initializes the object and calls \helpref{Create}{wxcollapsiblepanecreate} with
102all the parameters.
103
104
105\membersection{wxCollapsiblePane::Create}\label{wxcollapsiblepanecreate}
106
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},
58e8013e 114\param{const wxString\& }{name = ``collapsiblePane"}}
3c1f8cb1
VZ
115
116\wxheading{Parameters}
117
118\docparam{parent}{Parent window, must not be non-\texttt{NULL}.}
119
120\docparam{id}{The identifier for the control.}
121
122\docparam{label}{The initial label shown in the button which allows the user to expand or collapse the pane window.}
123
124\docparam{pos}{Initial position.}
125
126\docparam{size}{Initial size.}
127
128\docparam{style}{The window style, see {\tt wxCP\_*} flags.}
129
130\docparam{validator}{Validator which can be used for additional date checks.}
131
132\docparam{name}{Control name.}
133
134\wxheading{Return value}
135
136\true if the control was successfully created or \false if creation failed.
137
138
139\membersection{wxCollapsiblePane::IsCollapsed}\label{wxcollapsiblepaneiscollapsed}
140
141\constfunc{bool}{IsCollapsed}{\void}
142
143Returns \true if the pane window is currently hidden.
144
145
550d433e
VZ
146\membersection{wxCollapsiblePane::IsExpanded}\label{wxcollapsiblepaneisexpanded}
147
148\constfunc{bool}{IsExpanded}{\void}
149
150Returns \true if the pane window is currently shown.
151
3c1f8cb1
VZ
152
153\membersection{wxCollapsiblePane::Collapse}\label{wxcollapsiblepanecollapse}
154
155\func{void}{Collapse}{\param{bool }{collapse = true}}
156
157Collapses or expands the pane window.
158
159
3c1f8cb1
VZ
160\membersection{wxCollapsiblePane::Expand}\label{wxcollapsiblepaneexpand}
161
162\func{void}{Expand}{\void}
163
550d433e 164Same as \texttt{\helpref{Collapse}{wxcollapsiblepanecollapse}(false)}.
3c1f8cb1
VZ
165
166
044bb772
RD
167\membersection{wxCollapsiblePane::GetPane}\label{wxcollapsiblepanegetpane}
168
169\constfunc{wxWindow *}{GetPane}{\void}
170
171Returns a pointer to the pane window. Add controls to the returned \helpref{wxWindow}{wxwindow}
172to make them collapsible.
8ffbb0f8 173
c8743553
RR
174
175
176
177
178%% wxCollapsiblePaneEvent documentation
179
180\section{\class{wxCollapsiblePaneEvent}}\label{wxcollapsiblepaneevent}
181
182This event class is used for the events generated by
183\helpref{wxCollapsiblePane}{wxcollapsiblepane}.
184
185\wxheading{Derived from}
186
187\helpref{wxCommandEvent}{wxcommandevent}\\
188\helpref{wxEvent}{wxevent}\\
189\helpref{wxObject}{wxobject}
190
191\wxheading{Include files}
192
193<wx/collpane.h>
194
a7af285d
VZ
195\wxheading{Library}
196
197\helpref{wxCore}{librarieslist}
198
c8743553
RR
199\wxheading{Event handling}
200
201To process input from a wxCollapsiblePane, use one of these event handler macros to
202direct input to member function that take a
203\helpref{wxCollapsiblePaneEvent}{wxcollapsiblepaneevent} argument:
204
205\twocolwidtha{7cm}
206\begin{twocollist}
207\twocolitem{{\bf EVT\_COLLAPSIBLEPANE\_CHANGED(id, func)}}{The user showed or hidden the collapsible pane.}
208\end{twocollist}%
209
210
211\wxheading{See also}
212
213\helpref{wxCollapsiblePane}{wxcollapsiblepane}
214
215\latexignore{\rtfignore{\wxheading{Members}}}
216
217\membersection{wxCollapsiblePaneEvent::wxCollapsiblePaneEvent}\label{wxcollapsiblepaneeventctor}
218
219\func{}{wxCollapsiblePaneEvent}{\param{wxObject *}{ generator}, \param{int}{ id}, \param{bool}{ collapsed}}
220
221The constructor is not normally used by the user code.
222
223
224\membersection{wxCollapsiblePaneEvent::GetCollapsed}\label{wxcollapsiblepaneeventgetcollapsed}
225
226\constfunc{bool}{GetCollapsed}{\void}
227
228Returns \true if the pane has been collapsed.
229
230
231\membersection{wxCollapsiblePaneEvent::SetCollapsed}\label{wxcollapsiblepaneeventsetcollapsed}
232
233\func{void}{SetCollapsed}{\param{bool}{ collapsed}}
234
235Sets this as a collapsed pane event (if \arg{collapsed} is \true) or as an expanded
236pane event (if \arg{collapsed} is \false).
237