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
applyFilter
applySort
closeAll
createWindow
createWindow
createWindow
createWindowWithClass
createWindowWithClass
createWindowWithClass
getNextWindow
getPrevWindow
getWindowAt
getWindows
onCheckDeletePermission
onFilter
onListRearranged
onSortCompare



Inherits windowcontrol databasecontrol
Context windowinstance

Window lists are controls containing a number of windowinstance objects as entries in list format.

Typically, a window list is bound to a database node and displays and keeps track of all objects in that node. The list may also contain header or title entries, or other entries based on the context of the list.

A reference to the window list object is available from the environments of all the contained window instances through the windowlist variable.



Definition

<windowlist name="..." >
<class > ... </class> The name of the windowclass that is used by default to generate the list entries
<datasource > ... </datasource> A relative (to the window data source) identifier to a database node acting as the list parent
<allowcreate /> If given, users can use the radial menu to create new entries in the list
<allowdelete /> If given, users can delete entries from the list using the radial menu
<noscroll /> If given, the list can't be scrolled; This is useful when the list is used as a dynamically sized control element
<skipempty /> If given, the empty entry is not created in lists with no entries
<acceptdrop > Specify that a "shortcut" drag with the specified windowclass will create a new entry in the list. The definition can contain multiple instances of this element.
<class > ... </class> The name of the windowclass in the dragdata object containing the dragged shortcut
<field > ... </field> A series of "fields" tags specifying the fields copied to the created window's data source
</acceptdrop>
<footer > ... </footer> The name of an icon resource to be used as a footer image, i.e. drawn in the control following all entries
<columns > Indicates the list should be drawn in columns with the specified width
<width > ... </width> Specifies the width of a column, in pixels
<filldown /> Renders the list so that columns are completed before moving to the next column, as opposed to the default case where the number of entries in columns is equalized.
<fillwidth /> Enters the entries in the list filling rows from left to right before continuing with the next row.
</columns>
<ownedonly /> If acting as a client, only renders the entries whose data sources are owned by the currently active user
</windowlist>


Interface

applyFilter

function applyFilter( [immediate] )

Filter the list, using onFilter to select entries for display.

Parameters

immediate   (boolean)   [optional]
If true, the contents are sorted immediately. Specifying this option might degrade performance, but be necessary in cases where succeeding script commands require the results of the operation.

applySort

function applySort( [immediate] )

Sort the contents of the list, using onSortCompare to place the entries in the desired order.

Parameters

immediate   (boolean)   [optional]
If true, the contents are sorted immediately. Specifying this option might degrade performance, but be necessary in cases where succeeding script commands require the results of the operation.

closeAll

function closeAll( )

This function closes all the windows in the window list.


createWindow

function createWindow( )

Creates a new entry in the list, represented by the returned windowinstance. The list is filtered and sorted automatically after the addition of the new entry.

This form of the function creates a window instance with the window class specified in the definition of the list control, with an automatically generated data source name.

Return values

(windowinstance)
A windowinstance representing the created entry, or nil in case of errors.

createWindow

function createWindow( dbnodeid )

Creates a new entry in the list, represented by the returned windowinstance. The list is filtered and sorted automatically after the addition of the new entry.

This form of the function creates a window instance with the window class specified in the definition of the list control, with a data source whose identifier string is passed as a parameter.

Parameters

dbnodeid   (string)   
A database node identifier specifying the created window instance's data source. This value can be absolute or relative to the list control's own data source.

Return values

(windowinstance)
A windowinstance representing the created entry, or nil in case of errors.

createWindow

function createWindow( dbnode )

Creates a new entry in the list, represented by the returned windowinstance. The list is filtered and sorted automatically after the addition of the new entry.

This form of the function creates a window instance with the window class specified in the definition of the list control, with a data source specified as a databasenode.

Parameters

dbnode   (databasenode)   
A reference to the data base node to be used as the data source for the created window instance

Return values

(windowinstance)
A windowinstance representing the created entry, or nil in case of errors.

createWindowWithClass

function createWindowWithClass( class )

Creates a new entry in the list, represented by the returned windowinstance. The list is filtered and sorted automatically after the addition of the new entry.

This form of the function creates a window instance with the window class specified as a parameter, with an automatically generated data source name.

Parameters

class   (string)   
The name of the windowclass used to create the window

Return values

(windowinstance)
A windowinstance representing the created entry, or nil in case of errors.

createWindowWithClass

function createWindowWithClass( class, dbnodeid )

Creates a new entry in the list, represented by the returned windowinstance. The list is filtered and sorted automatically after the addition of the new entry.

This form of the function creates a window instance with the window class specified as a parameter, with a data source whose identifier string is passed as a parameter.

Parameters

class   (string)   
The name of the windowclass used to create the window
dbnodeid   (string)   
A database node identifier specifying the created window instance's data source. This value can be absolute or relative to the list control's own data source.

Return values

(windowinstance)
A windowinstance representing the created entry, or nil in case of errors.

createWindowWithClass

function createWindowWithClass( class, dbnode )

Creates a new entry in the list, represented by the returned windowinstance. The list is filtered and sorted automatically after the addition of the new entry.

This form of the function creates a window instance with the window class specified as a parameter, with a data source specified as a databasenode.

Parameters

class   (string)   
The name of the windowclass used to create the window
dbnode   (databasenode)   
A reference to the data base node to be used as the data source for the created window instance

Return values

(windowinstance)
A windowinstance representing the created entry, or nil in case of errors.

getNextWindow

function getNextWindow( source )

Retrieve the window instance entry in the list control following the one given as a parameter.

Parameters

source   (windowinstance)   
The window instance from which the next window is to be determined.

Return values

(windowinstance)
A windowinstance representing the entry following the given entry. If the entry given as the parameter is the last one in the list, the return value will be nil.

getPrevWindow

function getPrevWindow( source )

Retrieve the window instance entry in the list control preceding the one given as a parameter.

Parameters

source   (windowinstance)   
The window instance from which the previous window is to be determined.

Return values

(windowinstance)
A windowinstance representing the entry preceding the given entry. If the entry given as the parameter is the first one in the list, the return value will be nil.

getWindowAt

function getWindowAt( x, y )

Retrieve the window instance entry in the list control at the specified coordinates.

Parameters

x   (number)   
The horizontal position relative to the left edge of the control in its current scroll state, in pixels
y   (number)   
The vertical position relative to the top edge of the control in its current scroll state, in pixels

Return values

(windowinstance)
A windowinstance representing the entry at the given position. If no entry was found at the position, the return value will be nil.

getWindows

function getWindows( )

Get the selection of windowinstance objects forming the entries in the list.

Return values

(table)
An integer indexed table containing references to the windowinstance entries in the list

onCheckDeletePermission

event function onCheckDeletePermission( window )

This function is called whenever the framework prepares to delete a record from the list using the interface radial menu. This allows portions of the list to stay undeletable.

Parameters

window   (windowinstance)   
A reference to a windowinstance representing the entry whose status is being determined

Return values

(boolean)
A true value if the framework should allow deletion, false otherwise.

onFilter

event function onFilter( w )

If this function is defined, it is executed for each record in the window list each time the list is reordered or new entries are added. Based on the return value, the corresponding record is only shown if it passes the filtering conditions.

Parameters

w   (windowinstance)   
A windowinstance representing the list entry being filtered

Return values

(boolean)
A return value of true indicates the entry passes the filter, a value of false hides it from the currently displayed selection of entries

onListRearranged

event function onListRearranged( listchanged )

If present, this function is called whenever the number or order of entries in the list changed.

Parameters

listchanged   (boolean)   
If the event causing the invocation of this event added or removed items from the list, the value will be true. Otherwise, false indicating that only the order of items was changed.

onSortCompare

event function onSortCompare( w1, w2 )

When the list is sorted, this function is executed to perform comparison operations between two entries in the list. All entries are not necessarily compared against each other. The function should perform a greater than operation.

Parameters

w1   (windowinstance)   
A reference to a windowinstance representing the first comparison operand
w2   (windowinstance)   
A reference to a windowinstance representing the second comparison operand

Return values

(boolean)
A return value of true indicates the entry represented by w1 is greater than (should be located later in the list) than the entry represented by w2. Otherwise, the function should return false.


'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