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