DialogControls-Toolbox: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Created page with "==CT_TOOLBOX Type=6== '''TokenNames common to most controls, such as x,y,w,h,text,idc... are not listed here.''' A Toolbox is a set of buttons, ordered by columns and rows. Onl...")
 
m (Text replacement - "#redirect " to "#REDIRECT ")
 
(24 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==CT_TOOLBOX Type=6==
#REDIRECT [[CT_TOOLBOX]]
 
'''TokenNames common to most controls, such as x,y,w,h,text,idc... are not listed here.'''
 
A Toolbox is a set of buttons, ordered by columns and rows. Only one can be active at a time.
 
{| border="1" align="left" cellpadding="3" cellspacing="0" |
! colspan="3" bgcolor="#bbbbff" | Properties
|-
! bgcolor="#ddddff" | Name
! bgcolor="#ddddff" | Type
! bgcolor="#ddddff" | Remark
|-
| '''color'''
| color array
| Color of the selection box when this the control isn't active.
|-
| '''colorTextSelect'''
| color array
| Color of the text when selected.
|-
| '''colorSelect'''
| color array
| Color of the selection box.
|-
| '''colorTextDisable'''
| color array
| Color of control text when the control is disabled.
|-
| '''colorDisable'''
| color array
| Color of the selection box when the control is disabled.
|-
| '''rows'''
| integer
| Amount of rows to display
|-
| '''columns'''
| integer
| Amount of columns to display
|-
| '''colorSelectedBg'''
| 255 color array
| this appears to be non-working typo
|-
| '''strings'''
| string array
| Text for each toolbox entry
|-
| '''values'''
| integer array
| Initial state for each toolbox entry, using values 0 or 1.
|-
|}<br clear="all">
 
[[Image:ToolboxControl.jpg|thumb|200px|A Toolbox Control from example code with a hint dialog from UI event handler]]
* '''Example:'''
<code><nowiki>class MyRscToolbox {
  idc = 200;
  type = CT_TOOLBOX;  //defined constant (6)
  style = ST_LEFT; //defined constant (2)
 
  x = 0.1;
  y = 0.2;
  w = 0.2;
  h = 0.15;
 
  colorText[] = {1, 1, 1, 1};
  color[] = {0, 0, 0, 1};    // seems nothing to change, but define it to avoid error!
  colorTextSelect[] = {1, 0, 0, 1};
  colorSelect[] = {0, 0, 1, 1};
  colorTextDisable[] = {0.4, 0.4, 0.4, 1};
  colorDisable[] = {0.4, 0.4, 0.4, 1};
  font = "Zeppelin32";
  sizeEx = 0.0208333;
  rows = 3;
  columns = 2;
  strings[] = {"Entry 1","Entry 2","Entry 3","Entry 4","Entry 5","Entry 6"};
  values[] = {1,1,0,1,0,0};
 
  // Only a simple user interface event handler to show some response
  onToolBoxSelChanged = "hint format[""Toolbox change:\n%1\nEntry#:%2"",(_this select 0),(_this select 1)];"
};
</nowiki></code>
 
'''Notice:'''
As you see in the example image, the returned entry number from the ''onToolBoxSelChanged'' event handler starts at zero (0)! So if you have 6 toolbox entrys, the first is 0 and the last is 5!
[[Category: Dialogs]]

Latest revision as of 07:28, 30 December 2020

Redirect to: