os::TabView Class Reference
[The Syllable Graphical User Interface API]

Description:
More...

Inheritance diagram for os::TabView:

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

Public Member Functions

 TabView (const Rect &cFrame, const String &cTitle, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_FULL_UPDATE_ON_RESIZE)
 Contruct the TabView.
 ~TabView ()
int AppendTab (const String &cTitle, View *pcView=NULL)
 Add a tab at the end of the list.
int InsertTab (uint nIndex, const String &cTitle, View *pcView=NULL)
 Insert tabs at a given position.
int AppendTab (TabViewTab *pcTab, View *pcView=NULL)
int InsertTab (uint nIndex, TabViewTab *pcTab, View *pcView=NULL)
ViewDeleteTab (uint nIndex)
 Delete a given tab.
ViewGetTabView (uint nIndex) const
 Get the View associated with a given tab.
int GetTabCount () const
 Get number of tabs currently added to the view.
int SetTabTitle (uint nIndex, const String &cTitle)
const StringGetTabTitle (uint nIndex) const
 Get the title of a given tab.
uint GetSelection () const
 Get the current selection.
void SetSelection (uint nIndex, bool bNotify=true)
 Select a tab, and optionally notify the target.
virtual void FrameSized (const Point &cDelta)
 Virtual hook called by the system when the view is resized.
virtual void MouseMove (const Point &cNewPos, int nCode, uint32 nButtons, Message *pcData)
 Hook called by the system when the mouse is moved.
virtual void MouseDown (const Point &cPosition, uint32 nButtons)
 Hook called by the system when a mouse button is pressed.
virtual void MouseUp (const Point &cPosition, uint32 nButtons, Message *pcData)
 Hook called by the system when a mouse button is release.
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.
virtual Point GetPreferredSize (bool bLargest) const
 
Description:
TabView overloads GetPreferredSize() and return the largest size returned by any of the views associated with the different tabs.

virtual void Paint (const Rect &cUpdateRect)
 Called by the system update "damaged" areas of the view.
virtual void AllAttached ()
 
Description:
TabView overloades AllAttached to set the window as it's message target.


Friends

class TabView::TopView

Classes

class  Private
class  TopView

Detailed Description

See also:
Author:
Kurt Skauen ([email protected])


Constructor & Destructor Documentation

TabView::TabView ( const Rect cFrame,
const String cName,
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 ([email protected])

TabView::~TabView (  ) 


Member Function Documentation

int TabView::AppendTab ( const String cTitle,
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 ([email protected])

int TabView::InsertTab ( uint  nIndex,
const String cTitle,
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 ([email protected])

int TabView::AppendTab ( TabViewTab pcTab,
View pcView = NULL 
)

int TabView::InsertTab ( uint  nIndex,
TabViewTab pcTab,
View pcView = NULL 
)

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 ([email protected])

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 ([email protected])

int TabView::GetTabCount (  )  const

Returns:
Tab count
See also:
AppendTab(), InsertTab(), DeleteTab()
Author:
Kurt Skauen ([email protected])

int TabView::SetTabTitle ( uint  nIndex,
const String cTitle 
)

const 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 ([email protected])

uint TabView::GetSelection (  )  const

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 ([email protected])

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 ([email protected])

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 ([email protected])

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 has 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 has 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 ([email protected])

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 ([email protected])

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 ([email protected])

Reimplemented from os::View.

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 ([email protected])

Reimplemented from os::View.

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

Returns:
The largest preffered size returned by it's childs.
See also:
View::GetPreferredSize()
Author:
Kurt Skauen ([email protected])

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 ([email protected])

Reimplemented from os::View.

void TabView::AllAttached ( void   )  [virtual]

See also:
Invoker::SetTarget(), Invoker::SetMessage(), View::AllAttached()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.


Friends And Related Function Documentation

friend class TabView::TopView [friend]


Generated on Sat May 9 22:51:47 2009 for Syllable higlevel API by  doxygen 1.5.1