torque Torque Game Engine Documentation
TGE Version 1.5.2

GuiTabBookCtrl Class Reference

#include <guiTabBookCtrl.h>

Inheritance diagram for GuiTabBookCtrl:

Inheritance graph
[legend]

Detailed Description

Tab Book Control for creation of tabbed dialogs.

See also:
GUI for an overview of the Torque GUI system.

Introduction

GuiTabBookCtrl is a container class that holds children of type GuiTabPageCtrl

GuiTabBookCtrl creates an easy to work with system for creating tabbed dialogs allowing for creation of dialogs that store alot of information in a small area by seperating the information into pages which are changeable by clicking their page title on top or bottom of the control

tabs may be aligned to be on top or bottom of the book and are changeable while the GUI editor is open for quick switching between pages allowing multipage dialogs to be edited quickly and easily.

The control may only contain children of type GuiTabPageCtrl. If a control is added to the Book that is not of type GuiTabPageCtrl, it will be removed and relocated to the currently active page of the control. If there is no active page in the book, the child control will be relocated to the parent of the book.

The Graphical User Interface (GUI) has an overview of the GUI system.


Control Events

bool onAdd ()
 Called when this object is added to the scene.
void onRemove ()
 Called when this object is removed.
bool onWake ()
 Called when this object is asked to wake up returns true if it's actually awake at the end.
void onSleep ()
 Called when this object is asked to sleep.
void onPreRender ()
 Do special pre-render proecessing.
void onRender (Point2I offset, const RectI &updateRect)
 Called when this control is to render itself.

Child events

void onChildRemoved (GuiControl *child)
 Called when one of this objects children is removed.
void onChildAdded (GuiControl *child)
 Called when this object has a new child.

Rendering methods

void renderTabs (const Point2I &offset)
 Tab rendering routine, iterates through all tabs rendering one at a time.
void renderTab (RectI tabRect, GuiTabPageCtrl *tab)
 Tab rendering subroutine, renders one tab with specified options.
void renderBackground (Point2I offset, const RectI &updateRect)
 Page Rendering Routine.
void renderJustifiedTextRot (Point2I offset, Point2I extent, const char *text, F32 rot)

Page Management

void addNewPage ()
 Create a new tab page child in the book.
void selectPage (S32 index)
 Select a tab page based on an index.
void selectPage (GuiTabPageCtrl *page)
 Select a tab page by a pointer to that page.
void selectNextPage ()
 Select the Next page in the tab book.
void selectPrevPage ()
 Select the Previous page in the tab book.

Internal Utility Functions

void setUpdate ()
 Update ourselves by hooking common GuiControl functionality.
void balanceRow (S32 row, S32 totalTabWidth)
 Balance a top/bottom tab row.
void balanceColumn (S32 row, S32 totalTabWidth)
 Balance a left/right tab column.
void solveDirty ()
 Checks to see if a tab option has changed and we need to resize children, resizes if necessary.
S32 calculatePageTabWidth (GuiTabPageCtrl *page)
 Calculate the tab width of a page, given it's caption.
void calculatePageTabs ()
 Calculate Page Header Information.
GuiTabPageCtrlfindHitTab (const GuiEvent &event)
 Find the tab that was hit by the current event, if any.
GuiTabPageCtrlfindHitTab (Point2I hitPoint)
 Find the tab that was hit, based on a point.

Sizing

void resize (const Point2I &newPosition, const Point2I &newExtent)
 Rezize our control This method is overridden so that we may handle resizing of our child tab pages when we are resized.
void childResized (GuiControl *child)
 Called when a child page is resized This method is overridden so that we may handle resizing of our child tab pages when one of them is resized.

Mouse Events

void onMouseDown (const GuiEvent &event)
void onMouseMove (const GuiEvent &event)
void onMouseLeave (const GuiEvent &event)
virtual bool onMouseDownEditor (const GuiEvent &event, Point2I offset)
 Called when a mouseDown event occurs on a control and the GUI editor is active.

Public Types

enum  TabPosition {
  AlignTop,
  AlignBottom,
  AlignLeft,
  AlignRight
}

Public Member Functions

 GuiTabBookCtrl ()
 DECLARE_CONOBJECT (GuiTabBookCtrl)
virtual bool onKeyDown (const GuiEvent &event)
 Happens when a key is depressed.

Static Public Member Functions

static void initPersistFields ()
 Register dynamic fields in a subclass of ConsoleObject.

Private Types

enum  {
  TabSelected = 0,
  TabNormal,
  TabHover,
  TabSelectedVertical,
  TabNormalVertical,
  TabHoverVertical,
  TabBackground = 19,
  NumBitmaps
}
typedef GuiControl Parent
 typedef for parent class access

Private Attributes

RectI mPageRect
 Rectangle of the tab page portion of the control.
RectI mTabRect
 Rectangle of the tab portion of the control.
Vector< TabHeaderInfomPages
 Vector of pages contained by the control.
GuiTabPageCtrlmActivePage
 Pointer to the active (selected) tab page child control.
GuiTabPageCtrlmHoverTab
 Pointer to the tab page that currently has the mouse positioned ontop of its tab.
S32 mMinTabWidth
 Minimum Width a tab will display as.
TabPosition mTabPosition
 Current tab position (see alignment).
TabPosition mLastTabPosition
 Last known tab position, stored to compare to tabPosition to know when to resize children.
S32 mTabHeight
 Current tab height.
S32 mLastTabHeight
 Last known tab height, stored to compare to current tabHeight to know when to resize children.
S32 mTabWidth
 Current tab width.
S32 mLastTabWidth
 Last know tab width, stored to compare to current tabWidth to know when to resize children.
S32 mTabMargin
 Margin left/right of tab text in tab.
bool mHasTexture
 Indicates whether we have a texture to render the tabs with.
RectImBitmapBounds
 Array of rectangles identifying textures for tab book.

Data Structures

struct  TabHeaderInfo


Member Typedef Documentation

typedef for parent class access

Reimplemented from GuiControl.


Member Enumeration Documentation

Enumerator:
AlignTop  Align the tabs on the top of the tab book control.
AlignBottom  Align the tabs on the bottom of the tab book control.
AlignLeft  Align the tabs on the left of the tab book control.
AlignRight  Align the tabs on the right of the tab book control.

anonymous enum [private]

Enumerator:
TabSelected  Index of selected tab texture.
TabNormal  Index of normal tab texture.
TabHover  Index of hover tab texture.
TabSelectedVertical  Index of selected tab texture.
TabNormalVertical  Index of normal tab texture.
TabHoverVertical  Index of hover tab texture.
TabBackground  Index of background texture (tiled).
NumBitmaps  Number of bitmaps in this array.


Constructor & Destructor Documentation

GuiTabBookCtrl::GuiTabBookCtrl (  ) 


Member Function Documentation

GuiTabBookCtrl::DECLARE_CONOBJECT ( GuiTabBookCtrl   ) 

static void GuiTabBookCtrl::initPersistFields (  )  [static]

Register dynamic fields in a subclass of ConsoleObject.

See also:
addField(), addFieldV(), addDepricatedField(), addGroup(), endGroup()

Reimplemented from GuiControl.

bool GuiTabBookCtrl::onAdd (  )  [virtual]

Called when this object is added to the scene.

Reimplemented from GuiControl.

void GuiTabBookCtrl::onRemove (  )  [virtual]

Called when this object is removed.

Reimplemented from GuiControl.

bool GuiTabBookCtrl::onWake (  )  [virtual]

Called when this object is asked to wake up returns true if it's actually awake at the end.

Reimplemented from GuiControl.

void GuiTabBookCtrl::onSleep (  )  [virtual]

Called when this object is asked to sleep.

Reimplemented from GuiControl.

void GuiTabBookCtrl::onPreRender (  )  [virtual]

Do special pre-render proecessing.

Reimplemented from GuiControl.

void GuiTabBookCtrl::onRender ( Point2I  offset,
const RectI updateRect 
) [virtual]

Called when this control is to render itself.

Parameters:
offset The location this control is to begin rendering
updateRect The screen area this control has drawing access to

Reimplemented from GuiControl.

void GuiTabBookCtrl::onChildRemoved ( GuiControl child  )  [virtual]

Called when one of this objects children is removed.

Reimplemented from GuiControl.

void GuiTabBookCtrl::onChildAdded ( GuiControl child  )  [virtual]

Called when this object has a new child.

Reimplemented from GuiControl.

void GuiTabBookCtrl::renderTabs ( const Point2I offset  ) 

Tab rendering routine, iterates through all tabs rendering one at a time.

Parameters:
offset the render offset to accomodate global coords

void GuiTabBookCtrl::renderTab ( RectI  tabRect,
GuiTabPageCtrl tab 
)

Tab rendering subroutine, renders one tab with specified options.

Parameters:
tabRect the rectangle to render the tab into
tab pointer to the tab page control for which to render the tab

void GuiTabBookCtrl::renderBackground ( Point2I  offset,
const RectI updateRect 
)

Page Rendering Routine.

void GuiTabBookCtrl::renderJustifiedTextRot ( Point2I  offset,
Point2I  extent,
const char *  text,
F32  rot 
)

void GuiTabBookCtrl::addNewPage (  ) 

Create a new tab page child in the book.

Pages created are not titled and appear with no text on their tab when created. This may change in the future.

void GuiTabBookCtrl::selectPage ( S32  index  ) 

Select a tab page based on an index.

Parameters:
index The index in the list that specifies which page to select

void GuiTabBookCtrl::selectPage ( GuiTabPageCtrl page  ) 

Select a tab page by a pointer to that page.

Parameters:
page A pointer to the GuiTabPageCtrl to select. This page must be a child of the tab book.

void GuiTabBookCtrl::selectNextPage (  ) 

Select the Next page in the tab book.

void GuiTabBookCtrl::selectPrevPage (  ) 

Select the Previous page in the tab book.

void GuiTabBookCtrl::setUpdate (  )  [virtual]

Update ourselves by hooking common GuiControl functionality.

Reimplemented from GuiControl.

void GuiTabBookCtrl::balanceRow ( S32  row,
S32  totalTabWidth 
)

Balance a top/bottom tab row.

void GuiTabBookCtrl::balanceColumn ( S32  row,
S32  totalTabWidth 
)

Balance a left/right tab column.

void GuiTabBookCtrl::solveDirty (  ) 

Checks to see if a tab option has changed and we need to resize children, resizes if necessary.

S32 GuiTabBookCtrl::calculatePageTabWidth ( GuiTabPageCtrl page  ) 

Calculate the tab width of a page, given it's caption.

void GuiTabBookCtrl::calculatePageTabs (  ) 

Calculate Page Header Information.

GuiTabPageCtrl* GuiTabBookCtrl::findHitTab ( const GuiEvent event  ) 

Find the tab that was hit by the current event, if any.

Parameters:
event The GuiEvent that caused this function call

GuiTabPageCtrl* GuiTabBookCtrl::findHitTab ( Point2I  hitPoint  ) 

Find the tab that was hit, based on a point.

Parameters:
hitPoint A Point2I that specifies where to search for a tab hit

void GuiTabBookCtrl::resize ( const Point2I newPosition,
const Point2I newExtent 
) [virtual]

Rezize our control This method is overridden so that we may handle resizing of our child tab pages when we are resized.

This ensures we keep our sizing in sync when we are moved or sized.

Parameters:
newPosition The new position of the control
newExtent The new extent of the control

Reimplemented from GuiControl.

void GuiTabBookCtrl::childResized ( GuiControl child  )  [virtual]

Called when a child page is resized This method is overridden so that we may handle resizing of our child tab pages when one of them is resized.

This ensures we keep our sizing in sync when we our children are sized or moved.

Parameters:
child A pointer to the child control that has been resized

Reimplemented from GuiControl.

virtual bool GuiTabBookCtrl::onKeyDown ( const GuiEvent event  )  [virtual]

Happens when a key is depressed.

Parameters:
event Event descriptor (which contains the key)

Reimplemented from GuiControl.

void GuiTabBookCtrl::onMouseDown ( const GuiEvent event  )  [virtual]

Reimplemented from GuiControl.

void GuiTabBookCtrl::onMouseMove ( const GuiEvent event  )  [virtual]

Reimplemented from GuiControl.

void GuiTabBookCtrl::onMouseLeave ( const GuiEvent event  )  [virtual]

Reimplemented from GuiControl.

virtual bool GuiTabBookCtrl::onMouseDownEditor ( const GuiEvent event,
Point2I  offset 
) [virtual]

Called when a mouseDown event occurs on a control and the GUI editor is active.

Parameters:
event the GuiEvent which caused the call to this function
offset the offset which is representative of the units x and y that the editor takes up on screen

Reimplemented from GuiControl.


Field Documentation

Rectangle of the tab page portion of the control.

Rectangle of the tab portion of the control.

Vector of pages contained by the control.

Pointer to the active (selected) tab page child control.

Pointer to the tab page that currently has the mouse positioned ontop of its tab.

Minimum Width a tab will display as.

Current tab position (see alignment).

Last known tab position, stored to compare to tabPosition to know when to resize children.

Current tab height.

Last known tab height, stored to compare to current tabHeight to know when to resize children.

Current tab width.

Last know tab width, stored to compare to current tabWidth to know when to resize children.

Margin left/right of tab text in tab.

Indicates whether we have a texture to render the tabs with.

Array of rectangles identifying textures for tab book.




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen