NovaTK::Toolbar Class Reference

Inheritance diagram for NovaTK::Toolbar:
Collaboration diagram for NovaTK::Toolbar:

List of all members.


Detailed Description

A toolbar presents a horizontal series of widgets, traditionally buttons, whose layout is automatically managed. Buttons are the most common type of widget displayed on toolbars however other widgets can be used as well.

Public Member Functions

virtual NOVATKAPI NStatus Create (Window *parent, int c_x, int c_y, int c_width, int c_height)
virtual NOVATKAPI void Destroy ()
virtual NOVATKAPI NStatus DeleteWidget (Widget *w)
virtual NOVATKAPI WidgetInsertWidget (Widget *w)

Member Function Documentation

NStatus NovaTK::Toolbar::Create ( Window parent,
int  c_x,
int  c_y,
int  c_width,
int  c_height 
) [virtual]

This function is used by all widgets for initialization and to specify essential parameters. Each widget will reimplement this function but a few will have different parameters as needed(Such as Label). Most other member functions of all widgets cannot be called before calling this one except generally functions that specify attributes that must be known before creation of the widget.

Parameters:
parent Specifies the parent window.
c_x Specifies the location of the window's top-left corner along the X-axis relative to its parent.
c_y Specifies the location of the window's top-left corner along the Y-axis relative to its parent.
c_width Specifies the width of the window.
c_height Specifies the height of the window.
Returns:
NOVATK_SUCCESS upon successful creation of the widget otherwise returns NOVATK_ERROR_GENERAL_FAILURE.
Note:
By default, the widget has no border. When a widget is given a border, the top-left corner of the border itself will be the window's X and Y position minus its border width. The actual width of the widget with its border will be its width plus the border width and the same for height.

Reimplemented from NovaTK::Widget.

void NovaTK::Toolbar::Destroy (  )  [virtual]

Destroys the widget.

Reimplemented from NovaTK::Widget.

NStatus NovaTK::Toolbar::DeleteWidget ( Widget w  )  [virtual]

Removes the widget from the toolbar. You are still responsible for freeing memory allocated for this widget. You do not need to call Destroy on that widget as it will be called by the toolbar.

Returns:
NOVATK_SUCCESS upon success or NOVATK_ERROR_DOES_NOT_EXIST if the widget is unknown to the toolbar.

Widget * NovaTK::Toolbar::InsertWidget ( Widget w  )  [virtual]

Inserts the widget to the right of the last widget inserted. Prior to insertion your application should only allocate memory for this widget and call ONLY functions that may be called before creation as the toolbar will create and manage this widget. Widgets dimensions will be a square the size of the toolbar's height. Naturally this is not ideal for all widgets thus after insertion you may adjust the dimensions using the Resize member function of the widget but you should be ensure that the widgets dimensions are not too large for the toolbar. Never call the widget's Move member function if it is inserted into the toolbar as its position is managed by the toolbar.

Returns:
The pointer that was passed to it.
Note:
The few widgets that do not employ the common prototype for Create that is provided by the Widget base class(Menu, Scrollbar, etc...) CANNOT be inserted into a toolbar.


The documentation for this class was generated from the following files:

Generated on Sat Sep 13 22:34:25 2008 for NovaTK by  doxygen 1.5.5