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
activate
getTargetDatabaseNode
getValue
isEmpty
onValueChanged
setIcons
setValue



Inherits windowcontrol
Context windowinstance

This control acts like a button and is used to open a new window.

The value contained in the control is a combination of a string specifying a window class name and a string specifying a database identifier relative to the window source (the latter being called the control's record source).

The windowclass and data source of the created window will match the ones specified in the definition, or the ones in the contained shortcut value. If the record source is undefined and the window has a data source defined, the opened window's data source will be the same as that of the window containing the control. This last feature is useful for opening different views on the same data or for opening contained data in a new sheet from a windowlist entry.

This control supports the "shortcut" dragdata type.



Definition

<windowreferencecontrol >
<icon > The bitmap rendered in the control
<normal > ... </normal> The name of the icon resource used when the control is in the normal state and contains a value
<empty > ... </empty> The name of the icon resource used when the control contains an empty value
<pressed > ... </pressed> The name of the icon resource used when the mouse button is pressed on the control
</icon>
<description > The source of the description string added to a drag started in this control
<text > ... </text> OR A static text string
<textres > ... </textres> OR String resource ID
<control > ... </control> OR Name of a control with the same parent window that should be used fro description text
<field > ... </field> A relative (to the window data source) database identifier pointing to a field that contains the description text
</description>
<class > The name of the window class used for an opened window instance
<recordname > ... </recordname> A relative (to the window data source) database identifier pointing to the data source to assign to the opened window
</class>
<noreset /> Disable reset by using the middle mouse button
<nodrag /> Disable drag from this control
<allowdrop /> Allow drop operations to set the shortcut data contained in the control
<closetoggle /> Activating the control with the target window instance already in existance will cause the window to close if this is specified
</windowreferencecontrol>


Interface

activate

function activate( )

Emulates the activation of the window reference, opening a new window, if one corresponding to the specified target is not found, or bringing the window to the top in the draw order if it is already open.

Return values

(windowinstance)
A windowinstance object representing the shortcut stored in this control, or nil if not found or invalid shortcut data.

getTargetDatabaseNode

function getTargetDatabaseNode( )

This function can be used to fetch the database node used if the window reference were activated.

Return values

(databasenode)
A reference to a databasenode object representing the data source of the shortcut, or nil if is not found or specified.

getValue

function getValue( )

Returns data about the shortcut stored in the control.

Return values

(string)
The name of the windowclass used for the shortcut
(string)
The database identifier used for the shortcut

isEmpty

function isEmpty( )

Returns whether the control contains a link or is empty.

Return values

(boolean)
Whether the control is empty

onValueChanged

event function onValueChanged( )

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


setIcons

function setIcons( normal, pressed )

Set the icons for the normal and pressed states of the control.

Parameters

normal(string)
The name of an icon resource drawn in the control in the normal state
pressed(string)
The name of an icon resource drawn in the control when the mouse is pressed down on the control

setValue

function setValue( class, recordname )

Sets the shortcut stored in the control.

Parameters

class(string)
The name of the windowclass used for the shortcut
recordname(string)
The database identifier used for the shortcut. If this parameter is omitted, an empty value will be used indicating that the window data source should be used.


'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