GuiTabBookCtrl

Engine/source/gui/containers/guiTabBookCtrl.h

Tab Book Control for creation of tabbed dialogs.

More...

Classes:

Callbacks

DECLARE_CALLBACK(void , onTabSelected , (const String &text, U32 index) )
DECLARE_CALLBACK(void , onTabRightClick , (const String &text, U32 index) )

Control Events

bool

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

onRender(Point2I offset, const RectI & updateRect)

Called when this control is to render itself.

Child events

Called when one of this objects children is removed.

Called when this object has a new child.

bool
reOrder(SimObject * obj, SimObject * target)

Reorder the position of "obj" to either be the last object in the list or, if "target" is given, to come before "target" in the list of children.

bool

Return true if this set accepts the given object as a child.

Rendering methods

renderTabs(const Point2I & offset, const RectI & tabRect)

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

renderTab(const RectI & tabRect, GuiTabPageCtrl * tab)

Tab rendering subroutine, renders one tab with specified options.

Page Management

addNewPage(const char * text)

Create a new tab page child in the book.

selectPage(S32 index)

Select a tab page based on an index.

Select a tab page by a pointer to that page.

Get the current selected tab number.

Select the Next page in the tab book.

Select the Previous page in the tab book.

Make the page fill the entire page space.

Return the index for the given page. -1 if not a page in this book.

Internal Utility Functions

Update ourselves by hooking common GuiControl functionality.

balanceRow(S32 row, S32 totalTabWidth)

Balance a top/bottom tab row.

balanceColumn(S32 row, S32 totalTabWidth)

Balance a left/right tab column.

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

Calculate Page Header Information.

Get client area of tab book.

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

findHitTab(Point2I hitPoint)

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

Sizing

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

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

bool

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

Public Types

enum
TabPosition {
  AlignTop 
  AlignBottom 
}
Parent 

Protected Types

enum
_Anonymous_ {
  TabSelected = 0
  TabNormal 
  TabHover 
  TabEnds 
  NumBitmaps 
}

Protected Attributes

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

bool

Allow the user to reorder tabs by dragging them.

Array of rectangles identifying textures for tab book.

Page to select on first wake.

Padding to the Left of the first Tab.

bool

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

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

Minimum Width a tab will display as.

Rectangle of the tab page portion of the control.

Vector of pages contained by the control.

Current selected tab position.

Current tab height.

Margin left/right of tab text in tab.

Current tab position (see alignment)

Rectangle of the tab portion of the control.

Private Static Functions

bool
_setSelectedPage(void * object, const char * index, const char * data)

Public Functions

DECLARE_DESCRIPTION("A <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> that allows <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> select from <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> set of tabbed pages." )
bool

Happens when a key is depressed.

Public Static Functions

Detailed Description

Tab Book Control for creation of tabbed dialogs.

see:

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 a lot of information in a small area by separating 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 multi-page 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.

GUI has an overview of the GUI system.

Callbacks

DECLARE_CALLBACK(void , onTabSelected , (const String &text, U32 index) )

DECLARE_CALLBACK(void , onTabRightClick , (const String &text, U32 index) )

Control Events

onWake()

Reimplemented from: GuiControl

onRender(Point2I offset, const RectI & updateRect)

Reimplemented from: GuiControl

Child events

onChildRemoved(GuiControl * child)

Reimplemented from: GuiContainer

onChildAdded(GuiControl * child)

Reimplemented from: GuiContainer

reOrder(SimObject * obj, SimObject * target)

Reimplemented from: GuiContainer

acceptsAsChild(SimObject * object)

Reimplemented from: GuiControl

Rendering methods

renderTabs(const Point2I & offset, const RectI & tabRect)

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

Parameters:

offset

the render offset to accomodate global coords

tabRect

the Rectangle in which these tabs are to be rendered

renderTab(const 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

Page Management

addNewPage(const char * text)

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.

Parameters:

text

Tab page header text.

selectPage(S32 index)

Select a tab page based on an index.

Parameters:

index

The index in the list that specifies which page to select

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.

getSelectedPageNum()

Get the current selected tab number.

selectNextPage()

Select the Next page in the tab book.

selectPrevPage()

Select the Previous page in the tab book.

fitPage(GuiTabPageCtrl * page)

Make the page fill the entire page space.

getPageNum(GuiTabPageCtrl * page)

Return the index for the given page. -1 if not a page in this book.

Internal Utility Functions

setUpdate()

Reimplemented from: GuiControl

balanceRow(S32 row, S32 totalTabWidth)

Balance a top/bottom tab row.

balanceColumn(S32 row, S32 totalTabWidth)

Balance a left/right tab column.

calculatePageTabWidth(GuiTabPageCtrl * page)

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

calculatePageTabs()

Calculate Page Header Information.

getClientRect()

Reimplemented from: GuiContainer

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

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

Sizing

resize(const Point2I & newPosition, const Point2I & newExtent)

Reimplemented from: GuiContainer

childResized(GuiControl * child)

Reimplemented from: GuiContainer

Mouse Events

onMouseDown(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseUp(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseDragged(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseMove(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseLeave(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseDownEditor(const GuiEvent & event, Point2I offset)

Reimplemented from: GuiControl

onRightMouseUp(const GuiEvent & event)

Reimplemented from: GuiControl

Public Types

TabPosition

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.

typedef GuiContainer Parent 

Protected Types

@92

Enumerator

TabSelected = 0

Index of selected tab texture.

TabNormal

Index of normal tab texture.

TabHover

Index of hover tab texture.

TabEnds

Index of end lines for horizontal tabs.

NumBitmaps

Number of bitmaps in this array.

Protected Attributes

GuiTabPageCtrl * mActivePage 

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

bool mAllowReorder 

Allow the user to reorder tabs by dragging them.

RectI * mBitmapBounds 

Array of rectangles identifying textures for tab book.

S32 mDefaultPageNum 

Page to select on first wake.

bool mDraggingTab 
bool mDraggingTabRect 
S32 mFrontTabPadding 

Padding to the Left of the first Tab.

bool mHasTexture 

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

GuiTabPageCtrl * mHoverTab 

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

bool mIsFirstWake 
S32 mMinTabWidth 

Minimum Width a tab will display as.

RectI mPageRect 

Rectangle of the tab page portion of the control.

Vector< TabHeaderInfo > mPages 

Vector of pages contained by the control.

S32 mSelectedPageNum 

Current selected tab position.

S32 mTabHeight 

Current tab height.

S32 mTabMargin 

Margin left/right of tab text in tab.

TabPosition mTabPosition 

Current tab position (see alignment)

RectI mTabRect 

Rectangle of the tab portion of the control.

Private Static Functions

_setSelectedPage(void * object, const char * index, const char * data)

Public Functions

GuiTabBookCtrl()

DECLARE_CONOBJECT(GuiTabBookCtrl )

DECLARE_DESCRIPTION("A <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> that allows <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> select from <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> set of tabbed pages." )

onKeyDown(const GuiEvent & event)

Reimplemented from: GuiControl

Public Static Functions

initPersistFields()