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