History

Tidying

David Rowe committed 8 years ago

Commit 2119e011 parent bde3dbc3 files · +27 −26Browse files

Showing the changes to interface/src/scripting/MenuScriptingInterface.h (1 of 3 files). Show all

Unified · Split

interface/src/scripting/MenuScriptingInterface.h+18−17
@@ -33,7 +33,7 @@ class MenuItemProperties; · 32 unmodified lines
3333 *
3434 * @namespace Menu
3535 *
36− * @example
36+ * @example <caption>Add a menu and menu item, and detect clicks on the menu item added.</caption>
3737 * Menu.addMenu("Demo Menu");
3838 *
3939 * Menu.addMenuItem({
@@ -76,7 +76,7 @@ public slots: · 36 unmodified lines
7676 * @function Menu.addMenu
7777 * @param {string} menuName Name that will be displayed for the menu. Nested menus can be described using the ">" symbol.
7878 * @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>
8080 * Menu.addMenu("Test Menu");
8181 * Menu.addMenu("Test Menu > Test Sub Menu");
8282 */
@@ -86,7 +86,7 @@ public slots: · 3 unmodified lines
8686 * Remove a top-level menu.
8787 * @function Menu.removeMenu
8888 * @param {string} menuName Name of the menu to remove.
89− * @example
89+ * @example <caption>Remove a menu and nested submenu.</caption>
9090 * Menu.removeMenu("Test Menu > Test Sub Menu");
9191 * Menu.removeMenu("Test Menu");
9292 */
@@ -97,20 +97,21 @@ public slots: · 4 unmodified lines
9797 * @function Menu.menuExists
9898 * @param {string} menuName - Name of the menu to check for existence.
9999 * @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>
101101 * if (Menu.menuExists("Developer")) {
102− * // Perform a task if there is a Developer menu.
102+ * print("Developer menu exists.");
103103 * }
104104 */
105105 bool menuExists(const QString& menuName);
106106
107107 /**jsdoc
108− * Add a separator with an unclickable label below it.
109− * The line will be placed at the bottom of the menu.
108+ * Add a separator with an unclickable label below it. The separator 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.
110111 * @function Menu.addSeparator
111112 * @param {string} menuName Name of the menu to add a separator to.
112113 * @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>
114115 * Menu.addSeparator("Developer","Test Separator");
115116 */
116117 void addSeparator(const QString& menuName, const QString& separatorName);
@@ -120,7 +121,7 @@ public slots: · 3 unmodified lines
120121 * @function Menu.removeSeparator
121122 * @param {string} menuName Name of the menu to remove the separator from.
122123 * @param {string} separatorName Name of the separator to remove.
123− * @example
124+ * @example <caption>Remove a separator.</caption>
124125 * Menu.removeSeparator("Developer","Test Separator");
125126 */
126127 void removeSeparator(const QString& menuName, const QString& separatorName);
@@ -129,7 +130,7 @@ public slots: · 2 unmodified lines
129130 * Add a new menu item to a menu.
130131 * @function Menu.addMenuItem
131132 * @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>
133134 * Menu.addMenuItem({
134135 * menuName: "Developer",
135136 * menuItemName: "Test",
@@ -141,12 +142,12 @@ public slots: · 5 unmodified lines
141142 void addMenuItem(const MenuItemProperties& properties);
142143
143144 /**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.
145146 * @function Menu.addMenuItem
146147 * @param {string} menuName Name of the menu to add a menu item to.
147148 * @param {string} menuItem Name of the menu item. This is what will be displayed in the menu.
148149 * @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>
150151 * Menu.addMenuItem("Developer", "Test", "Ctrl+Shift+T");
151152 */
152153 void addMenuItem(const QString& menuName, const QString& menuitem, const QString& shortcutKey);
@@ -167,9 +168,9 @@ public slots: · 14 unmodified lines
167168 * @param {string} menuName Name of the menu that the menu item is in.
168169 * @param {string} menuItem Name of the menu item to check for existence of.
169170 * @returns {boolean} <code>true</code> if the menu item exists, otherwise <code>false</code>.
170− * @example
171+ * @example <caption>Determine if the Developer &gt; Stats menu exists.</caption>
171172 * 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.");
173174 * }
174175 */
175176 bool menuItemExists(const QString& menuName, const QString& menuitem);
@@ -185,7 +186,7 @@ public slots: · 9 unmodified lines
185186 * Check whether a checkable menu item is checked.
186187 * @function Menu.isOptionChecked
187188 * @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>.
189190 */
190191 bool isOptionChecked(const QString& menuOption);
191192
@@ -209,7 +210,7 @@ public slots: · 17 unmodified lines
209210 * Menus are enabled by default.
210211 * @function Menu.isMenuEnabled
211212 * @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>.
213214 */
214215 bool isMenuEnabled(const QString& menuName);
215216
@@ -233,7 +234,7 @@ signals: · 17 unmodified lines
233234 * @function Menu.menuItemEvent
234235 * @param {string} menuItem Name of the menu item that was clicked.
235236 * @returns {Signal}
236− * @example
237+ * @example <caption>Detect menu item events.</caption>
237238 * function onMenuItemEvent(menuItem) {
238239 * print("You clicked on " + menuItem);
239240 * }