{"name":"CT XBUTTON","title":"CT XBUTTON","type":"topic","url":"https://community.bistudio.com/wiki/CT_XBUTTON","revid":170192,"updated":"2020-11-30T10:08:46Z","aliases":[],"markdown":"### Introduction\n\nAnother type of button. Seems like the only difference between other buttons is, that it has no animation when being clicked.\n\n#### Related commands & functions\n\n- Commands: General\n- Commands: UI Eventhandlers\n\n#### Related User Interface Eventhandlers\n\n- Events: General\n\n### Alphabetical Order\n\n> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [this](https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf) config crawler.\n\n```cpp\n#define CT_XBUTTON 41\n```\n\n#### C\n\n##### color\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolor[] = {1,1,1,1};\n```\n\n##### colorActive\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorActive[] = {1,1,1,1};\n```\n\n##### colorActive2\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorActive2[] = {1,1,1,1};\n```\n\n##### colorActiveBackground\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorActiveBackground[] = {1,0.5,0,1};\n```\n\n##### colorActiveBackground2\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorActiveBackground2[] = {0,0,0,1};\n```\n\n#### P\n\n##### period\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nperiod = 1;\n```\n\n#### S\n\n##### soundClick\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundClick[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundClick\",0.09,1};\n```\n\n##### soundEnter\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundEnter[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundEnter\",0.09,1};\n```\n\n##### soundEscape\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundEscape[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundEscape\",0.09,1};\n```\n\n##### soundPush\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundPush[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundPush\",0.09,1};\n```\n\n### Default Classes\n\n> [!NOTE]\n> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`\n>\n> ---\n>\n> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the import keyword).\n>\n> In older versions, use `\"Default\" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the description.ext.\n\nNone.\n\n### Other Examples\n\n```cpp\nclass _CT_XBUTTON\n{\n    access = 0;\n    idc = 41;\n    type = 41;\n    style = 0;\n    default = 0;\n    enable = 1;\n    show = 1;\n    fade = 0;\n    blinkingPeriod = 0;\n    x = 12 * GUI_GRID_W + GUI_GRID_CENTER_X\";\n    y = 15 * GUI_GRID_H + GUI_GRID_CENTER_Y;\n    w = 10 * GUI_GRID_W;\n    h = 1 * GUI_GRID_H;\n    colorBackground[] = {0,0,0,0};\n    colorActiveBackground[] = {1,0.5,0,1};\n    colorActiveBackground2[] = {0,0,0,1};\n    colorDisabled[] = {0,1,1,1};\n    text = \"CT_XBUTTON\";\n    size = GUI_GRID_H;\n    font = \"RobotoCondensed\";\n    shadow = 0;\n    color[] = {1,1,1,1};\n    colorActive[] = {1,1,1,1};\n    colorActive2[] = {1,1,1,1};\n    tooltip = \"CT_XBUTTON\";\n    tooltipColorShade[] = {0,0,0,1};\n    tooltipColorText[] = {1,1,1,1};\n    tooltipColorBox[] = {1,1,1,1};\n    period = 1;\n    soundClick[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundClick\",0.09,1};\n    soundEnter[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundEnter\",0.09,1};\n    soundPush[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundPush\",0.09,1};\n    soundEscape[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundEscape\",0.09,1};\n    onCanDestroy = \"diag_log ['Log: onCanDestroy',ctrlClassname (_this select 0),_this]; true\";\n    onDestroy = \"diag_log ['Log: onDestroy',ctrlClassname (_this select 0),_this]; false\";\n    onMouseEnter = \"diag_log ['Log: onMouseEnter',ctrlClassname (_this select 0),_this]; false\";\n    onMouseExit = \"diag_log ['Log: onMouseExit',ctrlClassname (_this select 0),_this]; false\";\n    onSetFocus = \"diag_log ['Log: onSetFocus',ctrlClassname (_this select 0),_this]; false\";\n    onKillFocus = \"diag_log ['Log: onKillFocus',ctrlClassname (_this select 0),_this]; false\";\n    onKeyDown = \"diag_log ['Log: onKeyDown',ctrlClassname (_this select 0),_this]; false\";\n    onKeyUp = \"diag_log ['Log: onKeyUp',ctrlClassname (_this select 0),_this]; false\";\n    onMouseButtonDown = \"diag_log ['Log: onMouseButtonDown',ctrlClassname (_this select 0),_this]; false\";\n    onMouseButtonUp = \"diag_log ['Log: onMouseButtonUp',ctrlClassname (_this select 0),_this]; false\";\n    onMouseButtonClick = \"diag_log ['Log: onMouseButtonClick',ctrlClassname (_this select 0),_this]; false\";\n    onMouseButtonDblClick = \"diag_log ['Log: onMouseButtonDblClick',ctrlClassname (_this select 0),_this]; false\";\n    onMouseZChanged = \"diag_log ['Log: onMouseZChanged',ctrlClassname (_this select 0),_this]; false\";\n    onMouseMoving = \"\";\n    onMouseHolding = \"\";\n    onButtonClick = \"diag_log ['Log: onButtonClick',ctrlClassname (_this select 0),_this]; false\";\n    onButtonDown = \"diag_log ['Log: onButtonDown',ctrlClassname (_this select 0),_this]; false\";\n    onButtonUp = \"diag_log ['Log: onButtonUp',ctrlClassname (_this select 0),_this]; false\";\n};\n```","sections":[{"heading":"Introduction","level":3,"markdown":"Another type of button. Seems like the only difference between other buttons is, that it has no animation when being clicked."},{"heading":"Related commands & functions","level":4,"markdown":"- Commands: General\n- Commands: UI Eventhandlers"},{"heading":"Related User Interface Eventhandlers","level":4,"markdown":"- Events: General"},{"heading":"Alphabetical Order","level":3,"markdown":"> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [this](https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf) config crawler.\n\n```cpp\n#define CT_XBUTTON 41\n```"},{"heading":"C","level":4,"markdown":""},{"heading":"color","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolor[] = {1,1,1,1};\n```"},{"heading":"colorActive","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorActive[] = {1,1,1,1};\n```"},{"heading":"colorActive2","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorActive2[] = {1,1,1,1};\n```"},{"heading":"colorActiveBackground","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorActiveBackground[] = {1,0.5,0,1};\n```"},{"heading":"colorActiveBackground2","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorActiveBackground2[] = {0,0,0,1};\n```"},{"heading":"P","level":4,"markdown":""},{"heading":"period","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nperiod = 1;\n```"},{"heading":"S","level":4,"markdown":""},{"heading":"soundClick","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundClick[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundClick\",0.09,1};\n```"},{"heading":"soundEnter","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundEnter[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundEnter\",0.09,1};\n```"},{"heading":"soundEscape","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundEscape[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundEscape\",0.09,1};\n```"},{"heading":"soundPush","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundPush[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundPush\",0.09,1};\n```"},{"heading":"Default Classes","level":3,"markdown":"> [!NOTE]\n> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`\n>\n> ---\n>\n> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the import keyword).\n>\n> In older versions, use `\"Default\" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the description.ext.\n\nNone."},{"heading":"Other Examples","level":3,"markdown":"```cpp\nclass _CT_XBUTTON\n{\n    access = 0;\n    idc = 41;\n    type = 41;\n    style = 0;\n    default = 0;\n    enable = 1;\n    show = 1;\n    fade = 0;\n    blinkingPeriod = 0;\n    x = 12 * GUI_GRID_W + GUI_GRID_CENTER_X\";\n    y = 15 * GUI_GRID_H + GUI_GRID_CENTER_Y;\n    w = 10 * GUI_GRID_W;\n    h = 1 * GUI_GRID_H;\n    colorBackground[] = {0,0,0,0};\n    colorActiveBackground[] = {1,0.5,0,1};\n    colorActiveBackground2[] = {0,0,0,1};\n    colorDisabled[] = {0,1,1,1};\n    text = \"CT_XBUTTON\";\n    size = GUI_GRID_H;\n    font = \"RobotoCondensed\";\n    shadow = 0;\n    color[] = {1,1,1,1};\n    colorActive[] = {1,1,1,1};\n    colorActive2[] = {1,1,1,1};\n    tooltip = \"CT_XBUTTON\";\n    tooltipColorShade[] = {0,0,0,1};\n    tooltipColorText[] = {1,1,1,1};\n    tooltipColorBox[] = {1,1,1,1};\n    period = 1;\n    soundClick[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundClick\",0.09,1};\n    soundEnter[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundEnter\",0.09,1};\n    soundPush[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundPush\",0.09,1};\n    soundEscape[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundEscape\",0.09,1};\n    onCanDestroy = \"diag_log ['Log: onCanDestroy',ctrlClassname (_this select 0),_this]; true\";\n    onDestroy = \"diag_log ['Log: onDestroy',ctrlClassname (_this select 0),_this]; false\";\n    onMouseEnter = \"diag_log ['Log: onMouseEnter',ctrlClassname (_this select 0),_this]; false\";\n    onMouseExit = \"diag_log ['Log: onMouseExit',ctrlClassname (_this select 0),_this]; false\";\n    onSetFocus = \"diag_log ['Log: onSetFocus',ctrlClassname (_this select 0),_this]; false\";\n    onKillFocus = \"diag_log ['Log: onKillFocus',ctrlClassname (_this select 0),_this]; false\";\n    onKeyDown = \"diag_log ['Log: onKeyDown',ctrlClassname (_this select 0),_this]; false\";\n    onKeyUp = \"diag_log ['Log: onKeyUp',ctrlClassname (_this select 0),_this]; false\";\n    onMouseButtonDown = \"diag_log ['Log: onMouseButtonDown',ctrlClassname (_this select 0),_this]; false\";\n    onMouseButtonUp = \"diag_log ['Log: onMouseButtonUp',ctrlClassname (_this select 0),_this]; false\";\n    onMouseButtonClick = \"diag_log ['Log: onMouseButtonClick',ctrlClassname (_this select 0),_this]; false\";\n    onMouseButtonDblClick = \"diag_log ['Log: onMouseButtonDblClick',ctrlClassname (_this select 0),_this]; false\";\n    onMouseZChanged = \"diag_log ['Log: onMouseZChanged',ctrlClassname (_this select 0),_this]; false\";\n    onMouseMoving = \"\";\n    onMouseHolding = \"\";\n    onButtonClick = \"diag_log ['Log: onButtonClick',ctrlClassname (_this select 0),_this]; false\";\n    onButtonDown = \"diag_log ['Log: onButtonDown',ctrlClassname (_this select 0),_this]; false\";\n    onButtonUp = \"diag_log ['Log: onButtonUp',ctrlClassname (_this select 0),_this]; false\";\n};\n```"}],"categories":["Control Types"],"groups":["GUI"]}