Expand | ||
---|---|---|
| ||
|
Inherits | |
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.
...
Code Block | ||
---|---|---|
| ||
<genericcontrol >
<icon > ... </icon>
<iconcolor > ... </iconcolor>
<drawmode> ... </drawmode>
</genericcontrol> |
<genericcontrol >
Tag | Description |
icon | Name of an icon resource rendered in the control |
iconcolor | The color of the icon in the for #aarrggbb. If alpha is zero or not defined, FF is assumed. |
drawmode | Valid values are: ““ (default), “fill”, “fit”. |
Interface
hasIcon
Code Block | ||
---|---|---|
| ||
function hasIcon() |
...
(boolean)
Returns true if there is a valid icon, false otherwise
getAsset
Code Block | ||
---|---|---|
| ||
function getAsset() |
Get the asset assigned to this control (if any). An empty string will be returned if no asset assigned.
Return values
(string)
The key of the asset resource currently set.
getDrawMode
Code Block | ||
---|---|---|
| ||
function getDrawMode() |
Get the draw mode assigned to this control.
Return values
(string)
The draw mode string set for this control (See Definition above.)
setAsset
Code Block | ||
---|---|---|
| ||
function setAsset(asset) |
Set the given asset to be drawn in the control, based on the draw mode.
Parameters
asset (string)
The key of the asset resource to be displayed.
setColor
Code Block | ||
---|---|---|
| ||
function setColor(color) |
...
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.
...
setDrawMode
Code Block | ||
---|---|---|
| ||
function setIcon(bitmap, forcesetDrawMode(drawmodestring) |
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 controlGet the draw mode assigned to this control.
Parameters
drawmodestring (string)
The draw mode string to be set for this control (See Definition above.)
setIcon
Code Block | ||
---|---|---|
| ||
function setIcon(bitmap) |
Set the given icon to be drawn in the control, based on the draw mode.
Parameters
bitmap (string)
The name of the bitmap resource used as the iconforce (boolean)
Force the icon value to change even if the icon is not currently definedicon resource to be displayed.