Showing the changes to interface/src/scripting/MenuScriptingInterface.h (1 of 3 files). Show all
Unified · Split
| @@ -33,7 +33,7 @@ class MenuItemProperties; · 32 unmodified lines | |||
| 33 | * | 33 | * |
| 34 | * @namespace Menu | 34 | * @namespace Menu |
| 35 | * | 35 | * |
| 36 | * @example | 36 | * @example <caption>Add a menu and menu item, and detect clicks on the menu item added.</caption> |
| 37 | * Menu.addMenu("Demo Menu"); | 37 | * Menu.addMenu("Demo Menu"); |
| 38 | * | 38 | * |
| 39 | * Menu.addMenuItem({ | 39 | * Menu.addMenuItem({ |
| @@ -76,7 +76,7 @@ public slots: · 36 unmodified lines | |||
| 76 | * @function Menu.addMenu | 76 | * @function Menu.addMenu |
| 77 | * @param {string} menuName Name that will be displayed for the menu. Nested menus can be described using the ">" symbol. | 77 | * @param {string} menuName Name that will be displayed for the menu. Nested menus can be described using the ">" symbol. |
| 78 | * @param {string} [grouping] Name of the grouping, if any, to add this menu to. | 78 | * @param {string} [grouping] Name of the grouping, if any, to add this menu to. |
| 79 | * @example | 79 | * @example <caption>Add a menu and a nested submenu.</caption> |
| 80 | * Menu.addMenu("Test Menu"); | 80 | * Menu.addMenu("Test Menu"); |
| 81 | * Menu.addMenu("Test Menu > Test Sub Menu"); | 81 | * Menu.addMenu("Test Menu > Test Sub Menu"); |
| 82 | */ | 82 | */ |
| @@ -86,7 +86,7 @@ public slots: · 3 unmodified lines | |||
| 86 | * Remove a top-level menu. | 86 | * Remove a top-level menu. |
| 87 | * @function Menu.removeMenu | 87 | * @function Menu.removeMenu |
| 88 | * @param {string} menuName Name of the menu to remove. | 88 | * @param {string} menuName Name of the menu to remove. |
| 89 | * @example | 89 | * @example <caption>Remove a menu and nested submenu.</caption> |
| 90 | * Menu.removeMenu("Test Menu > Test Sub Menu"); | 90 | * Menu.removeMenu("Test Menu > Test Sub Menu"); |
| 91 | * Menu.removeMenu("Test Menu"); | 91 | * Menu.removeMenu("Test Menu"); |
| 92 | */ | 92 | */ |
| @@ -97,20 +97,21 @@ public slots: · 4 unmodified lines | |||
| 97 | * @function Menu.menuExists | 97 | * @function Menu.menuExists |
| 98 | * @param {string} menuName - Name of the menu to check for existence. | 98 | * @param {string} menuName - Name of the menu to check for existence. |
| 99 | * @returns {boolean} <code>true</code> if the menu exists, otherwise <code>false</code>. | 99 | * @returns {boolean} <code>true</code> if the menu exists, otherwise <code>false</code>. |
| 100 | * @example | 100 | * @example <caption>Check if the "Developer" menu exists.</caption> |
| 101 | * if (Menu.menuExists("Developer")) { | 101 | * if (Menu.menuExists("Developer")) { |
| 102 | * // Perform a task if there is a Developer menu. | 102 | * print("Developer menu exists."); |
| 103 | * } | 103 | * } |
| 104 | */ | 104 | */ |
| 105 | bool menuExists(const QString& menuName); | 105 | bool menuExists(const QString& menuName); |
| 106 | 106 | ||
| 107 | /**jsdoc | 107 | /**jsdoc |
| 108 | * Add a separator with an unclickable label below it. | 108 | * Add a separator with an unclickable label below it. The separator will be placed at the bottom of the menu. |
| 109 | * The line will be placed at the bottom of the menu. | 109 | * If you want to add a separator at a specific point in the menu, use {@link Menu.addMenuItem} with |
| 110 | * {@link Menu.MenuItemProperties} instead. | ||
| 110 | * @function Menu.addSeparator | 111 | * @function Menu.addSeparator |
| 111 | * @param {string} menuName Name of the menu to add a separator to. | 112 | * @param {string} menuName Name of the menu to add a separator to. |
| 112 | * @param {string} separatorName Name of the separator that will be displayed as the label below the separator line. | 113 | * @param {string} separatorName Name of the separator that will be displayed as the label below the separator line. |
| 113 | * @example | 114 | * @example <caption>Add a separator.</caption> |
| 114 | * Menu.addSeparator("Developer","Test Separator"); | 115 | * Menu.addSeparator("Developer","Test Separator"); |
| 115 | */ | 116 | */ |
| 116 | void addSeparator(const QString& menuName, const QString& separatorName); | 117 | void addSeparator(const QString& menuName, const QString& separatorName); |
| @@ -120,7 +121,7 @@ public slots: · 3 unmodified lines | |||
| 120 | * @function Menu.removeSeparator | 121 | * @function Menu.removeSeparator |
| 121 | * @param {string} menuName Name of the menu to remove the separator from. | 122 | * @param {string} menuName Name of the menu to remove the separator from. |
| 122 | * @param {string} separatorName Name of the separator to remove. | 123 | * @param {string} separatorName Name of the separator to remove. |
| 123 | * @example | 124 | * @example <caption>Remove a separator.</caption> |
| 124 | * Menu.removeSeparator("Developer","Test Separator"); | 125 | * Menu.removeSeparator("Developer","Test Separator"); |
| 125 | */ | 126 | */ |
| 126 | void removeSeparator(const QString& menuName, const QString& separatorName); | 127 | void removeSeparator(const QString& menuName, const QString& separatorName); |
| @@ -129,7 +130,7 @@ public slots: · 2 unmodified lines | |||
| 129 | * Add a new menu item to a menu. | 130 | * Add a new menu item to a menu. |
| 130 | * @function Menu.addMenuItem | 131 | * @function Menu.addMenuItem |
| 131 | * @param {Menu.MenuItemProperties} properties Properties of the menu item to create. | 132 | * @param {Menu.MenuItemProperties} properties Properties of the menu item to create. |
| 132 | * @example | 133 | * @example <caption>Add a menu item using {@link Menu.MenuItemProperties}.</caption> |
| 133 | * Menu.addMenuItem({ | 134 | * Menu.addMenuItem({ |
| 134 | * menuName: "Developer", | 135 | * menuName: "Developer", |
| 135 | * menuItemName: "Test", | 136 | * menuItemName: "Test", |
| @@ -141,12 +142,12 @@ public slots: · 5 unmodified lines | |||
| 141 | void addMenuItem(const MenuItemProperties& properties); | 142 | void addMenuItem(const MenuItemProperties& properties); |
| 142 | 143 | ||
| 143 | /**jsdoc | 144 | /**jsdoc |
| 144 | * Add a new menu item to a menu. | 145 | * Add a new menu item to a menu. The new item is added at the end of the menu. |
| 145 | * @function Menu.addMenuItem | 146 | * @function Menu.addMenuItem |
| 146 | * @param {string} menuName Name of the menu to add a menu item to. | 147 | * @param {string} menuName Name of the menu to add a menu item to. |
| 147 | * @param {string} menuItem Name of the menu item. This is what will be displayed in the menu. | 148 | * @param {string} menuItem Name of the menu item. This is what will be displayed in the menu. |
| 148 | * @param {string} [shortcutKey] A shortcut key that can be used to trigger the menu item. | 149 | * @param {string} [shortcutKey] A shortcut key that can be used to trigger the menu item. |
| 149 | * @example | 150 | * @example <caption>Add a menu item to the end of the "Developer" menu.</caption> |
| 150 | * Menu.addMenuItem("Developer", "Test", "Ctrl+Shift+T"); | 151 | * Menu.addMenuItem("Developer", "Test", "Ctrl+Shift+T"); |
| 151 | */ | 152 | */ |
| 152 | void addMenuItem(const QString& menuName, const QString& menuitem, const QString& shortcutKey); | 153 | void addMenuItem(const QString& menuName, const QString& menuitem, const QString& shortcutKey); |
| @@ -167,9 +168,9 @@ public slots: · 14 unmodified lines | |||
| 167 | * @param {string} menuName Name of the menu that the menu item is in. | 168 | * @param {string} menuName Name of the menu that the menu item is in. |
| 168 | * @param {string} menuItem Name of the menu item to check for existence of. | 169 | * @param {string} menuItem Name of the menu item to check for existence of. |
| 169 | * @returns {boolean} <code>true</code> if the menu item exists, otherwise <code>false</code>. | 170 | * @returns {boolean} <code>true</code> if the menu item exists, otherwise <code>false</code>. |
| 170 | * @example | 171 | * @example <caption>Determine if the Developer > Stats menu exists.</caption> |
| 171 | * if (Menu.menuItemExists("Developer", "Stats")) { | 172 | * if (Menu.menuItemExists("Developer", "Stats")) { |
| 172 | * // Perform a task if there is a Stats item in the Developer menu. | 173 | * print("Developer > Stats menu item exists."); |
| 173 | * } | 174 | * } |
| 174 | */ | 175 | */ |
| 175 | bool menuItemExists(const QString& menuName, const QString& menuitem); | 176 | bool menuItemExists(const QString& menuName, const QString& menuitem); |
| @@ -185,7 +186,7 @@ public slots: · 9 unmodified lines | |||
| 185 | * Check whether a checkable menu item is checked. | 186 | * Check whether a checkable menu item is checked. |
| 186 | * @function Menu.isOptionChecked | 187 | * @function Menu.isOptionChecked |
| 187 | * @param {string} menuOption The name of the menu item. | 188 | * @param {string} menuOption The name of the menu item. |
| 188 | * @returns {boolean} <code>true</code> if the option is checked, otherwise false. | 189 | * @returns {boolean} <code>true</code> if the option is checked, otherwise <code>false</code>. |
| 189 | */ | 190 | */ |
| 190 | bool isOptionChecked(const QString& menuOption); | 191 | bool isOptionChecked(const QString& menuOption); |
| 191 | 192 | ||
| @@ -209,7 +210,7 @@ public slots: · 17 unmodified lines | |||
| 209 | * Menus are enabled by default. | 210 | * Menus are enabled by default. |
| 210 | * @function Menu.isMenuEnabled | 211 | * @function Menu.isMenuEnabled |
| 211 | * @param {string} menuName The name of the menu to check. | 212 | * @param {string} menuName The name of the menu to check. |
| 212 | * @returns {boolean} <code>true</code> if the menu is enabled, otherwise false. | 213 | * @returns {boolean} <code>true</code> if the menu is enabled, otherwise <code>false</code>. |
| 213 | */ | 214 | */ |
| 214 | bool isMenuEnabled(const QString& menuName); | 215 | bool isMenuEnabled(const QString& menuName); |
| 215 | 216 | ||
| @@ -233,7 +234,7 @@ signals: · 17 unmodified lines | |||
| 233 | * @function Menu.menuItemEvent | 234 | * @function Menu.menuItemEvent |
| 234 | * @param {string} menuItem Name of the menu item that was clicked. | 235 | * @param {string} menuItem Name of the menu item that was clicked. |
| 235 | * @returns {Signal} | 236 | * @returns {Signal} |
| 236 | * @example | 237 | * @example <caption>Detect menu item events.</caption> |
| 237 | * function onMenuItemEvent(menuItem) { | 238 | * function onMenuItemEvent(menuItem) { |
| 238 | * print("You clicked on " + menuItem); | 239 | * print("You clicked on " + menuItem); |
| 239 | * } | 240 | * } |