This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
dev:v3:gui_api:menu:main_window [2020/07/06 14:29] – [Description] jedi18 | dev:v3:gui_api:menu:main_window [2020/07/06 14:34] – [Description] jedi18 | ||
---|---|---|---|
Line 12: | Line 12: | ||
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 in the menu bar. | Will not add if another menu of the same label already exists in the menu bar. | ||
- | //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. | + | \\ 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 - menu gui object |
==== Examples ==== | ==== Examples ==== | ||
Line 30: | 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 |
- | * Get menu by name/ | + | * Menu Position (Starting from 0 on the left most menu) |
- | * Parameters :- | + | |
- | - Menu Name - **Name/Label** of the menu to be returned. | + | |
- | * Returns :- | + | |
- | * **Pointer to the menu** of the given name in the menu bar. | + | |
- | + | ||
- | + | ||
- | * <code cpp-qt> lc:: | + | |
- | * Get menu by position | + | |
- | * Parameters :- | + | |
- | | + | |
- | * Returns :- | + | |
- | - **Pointer to menu** of the given position in the menu bar. | + | |
==== Examples ==== | ==== Examples ==== | ||
Line 62: | Line 50: | ||
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) </ | + | * Menu Label - string |
- | * Remove menu of the given name/ | + | * Menu Position |
- | * Parameters :- | + | |
- | | + | |
- | + | ||
- | + | ||
- | * <code cpp-qt> void removeMenu(int position) </ | + | |
- | * 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 ==== |