\section{\class{wxTabView}}\label{wxtabview}

Responsible for drawing tabs onto a window, and dealing with input.

Please note that the preferred class for programming tabbed windows is \helpref{wxNotebook}{wxnotebook}.
This class is retained for backward compatibility.

\wxheading{Derived from}

\helpref{wxObject}{wxobject}

\wxheading{Include files}

<wx/tab.h>

\wxheading{See also}

\helpref{wxTabView overview}{wxtabviewoverview}, \helpref{wxPanelTabView}{wxpaneltabview}

\latexignore{\rtfignore{\wxheading{Members}}}

\membersection{wxTabView::wxTabView}

\func{}{wxTabView}{\param{long }{style = wxTAB\_STYLE\_DRAW\_BOX \pipe wxTAB\_STYLE\_COLOUR\_INTERIOR}}

Constructor.

{\it style} may be a bit list of the following:

\begin{twocollist}\itemsep=0pt
\twocolitem{wxTAB\_STYLE\_DRAW\_BOX}{Draw a box around the view area. Most commonly used for dialogs.}
\twocolitem{wxTAB\_STYLE\_COLOUR\_INTERIOR}{Draw tab backgrounds in the specified colour. Omitting this style
will ensure that the tab background matches the dialog background.}
\end{twocollist}

\membersection{wxTabView::AddTab}\label{wxtabviewaddtab}

\func{wxTabControl *}{AddTab}{\param{int}{ id}, \param{const wxString\& }{label}, \param{wxTabControl *}{existingTab=NULL}}

Adds a tab to the view.

{\it id} is the application-chosen identifier for the tab, which will be used in subsequent tab operations.

{\it label} is the label to give the tab.

{\it existingTab} maybe NULL to specify a new tab, or non-NULL to indicate that an existing tab should be used.

A new layer (row) is started when the current layer has been filled up with tabs.

\membersection{wxTabView::CalculateTabWidth}\label{wxtabviewcalculatetabwidth}

\func{int}{CalculateTabWidth}{\param{int}{ noTabs}, \param{bool}{ adjustView = FALSE}}

The application can specify the tab width using this function, in terms
of the number of tabs per layer (row) which will fit the view area, which
should have been set previously with SetViewRect.

{\it noTabs} is the number of tabs which should take up the full width
of the view area.

{\it adjustView} can be set to TRUE in order to readjust the view width
to exactly fit the given number of tabs. 

The new tab width is returned.

\membersection{wxTabView::ClearTabs}

\func{void}{ClearTabs}{\param{bool }{deleteTabs=TRUE}}

Clears the tabs, deleting them if {\it deleteTabs} is TRUE.

\membersection{wxTabView::Draw}

\func{void}{Draw}{\param{wxDC\& }{dc}}

Draws the tabs and (optionally) a box around the view area.

\membersection{wxTabView::FindTabControlForId}

\func{wxTabControl *}{FindTabControlForId}{\param{int}{ id}}

Finds the wxTabControl corresponding to {\it id}.

\membersection{wxTabView::FindTabControlForPosition}

\func{wxTabControl *}{FindTabControlForPosition}{\param{int}{ layer}, \param{int}{ position}}

Finds the wxTabControl at layer {\it layer}, position in layer {\it position}, both starting from
zero. Note that tabs change layer as they are selected or deselected.

\membersection{wxTabView::GetBackgroundBrush}

\func{wxBrush *}{GetBackgroundBrush}{\void}

Returns the brush used to draw in the background colour. It is set when
SetBackgroundColour is called. 

\membersection{wxTabView::GetBackgroundColour}

\func{wxColour}{GetBackgroundColour}{\void}

Returns the colour used for each tab background. By default, this is
light grey. To ensure a match with the dialog or panel background, omit
the wxTAB\_STYLE\_COLOUR\_INTERIOR flag from the wxTabView constructor. 

\membersection{wxTabView::GetBackgroundPen}

\func{wxPen *}{GetBackgroundPen}{\void}

Returns the pen used to draw in the background colour. It is set when
SetBackgroundColour is called. 

\membersection{wxTabView::GetHighlightColour}

\func{wxColour}{GetHighlightColour}{\void}

Returns the colour used for bright highlights on the left side of `3D' surfaces. By default, this is white.

\membersection{wxTabView::GetHighlightPen}

\func{wxPen *}{GetHighlightPen}{\void}

Returns the pen used to draw 3D effect highlights. This is set when
SetHighlightColour is called. 

\membersection{wxTabView::GetHorizontalTabOffset}

\func{int}{GetHorizontalTabOffset}{\void}

Returns the horizontal spacing by which each tab layer is offset from the one below.

\membersection{wxTabView::GetNumberOfLayers}

\func{int}{GetNumberOfLayers}{\void}

Returns the number of layers (rows of tabs).

\membersection{wxTabView::GetSelectedTabFont}

\func{wxFont *}{GetSelectedTabFont}{\void}

Returns the font to be used for the selected tab label.

\membersection{wxTabView::GetShadowColour}

\func{wxColour}{GetShadowColour}{\void}

Returns the colour used for shadows on the right-hand side of `3D' surfaces. By default, this is dark grey.

\membersection{wxTabView::GetTabHeight}

\func{int}{GetTabHeight}{\void}

Returns the tab default height.

\membersection{wxTabView::GetTabFont}

\func{wxFont *}{GetTabFont}{\void}

Returns the tab label font.

\membersection{wxTabView::GetTabSelectionHeight}

\func{int}{GetTabSelectionHeight}{\void}

Returns the height to be used for the currently selected tab; normally a few pixels
higher than the other tabs.

\membersection{wxTabView::GetTabStyle}

\func{long}{GetTabStyle}{\void}

Returns the tab style. See constructor documentation for details of valid styles.

\membersection{wxTabView::GetTabWidth}

\func{int}{GetTabWidth}{\void}

Returns the tab default width.

\membersection{wxTabView::GetTextColour}

\func{wxColour}{GetTextColour}{\void}

Returns the colour used to draw label text. By default, this is
black.

\membersection{wxTabView::GetTopMargin}

\func{int}{GetTopMargin}{\void}

Returns the height between the top of the view area and the bottom of the first
row of tabs.

\membersection{wxTabView::GetShadowPen}

\func{wxPen *}{GetShadowPen}{\void}

Returns the pen used to draw 3D effect shadows. This is set when
SetShadowColour is called. 

\membersection{wxTabView::GetViewRect}

\func{wxRectangle}{GetViewRect}{\void}

Returns the rectangle specifying the view area (above which tabs are
placed).

\membersection{wxTabView::GetVerticalTabTextSpacing}

\func{int}{GetVerticalTabTextSpacing}{\void}

Returns the vertical spacing between the top of an unselected tab, and the tab label.

\membersection{wxTabView::GetWindow}

\func{wwxWindow *}{GetWindow}{\void}

Returns the window for the view.

\membersection{wxTabView::OnCreateTabControl}

\func{wxTabControl *}{OnCreateTabControl}{\void}

Creates a new tab control. By default, this returns a wxTabControl object, but the application may wish
to define a derived class, in which case the tab view should be subclassed and this function overridden.

\membersection{wxTabView::LayoutTabs}

\func{void}{LayoutTabs}{\void}

Recalculates the positions of the tabs, and adjusts the layer of the selected tab if necessary.

You may want to call this function if the view width has changed (for example, from an OnSize handler).

\membersection{wxTabView::OnEvent}

\func{bool}{OnEvent}{\param{wxMouseEvent\& }{event}}

Processes mouse events sent from the panel or dialog. Returns TRUE if the event was processed,
FALSE otherwise.

\membersection{wxTabView::OnTabActivate}

\func{void}{OnTabActivate}{\param{int}{ activateId}, \param{int}{ deactivateId}}

Called when a tab is activated, with the new active tab id, and the former active tab id.

\membersection{wxTabView::OnTabPreActivate}

\func{bool}{OnTabPreActivate}{\param{int}{ activateId}, \param{int}{ deactivateId}}

Called just before a tab is activated, with the new active tab id, and the former active tab id.

If the function returns FALSE, the tab is not activated.

\membersection{wxTabView::SetBackgroundColour}

\func{void}{SetBackgroundColour}{\param{const wxColour\&}{ col}}

Sets the colour to be used for each tab background. By default, this is
light grey. To ensure a match with the dialog or panel background, omit
the wxTAB\_STYLE\_COLOUR\_INTERIOR flag from the wxTabView constructor. 

\membersection{wxTabView::SetHighlightColour}

\func{void}{SetHighlightColour}{\param{const wxColour\&}{ col}}

Sets the colour to be used for bright highlights on the left side of `3D' surfaces. By default, this is white.

\membersection{wxTabView::SetHorizontalTabOffset}

\func{void}{SetHorizontalTabOffset}{\param{int}{ offset}}

Sets the horizontal spacing by which each tab layer is offset from the one below.

\membersection{wxTabView::SetSelectedTabFont}

\func{void}{SetSelectedTabFont}{\param{wxFont *}{font}}

Sets the font to be used for the selected tab label.

\membersection{wxTabView::SetShadowColour}

\func{void}{SetShadowColour}{\param{const wxColour\&}{ col}}

Sets the colour to be used for shadows on the right-hand side of `3D' surfaces. By default, this is dark grey.

\membersection{wxTabView::SetTabFont}

\func{void}{SetTabFont}{\param{wxFont *}{font}}

Sets the tab label font.

\membersection{wxTabView::SetTabStyle}

\func{void}{SetTabStyle}{\param{long}{ tabStyle}}

Sets the tab style. See constructor documentation for details of valid styles.

\membersection{wxTabView::SetTabSize}

\func{void}{SetTabSize}{\param{int}{ width}, \param{int}{ height}}

Sets the tab default width and height.

\membersection{wxTabView::SetTabSelectionHeight}

\func{void}{SetTabSelectionHeight}{\param{int}{ height}}

Sets the height to be used for the currently selected tab; normally a few pixels
higher than the other tabs.

\membersection{wxTabView::SetTabSelection}

\func{void}{SetTabSelection}{\param{int}{ sel}, \param{bool}{ activateTool=TRUE}}

Sets the selected tab, calling the application's OnTabActivate function.

If {\it activateTool} is FALSE, OnTabActivate will not be called.

\membersection{wxTabView::SetTextColour}

\func{void}{SetTextColour}{\param{const wxColour\&}{ col}}

Sets the colour to be used to draw label text. By default, this is
black.

\membersection{wxTabView::SetTopMargin}

\func{void}{SetTopMargin}{\param{int}{ margin}}

Sets the height between the top of the view area and the bottom of the first
row of tabs.

\membersection{wxTabView::SetVerticalTabTextSpacing}

\func{void}{SetVerticalTabTextSpacing}{\param{int}{ spacing}}

Sets the vertical spacing between the top of an unselected tab, and the tab label.

\membersection{wxTabView::SetViewRect}\label{wxtabviewsetviewrect}

\func{void}{SetViewRect}{\param{const wxRectangle\& }{rect}}

Sets the rectangle specifying the view area (above which tabs are
placed). This must be set by the application. 

\membersection{wxTabView::SetWindow}

\func{void}{SetWindow}{\param{wxWindow *}{window}}

Set the window that the tab view will use for drawing onto.


