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