]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/collpane.tex
Remove incorrect change that accidently made it into commit.
[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:
29\begin{verbatim}
30 wxCollapsiblePane *collpane = new wxCollapsiblePane(this, wxID_ANY, wxT("Details:"));
31
32 // add the pane with a zero proportion value to the 'sz' sizer which contains it
33 sz->Add(collpane, 0, wxGROW|wxALL, 5);
34
35 // now add a test label in the collapsible pane using a sizer to layout it:
36 wxWindow *win = collpane->GetPane();
37 wxSizer *paneSz = new wxBoxSizer(wxVERTICAL);
38 paneSz->Add(new wxStaticText(win, wxID_ANY, wxT("test!")), 1, wxGROW|wxALL, 2);
39 win->SetSizer(paneSz);
40 paneSz->SetSizeHints(win);
41
42\end{verbatim}
43
912c3932
VZ
44
45It is only available if \texttt{wxUSE\_COLLPANE} is set to $1$ (the default).
46
3c1f8cb1
VZ
47\wxheading{Derived from}
48
49\helpref{wxControl}{wxcontrol}\\
50\helpref{wxWindow}{wxwindow}\\
51\helpref{wxEvtHandler}{wxevthandler}\\
52\helpref{wxObject}{wxobject}
53
54\wxheading{Include files}
55
56<wx/collpane.h>
57
58\wxheading{Window styles}
59
912c3932
VZ
60\twocolwidtha{5cm}%
61\begin{twocollist}\itemsep=0pt
62\twocolitem{\windowstyle{wxCP\_DEFAULT\_STYLE}}{The default style: 0.}
63\end{twocollist}
64
65\wxheading{Event handling}
66
67\twocolwidtha{7cm}%
68\begin{twocollist}\itemsep=0pt
69\twocolitem{{\bf EVT\_COLLAPSIBLEPANE\_CHANGED(id, func)}}{The user showed or hidden the collapsible pane. }
70\end{twocollist}
3c1f8cb1 71
3c1f8cb1
VZ
72
73\wxheading{See also}
74
75\helpref{wxPanel}{wxpanel}
76
77\latexignore{\rtfignore{\wxheading{Members}}}
78
79
80
81\membersection{wxCollapsiblePane::wxCollapsiblePane}\label{wxcollapsiblepane}
82
83\func{}{wxCollapsiblePane}{\param{wxWindow *}{parent},\rtfsp
84\param{wxWindowID}{ id},\rtfsp
85\param{const wxString\& }{label},\rtfsp
86\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
87\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
88\param{long}{ style = wxCP\_DEFAULT\_STYLE},\rtfsp
89\param{const wxValidator\& }{validator = wxDefaultValidator},
90\param{const wxString\& }{name = ``collapsiblePane"}}
91
92Initializes the object and calls \helpref{Create}{wxcollapsiblepanecreate} with
93all the parameters.
94
95
96\membersection{wxCollapsiblePane::Create}\label{wxcollapsiblepanecreate}
97
98\func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
99\param{wxWindowID}{ id},\rtfsp
100\param{const wxString\& }{label},\rtfsp
101\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
102\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
103\param{long}{ style = wxCP\_DEFAULT\_STYLE},\rtfsp
104\param{const wxValidator\& }{validator = wxDefaultValidator},
105\param{const wxString\& }{name = ``colourpickerctrl"}}
106
107\wxheading{Parameters}
108
109\docparam{parent}{Parent window, must not be non-\texttt{NULL}.}
110
111\docparam{id}{The identifier for the control.}
112
113\docparam{label}{The initial label shown in the button which allows the user to expand or collapse the pane window.}
114
115\docparam{pos}{Initial position.}
116
117\docparam{size}{Initial size.}
118
119\docparam{style}{The window style, see {\tt wxCP\_*} flags.}
120
121\docparam{validator}{Validator which can be used for additional date checks.}
122
123\docparam{name}{Control name.}
124
125\wxheading{Return value}
126
127\true if the control was successfully created or \false if creation failed.
128
129
130\membersection{wxCollapsiblePane::IsCollapsed}\label{wxcollapsiblepaneiscollapsed}
131
132\constfunc{bool}{IsCollapsed}{\void}
133
134Returns \true if the pane window is currently hidden.
135
136
550d433e
VZ
137\membersection{wxCollapsiblePane::IsExpanded}\label{wxcollapsiblepaneisexpanded}
138
139\constfunc{bool}{IsExpanded}{\void}
140
141Returns \true if the pane window is currently shown.
142
3c1f8cb1
VZ
143
144\membersection{wxCollapsiblePane::Collapse}\label{wxcollapsiblepanecollapse}
145
146\func{void}{Collapse}{\param{bool }{collapse = true}}
147
148Collapses or expands the pane window.
149
150
3c1f8cb1
VZ
151\membersection{wxCollapsiblePane::Expand}\label{wxcollapsiblepaneexpand}
152
153\func{void}{Expand}{\void}
154
550d433e 155Same as \texttt{\helpref{Collapse}{wxcollapsiblepanecollapse}(false)}.
3c1f8cb1
VZ
156
157
044bb772
RD
158\membersection{wxCollapsiblePane::GetPane}\label{wxcollapsiblepanegetpane}
159
160\constfunc{wxWindow *}{GetPane}{\void}
161
162Returns a pointer to the pane window. Add controls to the returned \helpref{wxWindow}{wxwindow}
163to make them collapsible.