Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

os::TabView Class Reference

#include <tabview.h>

Inheritance diagram for os::TabView:

os::View os::Invoker os::Handler List of all members.

Public Methods

 TabView (const Rect &cFrame, const char *pzTitle, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_FULL_UPDATE_ON_RESIZE)
 Contruct the TabView. More...

int AppendTab (const char *pzTitle, View *pcView=NULL)
 Add a tab at the end of the list. More...

int InsertTab (uint nIndex, const char *pzTitle, View *pcView=NULL)
 Insert tabs at a given position. More...

ViewDeleteTab (uint nIndex)
 Delete a given tab. More...

ViewGetTabView (uint nIndex) const
 Get the View associated with a given tab. More...

const std::string& GetTabTitle (uint nIndex) const
 Get the title of a given tab. More...

uint GetSelection ()
 Get the current selection. More...

void SetSelection (uint nIndex, bool bNotify=true)
 Select a tab, and optionally notify the target. More...

virtual void FrameSized (const Point &cDelta)
virtual void MouseMove (const Point &cNewPos, int nCode, uint32 nButtons, Message *pcData)
virtual void MouseDown (const Point &cPosition, uint32 nButtons)
virtual void MouseUp (const Point &cPosition, uint32 nButtons, Message *pcData)
virtual void KeyDown (const char *pzString, const char *pzRawString, uint32 nQualifiers)
virtual Point GetPreferredSize (bool bLargest) const
virtual void Paint (const Rect &cUpdateRect)
 Called by the system update "damaged" areas of the view. More...

virtual void AllAttached ()

Detailed Description

Description:
See also:
Author(s):
Kurt Skauen (kurt@atheos.cx)


Constructor & Destructor Documentation

TabView::TabView ( const Rect & cFrame,
const char * pzTitle,
uint32 nResizeMask = CF_FOLLOW_LEFT | CF_FOLLOW_TOP,
uint32 nFlags = WID_WILL_DRAW | WID_FULL_UPDATE_ON_RESIZE )
 

Contruct the TabView.

Description:
Not much happens here. All paramaters are sendt ot the View() constructor
Note:
Warning:
Parameters:
return  
See also:
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)


Member Function Documentation

void TabView::AllAttached ( void ) [virtual]
 

Description:
TabView overloades AllAttached to set the window as it's message target.
See also:
Invoker::SetTarget(), Invoker::SetMessage(), View::AllAttached()
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)

Reimplemented from os::View.

int TabView::AppendTab ( const char * pzTitle,
View * pcView = NULL )
 

Add a tab at the end of the list.

Description:
Add a new tab to the TabView. The new tab will be appended to the list and will appear rightmost. Each tab is associated with title that is printed inside it, and a View that will be made visible when the tab is selected or hidden when the tab is inactive. If you want to use the TabView to something else than flipping between views, you can pass a NULL pointer, or you can pass the same ViewPointer for all tabs. Then you can associate a message with the TabView that will be sendt to it's target everytime the selection change.
Note:
Views associated with tabs should *NOT* be attached to any other view when or after the tab is created. It will automatically be a child of the TabView when added to a tab.

Views associated with tabs *MUST* have the CF_FOLLOW_ALL flag set to be properly resized when the TabView is resized.

When a view is associated with a tab, the view will be resized to fit the interiour of the TabView.

Parameters:
pcTitle   - The string that should appear inside the tab.
pcView   - The View to be accosiated with the tab, or NULL.

Returns:
The zero based index of the new tab.
See also:
InsertTab(), DeleteTab(), Invoker::SetMessage(), Invoker::SetTarget()
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)

View * TabView::DeleteTab ( uint nIndex )
 

Delete a given tab.

Description:
The tab at position nIndex is deleted, and the associated view is removed from the child list unless it is still associated with any of the remaining tabs. The view associated with the deleted tab is returned, and must be deleted by the caller if it is no longer needed.
Parameters:
nIndex   - The zero based index of the tab to delete.
Returns:
Pointer to the view associated with the deleted tab.
See also:
AppendTab(), InsertTab(), GetTabView(), GetTabTitle()
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)

void TabView::FrameSized ( const Point & cDelta ) [virtual]
 

Reimplemented from os::View.

Point TabView::GetPreferredSize ( bool bLargest ) const [virtual]
 

Description:
TabView overloads GetPreferredSize() and return the largest size returned by any of the views associated with the different tabs.
Returns:
The largest preffered size returned by it's childs.
See also:
View::GetPreferredSize()
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)

Reimplemented from os::View.

uint TabView::GetSelection ( )
 

Get the current selection.

Description:
Returns the zero based index of the selected tab.
Note:
This index is also added to the notification sendt when the selection change. The selection is then added under the name "selection".
Returns:
The zero based index of the selected tab.
See also:
SetSelection(), Invoker::SetMessage(), Invoker::SetTarget()
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)

const std::string & TabView::GetTabTitle ( uint nIndex ) const
 

Get the title of a given tab.

Parameters:
nIndex   - The zero based index of the tab.
Returns:
const reference to a STL string containing the title.
See also:
GetTabView(), AppendTab(), InsertTab()
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)

View * TabView::GetTabView ( uint nIndex ) const
 

Get the View associated with a given tab.

Parameters:
nIndex   - The zero based index of the tab.
Returns:
Pointer to the View associated with the tab.
See also:
GetTabTitle(), AppendTab(), InsertTab()
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)

int TabView::InsertTab ( uint nIndex,
const char * pzTitle,
View * pcView = NULL )
 

Insert tabs at a given position.

Description:
Same as AppendTab() except that InsertTab() accept a zero based index at which the tab will be inserted. Look at AppendTab() to get the full thruth.
Note:
If the rightmost tab is selected, the selection will be moved to the previous tab, and a notification message (if any) is sendt.
Warning:
The index *MUST* be between 0 and the current number of tabs!
Parameters:
nIndex   - The zero based position where the tab is inserted.
pcTitle   - The string that should appear inside the tab.
pcView   - The View to be accosiated with the tab, or NULL.

Returns:
The zero based index of the new tab (Same as nIndex).
See also:
AppendTab(), DeleteTab(), Invoker::SetMessage(), Invoker::SetTarget()
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)

void TabView::KeyDown ( const char * pzString,
const char * pzRawString,
uint32 nQualifiers ) [virtual]
 

Reimplemented from os::View.

void TabView::MouseDown ( const Point & cPosition,
uint32 nButtons ) [virtual]
 

Reimplemented from os::View.

void TabView::MouseMove ( const Point & cNewPos,
int nCode,
uint32 nButtons,
Message * pcData ) [virtual]
 

Reimplemented from os::View.

void TabView::MouseUp ( const Point & cPosition,
uint32 nButtons,
Message * pcData ) [virtual]
 

Reimplemented from os::View.

void TabView::Paint ( const Rect & cUpdateRect ) [virtual]
 

Called by the system update "damaged" areas of the view.

Description:
Note:
Warning:
Parameters:
cUpdateRect   A rectangle enclosing all damaged areas. This is just a rough "worst-case", further fine-grained clipping will be performed by the Application Server to avoid updating non-damaged pixels and make the update as fast and flicker-free as possible.

See also:
Invalidate(), Flush()
Author(s):
Kurt Skauen (kurt@atheos.cx)

Reimplemented from os::View.

void TabView::SetSelection ( uint nIndex,
bool bNotify = true )
 

Select a tab, and optionally notify the target.

Description:
Selects the given tab. If bNotify is true, and a messages has been assigned through Invoker::SetMessage() the message will be sendt to the target.
Parameters:
nIndex   - The zero based index of the tab to select.
bNotify   - Set to true if Invoker::Invoke() should be called.
See also:
GetSelection(), Invoker::Invoke(), Invoker::SetMessage(), Invoker::SetTarget()
Author(s):
Kurt Skauen (kurt.skauen@c2i.net)


The documentation for this class was generated from the following files:
Generated at Sat Apr 7 16:11:42 2001 for AtheOS higlevel API by doxygen1.2.5 written by Dimitri van Heesch, © 1997-2001