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
getPrototype
onValueChanged
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
<nodrag /> Disables drag operations originating from the control.
<nodrop /> Dropping tokens in the control does not modify the value of the control.
</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.

onValueChanged

event function onValueChanged( )

If present, this function is executed whenever the value of this control changes.


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. All other trademarks are the property of their respective owners.
2004-2010 SmiteWorks Ltd. ALL RIGHTS RESERVED.
Privacy policy