1 \section{\class{wxTabCtrl
}}\label{wxtabctrl
}
3 This class represents a tab control, which manages multiple tabs.
5 \wxheading{Derived from
}
7 \helpref{wxControl
}{wxcontrol
}\\
8 \helpref{wxWindow
}{wxwindow
}\\
9 \helpref{wxEvtHandler
}{wxevthandler
}\\
10 \helpref{wxObject
}{wxobject
}
14 \helpref{wxTabEvent
}{wxtabevent
},
\helpref{wxImageList
}{wximagelist
},
\rtfsp
15 \helpref{wxNotebook
}{wxnotebook
}
17 \latexignore{\rtfignore{\wxheading{Members
}}}
19 \membersection{wxTabCtrl::wxTabCtrl
}\label{wxtabctrlconstr
}
21 \func{}{wxTabCtrl
}{\void}
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"
}}
28 Constructs a tab control.
30 \wxheading{Parameters
}
32 \docparam{parent
}{The parent window. Must be non-NULL.
}
34 \docparam{id
}{The window identifier.
}
36 \docparam{pos
}{The window position.
}
38 \docparam{size
}{The window size.
}
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}.
}
43 \membersection{wxTabCtrl::
\destruct{wxTabCtrl
}}
45 \func{}{\destruct{wxTabCtrl
}}{\void}
47 Destroys the wxTabCtrl object.
49 \membersection{wxTabCtrl::Create
}\label{wxtabctrlcreate
}
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"
}}
54 Creates a tab control. See
\helpref{wxTabCtrl::wxTabCtrl
}{wxtabctrlconstr
} for a description
57 \membersection{wxTabCtrl::DeleteAllItems
}\label{wxtabctrldeleteallitems
}
59 \func{bool
}{DeleteAllItems
}{\void}
61 Deletes all tab items.
63 \membersection{wxTabCtrl::DeleteItem
}\label{wxtabctrldeleteitem
}
65 \func{bool
}{DeleteItem
}{\param{int
}{ item
}}
67 Deletes the specified tab item.
69 \membersection{wxTabCtrl::GetCurFocus
}\label{wxtabctrlgetcurfocus
}
71 \constfunc{int
}{GetCurFocus
}{\void}
73 Returns the index for the tab with the focus, or -
1 if none has the focus.
75 \membersection{wxTabCtrl::GetImageList
}\label{wxtabctrlgetimagelist
}
77 \constfunc{wxImageList*
}{GetImageList
}{\void}
79 Returns the associated image list.
83 \helpref{wxImageList
}{wximagelist
},
\helpref{wxTabCtrl::SetImageList
}{wxtabctrlsetimagelist
}
85 \membersection{wxTabCtrl::GetItemCount
}\label{wxtabctrlgetitemcount
}
87 \constfunc{int
}{GetItemCount
}{\void}
89 Returns the number of tabs in the tab control.
91 \membersection{wxTabCtrl::GetItemData
}\label{wxtabctrlgetitemdata
}
93 \constfunc{void*
}{GetItemData
}{\void}
95 Returns the client data for the given tab.
97 \membersection{wxTabCtrl::GetItemImage
}\label{wxtabctrlgetitemimage
}
99 \constfunc{int
}{GetItemImage
}{\void}
101 Returns the image index for the given tab.
103 \membersection{wxTabCtrl::GetItemRect
}\label{wxtabctrlgetitemrect
}
105 \constfunc{bool
}{GetItemRect
}{\param{int
}{item
},
\param{wxRect\&
}{ rect
}}
107 Returns the rectangle bounding the given tab.
111 \helpref{wxRect
}{wxrect
}
113 \membersection{wxTabCtrl::GetItemText
}\label{wxtabctrlgetitemtext
}
115 \constfunc{wxString
}{GetItemText
}{\void}
117 Returns the string for the given tab.
119 \membersection{wxTabCtrl::GetRowCount
}\label{wxtabctrlgetrowcount
}
121 \constfunc{int
}{GetRowCount
}{\void}
123 Returns the number of rows in the tab control.
125 \membersection{wxTabCtrl::GetSelection
}\label{wxtabctrlgetselection
}
127 \constfunc{int
}{GetSelection
}{\void}
129 Returns the index for the currently selected tab.
133 \helpref{wxTabCtrl::SetSelection
}{wxtabctrlsetselection
}
135 \membersection{wxTabCtrl::HitTest
}\label{wxtabctrlhittest
}
137 \func{int
}{HitTest
}{\param{const wxPoint\&
}{ pt
},
\param{long\&
}{ flags
}}
139 Tests whether a tab is at the specified position.
141 \wxheading{Parameters
}
143 \docparam{pt
}{Specifies the point for the hit test.
}
145 \docparam{flags
}{Return value for detailed information. One of the following values:
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.
}
156 \wxheading{Return value
}
158 Returns the zero-based tab index or -
1 if no tab is at the specified position.
160 \membersection{wxTabCtrl::InsertItem
}\label{wxtabctrlinsertitem
}
162 \func{void
}{InsertItem
}{\param{int
}{ item
},
\param{const wxString\&
}{ text
},
\param{int
}{imageId = -
1},
163 \param{void*
}{ clientData = NULL
}}
167 \wxheading{Parameters
}
169 \docparam{item
}{Specifies the index for the new item.
}
171 \docparam{text
}{Specifies the text for the new item.
}
173 \docparam{imageId
}{Specifies the optional image index for the new item.
}
175 \docparam{clientData
}{Specifies the optional client data for the new item.
}
177 \wxheading{Return value
}
179 TRUE if successful, FALSE otherwise.
181 \membersection{wxTabCtrl::SetItemData
}\label{wxtabctrlsetitemdata
}
183 \func{bool
}{SetItemData
}{\param{int
}{ item
},
\param{void*
}{ data
}}
185 Sets the client data for a tab.
187 \membersection{wxTabCtrl::SetItemImage
}\label{wxtabctrlsetitemimage
}
189 \func{bool
}{SetItemImage
}{\param{int
}{ item
},
\param{int
}{image
}}
191 Sets the image index for the given tab.
{\it image
} is an index into
192 the image list which was set with
\helpref{wxTabCtrl::SetImageList
}{wxtabctrlsetimagelist
}.
194 \membersection{wxTabCtrl::SetImageList
}\label{wxtabctrlsetimagelist
}
196 \func{void
}{SetImageList
}{\param{wxImageList*
}{ imageList
}}
198 Sets the image list for the tab control.
202 \helpref{wxImageList
}{wximagelist
}
204 \membersection{wxTabCtrl::SetItemSize
}\label{wxtabctrlsetitemsize
}
206 \func{void
}{SetItemSize
}{\param{const wxSize\&
}{ size
}}
208 Sets the width and height of the tabs.
210 \membersection{wxTabCtrl::SetItemText
}\label{wxtabctrlsetitemtext
}
212 \func{bool
}{SetItemText
}{\param{int
}{ item
},
\param{const wxString\&
}{text
}}
214 Sets the text for the given tab.
216 \membersection{wxTabCtrl::SetPadding
}\label{wxtabctrlsetpadding
}
218 \func{void
}{SetPadding
}{\param{const wxSize\&
}{ padding
}}
220 Sets the amount of space around each tab's icon and label.
222 \membersection{wxTabCtrl::SetSelection
}\label{wxtabctrlsetselection
}
224 \func{int
}{SetSelection
}{\param{int
}{ item
}}
226 Sets the selection for the given tab, returning the index of the previously
227 selected tab. Returns -
1 if the call was unsuccessful.
231 \helpref{wxTabCtrl::GetSelection
}{wxtabctrlgetselection
}