genericcontrol

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> <iconcolor > ... </iconcolor> </genericcontrol>

<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

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.