{"name":"CT MENU","title":"CT MENU","type":"topic","url":"https://community.bistudio.com/wiki/CT_MENU","revid":342185,"updated":"2023-07-09T12:27:00Z","aliases":[],"markdown":"### Introduction\n\nEden Editor context menu which is opened with right click. Same problems as CT_CONTEXT_MENU. When created as part of class controls it is visible and functional until clicked on/clicked on another part of the display and thereupon deleted. When listed as an independed class similar to controls and controlsBackground, like in 3den, it is not created at all. Also, the menu commands (menuAdd, menuSize, etc) don't seem to work on it.\n\n#### Related commands & functions\n\n- Commands: General\n- Commands: UI Eventhandlers\n- Commands: Menu\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_MENU 46\n```\n\n#### A\n\n##### arrow\n\n**Type:** String\n\n**Description:** Path to .paa file or procedural texture.\n\n```cpp\narrow = \"\";\n```\n\n#### I\n\n##### itemSpacingH\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nitemSpacingH = 0;\n```\n\n##### itemSpacingW\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nitemSpacingW = 0;\n```\n\n##### Items\n\n**Type:** Class\n\n**Description:** First entry is an `items[]` array listing all entry classes. Afterwards come the entry classes themselves. There has to be a Default class. See Eden Editor: Entity Context Menu for more information.\n\n| Properties |  |  |\n|---|---|---|\n| Name | Type | Remark |\n| Entry | class | Name can be anything |\n\n**Custom Items Class**\n\n| Properties |  |  |\n|---|---|---|\n| Name | Type | Remark |\n| text | string |  |\n| action | string | Has to contain valid sqf command(s) |\n| conditionShow | string | Simple Expression. Refer to Eden Editor: Entity Context Menu |\n\n```cpp\nclass Items\n{\n    items[]=\n    {\n        \"entry1\",\n        \"entry2\"\n    };\n    class Separator\n    {\n        value=0;\n    };\n    class entry1\n    {\n        text = \"My first entry\";\n        action = \"systemchat \"\"Selected first entry.\"\";\";\n        conditionShow=\"hoverObject\";\n    };\n    class entry2\n    {\n        text = \"My second entry\";\n        action = \"systemchat \"\"Selected second entry.\"\";\";\n        conditionShow=\"1\";\n    };\n    class Default\n    {\n        text=\"\";\n        data=\"Empty\";\n        enable=0;\n    };\n};\n```\n\n#### P\n\n##### pictureCheckboxEnabled\n\n**Type:** String\n\n**Description:** Path to .paa file or procedural texture.\n\n```cpp\npictureCheckboxEnabled = \"\";\n```\n\n##### pictureCheckboxDisabled\n\n**Type:** String\n\n**Description:** Path to .paa file or procedural texture.\n\n```cpp\npictureCheckboxDisabled = \"\";\n```\n\n##### pictureRadioEnabled\n\n**Type:** String\n\n**Description:** Path to .paa file or procedural texture.\n\n```cpp\npictureRadioEnabled = \"\";\n```\n\n##### pictureRadioDisabled\n\n**Type:** String\n\n**Description:** Path to .paa file or procedural texture.\n\n```cpp\npictureRadioDisabled = \"\";\n```\n\n#### R\n\n##### rowHeight\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nrowHeight = 0.025;\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 ContextMenu\n{\n    idc=1100;\n    type=CT_MENU;\n    shadow=1;\n    sizeEx=\"4.32 * (1 / (getResolution select 3)) * pixelGrid * 0.5\";\n    font=\"RobotoCondensedLight\";\n    colorBorder[]={0,0,0,0};\n    colorBackground[]={0.1,0.1,0.1,1};\n    colorText[]={1,1,1,1};\n    colorSelect[]={0,0,0,1};\n    colorSelectBackground[]=\n    {\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])\",\n        1\n    };\n    colorDisabled[]={1,1,1,0.25};\n    colorPicture[]={1,1,1,1};\n    colorPictureSelect[]={0,0,0,1};\n    colorPictureDisabled[]={1,1,1,0.5};\n    arrow=\"\\a3\\3DEN\\Data\\Controls\\ctrlMenu\\arrow_ca.paa\";\n    rowHeight=0;\n    itemSpacingW=0.0099999998;\n    itemSpacingH=0.0099999998;\n    pictureCheckboxEnabled=\"\\a3\\3DEN\\Data\\Controls\\CtrlMenu\\pictureCheckboxEnabled_ca.paa\";\n    pictureCheckboxDisabled=\"#(argb,8,8,3)color(0,0,0,0)\";\n    pictureRadioEnabled=\"\\a3\\3DEN\\Data\\Controls\\CtrlMenu\\pictureRadioEnabled_ca.paa\";\n    pictureRadioDisabled=\"#(argb,8,8,3)color(0,0,0,0)\";\n    class Items\n    {\n        items[]=\n        {\n            \"entry1\",\n            \"entry2\"\n        };\n        class Separator\n        {\n            value=0;\n        };\n        class entry1\n        {\n            text = \"My first entry\";\n            action = \"systemchat \"\"Selected first entry.\"\";\";\n            conditionShow=\"hoverObject\";\n        };\n        class entry2\n        {\n            text = \"My second entry\";\n            action = \"systemchat \"\"Selected second entry.\"\";\";\n            conditionShow=\"1\";\n        };\n        class Default\n        {\n            text=\"\";\n            data=\"Empty\";\n            enable=0;\n        };\n    };\n};\n```","sections":[{"heading":"Introduction","level":3,"markdown":"Eden Editor context menu which is opened with right click. Same problems as CT_CONTEXT_MENU. When created as part of class controls it is visible and functional until clicked on/clicked on another part of the display and thereupon deleted. When listed as an independed class similar to controls and controlsBackground, like in 3den, it is not created at all. Also, the menu commands (menuAdd, menuSize, etc) don't seem to work on it."},{"heading":"Related commands & functions","level":4,"markdown":"- Commands: General\n- Commands: UI Eventhandlers\n- Commands: Menu"},{"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_MENU 46\n```"},{"heading":"A","level":4,"markdown":""},{"heading":"arrow","level":5,"markdown":"**Type:** String\n\n**Description:** Path to .paa file or procedural texture.\n\n```cpp\narrow = \"\";\n```"},{"heading":"I","level":4,"markdown":""},{"heading":"itemSpacingH","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nitemSpacingH = 0;\n```"},{"heading":"itemSpacingW","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nitemSpacingW = 0;\n```"},{"heading":"Items","level":5,"markdown":"**Type:** Class\n\n**Description:** First entry is an `items[]` array listing all entry classes. Afterwards come the entry classes themselves. There has to be a Default class. See Eden Editor: Entity Context Menu for more information.\n\n| Properties |  |  |\n|---|---|---|\n| Name | Type | Remark |\n| Entry | class | Name can be anything |\n\n**Custom Items Class**\n\n| Properties |  |  |\n|---|---|---|\n| Name | Type | Remark |\n| text | string |  |\n| action | string | Has to contain valid sqf command(s) |\n| conditionShow | string | Simple Expression. Refer to Eden Editor: Entity Context Menu |\n\n```cpp\nclass Items\n{\n    items[]=\n    {\n        \"entry1\",\n        \"entry2\"\n    };\n    class Separator\n    {\n        value=0;\n    };\n    class entry1\n    {\n        text = \"My first entry\";\n        action = \"systemchat \"\"Selected first entry.\"\";\";\n        conditionShow=\"hoverObject\";\n    };\n    class entry2\n    {\n        text = \"My second entry\";\n        action = \"systemchat \"\"Selected second entry.\"\";\";\n        conditionShow=\"1\";\n    };\n    class Default\n    {\n        text=\"\";\n        data=\"Empty\";\n        enable=0;\n    };\n};\n```"},{"heading":"P","level":4,"markdown":""},{"heading":"pictureCheckboxEnabled","level":5,"markdown":"**Type:** String\n\n**Description:** Path to .paa file or procedural texture.\n\n```cpp\npictureCheckboxEnabled = \"\";\n```"},{"heading":"pictureCheckboxDisabled","level":5,"markdown":"**Type:** String\n\n**Description:** Path to .paa file or procedural texture.\n\n```cpp\npictureCheckboxDisabled = \"\";\n```"},{"heading":"pictureRadioEnabled","level":5,"markdown":"**Type:** String\n\n**Description:** Path to .paa file or procedural texture.\n\n```cpp\npictureRadioEnabled = \"\";\n```"},{"heading":"pictureRadioDisabled","level":5,"markdown":"**Type:** String\n\n**Description:** Path to .paa file or procedural texture.\n\n```cpp\npictureRadioDisabled = \"\";\n```"},{"heading":"R","level":4,"markdown":""},{"heading":"rowHeight","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nrowHeight = 0.025;\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 ContextMenu\n{\n    idc=1100;\n    type=CT_MENU;\n    shadow=1;\n    sizeEx=\"4.32 * (1 / (getResolution select 3)) * pixelGrid * 0.5\";\n    font=\"RobotoCondensedLight\";\n    colorBorder[]={0,0,0,0};\n    colorBackground[]={0.1,0.1,0.1,1};\n    colorText[]={1,1,1,1};\n    colorSelect[]={0,0,0,1};\n    colorSelectBackground[]=\n    {\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])\",\n        1\n    };\n    colorDisabled[]={1,1,1,0.25};\n    colorPicture[]={1,1,1,1};\n    colorPictureSelect[]={0,0,0,1};\n    colorPictureDisabled[]={1,1,1,0.5};\n    arrow=\"\\a3\\3DEN\\Data\\Controls\\ctrlMenu\\arrow_ca.paa\";\n    rowHeight=0;\n    itemSpacingW=0.0099999998;\n    itemSpacingH=0.0099999998;\n    pictureCheckboxEnabled=\"\\a3\\3DEN\\Data\\Controls\\CtrlMenu\\pictureCheckboxEnabled_ca.paa\";\n    pictureCheckboxDisabled=\"#(argb,8,8,3)color(0,0,0,0)\";\n    pictureRadioEnabled=\"\\a3\\3DEN\\Data\\Controls\\CtrlMenu\\pictureRadioEnabled_ca.paa\";\n    pictureRadioDisabled=\"#(argb,8,8,3)color(0,0,0,0)\";\n    class Items\n    {\n        items[]=\n        {\n            \"entry1\",\n            \"entry2\"\n        };\n        class Separator\n        {\n            value=0;\n        };\n        class entry1\n        {\n            text = \"My first entry\";\n            action = \"systemchat \"\"Selected first entry.\"\";\";\n            conditionShow=\"hoverObject\";\n        };\n        class entry2\n        {\n            text = \"My second entry\";\n            action = \"systemchat \"\"Selected second entry.\"\";\";\n            conditionShow=\"1\";\n        };\n        class Default\n        {\n            text=\"\";\n            data=\"Empty\";\n            enable=0;\n        };\n    };\n};\n```"}],"categories":["Control Types"],"groups":["GUI"]}