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
addImageFile
clipboardGetText
clipboardSetText
dialogFileOpen
dialogFileSave
dialogMessage
findWindow
getDice
getString
isFullScreen
onDesktopClose
onDesktopInit
onHotkeyActivated
onHotkeyDrop
onWindowClosed
onWindowOpened
openCampaignFolder
openDataFolder
openRadialMenu
openWindow
requestNewClientWindow
setLighting
setString



This is a global built-in package that provides interfaces for manipulating top level user interface objects, such as top level windows and panels. Hot key bar event processing also happens through this interface.

Opening windows explicitly using the functions in this interface should be done carefully, in order to preserve the integrity of the program data base on client instances. Generally, windows should only be opened once shared from the host, or by using requestNewClientWindow to notify the host of the new window and its data.



Interface

addImageFile

function addImageFile( [imagefile] )

Saves the specified image file into the current campaign's images folder.

Parameters

imagefile(string)[optional]
The full path of the image file to save

clipboardGetText

function clipboardGetText( )

Retrieves the current text value on the operating system clipboard.

Return values

(string)
The text from the clipboard

clipboardSetText

function clipboardSetText( text )

Sets the text parameter as the text value on the operating system clipboard.

Parameters

text(string)
The text to put on the clipboard

dialogFileOpen

function dialogFileOpen( [multiselect], [filter], [directory] )

Displays a standard file system dialog for opening files.

If a filter parameter is not defined or empty, then an XML file type will be added to the dialog filter.

Parameters

multiselect(boolean)[optional]
Defines whether multi-select is enabled for the open file dialog.
filter(table)[optional]
Specifies filter values to use in the file open dialog as a table of key/value pairs where the extension type is the key and the description is the value.
directory(string)[optional]
Specifies the initial directory to display when opening this dialog, relative to the FG data directory.

Return values

(string (or table))
Returns the file (or files if multi-select enabled) that the user selects.

dialogFileSave

function dialogFileSave( [filter], [directory] )

Displays a standard file system dialog for saving files

If a filter parameter is not defined or empty, then an XML file type will be added to the dialog filter.

Parameters

filter(table)[optional]
Specifies filter values to use in the file open dialog as a table of key/value pairs where the extension type is the key and the description is the value.
directory(string)[optional]
Specifies the initial directory to display when opening this dialog, relative to the FG data directory.

Return values

(string)
Returns the file that the user selects.

dialogMessage

function dialogMessage( [dialogtext], [title], [type] )

Opens a simple operating system dialog to provide information to the user, or to request a simple positive/negative answer.

Parameters

dialogtext(string)[optional]
The text to display in the dialog
title(string)[optional]
The text to display in the dialog title bar
type(string)[optional]
The type of dialog to display. Valid values are (nil, "okcancel", "yesno", "yesnocancel").

Return values

(string)
The button pressed in the dialog by the user. If nil, then the dialog was closed without selecting a button. Otherwise, valid values are ("ok", "cancel", "yes", "no").

findWindow

function findWindow( windowclass, datasource )

Finds a top level window or panel by its windowclass and datasource. If the window is not found, it is not created.

Parameters

windowclass(string)
The windowclass of the window to find
datasource(string)
The name of the datasource to use, see windowinstance for details

Return values

(windowinstance)
A windowinstance to the window, or nil if the request failed or the window was not found.

getDice

function getDice( )

Return the text of the string resource identified by the parameter

Return values

(table)
Table of strings, which correspond to the die resources defined via the die and customdie tags.

getString

function getString( id )

Return the text of the string resource identified by the parameter

Parameters

id(string)
String resource ID

Return values

(string)
The text stored in the string resource

isFullScreen

function isFullScreen( )

Returns whether Fantasy Grounds is running in full screen (maximized) mode or not.

Return values

(boolean)
Whether Fantasy Grounds is running in full screen mode.

onDesktopClose

handler function onDesktopClose( )

The functions registered on this handler will be called just before the virtual table is closed.


onDesktopInit

handler function onDesktopInit( )

The functions registered on this handler will be called after the virtual table is initialized.


onHotkeyActivated

handler function onHotkeyActivated( dragdata )

The functions registered on this handler will be called whenever a hot key bar slot is activated. This allows the processing of custom drag types and context specific special operation.

Parameters

dragdata(dragdata)
The dragdata object representing the contents of the activated hot key bar slot.

onHotkeyDrop

handler function onHotkeyDrop( dragdata )

The functions registered on this handler will be called whenever an object is dropped on the hot key bar.

Parameters

dragdata(dragdata)
A dragdata object containing the state of values connected to the mouse cursor as part of a drag and drop operation.

onWindowClosed

handler function onWindowClosed( window )

The functions registered on this handler will be called whenever a top level window is about to be closed.

Parameters

window(windowinstance)
A windowinstance object identifying the closed window

onWindowOpened

handler function onWindowOpened( window )

The functions registered on this handler will be called whenever a new top level window is created.

Parameters

window(windowinstance)
A windowinstance object identifying the opened window

openCampaignFolder

function openCampaignFolder( [relative] )

Opens an operating system file explorer instance to view the current campaign folder. If relative path parameter is defined, then open there instead.

Parameters

relative(string)[optional]
Relative path within current campaign folder

openDataFolder

function openDataFolder( [relative] )

Opens an operating system file explorer instance to view the FG data folder. If relative path parameter is defined, then open there instead.

Parameters

relative(string)[optional]
Relative path within FG data folder

openRadialMenu

function openRadialMenu( )

Opens the radial menu at the current mouse position. The radial menu is normally activated when right-clicking with the mouse.


openWindow

function openWindow( windowclass, datasource )

Creates a top level window by a windowclass and a datasource. If a matching window already exists, it is returned. Otherwise, a new window is created.

See windowinstance for more information on the parameter values.

Parameters

windowclass(string)
The windowclass of the window to create
datasource(string)
The name of the datasource to use, see windowinstance for details

Return values

(windowinstance)
A windowinstance to the window, or nil if the request failed.

requestNewClientWindow

function requestNewClientWindow( windowclass, rootnode )

Because client instances should not create windows with data bound to nonexistant database nodes, they need to ask the host to create a new data base node to act as the window datasource whenever a new record is required. This function sends a request to do this to the host asynchronously, with the host responding with an acknowledgement to create a new window instance if successful.

Due to the asynchronous nature of this function, it does not return a reference to the window, returning immediately. If any further processing is required, other means to process the created window are required.

A new datasource node will be created for the window. The host will create a new unique node under the node passed as the second parameter, i.e. the datasource node will be a child of the node specified in the root node parameter.

It is possible to create client windows with openWindow. This option should be reserved for special cases and should not be used under normal circumstances.

Parameters

windowclass(string)
The windowclass of the window to create
rootnode(string)
The name of the parent node used to create the data source, see above and windowinstance for details

setLighting

function setLighting( systemcolor, windowcolor, controlcolor, contentcolor )

This function can be used to change the ambient lighting of the user interface elements. The color change will take place on all connected clients gradually over a couple of seconds.

All the color components are specified as strings in the form "RRGGBB", where the characters are hexadecimal digits specifying the red, green and blue color channels in the range 0 .. 255. The colors will be modulated with the pixel values in the bitmaps defining the interface.

The recommended operation is to only alter the windowcolor parameter, passing the value "FFFFFF" to the other color channels.

Parameters

systemcolor(string)
The color used to render system interface elements
windowcolor(string)
The color used to render window frame interface elements
controlcolor(string)
The color used to render control elements
contentcolor(string)
The color used to render user specified content interface elements. Please note that changing this value may affect the usability of the respective content.

setString

function setString( id, text )

Sets the text of a string resource.

Parameters

id(string)
String resource ID
text(string)
Text to store in the string resource


'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