NovaTK::Section Class Reference

Inheritance diagram for NovaTK::Section:
Collaboration diagram for NovaTK::Section:

List of all members.


Detailed Description

A Section is simply a container widget. It was originally inteded to be used only in a table view to split parts of a table into sections. However it may now be used as a collapsable container for anything. A section always has a header which is used to collapse/expand the section. A section by default will be expanded to reveal its contents. When the user clicks on the header, it will collapse if expanded or expand if collapsed. When a section collapses it resizes to show only its header and the contents window, or body window as it is known to the widget, will be hidden and will send a window hide event if a callback is set for it. The section widget creates and manages the body window itself. The application MAY NOT perform any window management functions upon the body window which include: Creation, Destruction, Hiding, Showing, Moving or Resizing.

Note:
Calling GetHeight() will return the widget's current height whether it is collapsed or expanded. To obtain the section's expanded height while it is collapsed, one must add Section::GetHeaderHeight() and Section::GetBodyWindow()->GetHeight().

Public Member Functions

virtual NOVATKAPI NStatus Create (Window *parent, int c_x, int c_y, int c_width, int c_height)
virtual NOVATKAPI void Collapse ()
virtual NOVATKAPI void Destroy ()
virtual NOVATKAPI void Draw ()
virtual NOVATKAPI void Expand ()
virtual NOVATKAPI WindowGetBodyWindow () const
virtual NOVATKAPI FontGetFont () const
virtual NOVATKAPI ulong GetForegroundColor () const
virtual NOVATKAPI uint GetHeaderHeight () const
virtual NOVATKAPI bool IsCollapsed () const
virtual NOVATKAPI void SetCollapsed (bool state)
virtual NOVATKAPI void SetFont (Font *f)
virtual NOVATKAPI void SetForegroundColor (ulong fgColor)
virtual NOVATKAPI void SetHeaderBackgroundColor (ulong color)
virtual NOVATKAPI void SetName (const NString &s_name)
virtual NOVATKAPI void Resize (uint r_width, uint r_height)

Member Function Documentation

NStatus NovaTK::Section::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::Section::Collapse (  )  [virtual]

Collapses the secion - Resizes the section to hide its contents showing only the header.

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

Destroys the widget.

Reimplemented from NovaTK::Widget.

void NovaTK::Section::Draw (  )  [virtual]

Redraws the widget. This function is called by NovaTK and doesn't normally need to be called outside of the toolkit.

Reimplemented from NovaTK::Widget.

void NovaTK::Section::Expand (  )  [virtual]

Expands the section - Resizes the section vertically to reveal its contents.

virtual NOVATKAPI Window* NovaTK::Section::GetBodyWindow (  )  const [inline, virtual]

Returns:
A pointer to the body window which is content window for this Section.

Font * NovaTK::Section::GetFont (  )  const [virtual]

Note:
This function may be used before creating the widget. It is useful for dynamically determining the size of a widget. HOWEVER, it MAY NOT be used before initializing NovaTK.
Returns:
The primary font used by the widget.

Reimplemented from NovaTK::Widget.

ulong NovaTK::Section::GetForegroundColor (  )  const [virtual]

Returns:
The color set as the widget's font foreground color if it draws text.

Reimplemented from NovaTK::Widget.

uint NovaTK::Section::GetHeaderHeight (  )  const [virtual]

Retrieves the height of the section's header. The entire height of the Section when expanded is the height of the header plus the height of the body window. When collapsed it is the only the height of header. GetHeight() will return the height of the entire Section in its current state. This does not include the border which by default is of the width of one pixel. This function may be called before the widget is created.

virtual NOVATKAPI bool NovaTK::Section::IsCollapsed (  )  const [inline, virtual]

Returns:
TRUE if this Section is collapsed or FALSE if it is expanded.

void NovaTK::Section::SetCollapsed ( bool  state  )  [virtual]

Causes the section to expand or collapse. If state is TRUE then the section will be collapsed. If state is FALSE then the section will be expanded.

See also:
Collapse

Expand

void NovaTK::Section::SetFont ( Font f  )  [virtual]

Sets the primary font used by the widget to that specified by f.

Reimplemented from NovaTK::Widget.

void NovaTK::Section::SetForegroundColor ( ulong  fgColor  )  [virtual]

Sets the primary foreground color for text used by the widget.

Reimplemented from NovaTK::Widget.

void NovaTK::Section::SetHeaderBackgroundColor ( ulong  color  )  [virtual]

Sets the background color of the section header. The color of the section name can be changed by SetForegroundColor.

void NovaTK::Section::SetName ( const NString s_name  )  [virtual]

Sets the name shown in the header.

void NovaTK::Section::Resize ( uint  r_width,
uint  r_height 
) [virtual]

Changes the horiztonal size of the widget to r_w and the vertical size of the widget to r_h .

Reimplemented from NovaTK::Widget.


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

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