\hy-9{0}{
}










\hy-5{2}{User Manual for Tab Classes Version 1.0}

\hy-6{3}{Julian Smart
Artificial Intelligence Applications Institute

University of Edinburgh
EH1 1HN}

April 24th 1996





\hy-5{1}{Contents}

\hy-6{4}{Copyright notice}

\hy-6{6}{Introduction}

\hy-6{10}{Files}

\hy-6{16}{Alphabetical class reference}

\hy-6{366}{Classes by category}

\hy-6{382}{Topic overviews}

\hy-6{415}{Change log}




\hy-10{5}{Copyright notice}



Copyright (c) 1996 Artificial Intelligence Applications Institute,
The University of Edinburgh



Permission to use, copy, modify, and distribute this software and its
documentation for any purpose is hereby granted without fee, provided that the
above copyright notice, author statement and this permission notice appear in
all copies of this software and related documentation.

THE SOFTWARE IS PROVIDED ``AS-IS'' AND WITHOUT WARRANTY OF ANY KIND, EXPRESS,
IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

IN NO EVENT SHALL THE ARTIFICIAL INTELLIGENCE APPLICATIONS INSTITUTE OR THE
UNIVERSITY OF EDINBURGH BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF
DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.


\hy-10{7}{Introduction}


The tab classes provides a way to display rows of tabs (like file divider tabs), which can be
used to switch between panels or other information. Tabs are most
commonly used in dialog boxes where the number of options is too great
to fit on one dialog.

This code compiles and runs on MS Windows and Motif, but limitations of
XView (panel refresh, no nested subwindows) prevent it from being used
on that platform.

\hy-8{8}{The appearance and behaviour of a wxTabbedDialogBox}


\hy-10{11}{Files}


The class library comprises the following files, plus makefiles:


\hy-8{12}{o}  wxtab.cpp: implementation
\hy-8{13}{o}  wxtab.h: header
\hy-8{14}{o}  test.h: test application header
\hy-8{15}{o}  test.cpp: test application implementation



\hy-10{17}{Alphabetical class reference}


 
\hy-13{18}{Tab classes overview}


\hy-8{19}{wxPanelTabView: wxObject}

\hy-8{53}{wxTabbedDialogBox: wxDialogBox}

\hy-8{78}{wxTabbedPanel: wxPanel}

\hy-8{98}{wxTabControl: wxObject}

\hy-8{179}{wxTabView: wxObject}


\hy-10{367}{Classes by category}



A classification of tab classes by category.

\hy-8{368}{View classes}

\hy-8{376}{Window classes}


\hy-10{383}{Topic overviews}



This chapter contains a selection of topic overviews.

\hy-8{384}{Tab classes overview}

\hy-8{411}{wxTabView overview}


\hy-10{416}{Change log}


April 29th 1996, Version 1.1


\hy-8{417}{o}  Added SetHorizontalTabOffset, SetHorizontalTabSpacing.
\hy-8{418}{o}  Corrected bug in colouring tabs (1 pixel out).
\hy-8{419}{o}  Corrected bug in adding tabs: last tab on first row could overlap right-hand
edge.
\hy-8{420}{o}  Added Layout function to allow resizing of the view rectangle and subsequent redrawing
of the tabs.
\hy-8{421}{o}  Added WXTAB_VERSION symbol.
\hy-8{422}{o}  Fixed bug in SetTabSelection which did not move the selected tab to the first row.
\hy-8{423}{o}  Added argument in SetTabSelection to optionally avoid calling activation code.
\hy-8{424}{o}  Changed wxPanelTabView API to allow use of any window, not just a panel, in a tab.


April 24th 1996, Version 1.0


\hy-8{425}{o}  First release.








\hy-10{9}{The appearance and behaviour of a wxTabbedDialogBox}



The following screenshot shows the appearance of the sample tabbed dialog application.



By clicking on the tabs, the user can display a different set of controls. In the example,
the Close and Help buttons remain constant. These two buttons are children of the main dialog box,
whereas the other controls are children of panels which are shown and hidden according to
which tab is active.

A tabbed dialog may have several layers (rows) of tabs, each being
offset vertically and horizontally from the previous. Tabs work in
columns, in that when a tab is pressed, it swaps place with the tab on
the first row of the same column, in order to give the effect of
displaying that tab. All tabs must be of the same width.
This is a constraint of the implementation, but it also
means that the user will find it easier to find tabs since there are
distinct tab columns. On some tabbed dialog implementations, tabs jump around
seemingly randomly because tabs have different widths.
In this implementation, a tab can always be found on the same column.

Tabs are always drawn along the top of the view area; the implementation does
not allow for vertical tabs or any other configuration.


\hy-10{20}{wxPanelTabView: wxObject}



 
\hy-13{21}{wxTabView overview}


\hy-8{22}{wxPanelTabView::wxPanelTabView}

\hy-8{29}{wxPanelTabView::~wxPanelTabView}

\hy-8{32}{wxPanelTabView::AddTabWindow}

\hy-8{37}{wxPanelTabView::ClearWindows}

\hy-8{42}{wxPanelTabView::GetCurrentWindow}

\hy-8{45}{wxPanelTabView::GetTabWindow}

\hy-8{49}{wxPanelTabView::ShowWindowForTab}


\hy-10{54}{wxTabbedDialogBox: wxDialogBox}



 
\hy-13{55}{Tab classes overview}


\hy-8{56}{wxTabbedDialogBox::wxTabbedDialogBox}

\hy-8{68}{wxTabbedDialogBox::~wxTabbedDialogBox}

\hy-8{71}{wxTabbedDialogBox::SetTabView}

\hy-8{75}{wxTabbedDialogBox::GetTabView}


\hy-10{79}{wxTabbedPanel: wxPanel}



 
\hy-13{80}{Tab classes overview}


\hy-8{81}{wxTabbedPanel::wxTabbedPanel}

\hy-8{91}{wxTabbedPanel::SetTabView}

\hy-8{95}{wxTabbedPanel::GetTabView}


\hy-10{99}{wxTabControl: wxObject}



 
\hy-13{100}{Tab classes overview}


You will rarely need to use this class directly.

\hy-8{101}{wxTabControl::wxTabControl}

\hy-8{105}{wxTabControl::GetColPosition}

\hy-8{108}{wxTabControl::GetFont}

\hy-8{111}{wxTabControl::GetHeight}

\hy-8{114}{wxTabControl::GetId}

\hy-8{117}{wxTabControl::GetLabel}

\hy-8{120}{wxTabControl::GetRowPosition}

\hy-8{123}{wxTabControl::GetSelected}

\hy-8{126}{wxTabControl::GetWidth}

\hy-8{129}{wxTabControl::GetX}

\hy-8{132}{wxTabControl::GetY}

\hy-8{135}{wxTabControl::HitTest}

\hy-8{140}{wxTabControl::OnDraw}

\hy-8{145}{wxTabControl::SetColPosition}

\hy-8{149}{wxTabControl::SetFont}

\hy-8{153}{wxTabControl::SetId}

\hy-8{157}{wxTabControl::SetLabel}

\hy-8{161}{wxTabControl::SetPosition}

\hy-8{166}{wxTabControl::SetRowPosition}

\hy-8{170}{wxTabControl::SetSelected}

\hy-8{174}{wxTabControl::SetSize}


\hy-10{180}{wxTabView: wxObject}



 
\hy-13{181}{wxTabView overview}


\hy-8{182}{wxTabView::wxTabView}

\hy-8{187}{wxTabView::AddTab}

\hy-8{196}{wxTabView::CalculateTabWidth}

\hy-8{203}{wxTabView::ClearTabs}

\hy-8{208}{wxTabView::Draw}

\hy-8{211}{wxTabView::FindTabControlForId}

\hy-8{216}{wxTabView::FindTabControlForPosition}

\hy-8{223}{wxTabView::GetBackgroundBrush}

\hy-8{226}{wxTabView::GetBackgroundColour}

\hy-8{229}{wxTabView::GetBackgroundPen}

\hy-8{232}{wxTabView::GetDC}

\hy-8{235}{wxTabView::GetHighlightColour}

\hy-8{238}{wxTabView::GetHighlightPen}

\hy-8{241}{wxTabView::GetHorizontalTabOffset}

\hy-8{244}{wxTabView::GetNumberOfLayers}

\hy-8{247}{wxTabView::GetSelectedTabFont}

\hy-8{250}{wxTabView::GetShadowColour}

\hy-8{253}{wxTabView::GetTabHeight}

\hy-8{256}{wxTabView::GetTabFont}

\hy-8{259}{wxTabView::GetTabSelectionHeight}

\hy-8{262}{wxTabView::GetTabStyle}

\hy-8{265}{wxTabView::GetTabWidth}

\hy-8{268}{wxTabView::GetTextColour}

\hy-8{271}{wxTabView::GetTopMargin}

\hy-8{274}{wxTabView::GetShadowPen}

\hy-8{277}{wxTabView::GetViewRect}

\hy-8{280}{wxTabView::GetVerticalTabTextSpacing}

\hy-8{283}{wxTabView::OnCreateTabControl}

\hy-8{286}{wxTabView::Layout}

\hy-8{289}{wxTabView::OnEvent}

\hy-8{293}{wxTabView::OnTabActivate}

\hy-8{298}{wxTabView::OnTabPreActivate}

\hy-8{303}{wxTabView::SetBackgroundColour}

\hy-8{307}{wxTabView::SetDC}

\hy-8{311}{wxTabView::SetHighlightColour}

\hy-8{315}{wxTabView::SetHorizontalTabOffset}

\hy-8{319}{wxTabView::SetSelectedTabFont}

\hy-8{323}{wxTabView::SetShadowColour}

\hy-8{327}{wxTabView::SetTabFont}

\hy-8{331}{wxTabView::SetTabStyle}

\hy-8{335}{wxTabView::SetTabSize}

\hy-8{340}{wxTabView::SetTabSelectionHeight}

\hy-8{344}{wxTabView::SetTabSelection}

\hy-8{350}{wxTabView::SetTextColour}

\hy-8{354}{wxTabView::SetTopMargin}

\hy-8{358}{wxTabView::SetVerticalTabTextSpacing}

\hy-8{362}{wxTabView::SetViewRect}


\hy-10{369}{View classes}




\hy-8{370}{o}  \hy-13{371}{wxTabView}
\hy-8{372}{o}  \hy-13{373}{wxPanelTabView}
\hy-8{374}{o}  \hy-13{375}{wxTabControl}



\hy-10{377}{Window classes}




\hy-8{378}{o}  \hy-13{379}{wxTabbedDialogBox}
\hy-8{380}{o}  \hy-13{381}{wxTabbedPanel}



\hy-10{385}{Tab classes overview}



Classes: \hy-13{386}{wxTabView}, \hy-13{387}{wxPanelTabView},
 \hy-13{388}{wxTabbedPanel}, \hy-13{389}{wxTabbedDialogBox},
 \hy-13{390}{wxTabControl}

The tab classes provide facilities for switching between contexts by
means of `tabs', which look like file divider tabs.

To use them, include the wxtab.h header file and link with the
wxtab.lib (or libwxtab_motif.a) library.

You must create both a \hy-7{391}{view} to handle the tabs, and a \hy-7{392}{window} to display the tabs
and related information. The wxTabbedDialogBox and wxTabbedPanel classes are provided for
convenience, but you could equally well construct your own window class and derived
tab view.

If you wish to display a tabbed dialog - the most common use - you should follow these steps.


\hy-8{393}{1.}  Create a new wxTabbedDialogBox class, and any buttons you wish always to be displayed
(regardless of which tab is active).
\hy-8{394}{2.}  Create a new wxPanelTabView, passing the dialog as the first argument.
\hy-8{395}{3.}  Set the view rectangle with \hy-13{396}{wxTabView::SetViewRect},
to specify the area in which child panels will be
shown. The tabs will sit on top of this view rectangle.
\hy-8{397}{4.}  Call \hy-13{398}{wxTabView::CalculateTabWidth} to calculate
the width of the tabs based on the view area. This is optional if, for example, you have one row
of tabs which does not extend the full width of the view area.
\hy-8{399}{5.}  Call \hy-13{400}{wxTabView::AddTab} for each of the tabs you wish to create, passing
a unique identifier and a tab label.
\hy-8{401}{6.}  Construct a number of windows, one for each tab, and call \hy-13{402}{wxPanelTabView::AddTabWindow} for
each of these, passing a tab identifier and the window.
\hy-8{403}{7.}  Set the tab selection.
\hy-8{404}{8.}  Show the dialog.


Under Motif, you may also need to size the dialog just before setting the tab selection, for unknown reasons.

Some constraints you need to be aware of:


\hy-8{405}{o}  All tabs must be of the same width.
\hy-8{406}{o}  Omit the wxTAB_STYLE_COLOUR_INTERIOR flag to ensure that the dialog background
and tab backgrounds match.


\hy-8{407}{Example}


\hy-10{412}{wxTabView overview}



Classes: \hy-13{413}{wxTabView}, \hy-13{414}{wxPanelTabView}

A wxTabView manages and draws a number of tabs. Because it is separate
from the tabbed window implementation, it can be reused in a number of contexts.
This library provides tabbed dialog and panel classes to use with the
wxPanelTabView class, but an application could derive other kinds of
view from wxTabView. 

For example, a help application might draw a representation of a book on
a canvas, with a row of tabs along the top. The new tab view class might
be called wxCanvasTabView, for example, with the wxBookCanvas posting
the OnEvent function to the wxCanvasTabView before processing further,
application-specific event processing. 

A window class designed to work with a view class must call the view's
OnEvent and Draw functions at appropriate times.

\hy-10{23}{wxPanelTabView::wxPanelTabView}



\hy-8{24}{void wxPanelTabView(wxPanel * \hy-8{25}{panel}, long  \hy-8{26}{style = wxTAB_STYLE_DRAW_BOX |  wxTAB_STYLE_COLOUR_INTERIOR})}

Constructor. \hy-7{27}{panel} should be a wxTabbedPanel or wxTabbedDialogBox: the type will be checked by the view at run time.

\hy-7{28}{style} may be a bit list of the following:


wxTAB_STYLE_DRAW_BOX
    Draw a box around the view area. Most commonly used for dialogs.

wxTAB_STYLE_COLOUR_INTERIOR
    Draw tab backgrounds in the specified colour. Omitting this style
will ensure that the tab background matches the dialog background.




\hy-10{30}{wxPanelTabView::~wxPanelTabView}



\hy-8{31}{void ~wxPanelTabView(void)}

Destructor. This destructor deletes all the panels associated with the view.
If you do not wish this to happen, call ClearWindows with argument FALSE before the
view is likely to be destroyed. This will clear the list of windows, without deleting them.


\hy-10{33}{wxPanelTabView::AddTabWindow}



\hy-8{34}{void AddTabPanel(int \hy-8{35}{ id}, wxWindow * \hy-8{36}{window})}

Adds a window to the view. The window is associated with the tab identifier, and will be shown or hidden as the tab
is selected or deselected.


\hy-10{38}{wxPanelTabView::ClearWindows}



\hy-8{39}{void ClearWindows(Bool \hy-8{40}{ deleteWindows = TRUE})}

Removes the child windows from the view. If \hy-7{41}{deleteWindows} is TRUE, the windows will be deleted.


\hy-10{43}{wxPanelTabView::GetCurrentWindow}



\hy-8{44}{wxPanel * GetCurrentWindow(void)}

Returns the child window currently being displayed on the tabbed panel or dialog box.


\hy-10{46}{wxPanelTabView::GetTabWindow}



\hy-8{47}{wxWindow * GetTabWindow(int \hy-8{48}{ id})}

Returns the window associated with the tab identifier.


\hy-10{50}{wxPanelTabView::ShowWindowForTab}



\hy-8{51}{void ShowWindowForTab(int \hy-8{52}{ id})}

Shows the child window corresponding to the tab identifier, and hides the previously shown window.




\hy-10{57}{wxTabbedDialogBox::wxTabbedDialogBox}



\hy-8{58}{void wxTabbedDialogBox(wxWindow * \hy-8{59}{parent}, char * \hy-8{60}{title}, Bool  \hy-8{61}{modal}, int \hy-8{62}{ x}, int \hy-8{63}{ y}, int \hy-8{64}{ width}, int \hy-8{65}{ height},
 long \hy-8{66}{ style=wxDEFAULT_DIALOG_STYLE}, char * \hy-8{67}{name="dialogBox"})}

Constructor.


\hy-10{69}{wxTabbedDialogBox::~wxTabbedDialogBox}



\hy-8{70}{void ~wxTabbedDialogBox(void)}

Destructor. This destructor deletes the tab view associated with the dialog box.
If you do not wish this to happen, set the tab view to NULL before destruction (for example,
in the OnClose member).


\hy-10{72}{wxTabbedDialogBox::SetTabView}



\hy-8{73}{void SetTabView(wxTabView * \hy-8{74}{view})}

Sets the tab view associated with the dialog box.


\hy-10{76}{wxTabbedDialogBox::GetTabView}



\hy-8{77}{wxTabView * GetTabView(void)}

Returns the tab view associated with the dialog box.



\hy-10{82}{wxTabbedPanel::wxTabbedPanel}



\hy-8{83}{void wxTabbedPanel(wxWindow * \hy-8{84}{parent}, int \hy-8{85}{ x}, int \hy-8{86}{ y}, int \hy-8{87}{ width}, int \hy-8{88}{ height},
 long \hy-8{89}{ style=0}, char * \hy-8{90}{name="panel"})}

Constructor.


\hy-10{92}{wxTabbedPanel::SetTabView}



\hy-8{93}{void SetTabView(wxTabView * \hy-8{94}{view})}

Sets the tab view associated with the panel.


\hy-10{96}{wxTabbedPanel::GetTabView}



\hy-8{97}{wxTabView * GetTabView(void)}

Returns the tab view associated with the panel.




\hy-10{102}{wxTabControl::wxTabControl}



\hy-8{103}{void wxTabControl(wxTabView * \hy-8{104}{view = NULL})}

Constructor.


\hy-10{106}{wxTabControl::GetColPosition}



\hy-8{107}{int GetColPosition(void)}

Returns the position of the tab in the tab column.


\hy-10{109}{wxTabControl::GetFont}



\hy-8{110}{wxFont * GetFont(void)}

Returns the font to be used for this tab.


\hy-10{112}{wxTabControl::GetHeight}



\hy-8{113}{int GetHeight(void)}

Returns the tab height.


\hy-10{115}{wxTabControl::GetId}



\hy-8{116}{int GetId(void)}

Returns the tab identifier.


\hy-10{118}{wxTabControl::GetLabel}



\hy-8{119}{wxString GetLabel(void)}

Returns the tab label.


\hy-10{121}{wxTabControl::GetRowPosition}



\hy-8{122}{int GetRowPosition(void)}

Returns the position of the tab in the layer or row.


\hy-10{124}{wxTabControl::GetSelected}



\hy-8{125}{Bool GetSelected(void)}

Returns the selected flag.


\hy-10{127}{wxTabControl::GetWidth}



\hy-8{128}{int GetWidth(void)}

Returns the tab width.


\hy-10{130}{wxTabControl::GetX}



\hy-8{131}{int GetX(void)}

Returns the x offset from the top-left of the view area.


\hy-10{133}{wxTabControl::GetY}



\hy-8{134}{int GetY(void)}

Returns the y offset from the top-left of the view area.


\hy-10{136}{wxTabControl::HitTest}



\hy-8{137}{Bool HitTest(int \hy-8{138}{ x}, int \hy-8{139}{ y})}

Returns TRUE if the point x, y is within the tab area.


\hy-10{141}{wxTabControl::OnDraw}



\hy-8{142}{void OnDraw(wxDC * \hy-8{143}{dc}, Bool \hy-8{144}{ lastInRow})}

Draws the tab control on the given device context.


\hy-10{146}{wxTabControl::SetColPosition}



\hy-8{147}{void SetColPosition(int \hy-8{148}{ pos})}

Sets the position in the column.


\hy-10{150}{wxTabControl::SetFont}



\hy-8{151}{void SetFont(wxFont * \hy-8{152}{font})}

Sets the font to be used for this tab.


\hy-10{154}{wxTabControl::SetId}



\hy-8{155}{void SetId(int \hy-8{156}{ id})}

Sets the tab identifier.


\hy-10{158}{wxTabControl::SetLabel}



\hy-8{159}{void SetLabel(const wxString&  \hy-8{160}{str})}

Sets the label for the tab.


\hy-10{162}{wxTabControl::SetPosition}



\hy-8{163}{void SetPosition(int \hy-8{164}{ x}, int \hy-8{165}{ y})}

Sets the x and y offsets for this tab, measured from the top-left of the view area.


\hy-10{167}{wxTabControl::SetRowPosition}



\hy-8{168}{void SetRowPosition(int \hy-8{169}{ pos})}

Sets the position on the layer (row).


\hy-10{171}{wxTabControl::SetSelected}



\hy-8{172}{void SetSelected(Bool  \hy-8{173}{selected})}

Sets the selection flag for this tab (does not set the current tab for the view;
use wxTabView::SetSelectedTab for that).


\hy-10{175}{wxTabControl::SetSize}



\hy-8{176}{void SetSize(int \hy-8{177}{ width}, int \hy-8{178}{ height})}

Sets the width and height for this tab.




\hy-10{183}{wxTabView::wxTabView}



\hy-8{184}{void wxTabView(long  \hy-8{185}{style = wxTAB_STYLE_DRAW_BOX |  wxTAB_STYLE_COLOUR_INTERIOR})}

Constructor.

\hy-7{186}{style} may be a bit list of the following:


wxTAB_STYLE_DRAW_BOX
    Draw a box around the view area. Most commonly used for dialogs.

wxTAB_STYLE_COLOUR_INTERIOR
    Draw tab backgrounds in the specified colour. Omitting this style
will ensure that the tab background matches the dialog background.




\hy-10{188}{wxTabView::AddTab}



\hy-8{189}{wxTabControl * AddTab(int \hy-8{190}{ id}, const wxString&  \hy-8{191}{label}, wxTabControl * \hy-8{192}{existingTab=NULL})}

Adds a tab to the view.

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

\hy-7{194}{label} is the label to give the tab.

\hy-7{195}{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.


\hy-10{197}{wxTabView::CalculateTabWidth}



\hy-8{198}{int CalculateTabWidth(int \hy-8{199}{ noTabs}, Bool \hy-8{200}{ 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.

\hy-7{201}{noTabs} is the number of tabs which should take up the full width
of the view area.

\hy-7{202}{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.


\hy-10{204}{wxTabView::ClearTabs}



\hy-8{205}{void ClearTabs(Bool  \hy-8{206}{deleteTabs=TRUE})}

Clears the tabs, deleting them if \hy-7{207}{deleteTabs} is TRUE.


\hy-10{209}{wxTabView::Draw}



\hy-8{210}{void Draw(void)}

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


\hy-10{212}{wxTabView::FindTabControlForId}



\hy-8{213}{wxTabControl * FindTabControlForId(int \hy-8{214}{ id})}

Finds the wxTabControl corresponding to \hy-7{215}{id}.


\hy-10{217}{wxTabView::FindTabControlForPosition}



\hy-8{218}{wxTabControl * FindTabControlForPosition(int \hy-8{219}{ layer}, int \hy-8{220}{ position})}

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


\hy-10{224}{wxTabView::GetBackgroundBrush}



\hy-8{225}{wxBrush * GetBackgroundBrush(void)}

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


\hy-10{227}{wxTabView::GetBackgroundColour}



\hy-8{228}{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. 


\hy-10{230}{wxTabView::GetBackgroundPen}



\hy-8{231}{wxPen * GetBackgroundPen(void)}

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


\hy-10{233}{wxTabView::GetDC}



\hy-8{234}{wxDC * GetDC(void)}

Returns the current device context for the view.


\hy-10{236}{wxTabView::GetHighlightColour}



\hy-8{237}{wxColour GetHighlightColour(void)}

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


\hy-10{239}{wxTabView::GetHighlightPen}



\hy-8{240}{wxPen * GetHighlightPen(void)}

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


\hy-10{242}{wxTabView::GetHorizontalTabOffset}



\hy-8{243}{int GetHorizontalTabOffset(void)}

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


\hy-10{245}{wxTabView::GetNumberOfLayers}



\hy-8{246}{int GetNumberOfLayers(void)}

Returns the number of layers (rows of tabs).


\hy-10{248}{wxTabView::GetSelectedTabFont}



\hy-8{249}{wxFont * GetSelectedTabFont(void)}

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


\hy-10{251}{wxTabView::GetShadowColour}



\hy-8{252}{wxColour GetShadowColour(void)}

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


\hy-10{254}{wxTabView::GetTabHeight}



\hy-8{255}{int GetTabHeight(void)}

Returns the tab default height.


\hy-10{257}{wxTabView::GetTabFont}



\hy-8{258}{wxFont * GetTabFont(void)}

Returns the tab label font.


\hy-10{260}{wxTabView::GetTabSelectionHeight}



\hy-8{261}{int GetTabSelectionHeight(void)}

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


\hy-10{263}{wxTabView::GetTabStyle}



\hy-8{264}{long GetTabStyle(void)}

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


\hy-10{266}{wxTabView::GetTabWidth}



\hy-8{267}{int GetTabWidth(void)}

Returns the tab default width.


\hy-10{269}{wxTabView::GetTextColour}



\hy-8{270}{wxColour GetTextColour(void)}

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


\hy-10{272}{wxTabView::GetTopMargin}



\hy-8{273}{int GetTopMargin(void)}

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


\hy-10{275}{wxTabView::GetShadowPen}



\hy-8{276}{wxPen * GetShadowPen(void)}

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


\hy-10{278}{wxTabView::GetViewRect}



\hy-8{279}{wxRectangle GetViewRect(void)}

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


\hy-10{281}{wxTabView::GetVerticalTabTextSpacing}



\hy-8{282}{int GetVerticalTabTextSpacing(void)}

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


\hy-10{284}{wxTabView::OnCreateTabControl}



\hy-8{285}{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.


\hy-10{287}{wxTabView::Layout}



\hy-8{288}{void Layout(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).


\hy-10{290}{wxTabView::OnEvent}



\hy-8{291}{Bool OnEvent(wxMouseEvent&  \hy-8{292}{event})}

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


\hy-10{294}{wxTabView::OnTabActivate}



\hy-8{295}{void OnTabActivate(int \hy-8{296}{ activateId}, int \hy-8{297}{ deactivateId})}

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


\hy-10{299}{wxTabView::OnTabPreActivate}



\hy-8{300}{Bool OnTabPreActivate(int \hy-8{301}{ activateId}, int \hy-8{302}{ 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.


\hy-10{304}{wxTabView::SetBackgroundColour}



\hy-8{305}{void SetBackgroundColour(const wxColour& \hy-8{306}{ 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. 


\hy-10{308}{wxTabView::SetDC}



\hy-8{309}{void SetDC(wxDC * \hy-8{310}{dc})}

Set the device context that the tab view will use for drawing onto. You must specify this before drawing
takes place (automatically set by wxTabbedDialogBox and wxTabbedPanel).


\hy-10{312}{wxTabView::SetHighlightColour}



\hy-8{313}{void SetHighlightColour(const wxColour& \hy-8{314}{ col})}

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


\hy-10{316}{wxTabView::SetHorizontalTabOffset}



\hy-8{317}{void SetHorizontalTabOffset(int \hy-8{318}{ offset})}

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


\hy-10{320}{wxTabView::SetSelectedTabFont}



\hy-8{321}{void SetSelectedTabFont(wxFont * \hy-8{322}{font})}

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


\hy-10{324}{wxTabView::SetShadowColour}



\hy-8{325}{void SetShadowColour(const wxColour& \hy-8{326}{ col})}

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


\hy-10{328}{wxTabView::SetTabFont}



\hy-8{329}{void SetTabFont(wxFont * \hy-8{330}{font})}

Sets the tab label font.


\hy-10{332}{wxTabView::SetTabStyle}



\hy-8{333}{void SetTabStyle(long \hy-8{334}{ tabStyle})}

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


\hy-10{336}{wxTabView::SetTabSize}



\hy-8{337}{void SetTabSize(int \hy-8{338}{ width}, int \hy-8{339}{ height})}

Sets the tab default width and height.


\hy-10{341}{wxTabView::SetTabSelectionHeight}



\hy-8{342}{void SetTabSelectionHeight(int \hy-8{343}{ height})}

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


\hy-10{345}{wxTabView::SetTabSelection}



\hy-8{346}{void SetTabSelection(int \hy-8{347}{ sel}, Bool \hy-8{348}{ activateTool=TRUE})}

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

If \hy-7{349}{activateTool} is FALSE, OnTabActivate will not be called.


\hy-10{351}{wxTabView::SetTextColour}



\hy-8{352}{void SetTextColour(const wxColour& \hy-8{353}{ col})}

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


\hy-10{355}{wxTabView::SetTopMargin}



\hy-8{356}{void SetTopMargin(int \hy-8{357}{ margin})}

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


\hy-10{359}{wxTabView::SetVerticalTabTextSpacing}



\hy-8{360}{void SetVerticalTabTextSpacing(int \hy-8{361}{ spacing})}

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


\hy-10{363}{wxTabView::SetViewRect}



\hy-8{364}{void SetViewRect(const wxRectangle&  \hy-8{365}{rect})}

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







\hy-10{408}{Example}



The following fragment is taken from the file test.cpp.

\hy-12{409}{
\hy-14{410}{void MyFrame::TestTabbedDialog(void)
{
  int dialogWidth = 365;
  int dialogHeight = 400;
  
  wxTabbedDialogBox *dialog =
    new wxTabbedDialogBox(this, "Tabbed Dialog Box", TRUE, -1, -1, 365, 400);
  
  wxButton *okButton = new wxButton(dialog, (wxFunction)GenericOk, "Close",
    230, 100, 80, 25);
  wxButton *cancelButton = new wxButton(dialog, NULL, "Help", 230, 130, 80, 25);

  // Note, omit the wxTAB_STYLE_COLOUR_INTERIOR, so we will guarantee a match
  // with the panel background, and save a bit of time.
  wxPanelTabView *view = new wxPanelTabView(dialog, wxTAB_STYLE_DRAW_BOX);
  
  wxRectangle rect;
  rect.x = 5;
  rect.y = 70;
  // Could calculate the view width from the tab width and spacing,
  // as below, but let's assume we have a fixed view width.
//  rect.width = view->GetTabWidth()*4 + 3*view->GetHorizontalTabSpacing();
  rect.width = 326;
  rect.height = 300;
  
  view->SetViewRect(rect);

  // Calculate the tab width for 4 tabs, based on a view width of 326 and
  // the current horizontal spacing. Adjust the view width to exactly fit
  // the tabs.
  view->CalculateTabWidth(4, TRUE);

  if (!view->AddTab(TEST_TAB_CAT,        wxString("Cat")))
    return;
    
  if (!view->AddTab(TEST_TAB_DOG,        wxString("Dog")))
    return;
  if (!view->AddTab(TEST_TAB_GUINEAPIG,  wxString("Guinea Pig")))
    return;
  if (!view->AddTab(TEST_TAB_GOAT,       wxString("Goat")))
    return;
  if (!view->AddTab(TEST_TAB_ANTEATER,   wxString("Ant-eater")))
    return;
  if (!view->AddTab(TEST_TAB_SHEEP,      wxString("Sheep")))
    return;
  if (!view->AddTab(TEST_TAB_COW,        wxString("Cow")))
    return;
  if (!view->AddTab(TEST_TAB_HORSE,      wxString("Horse")))
    return;
  if (!view->AddTab(TEST_TAB_PIG,        wxString("Pig")))
    return;
  if (!view->AddTab(TEST_TAB_OSTRICH,    wxString("Ostrich")))
    return;
  if (!view->AddTab(TEST_TAB_AARDVARK,   wxString("Aardvark")))
    return;
  if (!view->AddTab(TEST_TAB_HUMMINGBIRD,wxString("Hummingbird")))
    return;
    
  // Add some panels
  wxPanel *panel1 = new wxPanel(dialog, rect.x + 20, rect.y + 10, 200, 250);
  (void)new wxButton(panel1, NULL, "Press me");
  panel1->NewLine();
  (void)new wxText(panel1, NULL, "Input:", "1234", -1, -1, 120);
  
  view->AddTabWindow(TEST_TAB_CAT, panel1);

  wxPanel *panel2 = new wxPanel(dialog, rect.x + 20, rect.y + 10, 200, 250);
  panel2->SetLabelPosition(wxVERTICAL);
  
  char *animals[] = { "Fox", "Hare", "Rabbit", "Sabre-toothed tiger", "T Rex" };
  (void)new wxListBox(panel2, NULL, "List of animals", wxSINGLE,
    5, 5, 170, 80, 5, animals);

  (void)new wxMultiText(panel2, NULL, "Notes",
    "Some notes about the animals in this house", 5, 100, 170, 100);
  
  view->AddTabWindow(TEST_TAB_DOG, panel2);
  
  // Don't know why this is necessary under Motif...
#ifdef wx_motif
  dialog->SetSize(dialogWidth, dialogHeight-20);
#endif

  view->SetTabSelection(TEST_TAB_CAT);
  
  dialog->Show(TRUE);  
}
}
}


\hyindex{
"Tab Classes Manual"
4 5
6 7
8 9
10 11
16 17
19 20
22 23
29 30
32 33
37 38
42 43
45 46
49 50
53 54
56 57
68 69
71 72
75 76
78 79
81 82
91 92
95 96
98 99
101 102
105 106
108 109
111 112
114 115
117 118
120 121
123 124
126 127
129 130
132 133
135 136
140 141
145 146
149 150
153 154
157 158
161 162
166 167
170 171
174 175
179 180
182 183
187 188
196 197
203 204
208 209
211 212
216 217
223 224
226 227
229 230
232 233
235 236
238 239
241 242
244 245
247 248
250 251
253 254
256 257
259 260
262 263
265 266
268 269
271 272
274 275
277 278
280 281
283 284
286 287
289 290
293 294
298 299
303 304
307 308
311 312
315 316
319 320
323 324
327 328
331 332
335 336
340 341
344 345
350 351
354 355
358 359
362 363
366 367
368 369
376 377
382 383
384 385
407 408
411 412
415 416
18 385
21 412
55 385
80 385
100 385
181 412
396 363
398 197
400 188
402 33
18 385
21 412
55 385
80 385
100 385
181 412
396 363
398 197
400 188
402 33
}
