Packages
Comm
DB
Debug
Input
Interface
Module
Token
User

Objects
bitmapwidget
databasenode
dragdata
textwidget
tokeninstance
widget
widgetcontainer

Elements
buttoncontrol
categoryselectioncontrol
chatentry
chatwindow
databasecontrol
diecontrol
diefield
formattedtextcontrol
formattedtextfield
genericcontrol
imagecontrol
numbercontrol
numberfield
portraitselectioncontrol
script
scrollbarcontrol
scrollercontrol
stringcontrol
stringfield
subwindow
textbasecontrol
tokenbag
tokencontrol
tokenfield
windowclass
windowcontrol
windowinstance
windowlist
windowreferencecontrol
windowreferencefield

Components
categoryselectionsettings
customdie
desktopframe
die
distance
font
framedef
hotkeybar
icon
imageupdatefolder
importinfo
includefile
panel
portraitset
properties
replaces
template
tokenroot
tooltip
bringToFront
destroy
getSize
isVisible
sendToBack
setFrame
setPosition
setRadialPosition
setVisible



Inherits
Context widgetcontainer

The widget object defines functions generic to all widget types. There are no standalone instances of this type, this is a virtual base class.



Interface

bringToFront

function bringToFront( )

Bring this widget to the front in the container drawing order. The widget will be drawn last (on top). Note that if the container is located below another interface element, this function will not bring the widget on top of that element.


destroy

function destroy( )

Destroy the widget, removing it from the parent container.

Warning
Using the widget reference for operations after a call to destroy may produce invalid operation. Any reference to the widget object should be invalidated (set to nil).

getSize

event function getSize( )

Get the on screen dimensions of the widget. The actual values and their calculation may vary by widget type.

Return values

(int)
Width of the widget
(int)
Height of the widget

isVisible

function isVisible( )

This function can be used to check if the widget has been toggled hidden.

Return values

(boolean)
Returns true if the widget is visible, false otherwise.

sendToBack

event function sendToBack( )

Send this widget to the back in the container drawing order. The widget will be drawn first (under others). Note that if the container is located above another interface element, this finction will not cause the widget to be drawn under either that element or the widget container itself.


setFrame

function setFrame( name, [leftmargin], [topmargin], [rightmargin], [bottommargin] )

This function sets a bitmap frame to be used when rendering the widget on the screen. The size of the frame will equal the size of the widget, with optional margins given as parameters. A positive value for the margins will shift the edge of the frame away from the widget center, with a negative value shifting it towards the center of the widget.

Parameters

name(string)
The name of the bitmap frame resource to be used
leftmargin(number)[optional]
The left margin offset, in pixels
topmargin(number)[optional]
The top margin offset, in pixels
rightmargin(number)[optional]
The right margin offset, in pixels
bottommargin(number)[optional]
The bottom margin offset, in pixels

setPosition

function setPosition( anchor, x, y )

Sets the position of the widget relative to the parent container. The widget can be placed relative to any corner of the container or its center point. The widget will be centered both horizontally and vertically on the anchor point given.

Parameters

anchor(string)
Defines the point on the parent container the widget will be centered on. This string should be a combination of the substrings "left", "top", "right" and "bottom". If either the vertical or horizontal dimension is omitted, the widget will be centered on the container in that direction. To place the widget relative to the center of the container, use the empty string "" or "center".
x(number)
Horizontal offset from the anchor point in pixels. Positive values indicate a shift to the right, negative values to the right.
y(number)
Vertical offset from the anchor point in pixels. Positive values indicate a shift down, negative values down.

setRadialPosition

function setRadialPosition( r, a )

Sets the position of the widget relative to the parent container. This function can be used to place widgets radially around the center point of the container. The widget will be centered both horizontally and vertically on the anchor point given.

Parameters

r(number)
The radial distance from the center of the container to the center of the widget, in pixels.
a(number)
The angle of widget placement from the center of the container. A value of zero is directly up, and the angle is measured clockwise from that location. The value should be given as a number from 0 to 100, with the value 100 specifying a complete rotation.

setVisible

function setVisible( state )

Set the widget visible or hidden.

Parameters

state(boolean)
If true, the widget will be visible. If false, the widget will be hidden


'Fantasy Grounds' is a trademark of SmiteWorks Ltd. All other trademarks are the property of their respective owners.
2004-2010 SmiteWorks Ltd. ALL RIGHTS RESERVED.
Privacy policy