DialogControls-Combo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (links)
(ct_combo)
Line 76: Line 76:
|}<br clear="all">
|}<br clear="all">


'''Notice:'''
==example (A3 1.28 Template)==
[[file:WuChaoRen_lbSortByValue.png]]
<code><nowiki>
                class _CT_COMBO
{
access = 0; // Control access (0 - ReadAndWrite, 1 - ReadAndCreate, 2 - ReadOnly, 3 - ReadOnlyVerified)
idc = CT_COMBO; // Control identification (without it, the control won't be displayed)
type = CT_COMBO; // Type is 4
style = ST_LEFT + LB_TEXTURES; // Style
default = 0; // Control selected by default (only one within a display can be used)
blinkingPeriod = 0; // Time in which control will fade out and back in. Use 0 to disable the effect.


This seems to be a kind of listbox, so use the '''lb*''' commands like '''[[lbAdd]]''' or '''[[lbSetSelected index|lbSetSelected]]''' to work with this control.
x = 1 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X; // Horizontal coordinates
y = 9 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y; // Vertical coordinates
w = 10 * GUI_GRID_CENTER_W; // Width
h = 1 * GUI_GRID_CENTER_H; // Height


colorBackground[] = {0.2,0.2,0.2,1}; // Fill color
colorSelectBackground[] = {1,0.5,0,1}; // Selected item fill color


[[Image:ControlCombo.JPG|thumb|200px|A ComboBox Control from example code]]
sizeEx = GUI_GRID_CENTER_H; // Text size
font = GUI_FONT_NORMAL; // Font from CfgFontFamilies
shadow = 0; // Shadow (0 - none, 1 - N/A, 2 - black outline)
colorText[] = {1,1,1,1}; // Text and frame color
colorDisabled[] = {1,1,1,0.5}; // Disabled text color
colorSelect[] = {1,1,1,1}; // Text selection color


==example==
pictureColor[] = {1,0.5,0,1}; // Picture color
pictureColorSelect[] = {1,1,1,1}; // Selected picture color
pictureColorDisabled[] = {1,1,1,0.5}; // Disabled picture color


<code><nowiki>
tooltip = "CT_COMBO"; // Tooltip text
class RscCombo
tooltipColorShade[] = {0,0,0,1}; // Tooltip background color
{
tooltipColorText[] = {1,1,1,1}; // Tooltip text color
access = 0;
tooltipColorBox[] = {1,1,1,1}; // Tooltip frame color
type = CT_COMBO;
 
style = ST_LEFT;
arrowEmpty = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_ca.paa"; // Expand arrow
h = 0.05;
arrowFull = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_active_ca.paa"; // Collapse arrow
wholeHeight = 0.25;
 
colorSelect[] = {0.6,0.6,0.6,1};
wholeHeight = 5 * GUI_GRID_CENTER_H; // Maximum height of expanded box (including the control height)
colorText[] = {1,1,1,1};
maxHistoryDelay = 1; // Time since last keyboard type search to reset it
colorBackground[] = {0.2,0.2,0.2,1};
 
colorScrollbar[] = {1,1,1,1};
soundExpand[] = {"\A3\ui_f\data\sound\RscCombo\soundExpand",0.1,1}; // Sound played when the list is expanded
font = "TahomaB";
soundCollapse[] = {"\A3\ui_f\data\sound\RscCombo\soundCollapse",0.1,1}; // Sound played when the list is collapsed
sizeEx = 0.04;
soundSelect[] = {"\A3\ui_f\data\sound\RscCombo\soundSelect",0.1,1}; // Sound played when an item is selected
soundSelect[] = {"",0.1,1};
 
soundExpand[] = {"",0.1,1};
// Scrollbar configuration (applied only when LB_TEXTURES style is used)
soundCollapse[] = {"",0.1,1};
class ComboScrollBar
maxHistoryDelay = 1.0;
{
shadow = 0;
width = 0; // width of ComboScrollBar
class ComboScrollBar : ScrollBar
height = 0; // height of ComboScrollBar
{
scrollSpeed = 0.01; // scrollSpeed of ComboScrollBar
  color[] = {1,1,1,0.6};
 
  colorActive[] = {1,1,1,1};
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; // Arrow
  colorDisabled[] = {1,1,1,0.3};
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; // Arrow when clicked on
  thumb = "#(argb,8,8,3)color(1,1,1,1)";
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; // Slider background (stretched vertically)
  arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; // Dragging element (stretched vertically)
  arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
 
  border = "#(argb,8,8,3)color(1,1,1,1)";
color[] = {1,1,1,1}; // Scrollbar color
  shadow = 0;
};
};
 
};
onCanDestroy = "systemChat str ['onCanDestroy',_this]; true";
onDestroy = "systemChat str ['onDestroy',_this]; false";
onSetFocus = "systemChat str ['onSetFocus',_this]; false";
onKillFocus = "systemChat str ['onKillFocus',_this]; false";
onKeyDown = "systemChat str ['onKeyDown',_this]; false";
onKeyUp = "systemChat str ['onKeyUp',_this]; false";
onMouseButtonDown = "systemChat str ['onMouseButtonDown',_this]; false";
onMouseButtonUp = "systemChat str ['onMouseButtonUp',_this]; false";
onMouseButtonClick = "systemChat str ['onMouseButtonClick',_this]; false";
onMouseButtonDblClick = "systemChat str ['onMouseButtonDblClick',_this]; false";
onMouseZChanged = "systemChat str ['onMouseZChanged',_this]; false";
onMouseMoving = "";
onMouseHolding = "";


class dialog
onLBSelChanged = "systemChat str ['onLBSelChanged',_this]; false";
{
};
class controls
</nowiki></code>
{
  class Values: RscCombo
  {
  idc = 102;
  x = 0.3025;
  y = 0.14;
  w = 0.1375;
  h = 0.03;
  sizeEx = 0.025;
  rowHeight = 0.025;
  wholeHeight = 4 * 0.025; // 3 lines to display + 1 line of the unelapsed control
  };
};
};</nowiki></code>
[[Category: Dialogs]]
[[Category: Dialogs]]



Revision as of 17:02, 10 September 2014

CT_COMBO Type=4

TokenNames common to most controls, such as x,y,w,h,text,idc... are not listed here.

Properties
Name Type Remark
ArrowEmpty/Full texture
color* color color of the control surrounding lines.
colorActive color
colorDisabled color
colorScrollBar color
colorSelect color array color of selected text.
colorSelectBackground* color array background color of selected lines.
from number 1980
to number 2020
maxHistoryDelay float
rowHeight* float the height of a single row in the elapsed box.
soundSelect sound array Maybe the sound if an item is selected. don't work at this time
soundExpand sound array Maybe the sound if the box expand. don't work at this time
soundCollapse sound array Maybe the sound if the box collapse. don't work at this time
ComboScrollBar class see DialogControls-Sliders
wholeHeight float the height of the elapsed box.


example (A3 1.28 Template)

WuChaoRen lbSortByValue.png class _CT_COMBO { access = 0; // Control access (0 - ReadAndWrite, 1 - ReadAndCreate, 2 - ReadOnly, 3 - ReadOnlyVerified) idc = CT_COMBO; // Control identification (without it, the control won't be displayed) type = CT_COMBO; // Type is 4 style = ST_LEFT + LB_TEXTURES; // Style default = 0; // Control selected by default (only one within a display can be used) blinkingPeriod = 0; // Time in which control will fade out and back in. Use 0 to disable the effect. x = 1 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X; // Horizontal coordinates y = 9 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y; // Vertical coordinates w = 10 * GUI_GRID_CENTER_W; // Width h = 1 * GUI_GRID_CENTER_H; // Height colorBackground[] = {0.2,0.2,0.2,1}; // Fill color colorSelectBackground[] = {1,0.5,0,1}; // Selected item fill color sizeEx = GUI_GRID_CENTER_H; // Text size font = GUI_FONT_NORMAL; // Font from CfgFontFamilies shadow = 0; // Shadow (0 - none, 1 - N/A, 2 - black outline) colorText[] = {1,1,1,1}; // Text and frame color colorDisabled[] = {1,1,1,0.5}; // Disabled text color colorSelect[] = {1,1,1,1}; // Text selection color pictureColor[] = {1,0.5,0,1}; // Picture color pictureColorSelect[] = {1,1,1,1}; // Selected picture color pictureColorDisabled[] = {1,1,1,0.5}; // Disabled picture color tooltip = "CT_COMBO"; // Tooltip text tooltipColorShade[] = {0,0,0,1}; // Tooltip background color tooltipColorText[] = {1,1,1,1}; // Tooltip text color tooltipColorBox[] = {1,1,1,1}; // Tooltip frame color arrowEmpty = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_ca.paa"; // Expand arrow arrowFull = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_active_ca.paa"; // Collapse arrow wholeHeight = 5 * GUI_GRID_CENTER_H; // Maximum height of expanded box (including the control height) maxHistoryDelay = 1; // Time since last keyboard type search to reset it soundExpand[] = {"\A3\ui_f\data\sound\RscCombo\soundExpand",0.1,1}; // Sound played when the list is expanded soundCollapse[] = {"\A3\ui_f\data\sound\RscCombo\soundCollapse",0.1,1}; // Sound played when the list is collapsed soundSelect[] = {"\A3\ui_f\data\sound\RscCombo\soundSelect",0.1,1}; // Sound played when an item is selected // Scrollbar configuration (applied only when LB_TEXTURES style is used) class ComboScrollBar { width = 0; // width of ComboScrollBar height = 0; // height of ComboScrollBar scrollSpeed = 0.01; // scrollSpeed of ComboScrollBar arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; // Arrow arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; // Arrow when clicked on border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; // Slider background (stretched vertically) thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; // Dragging element (stretched vertically) color[] = {1,1,1,1}; // Scrollbar color }; onCanDestroy = "systemChat str ['onCanDestroy',_this]; true"; onDestroy = "systemChat str ['onDestroy',_this]; false"; onSetFocus = "systemChat str ['onSetFocus',_this]; false"; onKillFocus = "systemChat str ['onKillFocus',_this]; false"; onKeyDown = "systemChat str ['onKeyDown',_this]; false"; onKeyUp = "systemChat str ['onKeyUp',_this]; false"; onMouseButtonDown = "systemChat str ['onMouseButtonDown',_this]; false"; onMouseButtonUp = "systemChat str ['onMouseButtonUp',_this]; false"; onMouseButtonClick = "systemChat str ['onMouseButtonClick',_this]; false"; onMouseButtonDblClick = "systemChat str ['onMouseButtonDblClick',_this]; false"; onMouseZChanged = "systemChat str ['onMouseZChanged',_this]; false"; onMouseMoving = ""; onMouseHolding = ""; onLBSelChanged = "systemChat str ['onLBSelChanged',_this]; false"; };

Bottom Section