This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dev:v3:gui_api:menu:menu [2020/07/06 06:04] – created jedi18 | dev:v3:gui_api:menu:menu [2020/07/07 04:18] (current) – jedi18 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Menu GUI Class ====== | + | ====== Menu Item GUI Class ====== |
- | [[https:// | + | [[https:// |
<code cpp-qt> namespace lc::ui::api </ | <code cpp-qt> namespace lc::ui::api </ | ||
---- | ---- | ||
+ | ===== Menu Item Constructor ===== | ||
+ | ---- | ||
+ | |||
+ | ==== Description ==== | ||
+ | |||
+ | Constructs a menu item gui object. Menu item after being constructed needs to be added to a menu for it to be visible in the application. | ||
+ | |||
+ | * Menu Item Name - //string// | ||
+ | * Menu Item Name - //string// , Lua Callback - // | ||
+ | |||
+ | ==== Examples ==== | ||
+ | |||
+ | * <code lua> local item1 = gui.MenuItem(" | ||
+ | * <code lua> local item1 = gui.MenuItem(" | ||
+ | |||
+ | ---- | ||
+ | ===== Add Callback ===== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Description ==== | ||
+ | |||
+ | Add lua function callback to be called when the menu item is clicked. Multiple callbacks can be added. Callbacks can also be named callbacks i.e. associated with a name so that it can be later removed by use of the name. | ||
+ | |||
+ | * Lua Callback - // | ||
+ | * Callback name - //string// , Lua Callback - // | ||
+ | |||
+ | ==== Examples ==== | ||
+ | |||
+ | * <code lua> item1: | ||
+ | * <code lua> item1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Remove Callback ===== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Description ==== | ||
+ | |||
+ | Remove lua function called associated with the given name. Only named callbacks can be removed. | ||
+ | |||
+ | * Callback name - //string// | ||
+ | |||
+ | ==== Examples ==== | ||
+ | |||
+ | * <code lua> item1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Label ===== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Description ==== | ||
+ | |||
+ | Get and set label for the menu item. | ||
+ | |||
+ | ==== Examples ==== | ||
+ | |||
+ | * <code lua> message(item1: | ||
+ | * <code lua> item1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Hide and Show ===== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Description ==== | ||
+ | |||
+ | Hide or show the menu item. | ||
+ | |||
+ | ==== Examples ==== | ||
+ | |||
+ | * <code lua> item1: | ||
+ | * <code lua> item1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Position ===== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Description ==== | ||
+ | |||
+ | Get the current menu item position or set the menu item position. Other items are rearranged accordingly. | ||
+ | |||
+ | * New Position - //int// | ||
+ | |||
+ | ==== Examples ==== | ||
+ | |||
+ | * <code lua> local pos = item1: | ||
+ | * <code lua> item1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Remove ===== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Description ==== | ||
+ | |||
+ | Remove the current menu item from the parent menu. | ||
+ | |||
+ | ==== Examples ==== | ||
+ | |||
+ | * <code lua> item1: | ||
+ | |||
+ | ---- |