DialogControls-ControlsGroup: Difference between revisions
Line 2: | Line 2: | ||
TokenNames common to most controls, such as x,y,w,h,text,idc... are not listed here. | TokenNames common to most controls, such as x,y,w,h,text,idc... are not listed here. | ||
The x and y coords of the child control are relative to the parent class, the height and width are not | *The x and y coords of the child control are relative to the parent class, the height and width are not | ||
*If the height and / or width of the child control are greater than the parent control then scrollbars will be seen | |||
**This allows the creation of scrollable active text controls etc | |||
*The entire child class needs to be defined in the parents subclass class Controls {}; | |||
{| border="1" align="left" cellpadding="3" cellspacing="0" | | {| border="1" align="left" cellpadding="3" cellspacing="0" | | ||
! colspan="3" bgcolor="#bbbbff" | Properties | ! colspan="3" bgcolor="#bbbbff" | Properties | ||
Line 39: | Line 39: | ||
! bgcolor="#ddddff" | Type | ! bgcolor="#ddddff" | Type | ||
! bgcolor="#ddddff" | Remark | ! bgcolor="#ddddff" | Remark | ||
|- | |- | ||
| '''autoScrollSpeed' | | '''autoScrollSpeed' | ||
Line 54: | Line 50: | ||
| '''autoScrollRewind' | | '''autoScrollRewind' | ||
| boolean | | boolean | ||
| | |||
|- | |||
| '''color''' | |||
| color array | |||
| | | | ||
|- | |- | ||
| '''shadow''' | | '''shadow''' | ||
| integer | | integer | ||
| | |||
|- | |||
| '''width''' | |||
| float | |||
| | | | ||
|- | |- | ||
Line 68: | Line 72: | ||
! bgcolor="#ddddff" | Type | ! bgcolor="#ddddff" | Type | ||
! bgcolor="#ddddff" | Remark | ! bgcolor="#ddddff" | Remark | ||
|- | |||
| '''color''' | |||
| color array | |||
| | |||
|- | |- | ||
| '''height''' | | '''height''' | ||
Line 112: | Line 120: | ||
|}<br clear="all"> | |}<br clear="all"> | ||
===class Controls=== | ===class Controls=== | ||
additional user added controls of any type can be added in a derived class. the base is empty because the engine looks for it regardless. | *additional user added controls of any type can be added in a derived class. the base is empty because the engine looks for it regardless. | ||
==Example== | ==Example== | ||
Revision as of 17:47, 29 January 2012
CT_CONTROLS_GROUP Type=15
TokenNames common to most controls, such as x,y,w,h,text,idc... are not listed here.
- The x and y coords of the child control are relative to the parent class, the height and width are not
- If the height and / or width of the child control are greater than the parent control then scrollbars will be seen
- This allows the creation of scrollable active text controls etc
- The entire child class needs to be defined in the parents subclass class Controls {};
Properties | ||
---|---|---|
Name | Type | Remark |
VScrollbar | class | |
HScrollbar | class | |
ScrollBar | class | |
Controls | class |
class VScrollbar
Properties | ||
---|---|---|
Name | Type | Remark |
autoScrollSpeed' | integer | typically -1 |
autoScrollDelay | integer | in seconds |
autoScrollRewind' | boolean | |
color | color array | |
shadow | integer | |
width | float |
class HScrollbar
Properties | ||
---|---|---|
Name | Type | Remark |
color | color array | |
height | float | |
shadow | integer |
class Scrollbar
Properties | ||
---|---|---|
Name | Type | Remark |
color | color array | |
colorActive | color array | |
colorDisabled | color array | |
thumb | string | path to texture or "#(argb,8,8,3)color(1,1,1,1)"; |
arrowEmpty/Full | string | path to texture or "#(argb,8,8,3)color(1,1,1,1)"; |
border | string | path to texture or "#(argb,8,8,3)color(1,1,1,1)"; |
class Controls
- additional user added controls of any type can be added in a derived class. the base is empty because the engine looks for it regardless.
Example
In this example, the child control My_RscStructuredText is higher (h value) than the parent control, so a vertical scrollbar is automatically created, which allows scrolling the entire length of the structured text display
class RscControlsGroup
{
type = CT_CONTROLS_GROUP;
idc = -1;
style = ST_MULTI;
x = 0; y = 0; w = 1; h = 1;
shadow=0;
class VScrollbar
{
width = 0.021;
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
shadow=0;
};
class HScrollbar
{
height = 0.028;
shadow=0;
};
class ScrollBar
{
color[] = {1,1,1,0.6};
colorActive[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.3};
thumb = "#(argb,8,8,3)color(1,1,1,1)";
arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
border = "#(argb,8,8,3)color(1,1,1,1)";
};
class Controls{};// an empty class telling the engine, no custom, additional controls
};
class dialog
{
class controls
{
class MyControls:RscControlsGroup
{
x = (safeZoneX + (SafezoneW * 0.0363)); // scalability code which resizes correctly no matter what gui size or screen dimensions is used
y = (safeZoneY + (SafezoneH * 0.132)); // scalability code which resizes correctly no matter what gui size or screen dimensions is used
w = (SafezoneW * 0.31); // scalability code which resizes correctly no matter what gui size or screen dimensions is used
h = (SafezoneH * 0.752); // scalability code which resizes correctly no matter what gui size or screen dimensions is used
class Controls
{
...class whatever additional controls you want
};
};
};
};