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