This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dev:v3:gui_api:menu:main_window [2020/07/06 14:27] – [Description] jedi18 | dev:v3:gui_api:menu:main_window [2020/07/06 14:39] (current) – [Main Window Menu GUI API Functions] jedi18 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Main Window Menu GUI API Functions ====== | ====== Main Window Menu GUI API Functions ====== | ||
[[https:// | [[https:// | ||
- | < | + | < |
---- | ---- | ||
Line 11: | Line 11: | ||
Add a menu to the MenuBar of the Main Window. Menu is an instance of the Menu GUI class. | Add a menu to the MenuBar of the Main Window. Menu is an instance of the Menu GUI class. | ||
- | Will not add if another menu of the same label already exists. | + | Will not add if another menu of the same label already exists |
+ | \\ Note :- Menu of same label may exist in a menu inside a menu of the menu bar i.e. more than one level away from the menu bar. | ||
- | * Menu Name | + | * Menu Name - //string// |
- | * Pointer to Menu GUI object | + | * Pointer to Menu GUI object |
==== Examples ==== | ==== Examples ==== | ||
Line 29: | Line 30: | ||
==== Description ==== | ==== Description ==== | ||
- | Return pointer to menu of the given name or position present in the menu bar. | + | Return pointer to menu of the given **name** or **position** present in the menu bar. Returns nullptr if not present. |
- | * <code cpp-qt> lc:: | + | * Menu Label - //string// |
- | * Get menu by name/label | + | * Menu Position |
- | | + | |
- | | + | |
- | * Returns :- | + | |
- | * **Pointer to the menu** of the given name in the menu bar. | + | |
- | + | ||
- | + | ||
- | * <code cpp-qt> lc:: | + | |
- | * Get menu by position | + | |
- | * Parameters :- | + | |
- | - Position (int) - **Position** of the menu in the menu bar (Starting from 0 on the left most menu) | + | |
- | * Returns :- | + | |
- | - **Pointer to menu** of the given position in the menu bar. | + | |
==== Examples ==== | ==== Examples ==== | ||
Line 59: | Line 48: | ||
==== Description ==== | ==== Description ==== | ||
- | Remove menu of the given name or at the given position from the menu bar. Does nothing if menu does not exist in the menu bar. | + | Remove menu of the given **name** or at the given **position** from the menu bar. Does nothing if menu does not exist in the menu bar. |
- | * <code cpp-qt> void removeMenu(const char* menuLabel) </code> | + | * Menu Label - //string// |
- | * Remove menu of the given name/label | + | * Menu Position |
- | | + | |
- | | + | |
- | + | ||
- | + | ||
- | * <code cpp-qt> void removeMenu(int position) </code> | + | |
- | * Remove menu at the given position in the menu bar. | + | |
- | * Parameters :- | + | |
- | - Position (int) - **Position** of the menu in the menu bar (Starting from 0 on the left most menu) | + | |
==== Examples ==== | ==== Examples ==== | ||
Line 87: | Line 68: | ||
Find and return the first menu item found of the given **label**/ | Find and return the first menu item found of the given **label**/ | ||
- | * <code cpp-qt> lc:: | + | * Menu Item Label - //string// |
- | | + | * Menu Item Qt Object |
- | * Parameters :- | + | |
- | | + | |
- | * Returns :- | + | |
- | - **Pointer to menu item** found of the given label. | + | |
- | + | ||
- | + | ||
- | * <code cpp-qt> lc:: | + | |
- | * Find menu item of the given qt object name. | + | |
- | * Parameters :- | + | |
- | - Object name - **Qt object name** of the menu item to be found. | + | |
- | * Returns :- | + | |
- | - **Pointer to menu item** found of the given object name. | + | |
==== Examples ==== | ==== Examples ==== | ||