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...

int GetTabCount () const
 Get number of tabs currently added to the view. More...

int SetTabTitle (uint nIndex, const std::string &cTitle)
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 hook called by the system when the view is resized. More...

virtual void MouseMove (const Point &cNewPos, int nCode, uint32 nButtons, Message *pcData)
 Hook called by the system when the mouse is moved. More...

virtual void MouseDown (const Point &cPosition, uint32 nButtons)
 Hook called by the system when a mouse button is pressed. More...

virtual void MouseUp (const Point &cPosition, uint32 nButtons, Message *pcData)
 Hook called by the system when a mouse button is release. More...

virtual void KeyDown (const char *pzString, const char *pzRawString, uint32 nQualifiers)
 Hook called by the system when a key is pressed while the view has focus. More...

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:
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
 

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


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:
Kurt Skauen (kurt@atheos.cx)

Reimplemented from os::View.

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

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:
Kurt Skauen (kurt@atheos.cx)

View * TabView::DeleteTab uint nIndex
 

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:
Kurt Skauen (kurt@atheos.cx)

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

Description:
Overload this member if you need to know when the view is resized.
Note:
This member is called after the view is resized. If you need the old size you can subtract the cDelta calue from the current size.
Parameters:
cDelta   The distance the bottom/right corner was moved relative to the upper/left corner.
See also:
FrameMoved(), SetFrame, ResizeBy(), ResizeTo()
Author:
Kurt Skauen (kurt@atheos.cx)

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:
Kurt Skauen (kurt@atheos.cx)

Reimplemented from os::View.

uint TabView::GetSelection
 

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:
Kurt Skauen (kurt@atheos.cx)

int TabView::GetTabCount const
 

Returns:
Tab count
See also:
AppendTab(), InsertTab(), DeleteTab()
Author:
Kurt Skauen (kurt@atheos.cx)

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

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:
Kurt Skauen (kurt@atheos.cx)

View * TabView::GetTabView uint nIndex const
 

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

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

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:
Kurt Skauen (kurt@atheos.cx)

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

Description:
Overload this member if your view need to handle keyboard input. This member is called to allow the view to handle M_KEY_DOWN messages. The most common members are exctracted from the message and passed as parameters but you might need to obtain the raw message with os::Looper::GetCurrentMessage() and find some members yourself if you the data you needed are not passed in.

For example if you need the raw key-code for the pressed key you will have to lookup the "_raw_key" member from the message.

Parameters:
pzString   String containing a single UTF-8 encoded character. This is the character generated by the pressed key according to the current keymap accounting for any qualifiers that might be pressed.
pzRawString   Same as pzString except that the key is converted without accounting for qualifiers. Ie. if 'A' is pressed while pressing <SHIFT> pzString will contain 'A' and pzRawString will contain 'a'.
nQualifiers   Bitmask describing which qualifiers that was active when the key was pressed.

See also:
KeyUp(), os::Looper::GetCurrentMessage()
Author:
Kurt Skauen (kurt@atheos.cx)

Reimplemented from os::View.

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

Description:
This member is called from the window thread whenever a mouse button is clicked above the view. You can overload this member if your view need to know about mouse-down events.

A view will not automatically take focus when clicked so if you want that behaviour you must call MakeFocus() from an overloaded version of this member.

The default implementation of this member will call MouseDown() on it's parent view if one exists.

Parameters:
cPosition   Mouse position in the views coordinate system at the time the mouse was pressed.
nButtons   Index of the pressed button. Buttons start at 1 for the left button, 2 for the right button, 3 for the middle button. Additional buttons might be supported by the mouse driver and will then be assigned numbers from 4 and up.

See also:
MouseUp(), MouseMove(), WheelMoved()
Author:
Kurt Skauen (kurt@atheos.cx)

Reimplemented from os::View.

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

Description:
This member is called from the window thread whenever the mouse is moved above the view or if the view have focus.

Oveload this member if your view need to handle mouse-move events.

The default implementation of this member will call MouseMove() on it's parent view if one exists.

Parameters:
cNewPos   New mouse position given in the views coordinate system.
nCode   Enter/exit code. This is MOUSE_ENTERED when the mouse first enter the view, MOUSE_EXITED when the mouse leaves the view, MOUSE_INSIDE whenever the mouse move withing the boundary of the view and MOUSE_OUTSIDE when the mouse move outside the view (will only happen if the view have focus).
nButtons   Bitmask telling which buttons that are currently pressed. Bit 0 is button 1 (left), bit 1 is button 2 (right), and bit 2 is button 3 (middle), and so on.
pcData   Pointer to a Message object containing the dragged data if the user is in the middle of a drag and drop operation. Otherwise this pointer is NULL. Look at BeginDrag() for a more detailed description of the drag and drop system.

See also:
MouseDown(), MouseUp(), WheelMoved(), BeginDrag()
Author:
Kurt Skauen (kurt@atheos.cx)

Reimplemented from os::View.

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

Description:
This member is called from the window thread whenever a mouse button is released above the view. You can overload this member if your view need to know about mouse-up events or if your view support drag and drop.

If mouse-up was the result of ending a drag and drop operation the pcData member will point to a Message containing the dragged data. Look at BeginDrag() for a more detailed description of the drag and drop system.

The default implementation of this member will call MouseDown() on it's parent view if one exists.

Parameters:
cPosition   Mouse position in the views coordinate system at the time the mouse was pressed.
nButtons   Index of the pressed button. Buttons start at 1 for the left button, 2 for the right button, 3 for the middle button. Additional buttons might be supported by the mouse driver and will then be assigned numbers from 4 and up.
pcData   Pointer to a Message object containing the dragged data if this mouse-up was the end of a drag and drop operation. If no data was dragged it will be NULL.

See also:
MouseDown(), MouseMove(), WheelMoved()
Author:
Kurt Skauen (kurt@atheos.cx)

Reimplemented from os::View.

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

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:
Kurt Skauen (kurt@atheos.cx)

Reimplemented from os::View.

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

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:
Kurt Skauen (kurt@atheos.cx)

int TabView::SetTabTitle uint nIndex,
const std::string & cTitle
 


Generated at Tue Sep 11 15:27:55 2001 for AtheOS higlevel API by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001