]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/tabctrl.tex
Changed documentation const convention for non-objects; added some manual files
[wxWidgets.git] / docs / latex / wx / tabctrl.tex
1 \section{\class{wxTabCtrl}}\label{wxtabctrl}
2
3 This class represents a tab control, which manages multiple tabs.
4
5 \wxheading{Derived from}
6
7 \helpref{wxControl}{wxcontrol}\\
8 \helpref{wxWindow}{wxwindow}\\
9 \helpref{wxEvtHandler}{wxevthandler}\\
10 \helpref{wxObject}{wxobject}
11
12 \wxheading{See also}
13
14 \helpref{wxTabEvent}{wxtabevent}, \helpref{wxImageList}{wximagelist}
15
16 \latexignore{\rtfignore{\wxheading{Members}}}
17
18 \membersection{wxTabCtrl::wxTabCtrl}\label{wxtabctrlconstr}
19
20 \func{}{wxTabCtrl}{\void}
21
22 Default constructor.
23
24 \func{}{wxTabCtrl}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
25 \param{const wxSize\&}{ size}, \param{long}{ style = 0}, \param{const wxString\& }{name = "tabCtrl"}}
26
27 Constructs a tab control.
28
29 \wxheading{Parameters}
30
31 \docparam{parent}{The parent window. Must be non-NULL.}
32
33 \docparam{id}{The window identifier.}
34
35 \docparam{pos}{The window position.}
36
37 \docparam{size}{The window size.}
38
39 \docparam{style}{The window style. Its value is a bit list of zero or more of {\bf wxTC\_MULTILINE},
40 {\bf wxTC\_RIGHTJUSTIFY}, {\bf wxTC\_FIXEDWIDTH} and {\bf wxTC\_OWNERDRAW}.}
41
42 \membersection{wxTabCtrl::\destruct{wxTabCtrl}}
43
44 \func{}{\destruct{wxTabCtrl}}{\void}
45
46 Destroys the wxTabCtrl object.
47
48 \membersection{wxTabCtrl::Create}\label{wxtabctrlcreate}
49
50 \func{bool}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
51 \param{const wxSize\&}{ size}, \param{long}{ style = 0}, \param{const wxString\& }{name = "tabCtrl"}}
52
53 Creates a tab control. See \helpref{wxTabCtrl::wxTabCtrl}{wxtabctrlconstr} for a description
54 of the parameters.
55
56 \membersection{wxTabCtrl::DeleteAllItems}\label{wxtabctrldeleteallitems}
57
58 \func{bool}{DeleteAllItems}{\void}
59
60 Deletes all tab items.
61
62 \membersection{wxTabCtrl::DeleteItem}\label{wxtabctrldeleteitem}
63
64 \func{bool}{DeleteItem}{\param{int}{ item}}
65
66 Deletes the specified tab item.
67
68 \membersection{wxTabCtrl::GetImageList}\label{wxtabctrlgetimagelist}
69
70 \constfunc{wxImageList*}{GetImageList}{\void}
71
72 Returns the associated image list.
73
74 \wxheading{See also}
75
76 \helpref{wxImageList}{wximagelist}, \helpref{wxTabCtrl::SetImageList}{wxtabctrlsetimagelist}
77
78 \membersection{wxTabCtrl::GetItemCount}\label{wxtabctrlgetitemcount}
79
80 \constfunc{int}{GetItemCount}{\void}
81
82 Returns the number of tabs in the tab control.
83
84 \membersection{wxTabCtrl::GetItemData}\label{wxtabctrlgetitemdata}
85
86 \constfunc{void*}{GetItemData}{\void}
87
88 Returns the client data for the given tab.
89
90 \membersection{wxTabCtrl::GetItemImage}\label{wxtabctrlgetitemimage}
91
92 \constfunc{int}{GetItemImage}{\void}
93
94 Returns the image index for the given tab.
95
96 \membersection{wxTabCtrl::GetItemRect}\label{wxtabctrlgetitemrect}
97
98 \constfunc{bool}{GetItemRect}{\param{int }{item}, \param{wxRect\&}{ rect}}
99
100 Returns the rectangle bounding the given tab.
101
102 \wxheading{See also}
103
104 \helpref{wxRect}{wxrect}
105
106 \membersection{wxTabCtrl::GetItemText}\label{wxtabctrlgetitemtext}
107
108 \constfunc{wxString}{GetItemText}{\void}
109
110 Returns the string for the given tab.
111
112 \membersection{wxTabCtrl::GetRowCount}\label{wxtabctrlgetrowcount}
113
114 \constfunc{bool}{GetRowCount}{\void}
115
116 Returns the number of rows in the tab control.
117
118 \membersection{wxTabCtrl::GetSelection}\label{wxtabctrlgetselection}
119
120 \constfunc{int}{GetSelection}{\void}
121
122 Returns the index for the currently selected tab.
123
124 \wxheading{See also}
125
126 \helpref{wxTabCtrl::SetSelection}{wxtabctrlsetselection}
127
128 \membersection{wxTabCtrl::HitTest}\label{wxtabctrlhittest}
129
130 \func{int}{HitTest}{\param{const wxPoint\&}{ pt}, \param{long\&}{ flags}}
131
132 Tests whether a tab is at the specified position.
133
134 \wxheading{Parameters}
135
136 \docparam{pt}{Specifies the point for the hit test.}
137
138 \docparam{flags}{Return value for detailed information. One of the following values:
139
140 \twocolwidtha{7cm}
141 \begin{twocollist}\itemsep=0pt
142 \twocolitem{{\bf wxTAB\_HITTEST\_NOWHERE}}{There was no tab under this point.}
143 \twocolitem{{\bf wxTAB\_HITTEST\_ONICON}}{The point was over an icon.}
144 \twocolitem{{\bf wxTAB\_HITTEST\_ONLABEL}}{The point was over a label.}
145 \twocolitem{{\bf wxTAB\_HITTEST\_ONITEM}}{The point was over an item, but not on the label or icon.}
146 \end{twocollist}
147 }
148
149 \wxheading{Return value}
150
151 Returns the zero-based tab index or -1 if no tab is at the specified position.
152
153 \membersection{wxTabCtrl::InsertItem}\label{wxtabctrlinsertitem}
154
155 \func{void}{InsertItem}{\param{int}{ item}, \param{const wxString\&}{ text}, \param{int }{imageId = -1},
156 \param{void*}{ clientData = NULL}}
157
158 Inserts a new tab.
159
160 \wxheading{Parameters}
161
162 \docparam{item}{Specifies the index for the new item.}
163
164 \docparam{text}{Specifies the text for the new item.}
165
166 \docparam{imageId}{Specifies the optional image index for the new item.}
167
168 \docparam{clientData}{Specifies the optional client data for the new item.}
169
170 \wxheading{Return value}
171
172 TRUE if successful, FALSE otherwise.
173
174 \membersection{wxTabCtrl::SetItemData}\label{wxtabctrlsetitemdata}
175
176 \func{bool}{SetItemData}{\param{int}{ item}, \param{void*}{ data}}
177
178 Sets the client data for a tab.
179
180 \membersection{wxTabCtrl::SetItemImage}\label{wxtabctrlsetitemimage}
181
182 \func{bool}{SetItemImage}{\param{int}{ item}, \param{int }{image}}
183
184 Sets the image index for the given tab. {\it image} is an index into
185 the image list which was set with \helpref{wxTabCtrl::SetImageList}{setimagelist}.
186
187 \membersection{wxTabCtrl::SetImageList}\label{wxtabctrlsetimagelist}
188
189 \func{void}{SetImageList}{\param{wxImageList*}{ imageList}}
190
191 Sets the image list for the tab control.
192
193 \wxheading{See also}
194
195 \helpref{wxImageList}{wximagelist}
196
197 \membersection{wxTabCtrl::SetItemSize}\label{wxtabctrlsetitemsize}
198
199 \func{void}{SetItemSize}{\param{const wxSize\&}{ size}}
200
201 Sets the width and height of the tabs.
202
203 \membersection{wxTabCtrl::SetItemText}\label{wxtabctrlsetitemtext}
204
205 \func{bool}{SetItemText}{\param{int}{ item}, \param{const wxString\& }{text}}
206
207 Sets the text for the given tab.
208
209 \membersection{wxTabCtrl::SetPadding}\label{wxtabctrlsetpadding}
210
211 \func{void}{SetPadding}{\param{const wxSize\&}{ padding}}
212
213 Sets the amount of space around each tab's icon and label.
214
215 \membersection{wxTabCtrl::SetSelection}\label{wxtabctrlsetselection}
216
217 \func{int}{SetSelection}{\param{int}{ item}}
218
219 Sets the selection for the given tab, returning the index of the previously
220 selected tab. Returns -1 if the call was unsuccessful.
221
222 \wxheading{See also}
223
224 \helpref{wxTabCtrl::GetSelection}{wxtabctrlgetselection}
225
226