Packages
 Input
 Module
 User
 DB
 Interface

Objects
 bitmapwidget
 databasenode
 dragdata
 textwidget
 tokeninstance
 widget
 widgetcontainer

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

Components
 categoryselectionsettings
 customdie
 die
 font
 framedef
 desktopframe
 hotkeybar
 icon
 imageupdatefolder
 importinfo
 includefile
 panel
 portraitset
 template
 tokenroot
 tooltip
getPrototype
populateFromImageNode
setPrototype



Inherits windowcontrol
Context windowinstance

Token controls contain token prototypes, and can be used to create token instances on controls accepting tokens. The icon representing the token is drawn in the control. If the control's dimensions are smaller than the prototype bitmap, the token image is scaled to fit in the control.

See tokenfield for a database bound version of this control type.

The control has built-in support for the "token" dragdata type.



Definition

<tokencontrol name="..." >
<empty > ... </empty> The icon resource name of an icon drawn in the control if the token value is empty
</tokencontrol>


Interface

getPrototype

function getPrototype( )

Returns the string identifying the token prototype contained in the control. The prototype string is a file name locating the token prototype image in the application directory. It should only be used as an identifier, direct manipulation of the string value is not recommended.

Return values

(string)
A string identifying the token contained in the control.

populateFromImageNode

function populateFromImageNode( dbnodename, id )

This function can be used to fetch a token instance from the program database. The prototype contained in the control is set to the prototype contained in the specified database node by the given id number, and the corresponding token instance is returned. The return value should be stored by the calling script if it is to be used as a reference.

Parameters

dbnodename   (string)   
A database reference identifier string specifying the database node. If this node is not an image value, the call will fail.
id   (number)   
A number value identifying a token instance in the specified image database node.

Return values

(tokeninstance)
The tokeninstance identified by the given parameters, or nil if not found.

setPrototype

function setPrototype( prototypename )

Sets the string identifying the token prototype contained in the control. The prototype string is a file name locating the token prototype image in the application directory. Direct manipulation of this value is not recommended. Only strings obtained through secondary token sources (such as other tokencontrol instances or token containers) should be used.

Parameters

prototypename   (string)   
The string representing the token that is to be presented in the control


'Fantasy Grounds' is a trademark of SmiteWorks Ltd.
'd20 System' and the d20 System logo are trademarks of Wizards of the Coast, Inc. in the United States and other countries and are used with permission.
© 2004-2008 SmiteWorks Ltd. ALL RIGHTS RESERVED.
Privacy policy