]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/collpane.tex
don't make read-only text controls editable when enabled
[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
59\wxheading{Window styles}
60
912c3932
VZ
61\twocolwidtha{5cm}%
62\begin{twocollist}\itemsep=0pt
63\twocolitem{\windowstyle{wxCP\_DEFAULT\_STYLE}}{The default style: 0.}
64\end{twocollist}
65
66\wxheading{Event handling}
67
c8743553
RR
68To process a collapsible pane event, use these event handler macros to direct input to member
69functions that take a \helpref{wxCollapsiblePaneEvent}{wxcollapsiblepaneevent} argument.
70
912c3932
VZ
71\twocolwidtha{7cm}%
72\begin{twocollist}\itemsep=0pt
73\twocolitem{{\bf EVT\_COLLAPSIBLEPANE\_CHANGED(id, func)}}{The user showed or hidden the collapsible pane. }
74\end{twocollist}
3c1f8cb1 75
3c1f8cb1
VZ
76
77\wxheading{See also}
78
c8743553
RR
79\helpref{wxPanel}{wxpanel},\\
80\helpref{wxCollapsiblePaneEvent}{wxcollapsiblepaneevent}
3c1f8cb1
VZ
81
82\latexignore{\rtfignore{\wxheading{Members}}}
83
84
85
86\membersection{wxCollapsiblePane::wxCollapsiblePane}\label{wxcollapsiblepane}
87
88\func{}{wxCollapsiblePane}{\param{wxWindow *}{parent},\rtfsp
89\param{wxWindowID}{ id},\rtfsp
90\param{const wxString\& }{label},\rtfsp
91\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
92\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
93\param{long}{ style = wxCP\_DEFAULT\_STYLE},\rtfsp
94\param{const wxValidator\& }{validator = wxDefaultValidator},
95\param{const wxString\& }{name = ``collapsiblePane"}}
96
97Initializes the object and calls \helpref{Create}{wxcollapsiblepanecreate} with
98all the parameters.
99
100
101\membersection{wxCollapsiblePane::Create}\label{wxcollapsiblepanecreate}
102
103\func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
104\param{wxWindowID}{ id},\rtfsp
105\param{const wxString\& }{label},\rtfsp
106\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
107\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
108\param{long}{ style = wxCP\_DEFAULT\_STYLE},\rtfsp
109\param{const wxValidator\& }{validator = wxDefaultValidator},
58e8013e 110\param{const wxString\& }{name = ``collapsiblePane"}}
3c1f8cb1
VZ
111
112\wxheading{Parameters}
113
114\docparam{parent}{Parent window, must not be non-\texttt{NULL}.}
115
116\docparam{id}{The identifier for the control.}
117
118\docparam{label}{The initial label shown in the button which allows the user to expand or collapse the pane window.}
119
120\docparam{pos}{Initial position.}
121
122\docparam{size}{Initial size.}
123
124\docparam{style}{The window style, see {\tt wxCP\_*} flags.}
125
126\docparam{validator}{Validator which can be used for additional date checks.}
127
128\docparam{name}{Control name.}
129
130\wxheading{Return value}
131
132\true if the control was successfully created or \false if creation failed.
133
134
135\membersection{wxCollapsiblePane::IsCollapsed}\label{wxcollapsiblepaneiscollapsed}
136
137\constfunc{bool}{IsCollapsed}{\void}
138
139Returns \true if the pane window is currently hidden.
140
141
550d433e
VZ
142\membersection{wxCollapsiblePane::IsExpanded}\label{wxcollapsiblepaneisexpanded}
143
144\constfunc{bool}{IsExpanded}{\void}
145
146Returns \true if the pane window is currently shown.
147
3c1f8cb1
VZ
148
149\membersection{wxCollapsiblePane::Collapse}\label{wxcollapsiblepanecollapse}
150
151\func{void}{Collapse}{\param{bool }{collapse = true}}
152
153Collapses or expands the pane window.
154
155
3c1f8cb1
VZ
156\membersection{wxCollapsiblePane::Expand}\label{wxcollapsiblepaneexpand}
157
158\func{void}{Expand}{\void}
159
550d433e 160Same as \texttt{\helpref{Collapse}{wxcollapsiblepanecollapse}(false)}.
3c1f8cb1
VZ
161
162
044bb772
RD
163\membersection{wxCollapsiblePane::GetPane}\label{wxcollapsiblepanegetpane}
164
165\constfunc{wxWindow *}{GetPane}{\void}
166
167Returns a pointer to the pane window. Add controls to the returned \helpref{wxWindow}{wxwindow}
168to make them collapsible.
8ffbb0f8 169
c8743553
RR
170
171
172
173
174%% wxCollapsiblePaneEvent documentation
175
176\section{\class{wxCollapsiblePaneEvent}}\label{wxcollapsiblepaneevent}
177
178This event class is used for the events generated by
179\helpref{wxCollapsiblePane}{wxcollapsiblepane}.
180
181\wxheading{Derived from}
182
183\helpref{wxCommandEvent}{wxcommandevent}\\
184\helpref{wxEvent}{wxevent}\\
185\helpref{wxObject}{wxobject}
186
187\wxheading{Include files}
188
189<wx/collpane.h>
190
191\wxheading{Event handling}
192
193To process input from a wxCollapsiblePane, use one of these event handler macros to
194direct input to member function that take a
195\helpref{wxCollapsiblePaneEvent}{wxcollapsiblepaneevent} argument:
196
197\twocolwidtha{7cm}
198\begin{twocollist}
199\twocolitem{{\bf EVT\_COLLAPSIBLEPANE\_CHANGED(id, func)}}{The user showed or hidden the collapsible pane.}
200\end{twocollist}%
201
202
203\wxheading{See also}
204
205\helpref{wxCollapsiblePane}{wxcollapsiblepane}
206
207\latexignore{\rtfignore{\wxheading{Members}}}
208
209\membersection{wxCollapsiblePaneEvent::wxCollapsiblePaneEvent}\label{wxcollapsiblepaneeventctor}
210
211\func{}{wxCollapsiblePaneEvent}{\param{wxObject *}{ generator}, \param{int}{ id}, \param{bool}{ collapsed}}
212
213The constructor is not normally used by the user code.
214
215
216\membersection{wxCollapsiblePaneEvent::GetCollapsed}\label{wxcollapsiblepaneeventgetcollapsed}
217
218\constfunc{bool}{GetCollapsed}{\void}
219
220Returns \true if the pane has been collapsed.
221
222
223\membersection{wxCollapsiblePaneEvent::SetCollapsed}\label{wxcollapsiblepaneeventsetcollapsed}
224
225\func{void}{SetCollapsed}{\param{bool}{ collapsed}}
226
227Sets this as a collapsed pane event (if \arg{collapsed} is \true) or as an expanded
228pane event (if \arg{collapsed} is \false).
229