{"name":"Arma: GUI Configuration","title":"Arma: GUI Configuration","type":"topic","url":"https://community.bistudio.com/wiki/Arma:_GUI_Configuration","revid":376702,"updated":"2025-11-08T12:23:20Z","aliases":["Dialog Control","Dialogs"],"markdown":"Dialogs are one way to provide custom graphical user interface in your missions and allow interaction with the player as well as they are able to run code. They are defined as classes in the missionConfigFile (description.ext), campaignConfigFile (Campaign Description.ext) or configFile (config.cpp).\n\n#### Terminology\n\n**GUI:** Graphical User Interface - Allows user interaction with the software through graphical controls like buttons, lists and so on.\n\n**UI:** User Interface - Allows the user to interact with the software through a console application.\n\n**IGUI:** Integrated Graphical User Interface - A term usually encountered when talking about vanilla menus in Arma 3.\n\n### User Interface Types\n\n**Additional Information:** GUI Tutorial - createDialog vs createDisplay vs cutRsc\n\n#### Dialog\n\n- Can be created on top of an existing display. The parent display will be hidden.\n- Player movement is blocked by dialogs.\n- Every dialog is a display, but not every display is a dialog.\n- **Commands:** createDialog, closeDialog, dialog, allControls, allDisplays\n\n#### Display\n\n- Can be created on top of an existing display. The parent display will be hidden.\n- Player movement is not blocked by displays (unless it is blocked by the parent display).\n- **Commands:** createDisplay, closeDisplay, allControls, allDisplays\n\n#### HUD\n\n- Can be created in a new or in an already existing layer. The user can not interact with it. Usually used to show information, like stamina, ammunition and so on.\n- **Commands:** allCutLayers, titleRsc, cutText, cutObj, cutFadeOut, setTitleEffect, allActiveTitleEffects\n\n> [!NOTE]\n> Some of these commands have different effects. See the command documentation for detailed information.\n\n### Display and Dialog\n\nDisplays and dialogs are defined in the config file. They are usually used to simplify user interactions, through controls like buttons, list boxes and so on.\n\n#### Properties\n\n| Name | Type | Remark |\n|---|---|---|\n| **idd** | Integer | The unique ID number of this dialog. Used with findDisplay to find the display. Can be -1 if no access is required from within a script. |\n| **access** | Integer | - 0 - ReadAndWrite - this is the default case where properties can still be added or overridden.<br>- 1 - ReadAndCreate - this only allows creating new properties.<br>- 2 - ReadOnly - this does not allow to do anything in deriving classes.<br>- 3 - ReadOnlyVerified - this does not allow to do anything either in deriving classes, and a CRC check will be performed. |\n| **movingEnable** | Boolean | Specifies whether the dialog can be moved or not (if enabled one of the dialogs controls should have the *moving* property set to 1 so it becomes the \"handle\" the dialog can be moved with). Doesn't seem to matter in Arma 3 |\n| **enableSimulation** | Boolean | Specifies whether the game continues while the dialog is shown or not. |\n| **onLoad** | String | Expression executed when the dialog is opened. See User Interface Event Handlers |\n| **onUnload** | String | Expression executed when the dialog is closed. See User Interface Event Handlers |\n| **controlsBackground** | Array or class | Contains class names of all background controls associated to this dialog.<br>The sequence in which the controls are listed will decide their z-index (i.e. the last ones will on top of the first ones). |\n| **controls** | Array or class | Contains class names of all foreground controls associated to this dialog. |\n| **objects** | Array or class | List of all DialogControls-Objects type controls |\n\n#### Example Config\n\n```cpp\nclass DefaultDialog\n{\n    idd = -1;\n    access = 0;\n    movingEnable = true;\n    onLoad = \"hint str _this\";\n    onUnload  = \"hint str _this\";\n    enableSimulation = false;\n    class ControlsBackground\n    {\n        //Background controls\n    };\n    class Controls\n    {\n        //Controls\n    };\n    class Objects\n    {\n        //Objects\n    };\n};\n```\n\n#### Opening a display or dialog\n\nThere are two ways of creating a display or dialog. One can either use createDialog or createDisplay command.\n\n#### Closing a display or dialog\n\nThere are several ways to close a dialog:\n\n- Pressing <kbd>Esc</kbd>\n- Clicking a button with IDC 0, 1 or 2\n- closeDialog\n- closeDisplay\n\n##### Exit Codes\n\nExit codes are a way to determine in what way a display was closed. The onUnload UIEH has the exit code as one of its parameters. This way you can handle different user decisions, eg. save a value if the user confirms it or discard changes when the user pressed a cancel button. Macros for the different exit codes can be found in `\\a3\\ui_f\\hpp\\defineResincl.inc`:\n\n```cpp\n// Predefined controls\n#define IDC_OK                1\n#define IDC_CANCEL            2\n#define IDC_AUTOCANCEL        3\n#define IDC_ABORT            4\n#define IDC_RESTART            5\n#define IDC_USER_BUTTON        6\n#define IDC_EXIT_TO_MAIN    7\n```\n\n| Exit Code | Macro | Comment |\n|---|---|---|\n| 1 | IDC_OK | Dialog was closed with a positive outcome |\n| 2 | IDC_CANCEL | Dialog was closed with a negative outcome |\n| 3 | IDC_AUTOCANCEL | ? |\n| 4 | IDC_ABORT | When used on the mission display (Display #46) it simulates \"Save and Exit\" button from escape menu |\n| 5 | IDC_RESTART | ? |\n| 6 | IDC_USER_BUTTON | ? |\n| 7 | IDC_EXIT_TO_MAIN | ? |\n\n### HUDs\n\nHUDs are defined in the class RscTitles, unlike displays or dialogs which are root classes in the config file. Additionally, their properties are different.\n\n#### Properties\n\n| Name | Type | Remark |\n|---|---|---|\n| **idd** | Integer | The unique ID number of this HUD. Used with findDisplay to find the display. Can be -1 if no access is required from within a script. |\n| **fadeIn** | Integer | Duration of fade in effect when opening in seconds. |\n| **fadeOut** | Integer | Duration of fade out effect when closing in seconds. |\n| **duration** | Integer | Duration the HUD is displayed after opening in seconds. Use a very large number to have it always open. |\n| **onLoad** | String | Expression executed when the dialog is opened. See User Interface Event Handlers |\n| **onUnload** | String | Expression executed when the dialog is closed. See User Interface Event Handlers |\n| **controls** | Array | Contains class names of all foreground controls associated to this dialog. |\n\n#### Example Config\n\n```cpp\n#include \"\\a3\\ui_f\\hpp\\definecommongrids.inc\"\n\nclass RscTitles\n{\n    class RscInfoText\n    {\n        idd = 3100;\n        fadein = 0;\n        fadeout = 0;\n        duration = 1e+011;\n        onLoad = \"uinamespace setVariable ['BIS_InfoText',_this select 0]\";\n        onUnLoad = \"uinamespace setVariable ['BIS_InfoText', nil]\";\n        class Controls\n        {\n            class InfoText\n            {\n                idc = 3101;\n                style = \"0x01 + 0x10 + 0x200 + 0x100\";\n                font = \"RobotoCondensedBold\";\n                x = \"(profileNamespace getVariable [\"\"IGUI_GRID_MISSION_X\"\", (safezoneX + safezoneW - 21 * (GUI_GRID_WAbs / 40))])\";\n                y = \"(profileNamespace getVariable [\"\"IGUI_GRID_MISSION_Y\"\", (safezoneY + safezoneH - 10.5 * (GUI_GRID_HAbs / 25))])\";\n                w = \"20 * (GUI_GRID_WAbs / 40)\";\n                h = \"5 * ((GUI_GRID_WAbs / 1.2) / 25)\";\n                colorText[] = {1,1,1,1};\n                colorBackground[] = {0,0,0,0};\n                text = \"\";\n                lineSpacing = 1;\n                sizeEx = 0.045;\n                fixedWidth = 1;\n                deletable = 0;\n                fade = 0;\n                access = 0;\n                type = 0;\n                shadow = 1;\n                colorShadow[] = {0,0,0,0.5};\n                tooltipColorText[] = {1,1,1,1};\n                tooltipColorBox[] = {1,1,1,1};\n                tooltipColorShade[] = {0,0,0,0.65};\n            };\n        };\n    };\n};\n```\n\n### Controls\n\nControls are used to allow the player to interact with the GUI. Controls range from simple rectangles to 3D objects.\nLike dialogs, displays and HUDs, controls can have a unique ID to access them from within scripts. The classname of controls have to be unique.\n\nWhat properties a control needs is defined by its *type* property. However most controls share a set of properties described in the following sections.\nFor control specific properties visit the corresponding pages.\n\n#### Common Properties\n\n| Name | Type | Remark |\n|---|---|---|\n| **idc** | Integer | The unique ID number of this control. Can be -1 if you don't require access to the control itself from within a script.<br>Special (button) IDCs (according to \\a3\\ui_f\\hpp\\defineResincl.inc):<br>- 1: OK (closes display when clicked upon, raises exit code 1 in the onUnload UIEH)<br>- 2: Cancel (closes display when clicked upon, raises exit code 2 in the onUnload UIEH)<br>- 3: Auto cancel<br>- 4: Abort<br>- 5: Restart<br>- 6: User button<br>- 7: Exit to main<br>While the purposes of idcs 3 to 7 remain unknown, it is advisable to give all of your controls larger numbers, eg. 100. |\n| **moving** | Boolean | Whether the dialog will be moved if this control is dragged (may require \"movingEnable\" to be 1 in the dialog. In Arma 3 works regardless). Another way of allowing moving of the dialog is to have control of style ST_TITLE_BAR |\n| **type** | Integer | See Control Types |\n| **style** | Integer | See Control Styles. `style = \"0x400+0x02+0x10\";` |\n| **x/y/w/h** | Number | The position and size of the control in fractions of screen size. |\n| **sizeEx** | Number | The font size of text in fractions of screen size. Behaves similar to **h** property. For some controls it is named **size**. |\n| **font** | String | The font to use. See the list of available fonts for possible values. |\n| **colorText** | Array | Text color |\n| **colorBackground** | Array | Background color |\n| **text** | String | The text **or picture** to display. |\n| **shadow** | Integer | Can be applied to most controls (0 = no shadow, 1 = drop shadow with soft edges, 2 = stroke). |\n| **tooltip** | String | Text to display in a tooltip when control is moused over. A tooltip can be added to any control type except CT_STATIC and CT_STRUCTURED_TEXT. Note: As of Arma 3 v1.48, most controls now support tooltips. A linebreak can be created by adding **\\n**. |\n| **tooltipColorShade** | Array | Tooltip background color |\n| **tooltipColorText** | Array | Tooltip text color |\n| **tooltipColorBox** | Array | Tooltip border color |\n| **autocomplete** | String | (where applicable) Option for entry fields (e.g. RscEdit) to activate autocompletion. For known script commands and functions use autocomplete = \"scripting\". |\n| **url** | String | (where applicable) URL which will be opened when clicking on the control. Used on e.g. a button control. Does not utilize the Steam Overlay browser if enabled by default, opens the link in the default browser set by the OS. |\n| **overlayMode** | Number | Arma 3 v2.10 (where applicable) 0 - opens URL in default browser; 1 - opens URL in Steam overlay id enabled, otherwise in default browser; 2 - opens URL in Steam overlay, shows error message box (with button to use default browser) if Steam overlay is disabled. |\n\nA property to enable or disable a control does not exist (because of implementation issues). However, there is a simple workaround based on the onLoad UI Event Handler that can be used to disable a control in the config:\n\n```cpp\nonLoad = \"(_this # 0) ctrlEnable false;\";\n```\n\n#### Attributes Class\n\n| Name | Type | Remark |\n|---|---|---|\n| **font** | String | Available Fonts |\n| **color** | HTML color | [HTML Color Codes](https://html-color-codes.info/) |\n| **align** | String | \"center\", \"left\", \"right\" |\n| **shadow** | Integer | 0 = no shadow, 1 = drop shadow with soft edges, 2 = stroke |\n\n#### AttributesImage Class\n\n| Name | Type | Remark |\n|---|---|---|\n| **font** | String | Available Fonts (Optional) |\n| **color** | HTML color | [HTML Color Codes](https://html-color-codes.info/) |\n| **align** | String | \"center\", \"left\", \"Right\" (optional) |\n\n#### Example Config\n\n```cpp\n#include \"\\a3\\ui_f\\hpp\\definecommongrids.inc\"\n\nclass RscButton\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = 1;\n    text = \"\";\n    colorText[] = {1,1,1,1};\n    colorDisabled[] = {1,1,1,0.25};\n    colorBackground[] = {0,0,0,0.5};\n    colorBackgroundDisabled[] = {0,0,0,0.5};\n    colorBackgroundActive[] = {0,0,0,1};\n    colorFocused[] = {0,0,0,1};\n    colorShadow[] = {0,0,0,0};\n    colorBorder[] = {0,0,0,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    soundClick[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundClick\",0.09,1};\n    soundEscape[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundEscape\",0.09,1};\n    idc = -1;\n    style = 2;\n    x = 0;\n    y = 0;\n    w = 0.095589;\n    h = 0.039216;\n    shadow = 2;\n    font = \"RobotoCondensed\";\n    sizeEx = \"GUI_GRID_HAbs / 25\";\n    url = \"\";\n    offsetX = 0;\n    offsetY = 0;\n    offsetPressedX = 0;\n    offsetPressedY = 0;\n    borderSize = 0;\n};\n```\n\n### Control Types\n\nThe type property of controls defines what type of control they are. For example an edit box has the type 2.\nThere is an ingame dialog with examples of how the control types look and act like:\n\n```sqf\ncreateDialog \"RscTestControlTypes\";\n```\n\n#### Control Type Definitions\n\nAll definitions can be retrieved with `\"Default\" call BIS_fnc_exportGUIBaseClasses;`.\n\n```cpp\n#define CT_STATIC                  0\n#define CT_BUTTON                  1\n#define CT_EDIT                      2\n#define CT_SLIDER                  3\n#define CT_COMBO                  4\n#define CT_LISTBOX                  5\n#define CT_TOOLBOX                  6\n#define CT_CHECKBOXES              7\n#define CT_PROGRESS                  8\n#define CT_HTML                      9\n#define CT_STATIC_SKEW             10\n#define CT_ACTIVETEXT             11\n#define CT_TREE                     12\n#define CT_STRUCTURED_TEXT         13\n#define CT_CONTEXT_MENU             14\n#define CT_CONTROLS_GROUP         15\n#define CT_SHORTCUTBUTTON         16\n#define CT_HITZONES                 17\n#define CT_VEHICLETOGGLES         18\n#define CT_CONTROLS_TABLE         19\n#define CT_XKEYDESC                 40\n#define CT_XBUTTON                 41\n#define CT_XLISTBOX                 42\n#define CT_XSLIDER                 43\n#define CT_XCOMBO                 44\n#define CT_ANIMATED_TEXTURE         45\n#define CT_MENU                     46\n#define CT_MENU_STRIP             47\n#define CT_CHECKBOX                 77\n#define CT_OBJECT                 80\n#define CT_OBJECT_ZOOM             81\n#define CT_OBJECT_CONTAINER         82\n#define CT_OBJECT_CONT_ANIM         83\n#define CT_LINEBREAK             98\n#define CT_USER                     99\n#define CT_MAP                    100\n#define CT_MAP_MAIN                101\n#define CT_LISTNBOX                102\n#define CT_ITEMSLOT                103\n#define CT_LISTNBOX_CHECKABLE    104\n#define CT_VEHICLE_DIRECTION    105\n```\n\n### Control Styles\n\nTo further customize controls there are several different styles for each control type available.\n\nTo get an idea of how the styles look like you can create the following dialog:\n\n```sqf\ncreateDialog \"RscTestControlStyles\";\n```\n\n> [!IMPORTANT]\n> Note that drawing of vertical text is not supported and any attempt to use `ST_UP`, `ST_DOWN`, `ST_VCENTER` is likely to result in the following *.rpt* spam:\n> `Obsolete, sizeH and sizeW calculation missing`\n> In addition, `ST_UP`, `ST_DOWN`, `ST_VCENTER` are stand alone styles and should not be mixed with any other styles\n\n| Define | Decimal | Hexadecimal | Remark |\n|---|---|---|---|\n| ST_LEFT | 0 | 0x00 | Default, text left aligned |\n| ST_RIGHT | 1 | 0x01 | Modifier, adding this to another style will force text to be aligned to the right |\n| ST_CENTER | 2 | 0x02 | Modifier, adding this to another style will force text to be centered |\n| ST_DOWN | 4 | 0x04 | Vertical text alignment (See the note above) |\n| ST_UP | 8 | 0x08 | Vertical text alignment (See the note above) |\n| ST_VCENTER | 12 | 0x0C | Vertical text alignment, same as ST_DOWN + ST_UP (See the note above) |\n| ST_SINGLE | 0 | 0x00 | Plain single line box without a border |\n| ST_MULTI | 16 | 0x10 | Plain multiple line box with a slight border. To remove border add 512 (+ ST_NO_RECT) to the style (style 528, 529 and 530 are therefore border-less). Additional parameter *lineSpacing* is required for this style. *lineSpacing* = 1; is normal line spacing. Any **\\n** character in the text string will be interpreted as new line. |\n| ST_TITLE_BAR | 32 | 0x20 | Plain single line box with semi-transparent background and somewhat embossed border. When this style is used, the dialog containing control becomes draggable by this control |\n| ST_PICTURE | 48 | 0x30 | Border-less picture box. Text string is treated as a path to a texture. Alignment has no effect. The texture is stretched to fit the box by default. To force original aspect ratio add 2048 (+ ST_KEEP_ASPECT_RATIO) to the style. Background is ignored, *colorText* controls texture colour and opacity |\n| ST_FRAME | 64 | 0x40 | Legend like frame without background with text showing over the frame edge. Alignment has no effect. *colorText* defines both text and frame colour |\n| ST_BACKGROUND | 80 | 0x50 | Single line box with always black opaque background and thick raised beveled border |\n| ST_GROUP_BOX | 96 | 0x60 | Single line box with delicate semi-transparent background and slight border. Only text colour can be controlled |\n| ST_GROUP_BOX2 | 112 | 0x70 | Plain single line box, same as ST_SINGLE, only with a slight border similar to ST_MULTI box border |\n| ST_HUD_BACKGROUND | 128 | 0x80 | Sets special texture for corners. It was used for rounded corners in OFP, ArmA and Arma 2. In Arma 3, square corners are used everywhere, so the texture is adapted to the unified style, but the technology is not removed. In Arma 3 it looks the same as normal ST_SINGLE. Corner textures are defined in `configFile >> \"CfgInGameUI\" >> \"imageCornerElement\"` (can be set only globally for the whole game, not per control) |\n| ST_TILE_PICTURE | 144 | 0x90 | The picture is tiled according to *tileH* and *tileW* values. To force tiled picture to keep aspect ratio of original image, add 2048 (+ ST_KEEP_ASPECT_RATIO) to the style. |\n| ST_WITH_RECT | 160 | 0xA0 | Single line box frame, similar to ST_FRAME box. The text however is displayed inside the frame. Frame and text colour are set with *colorText* |\n| ST_LINE | 176 | 0xB0 | Diagonal line going from left top corner to bottom right corner. To control line direction, width *w* and height *h* parameters of the box could be negative. Line and text colour are set with *colorText* |\n| ST_UPPERCASE | 192 | 0xC0 | Forces control text to upper case |\n| ST_LOWERCASE | 208 | 0xD0 | Forces control text to lower case |\n| ST_ADDITIONAL_INFO | 3840 | 0x0F00 | ST_SHADOW + ST_NO_RECT + SL_HORZ + ST_KEEP_ASPECT_RATIO |\n| ST_SHADOW | 256 | 0x0100 |  |\n| ST_NO_RECT | 512 | 0x0200 | This style works for CT_STATIC in conjunction with ST_MULTI |\n| ST_KEEP_ASPECT_RATIO | 2048 | 0x0800 | When used with image or texture, stops it from stretching to fit the control |\n| ST_TITLE | 34 | 0x22 | ST_TITLE_BAR + ST_CENTER |\n\n#### Control Specific Styles\n\n##### CT_LISTBOX Specific Styles\n\n| Define | Decimal | Hexadecimal | Remark |\n|---|---|---|---|\n| LB_TEXTURES | 16 | 0x10 |  |\n| LB_MULTI | 32 | 0x20 | Makes CT_LISTBOX multi-selectable |\n\n##### CT_PROGRESS Specific Styles\n\n| Define | Decimal | Hexadecimal |\n|---|---|---|\n| ST_VERTICAL | 1 | 0x01 |\n| ST_HORIZONTAL | 0 | 0x00 |\n\n##### CT_SLIDER Specific Styles\n\n| Define | Decimal | Hexadecimal |\n|---|---|---|\n| SL_VERT | 0 | 0x00 |\n| SL_HORZ | 1024 | 0x0400 |\n| SL_TEXTURES | 16 | 0x10 |\n\n##### CT_TREE Specific Styles\n\n| Define | Decimal | Hexadecimal | Remark |\n|---|---|---|---|\n| TR_SHOWROOT | 1 | 0x01 | When this style is applied, all entries even with path [] can be collapsed. Use unkown. |\n| TR_AUTOCOLLAPSE | 2 | 0x02 | Use unknown |\n\n#### Control Style Definitions\n\nAll definitions can be retrieved with `\"Default\" call BIS_fnc_exportGUIBaseClasses;`.\n\n```cpp\n#define ST_LEFT                    0x00\n#define ST_RIGHT                0x01\n#define ST_CENTER                0x02\n#define ST_DOWN                    0x04\n#define ST_UP                    0x08\n#define ST_VCENTER                0x0C\n#define ST_SINGLE                0x00\n#define ST_MULTI                0x10\n#define ST_TITLE_BAR            0x20\n#define ST_PICTURE                0x30\n#define ST_FRAME                0x40\n#define ST_BACKGROUND            0x50\n#define ST_GROUP_BOX            0x60\n#define ST_GROUP_BOX2            0x70\n#define ST_HUD_BACKGROUND        0x80\n#define ST_TILE_PICTURE            0x90\n#define ST_WITH_RECT            0xA0\n#define ST_LINE                    0xB0\n#define ST_UPPERCASE            0xC0\n#define ST_LOWERCASE            0xD0\n#define ST_ADDITIONAL_INFO        0x0F00\n#define ST_SHADOW                0x0100\n#define ST_NO_RECT                0x0200\n#define ST_KEEP_ASPECT_RATIO    0x0800\n#define ST_TITLE                ST_TITLE_BAR + ST_CENTER\n#define SL_VERT                    0\n#define SL_HORZ                    0x400\n#define SL_TEXTURES                0x10\n#define ST_VERTICAL                0x01\n#define ST_HORIZONTAL            0\n#define LB_TEXTURES                0x10\n#define LB_MULTI                0x20\n#define TR_SHOWROOT                1\n#define TR_AUTOCOLLAPSE            2\n```\n\n### Positioning\n\nA detailed description of how you can achieve proper GUI placement can be found on the Arma 3: GUI Coordinates page.\n\n### Inheritance\n\nUsing inheritance can reduce your dialog class definitions significantly by standardising common attributes in base classes and just changing unique attributes in derived classes. There is no need to re-declare all attributes for every class definition.\n\n> [!NOTE]\n> Using inheritance can make your GUI config hard to read for others.\n\nView the dedicated inheritance page for more information.\n\n### Preprocessor instructions\n\nNote that you can also add your own preprocessor instructions for commonly used data, eg. for colors, to save yourself the hassle of writing it in several different places and then adapt each of them if you want to change them afterwards (especially if class inheritance is not applicable). It can also make your code more readable sometimes.\n\n#### Example Config\n\n```cpp\n#define COLOR_HALF_BLACK { 0, 0, 0, 0.5 }\n\nclass MyDialog\n{\n    idd = -1;\n    movingEnable = 1;\n    objects[] = {};\n    controlsBackground[] = { MyDialogBackground };\n\n    class MyDialogBackground : RscText\n    {\n        colorBackground[] = COLOR_HALF_BLACK;\n        x = 0.7;  y = 0.1;\n        w = 0.25; h = 0.15;\n    };\n};\n```\n\n#### Useful includes\n\nArma 3 offers a wide range of useful files which can be included to get access to some helpful macros.\n\n| Include Code | Description / Content |\n|---|---|\n| `#include \"\\a3\\3DEN\\UI\\macros.inc\"` | Defines for Eden Editor like colors, text sizes custom pixel grid macros. |\n| `#include \"\\a3\\3DEN\\UI\\macroexecs.inc\"` | Defines for Eden Editor to calculate text sizes etc. |\n| `#include \"\\a3\\ui_f\\hpp\\definedikcodes.inc\"` | Useful when working with custom shortcuts. Contains defines for key codes. |\n| `#include \"\\a3\\ui_f\\hpp\\definecommoncolors.inc\"` | Colors used in Arma 3, like background color set by the user. |\n| `#include \"\\a3\\ui_f\\hpp\\definecommongrids.inc\"` | UI grids such as GUI_GRID and all its variants. |\n| `#include \"\\a3\\ui_f\\hpp\\defineresincl.inc\"` | IDCs and IDDs of many Arma 3 UIs. |\n\n### User Interface Event Handlers\n\nUser Interface Event Handlers are a key component of any Arma 3 GUI. See User Interface Event Handlers.\n\n### Scripting\n\nThere are several functions and commands to edit your dialog after its creation. These functions and commands can be found here:\n\n- GUI Functions\n- GUI Commands\n\n### Native Arma 3 GUIs\n\nArma 3 comes with a wide varity of various displays and dialogs. They can be found in:\n\n- configFile usually with names like **Rsc**SomeDisplayName or **Display**SomeDisplayName\n\nAdditonally, Arma 3 offers some customizeable GUIs which can be accessed by scripts.\n\n- BIS_fnc_3DENShowMessage\n- BIS_fnc_guiMessage\n- BIS_fnc_GUIhint\n- hint, hintSilent, hintC\n\n### GUI References\n\nIt is sometimes a good idea so see how others created their GUIs. Here is a list of a few resources:\n\n- [Terra's Editing Extensions](https://github.com/7erra/-Terra-s-Editing-Extensions/tree/master/TER_editing/gui)\n- [A3ExtendedFunctionViewer](https://github.com/ConnorAU/A3ExtendedFunctionViewer)\n- [A3UserInputMenus](https://github.com/ConnorAU/A3UserInputMenus)\n- [A3ColorPicker](https://github.com/ConnorAU/A3ColorPicker)\n- [3den Enhanced](https://github.com/R3voA3/3den-Enhanced/tree/master/3denEnhanced/GUI)\n\n### Tips for creating GUIs\n\n- Functionality\n- Layout\n- Style\n- Behaviour\n- Customizability\n\n### Tutorials\n\n- GUI Tutorial\n\n### See Also\n\n- Arma 3: IDD List\n- Arma 3: User Interface Editor\n- Arma 3: GUI Coordinates\n- GUI Functions\n- GUI Commands\n- User Interface Event Handlers\n- Class Inheritance\n- PreProcessor Commands","sections":[{"heading":null,"level":1,"markdown":"Dialogs are one way to provide custom graphical user interface in your missions and allow interaction with the player as well as they are able to run code. They are defined as classes in the missionConfigFile (description.ext), campaignConfigFile (Campaign Description.ext) or configFile (config.cpp)."},{"heading":"Terminology","level":4,"markdown":"**GUI:** Graphical User Interface - Allows user interaction with the software through graphical controls like buttons, lists and so on.\n\n**UI:** User Interface - Allows the user to interact with the software through a console application.\n\n**IGUI:** Integrated Graphical User Interface - A term usually encountered when talking about vanilla menus in Arma 3."},{"heading":"User Interface Types","level":3,"markdown":"**Additional Information:** GUI Tutorial - createDialog vs createDisplay vs cutRsc"},{"heading":"Dialog","level":4,"markdown":"- Can be created on top of an existing display. The parent display will be hidden.\n- Player movement is blocked by dialogs.\n- Every dialog is a display, but not every display is a dialog.\n- **Commands:** createDialog, closeDialog, dialog, allControls, allDisplays"},{"heading":"Display","level":4,"markdown":"- Can be created on top of an existing display. The parent display will be hidden.\n- Player movement is not blocked by displays (unless it is blocked by the parent display).\n- **Commands:** createDisplay, closeDisplay, allControls, allDisplays"},{"heading":"HUD","level":4,"markdown":"- Can be created in a new or in an already existing layer. The user can not interact with it. Usually used to show information, like stamina, ammunition and so on.\n- **Commands:** allCutLayers, titleRsc, cutText, cutObj, cutFadeOut, setTitleEffect, allActiveTitleEffects\n\n> [!NOTE]\n> Some of these commands have different effects. See the command documentation for detailed information."},{"heading":"Display and Dialog","level":3,"markdown":"Displays and dialogs are defined in the config file. They are usually used to simplify user interactions, through controls like buttons, list boxes and so on."},{"heading":"Properties","level":4,"markdown":"| Name | Type | Remark |\n|---|---|---|\n| **idd** | Integer | The unique ID number of this dialog. Used with findDisplay to find the display. Can be -1 if no access is required from within a script. |\n| **access** | Integer | - 0 - ReadAndWrite - this is the default case where properties can still be added or overridden.<br>- 1 - ReadAndCreate - this only allows creating new properties.<br>- 2 - ReadOnly - this does not allow to do anything in deriving classes.<br>- 3 - ReadOnlyVerified - this does not allow to do anything either in deriving classes, and a CRC check will be performed. |\n| **movingEnable** | Boolean | Specifies whether the dialog can be moved or not (if enabled one of the dialogs controls should have the *moving* property set to 1 so it becomes the \"handle\" the dialog can be moved with). Doesn't seem to matter in Arma 3 |\n| **enableSimulation** | Boolean | Specifies whether the game continues while the dialog is shown or not. |\n| **onLoad** | String | Expression executed when the dialog is opened. See User Interface Event Handlers |\n| **onUnload** | String | Expression executed when the dialog is closed. See User Interface Event Handlers |\n| **controlsBackground** | Array or class | Contains class names of all background controls associated to this dialog.<br>The sequence in which the controls are listed will decide their z-index (i.e. the last ones will on top of the first ones). |\n| **controls** | Array or class | Contains class names of all foreground controls associated to this dialog. |\n| **objects** | Array or class | List of all DialogControls-Objects type controls |"},{"heading":"Example Config","level":4,"markdown":"```cpp\nclass DefaultDialog\n{\n    idd = -1;\n    access = 0;\n    movingEnable = true;\n    onLoad = \"hint str _this\";\n    onUnload  = \"hint str _this\";\n    enableSimulation = false;\n    class ControlsBackground\n    {\n        //Background controls\n    };\n    class Controls\n    {\n        //Controls\n    };\n    class Objects\n    {\n        //Objects\n    };\n};\n```"},{"heading":"Opening a display or dialog","level":4,"markdown":"There are two ways of creating a display or dialog. One can either use createDialog or createDisplay command."},{"heading":"Closing a display or dialog","level":4,"markdown":"There are several ways to close a dialog:\n\n- Pressing <kbd>Esc</kbd>\n- Clicking a button with IDC 0, 1 or 2\n- closeDialog\n- closeDisplay"},{"heading":"Exit Codes","level":5,"markdown":"Exit codes are a way to determine in what way a display was closed. The onUnload UIEH has the exit code as one of its parameters. This way you can handle different user decisions, eg. save a value if the user confirms it or discard changes when the user pressed a cancel button. Macros for the different exit codes can be found in `\\a3\\ui_f\\hpp\\defineResincl.inc`:\n\n```cpp\n// Predefined controls\n#define IDC_OK                1\n#define IDC_CANCEL            2\n#define IDC_AUTOCANCEL        3\n#define IDC_ABORT            4\n#define IDC_RESTART            5\n#define IDC_USER_BUTTON        6\n#define IDC_EXIT_TO_MAIN    7\n```\n\n| Exit Code | Macro | Comment |\n|---|---|---|\n| 1 | IDC_OK | Dialog was closed with a positive outcome |\n| 2 | IDC_CANCEL | Dialog was closed with a negative outcome |\n| 3 | IDC_AUTOCANCEL | ? |\n| 4 | IDC_ABORT | When used on the mission display (Display #46) it simulates \"Save and Exit\" button from escape menu |\n| 5 | IDC_RESTART | ? |\n| 6 | IDC_USER_BUTTON | ? |\n| 7 | IDC_EXIT_TO_MAIN | ? |"},{"heading":"HUDs","level":3,"markdown":"HUDs are defined in the class RscTitles, unlike displays or dialogs which are root classes in the config file. Additionally, their properties are different."},{"heading":"Properties","level":4,"markdown":"| Name | Type | Remark |\n|---|---|---|\n| **idd** | Integer | The unique ID number of this HUD. Used with findDisplay to find the display. Can be -1 if no access is required from within a script. |\n| **fadeIn** | Integer | Duration of fade in effect when opening in seconds. |\n| **fadeOut** | Integer | Duration of fade out effect when closing in seconds. |\n| **duration** | Integer | Duration the HUD is displayed after opening in seconds. Use a very large number to have it always open. |\n| **onLoad** | String | Expression executed when the dialog is opened. See User Interface Event Handlers |\n| **onUnload** | String | Expression executed when the dialog is closed. See User Interface Event Handlers |\n| **controls** | Array | Contains class names of all foreground controls associated to this dialog. |"},{"heading":"Example Config","level":4,"markdown":"```cpp\n#include \"\\a3\\ui_f\\hpp\\definecommongrids.inc\"\n\nclass RscTitles\n{\n    class RscInfoText\n    {\n        idd = 3100;\n        fadein = 0;\n        fadeout = 0;\n        duration = 1e+011;\n        onLoad = \"uinamespace setVariable ['BIS_InfoText',_this select 0]\";\n        onUnLoad = \"uinamespace setVariable ['BIS_InfoText', nil]\";\n        class Controls\n        {\n            class InfoText\n            {\n                idc = 3101;\n                style = \"0x01 + 0x10 + 0x200 + 0x100\";\n                font = \"RobotoCondensedBold\";\n                x = \"(profileNamespace getVariable [\"\"IGUI_GRID_MISSION_X\"\", (safezoneX + safezoneW - 21 * (GUI_GRID_WAbs / 40))])\";\n                y = \"(profileNamespace getVariable [\"\"IGUI_GRID_MISSION_Y\"\", (safezoneY + safezoneH - 10.5 * (GUI_GRID_HAbs / 25))])\";\n                w = \"20 * (GUI_GRID_WAbs / 40)\";\n                h = \"5 * ((GUI_GRID_WAbs / 1.2) / 25)\";\n                colorText[] = {1,1,1,1};\n                colorBackground[] = {0,0,0,0};\n                text = \"\";\n                lineSpacing = 1;\n                sizeEx = 0.045;\n                fixedWidth = 1;\n                deletable = 0;\n                fade = 0;\n                access = 0;\n                type = 0;\n                shadow = 1;\n                colorShadow[] = {0,0,0,0.5};\n                tooltipColorText[] = {1,1,1,1};\n                tooltipColorBox[] = {1,1,1,1};\n                tooltipColorShade[] = {0,0,0,0.65};\n            };\n        };\n    };\n};\n```"},{"heading":"Controls","level":3,"markdown":"Controls are used to allow the player to interact with the GUI. Controls range from simple rectangles to 3D objects.\nLike dialogs, displays and HUDs, controls can have a unique ID to access them from within scripts. The classname of controls have to be unique.\n\nWhat properties a control needs is defined by its *type* property. However most controls share a set of properties described in the following sections.\nFor control specific properties visit the corresponding pages."},{"heading":"Common Properties","level":4,"markdown":"| Name | Type | Remark |\n|---|---|---|\n| **idc** | Integer | The unique ID number of this control. Can be -1 if you don't require access to the control itself from within a script.<br>Special (button) IDCs (according to \\a3\\ui_f\\hpp\\defineResincl.inc):<br>- 1: OK (closes display when clicked upon, raises exit code 1 in the onUnload UIEH)<br>- 2: Cancel (closes display when clicked upon, raises exit code 2 in the onUnload UIEH)<br>- 3: Auto cancel<br>- 4: Abort<br>- 5: Restart<br>- 6: User button<br>- 7: Exit to main<br>While the purposes of idcs 3 to 7 remain unknown, it is advisable to give all of your controls larger numbers, eg. 100. |\n| **moving** | Boolean | Whether the dialog will be moved if this control is dragged (may require \"movingEnable\" to be 1 in the dialog. In Arma 3 works regardless). Another way of allowing moving of the dialog is to have control of style ST_TITLE_BAR |\n| **type** | Integer | See Control Types |\n| **style** | Integer | See Control Styles. `style = \"0x400+0x02+0x10\";` |\n| **x/y/w/h** | Number | The position and size of the control in fractions of screen size. |\n| **sizeEx** | Number | The font size of text in fractions of screen size. Behaves similar to **h** property. For some controls it is named **size**. |\n| **font** | String | The font to use. See the list of available fonts for possible values. |\n| **colorText** | Array | Text color |\n| **colorBackground** | Array | Background color |\n| **text** | String | The text **or picture** to display. |\n| **shadow** | Integer | Can be applied to most controls (0 = no shadow, 1 = drop shadow with soft edges, 2 = stroke). |\n| **tooltip** | String | Text to display in a tooltip when control is moused over. A tooltip can be added to any control type except CT_STATIC and CT_STRUCTURED_TEXT. Note: As of Arma 3 v1.48, most controls now support tooltips. A linebreak can be created by adding **\\n**. |\n| **tooltipColorShade** | Array | Tooltip background color |\n| **tooltipColorText** | Array | Tooltip text color |\n| **tooltipColorBox** | Array | Tooltip border color |\n| **autocomplete** | String | (where applicable) Option for entry fields (e.g. RscEdit) to activate autocompletion. For known script commands and functions use autocomplete = \"scripting\". |\n| **url** | String | (where applicable) URL which will be opened when clicking on the control. Used on e.g. a button control. Does not utilize the Steam Overlay browser if enabled by default, opens the link in the default browser set by the OS. |\n| **overlayMode** | Number | Arma 3 v2.10 (where applicable) 0 - opens URL in default browser; 1 - opens URL in Steam overlay id enabled, otherwise in default browser; 2 - opens URL in Steam overlay, shows error message box (with button to use default browser) if Steam overlay is disabled. |\n\nA property to enable or disable a control does not exist (because of implementation issues). However, there is a simple workaround based on the onLoad UI Event Handler that can be used to disable a control in the config:\n\n```cpp\nonLoad = \"(_this # 0) ctrlEnable false;\";\n```"},{"heading":"Attributes Class","level":4,"markdown":"| Name | Type | Remark |\n|---|---|---|\n| **font** | String | Available Fonts |\n| **color** | HTML color | [HTML Color Codes](https://html-color-codes.info/) |\n| **align** | String | \"center\", \"left\", \"right\" |\n| **shadow** | Integer | 0 = no shadow, 1 = drop shadow with soft edges, 2 = stroke |"},{"heading":"AttributesImage Class","level":4,"markdown":"| Name | Type | Remark |\n|---|---|---|\n| **font** | String | Available Fonts (Optional) |\n| **color** | HTML color | [HTML Color Codes](https://html-color-codes.info/) |\n| **align** | String | \"center\", \"left\", \"Right\" (optional) |"},{"heading":"Example Config","level":4,"markdown":"```cpp\n#include \"\\a3\\ui_f\\hpp\\definecommongrids.inc\"\n\nclass RscButton\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = 1;\n    text = \"\";\n    colorText[] = {1,1,1,1};\n    colorDisabled[] = {1,1,1,0.25};\n    colorBackground[] = {0,0,0,0.5};\n    colorBackgroundDisabled[] = {0,0,0,0.5};\n    colorBackgroundActive[] = {0,0,0,1};\n    colorFocused[] = {0,0,0,1};\n    colorShadow[] = {0,0,0,0};\n    colorBorder[] = {0,0,0,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    soundClick[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundClick\",0.09,1};\n    soundEscape[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundEscape\",0.09,1};\n    idc = -1;\n    style = 2;\n    x = 0;\n    y = 0;\n    w = 0.095589;\n    h = 0.039216;\n    shadow = 2;\n    font = \"RobotoCondensed\";\n    sizeEx = \"GUI_GRID_HAbs / 25\";\n    url = \"\";\n    offsetX = 0;\n    offsetY = 0;\n    offsetPressedX = 0;\n    offsetPressedY = 0;\n    borderSize = 0;\n};\n```"},{"heading":"Control Types","level":3,"markdown":"The type property of controls defines what type of control they are. For example an edit box has the type 2.\nThere is an ingame dialog with examples of how the control types look and act like:\n\n```sqf\ncreateDialog \"RscTestControlTypes\";\n```"},{"heading":"Control Type Definitions","level":4,"markdown":"All definitions can be retrieved with `\"Default\" call BIS_fnc_exportGUIBaseClasses;`.\n\n```cpp\n#define CT_STATIC                  0\n#define CT_BUTTON                  1\n#define CT_EDIT                      2\n#define CT_SLIDER                  3\n#define CT_COMBO                  4\n#define CT_LISTBOX                  5\n#define CT_TOOLBOX                  6\n#define CT_CHECKBOXES              7\n#define CT_PROGRESS                  8\n#define CT_HTML                      9\n#define CT_STATIC_SKEW             10\n#define CT_ACTIVETEXT             11\n#define CT_TREE                     12\n#define CT_STRUCTURED_TEXT         13\n#define CT_CONTEXT_MENU             14\n#define CT_CONTROLS_GROUP         15\n#define CT_SHORTCUTBUTTON         16\n#define CT_HITZONES                 17\n#define CT_VEHICLETOGGLES         18\n#define CT_CONTROLS_TABLE         19\n#define CT_XKEYDESC                 40\n#define CT_XBUTTON                 41\n#define CT_XLISTBOX                 42\n#define CT_XSLIDER                 43\n#define CT_XCOMBO                 44\n#define CT_ANIMATED_TEXTURE         45\n#define CT_MENU                     46\n#define CT_MENU_STRIP             47\n#define CT_CHECKBOX                 77\n#define CT_OBJECT                 80\n#define CT_OBJECT_ZOOM             81\n#define CT_OBJECT_CONTAINER         82\n#define CT_OBJECT_CONT_ANIM         83\n#define CT_LINEBREAK             98\n#define CT_USER                     99\n#define CT_MAP                    100\n#define CT_MAP_MAIN                101\n#define CT_LISTNBOX                102\n#define CT_ITEMSLOT                103\n#define CT_LISTNBOX_CHECKABLE    104\n#define CT_VEHICLE_DIRECTION    105\n```"},{"heading":"Control Styles","level":3,"markdown":"To further customize controls there are several different styles for each control type available.\n\nTo get an idea of how the styles look like you can create the following dialog:\n\n```sqf\ncreateDialog \"RscTestControlStyles\";\n```\n\n> [!IMPORTANT]\n> Note that drawing of vertical text is not supported and any attempt to use `ST_UP`, `ST_DOWN`, `ST_VCENTER` is likely to result in the following *.rpt* spam:\n> `Obsolete, sizeH and sizeW calculation missing`\n> In addition, `ST_UP`, `ST_DOWN`, `ST_VCENTER` are stand alone styles and should not be mixed with any other styles\n\n| Define | Decimal | Hexadecimal | Remark |\n|---|---|---|---|\n| ST_LEFT | 0 | 0x00 | Default, text left aligned |\n| ST_RIGHT | 1 | 0x01 | Modifier, adding this to another style will force text to be aligned to the right |\n| ST_CENTER | 2 | 0x02 | Modifier, adding this to another style will force text to be centered |\n| ST_DOWN | 4 | 0x04 | Vertical text alignment (See the note above) |\n| ST_UP | 8 | 0x08 | Vertical text alignment (See the note above) |\n| ST_VCENTER | 12 | 0x0C | Vertical text alignment, same as ST_DOWN + ST_UP (See the note above) |\n| ST_SINGLE | 0 | 0x00 | Plain single line box without a border |\n| ST_MULTI | 16 | 0x10 | Plain multiple line box with a slight border. To remove border add 512 (+ ST_NO_RECT) to the style (style 528, 529 and 530 are therefore border-less). Additional parameter *lineSpacing* is required for this style. *lineSpacing* = 1; is normal line spacing. Any **\\n** character in the text string will be interpreted as new line. |\n| ST_TITLE_BAR | 32 | 0x20 | Plain single line box with semi-transparent background and somewhat embossed border. When this style is used, the dialog containing control becomes draggable by this control |\n| ST_PICTURE | 48 | 0x30 | Border-less picture box. Text string is treated as a path to a texture. Alignment has no effect. The texture is stretched to fit the box by default. To force original aspect ratio add 2048 (+ ST_KEEP_ASPECT_RATIO) to the style. Background is ignored, *colorText* controls texture colour and opacity |\n| ST_FRAME | 64 | 0x40 | Legend like frame without background with text showing over the frame edge. Alignment has no effect. *colorText* defines both text and frame colour |\n| ST_BACKGROUND | 80 | 0x50 | Single line box with always black opaque background and thick raised beveled border |\n| ST_GROUP_BOX | 96 | 0x60 | Single line box with delicate semi-transparent background and slight border. Only text colour can be controlled |\n| ST_GROUP_BOX2 | 112 | 0x70 | Plain single line box, same as ST_SINGLE, only with a slight border similar to ST_MULTI box border |\n| ST_HUD_BACKGROUND | 128 | 0x80 | Sets special texture for corners. It was used for rounded corners in OFP, ArmA and Arma 2. In Arma 3, square corners are used everywhere, so the texture is adapted to the unified style, but the technology is not removed. In Arma 3 it looks the same as normal ST_SINGLE. Corner textures are defined in `configFile >> \"CfgInGameUI\" >> \"imageCornerElement\"` (can be set only globally for the whole game, not per control) |\n| ST_TILE_PICTURE | 144 | 0x90 | The picture is tiled according to *tileH* and *tileW* values. To force tiled picture to keep aspect ratio of original image, add 2048 (+ ST_KEEP_ASPECT_RATIO) to the style. |\n| ST_WITH_RECT | 160 | 0xA0 | Single line box frame, similar to ST_FRAME box. The text however is displayed inside the frame. Frame and text colour are set with *colorText* |\n| ST_LINE | 176 | 0xB0 | Diagonal line going from left top corner to bottom right corner. To control line direction, width *w* and height *h* parameters of the box could be negative. Line and text colour are set with *colorText* |\n| ST_UPPERCASE | 192 | 0xC0 | Forces control text to upper case |\n| ST_LOWERCASE | 208 | 0xD0 | Forces control text to lower case |\n| ST_ADDITIONAL_INFO | 3840 | 0x0F00 | ST_SHADOW + ST_NO_RECT + SL_HORZ + ST_KEEP_ASPECT_RATIO |\n| ST_SHADOW | 256 | 0x0100 |  |\n| ST_NO_RECT | 512 | 0x0200 | This style works for CT_STATIC in conjunction with ST_MULTI |\n| ST_KEEP_ASPECT_RATIO | 2048 | 0x0800 | When used with image or texture, stops it from stretching to fit the control |\n| ST_TITLE | 34 | 0x22 | ST_TITLE_BAR + ST_CENTER |"},{"heading":"Control Specific Styles","level":4,"markdown":""},{"heading":"CT_LISTBOX Specific Styles","level":5,"markdown":"| Define | Decimal | Hexadecimal | Remark |\n|---|---|---|---|\n| LB_TEXTURES | 16 | 0x10 |  |\n| LB_MULTI | 32 | 0x20 | Makes CT_LISTBOX multi-selectable |"},{"heading":"CT_PROGRESS Specific Styles","level":5,"markdown":"| Define | Decimal | Hexadecimal |\n|---|---|---|\n| ST_VERTICAL | 1 | 0x01 |\n| ST_HORIZONTAL | 0 | 0x00 |"},{"heading":"CT_SLIDER Specific Styles","level":5,"markdown":"| Define | Decimal | Hexadecimal |\n|---|---|---|\n| SL_VERT | 0 | 0x00 |\n| SL_HORZ | 1024 | 0x0400 |\n| SL_TEXTURES | 16 | 0x10 |"},{"heading":"CT_TREE Specific Styles","level":5,"markdown":"| Define | Decimal | Hexadecimal | Remark |\n|---|---|---|---|\n| TR_SHOWROOT | 1 | 0x01 | When this style is applied, all entries even with path [] can be collapsed. Use unkown. |\n| TR_AUTOCOLLAPSE | 2 | 0x02 | Use unknown |"},{"heading":"Control Style Definitions","level":4,"markdown":"All definitions can be retrieved with `\"Default\" call BIS_fnc_exportGUIBaseClasses;`.\n\n```cpp\n#define ST_LEFT                    0x00\n#define ST_RIGHT                0x01\n#define ST_CENTER                0x02\n#define ST_DOWN                    0x04\n#define ST_UP                    0x08\n#define ST_VCENTER                0x0C\n#define ST_SINGLE                0x00\n#define ST_MULTI                0x10\n#define ST_TITLE_BAR            0x20\n#define ST_PICTURE                0x30\n#define ST_FRAME                0x40\n#define ST_BACKGROUND            0x50\n#define ST_GROUP_BOX            0x60\n#define ST_GROUP_BOX2            0x70\n#define ST_HUD_BACKGROUND        0x80\n#define ST_TILE_PICTURE            0x90\n#define ST_WITH_RECT            0xA0\n#define ST_LINE                    0xB0\n#define ST_UPPERCASE            0xC0\n#define ST_LOWERCASE            0xD0\n#define ST_ADDITIONAL_INFO        0x0F00\n#define ST_SHADOW                0x0100\n#define ST_NO_RECT                0x0200\n#define ST_KEEP_ASPECT_RATIO    0x0800\n#define ST_TITLE                ST_TITLE_BAR + ST_CENTER\n#define SL_VERT                    0\n#define SL_HORZ                    0x400\n#define SL_TEXTURES                0x10\n#define ST_VERTICAL                0x01\n#define ST_HORIZONTAL            0\n#define LB_TEXTURES                0x10\n#define LB_MULTI                0x20\n#define TR_SHOWROOT                1\n#define TR_AUTOCOLLAPSE            2\n```"},{"heading":"Positioning","level":3,"markdown":"A detailed description of how you can achieve proper GUI placement can be found on the Arma 3: GUI Coordinates page."},{"heading":"Inheritance","level":3,"markdown":"Using inheritance can reduce your dialog class definitions significantly by standardising common attributes in base classes and just changing unique attributes in derived classes. There is no need to re-declare all attributes for every class definition.\n\n> [!NOTE]\n> Using inheritance can make your GUI config hard to read for others.\n\nView the dedicated inheritance page for more information."},{"heading":"Preprocessor instructions","level":3,"markdown":"Note that you can also add your own preprocessor instructions for commonly used data, eg. for colors, to save yourself the hassle of writing it in several different places and then adapt each of them if you want to change them afterwards (especially if class inheritance is not applicable). It can also make your code more readable sometimes."},{"heading":"Example Config","level":4,"markdown":"```cpp\n#define COLOR_HALF_BLACK { 0, 0, 0, 0.5 }\n\nclass MyDialog\n{\n    idd = -1;\n    movingEnable = 1;\n    objects[] = {};\n    controlsBackground[] = { MyDialogBackground };\n\n    class MyDialogBackground : RscText\n    {\n        colorBackground[] = COLOR_HALF_BLACK;\n        x = 0.7;  y = 0.1;\n        w = 0.25; h = 0.15;\n    };\n};\n```"},{"heading":"Useful includes","level":4,"markdown":"Arma 3 offers a wide range of useful files which can be included to get access to some helpful macros.\n\n| Include Code | Description / Content |\n|---|---|\n| `#include \"\\a3\\3DEN\\UI\\macros.inc\"` | Defines for Eden Editor like colors, text sizes custom pixel grid macros. |\n| `#include \"\\a3\\3DEN\\UI\\macroexecs.inc\"` | Defines for Eden Editor to calculate text sizes etc. |\n| `#include \"\\a3\\ui_f\\hpp\\definedikcodes.inc\"` | Useful when working with custom shortcuts. Contains defines for key codes. |\n| `#include \"\\a3\\ui_f\\hpp\\definecommoncolors.inc\"` | Colors used in Arma 3, like background color set by the user. |\n| `#include \"\\a3\\ui_f\\hpp\\definecommongrids.inc\"` | UI grids such as GUI_GRID and all its variants. |\n| `#include \"\\a3\\ui_f\\hpp\\defineresincl.inc\"` | IDCs and IDDs of many Arma 3 UIs. |"},{"heading":"User Interface Event Handlers","level":3,"markdown":"User Interface Event Handlers are a key component of any Arma 3 GUI. See User Interface Event Handlers."},{"heading":"Scripting","level":3,"markdown":"There are several functions and commands to edit your dialog after its creation. These functions and commands can be found here:\n\n- GUI Functions\n- GUI Commands"},{"heading":"Native Arma 3 GUIs","level":3,"markdown":"Arma 3 comes with a wide varity of various displays and dialogs. They can be found in:\n\n- configFile usually with names like **Rsc**SomeDisplayName or **Display**SomeDisplayName\n\nAdditonally, Arma 3 offers some customizeable GUIs which can be accessed by scripts.\n\n- BIS_fnc_3DENShowMessage\n- BIS_fnc_guiMessage\n- BIS_fnc_GUIhint\n- hint, hintSilent, hintC"},{"heading":"GUI References","level":3,"markdown":"It is sometimes a good idea so see how others created their GUIs. Here is a list of a few resources:\n\n- [Terra's Editing Extensions](https://github.com/7erra/-Terra-s-Editing-Extensions/tree/master/TER_editing/gui)\n- [A3ExtendedFunctionViewer](https://github.com/ConnorAU/A3ExtendedFunctionViewer)\n- [A3UserInputMenus](https://github.com/ConnorAU/A3UserInputMenus)\n- [A3ColorPicker](https://github.com/ConnorAU/A3ColorPicker)\n- [3den Enhanced](https://github.com/R3voA3/3den-Enhanced/tree/master/3denEnhanced/GUI)"},{"heading":"Tips for creating GUIs","level":3,"markdown":"- Functionality\n- Layout\n- Style\n- Behaviour\n- Customizability"},{"heading":"Tutorials","level":3,"markdown":"- GUI Tutorial"},{"heading":"See Also","level":3,"markdown":"- Arma 3: IDD List\n- Arma 3: User Interface Editor\n- Arma 3: GUI Coordinates\n- GUI Functions\n- GUI Commands\n- User Interface Event Handlers\n- Class Inheritance\n- PreProcessor Commands"}],"categories":["GUI Topics","Stubs"],"groups":["GUI"]}