Vaca::TabBase Class Reference

#include <Tab.h>

Inheritance diagram for Vaca::TabBase:

Vaca::Widget Vaca::Component Vaca::Referenceable Vaca::NonCopyable Vaca::Tab

List of all members.


Detailed Description

Widget that contains tabs to switch between them.

This class doesn't controls pages automatically, it's useful when you want a special behaviour for the tabs (see Tabs example). If you want to put one Panel in the each page, and swap them when the user change the pages, you should use the Tab widget.

See also:
Tab

Public Member Functions

 TabBase (Widget *parent, Style style=TabBaseStyle)
 Creates a new tab control.
virtual ~TabBase ()
virtual Font getFont () const
 Returns the current font used to paint the Widget.
virtual void setFont (Font font)
 Sets the font of the widget.
virtual Rect getLayoutBounds ()
 Returns the area where the pages should be positioned.
Side getSide ()
void setSide (Side side)
 Sets the side of the pages.
bool isMultiline ()
void setMultiline (bool state)
int addPage (const String &text)
int insertPage (int pageIndex, const String &text)
void removePage (int pageIndex)
int getPageCount ()
int getRowCount ()
int getActivePage ()
void setActivePage (int pageIndex)
String getPageText (int pageIndex)
void setPageText (int pageIndex, const String &text)
Size getNonClientSize ()

Public Attributes

Signal1< void, Event & > PageChange

Protected Member Functions

virtual void onPreferredSize (Size &sz)
 Adds space for the non-client size.
virtual bool onReflectedNotify (LPNMHDR lpnmhdr, LRESULT &lResult)
 This method can be used to handle notifications (WM_NOTIFY(W32)) reflected from the parent.
virtual void onPageChange (Event &ev)
 TCN_SELCHANGING.

Private Member Functions

void updateFont ()

Private Attributes

Font m_userFont
Font m_tabFont

Constructor & Destructor Documentation

TabBase::TabBase ( Widget parent,
Style  style = TabBaseStyle 
)

Creates a new tab control.

A tab is a set of pages, each page has a group of widgets, so you can navigate through the pages.

TabBase::~TabBase (  )  [virtual]


Member Function Documentation

Font TabBase::getFont (  )  const [virtual]

Returns the current font used to paint the Widget.

Reimplemented from Vaca::Widget.

void TabBase::setFont ( Font  font  )  [virtual]

Sets the font of the widget.

Reimplemented from Vaca::Widget.

Rect TabBase::getLayoutBounds (  )  [virtual]

Returns the area where the pages should be positioned.

It's like Win32 TabCtrl_AdjustRect.

Reimplemented from Vaca::Widget.

Side TabBase::getSide (  ) 

void TabBase::setSide ( Side  side  ) 

Sets the side of the pages.

Warning:
You can't use LeftSide and RightSide sides in a Tab with isMultiline() == false. This routine will set the Tab in a multiline style automatically if you try this.
See also:
setMultiline

bool TabBase::isMultiline (  ) 

void TabBase::setMultiline ( bool  state  ) 

int TabBase::addPage ( const String text  ) 

int TabBase::insertPage ( int  pageIndex,
const String text 
)

void TabBase::removePage ( int  pageIndex  ) 

int TabBase::getPageCount (  ) 

int TabBase::getRowCount (  ) 

int TabBase::getActivePage (  ) 

void TabBase::setActivePage ( int  pageIndex  ) 

String TabBase::getPageText ( int  pageIndex  ) 

void TabBase::setPageText ( int  pageIndex,
const String text 
)

Size TabBase::getNonClientSize (  ) 

Warning:
This function couldn't work for Tab with getSide() != TopSide.

void TabBase::onPreferredSize ( Size sz  )  [protected, virtual]

Adds space for the non-client size.

See also:
getNonClientSize

Reimplemented from Vaca::Widget.

bool TabBase::onReflectedNotify ( LPNMHDR  lpnmhdr,
LRESULT &  lResult 
) [protected, virtual]

This method can be used to handle notifications (WM_NOTIFY(W32)) reflected from the parent.

Parameters:
lpnmhdr Information about the notification message.
lResult Result to return by the wndProc method.
Returns:
False if it doesn't use the notification.

Reimplemented from Vaca::Widget.

void TabBase::onPageChange ( Event ev  )  [protected, virtual]

TCN_SELCHANGING.

Event generated when the user select a new page. Use getActivePage() to known which page was selected.

TCN_SELCHANGE

Reimplemented in Vaca::Tab.

void TabBase::updateFont (  )  [private]


Member Data Documentation

See also:
onPageChange