Packages
 Comm
 DB
 Debug
 Extension
 Input
 Interface
 Module
 Token
 User

Objects
 bitmapwidget
 databasenode
 dragdata
 textbasecontrol
 textwidget
 tokeninstance
 widget
 widgetcontainer
 windowcontrol
 windowinstance

Controls
 buttoncontrol
 buttonfield
 categoryselectioncontrol
 chatentry
 chatwindow
 databasecontrol
 diecontrol
 diefield
 formattedtextcontrol
 formattedtextfield
 genericcontrol
 imagecontrol
 numbercontrol
 numberfield
 portraitselectioncontrol
 scrollbarcontrol
 scrollercontrol
 stringcontrol
 stringfield
 subwindow
 tokenbag
 tokencontrol
 tokenfield
 windowlist
 windowreferencecontrol
 windowreferencefield

Assets and Settings
 announcement
 categoryselectionsettings
 characterdbroot
 customdie
 description
 desktopframe
 die
 diebox
 distance
 font
 framedef
 hotkeybar
 icon
 imageupdatefolder
 imagesettings
 importinfo
 importruleset
 includefile
 panel
 pollbox
 portraitset
 properties
 replaces
 script
 string
 template
 textsettings
 tokenroot
 tooltip
 windowclass
hasIcon
setColor
setIcon



Inherits windowcontrol
Context windowinstance

A generic control has no other functionality than displaying an optional icon centered in the control. This control type is intended to work as a generic basis for custom control setups. See windowcontrol for generic properties of window controls and widgetcontainer for information on widgets.



Definition

<genericcontrol >
<icon > ... </icon> Name of an icon resource rendered in the control
<iconcolor > ... </iconcolor> The color of the icon in the for #aarrggbb. If alpha is zero or not defined, FF is assumed.
</genericcontrol>


Interface


hasIcon

function hasIcon()

Checks whether the control contains a valid icon.

Return values

(boolean)
Returns true if there is a valid icon, false otherwise

setColor

function setColor(color)

Set the color that the icon image is modulated with. The modulation operation scales the color components of the pixels in the bitmap from zero to the value in the original bitmap, thus adjusting the hue of the image. The image color values can't be scaled up using this functionality.

Parameters

color   (string)   

The color specified as a HTML compatible string representing an RGB color with an alpha (transparency) value. The format of the string is 'aarrggbb', and each component is presented as a hexadecimal value from 00 to FF. If alpha is zero or not defined, FF is assumed.


setIcon

function setIcon(bitmap, force)

Set the bitmap rendered in the control. The bitmap will be drawn centered on the control. If the control's size is smaller than the size of the bitmap in any dimension, the bitmap will be scaled so that it fits in the control.

Parameters

bitmap   (string)   

The name of the bitmap resource used as the icon

force   (boolean)   

Force the icon value to change even if the icon is not currently defined.



'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