]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/collpane.tex
fixed wrong parameter types in FindToolForPosition
[wxWidgets.git] / docs / latex / wx / collpane.tex
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
11 \section{\class{wxCollapsiblePane}}\label{wxcollapsiblepane}
12
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.
15
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!).
20
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.
27
28 Usage sample:
29
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
45
46 It is only available if \texttt{wxUSE\_COLLPANE} is set to $1$ (the default).
47
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
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
68 \twocolwidtha{7cm}%
69 \begin{twocollist}\itemsep=0pt
70 \twocolitem{{\bf EVT\_COLLAPSIBLEPANE\_CHANGED(id, func)}}{The user showed or hidden the collapsible pane. }
71 \end{twocollist}
72
73
74 \wxheading{See also}
75
76 \helpref{wxPanel}{wxpanel}
77
78 \latexignore{\rtfignore{\wxheading{Members}}}
79
80
81
82 \membersection{wxCollapsiblePane::wxCollapsiblePane}\label{wxcollapsiblepane}
83
84 \func{}{wxCollapsiblePane}{\param{wxWindow *}{parent},\rtfsp
85 \param{wxWindowID}{ id},\rtfsp
86 \param{const wxString\& }{label},\rtfsp
87 \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
88 \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
89 \param{long}{ style = wxCP\_DEFAULT\_STYLE},\rtfsp
90 \param{const wxValidator\& }{validator = wxDefaultValidator},
91 \param{const wxString\& }{name = ``collapsiblePane"}}
92
93 Initializes the object and calls \helpref{Create}{wxcollapsiblepanecreate} with
94 all the parameters.
95
96
97 \membersection{wxCollapsiblePane::Create}\label{wxcollapsiblepanecreate}
98
99 \func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
100 \param{wxWindowID}{ id},\rtfsp
101 \param{const wxString\& }{label},\rtfsp
102 \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
103 \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
104 \param{long}{ style = wxCP\_DEFAULT\_STYLE},\rtfsp
105 \param{const wxValidator\& }{validator = wxDefaultValidator},
106 \param{const wxString\& }{name = ``colourpickerctrl"}}
107
108 \wxheading{Parameters}
109
110 \docparam{parent}{Parent window, must not be non-\texttt{NULL}.}
111
112 \docparam{id}{The identifier for the control.}
113
114 \docparam{label}{The initial label shown in the button which allows the user to expand or collapse the pane window.}
115
116 \docparam{pos}{Initial position.}
117
118 \docparam{size}{Initial size.}
119
120 \docparam{style}{The window style, see {\tt wxCP\_*} flags.}
121
122 \docparam{validator}{Validator which can be used for additional date checks.}
123
124 \docparam{name}{Control name.}
125
126 \wxheading{Return value}
127
128 \true if the control was successfully created or \false if creation failed.
129
130
131 \membersection{wxCollapsiblePane::IsCollapsed}\label{wxcollapsiblepaneiscollapsed}
132
133 \constfunc{bool}{IsCollapsed}{\void}
134
135 Returns \true if the pane window is currently hidden.
136
137
138 \membersection{wxCollapsiblePane::IsExpanded}\label{wxcollapsiblepaneisexpanded}
139
140 \constfunc{bool}{IsExpanded}{\void}
141
142 Returns \true if the pane window is currently shown.
143
144
145 \membersection{wxCollapsiblePane::Collapse}\label{wxcollapsiblepanecollapse}
146
147 \func{void}{Collapse}{\param{bool }{collapse = true}}
148
149 Collapses or expands the pane window.
150
151
152 \membersection{wxCollapsiblePane::Expand}\label{wxcollapsiblepaneexpand}
153
154 \func{void}{Expand}{\void}
155
156 Same as \texttt{\helpref{Collapse}{wxcollapsiblepanecollapse}(false)}.
157
158
159 \membersection{wxCollapsiblePane::GetPane}\label{wxcollapsiblepanegetpane}
160
161 \constfunc{wxWindow *}{GetPane}{\void}
162
163 Returns a pointer to the pane window. Add controls to the returned \helpref{wxWindow}{wxwindow}
164 to make them collapsible.
165