MenuItem
This page has been automatically translated using the Google Translate API services. We are working on improving texts. Thank you for your understanding and patience.
Functions
MenuItem* | menuitem_create (void) |
MenuItem* | menuitem_separator (void) |
void | menuitem_OnClick (...) |
void | menuitem_enabled (...) |
void | menuitem_visible (...) |
void | menuitem_text (...) |
void | menuitem_image (...) |
void | menuitem_key (...) |
void | menuitem_submenu (...) |
void | menuitem_state (...) |
Represents an option within a Menu. They will always have an associated action that will be executed when activated.
- Use menuitem_create to create an item.
- Use menuitem_text to assign a text.
- Use menuitem_image to assign an icon.
menuitem_create ()
Create a new item for a menu.
MenuItem* menuitem_create(void);
Return
The newly item.
menuitem_separator ()
Create a new separator for a menu.
MenuItem* menuitem_separator(void);
Return
The newly item.
menuitem_OnClick ()
Set an event handle for item click.
void menuitem_OnClick(MenuItem *item, Listener *listener);
item | The item. |
listener | Callback function to be called after clicking. |
Remarks
See GUI Events.
menuitem_enabled ()
Enables or disables a menu item.
void menuitem_enabled(MenuItem *item, const bool_t enabled);
item | The item. |
enabled | Enabled or not. |
menuitem_visible ()
Show or hide a menu item.
void menuitem_visible(MenuItem *item, const bool_t enabled);
item | The item. |
enabled | Enabled or not. |
menuitem_text ()
Set the item text.
void menuitem_text(MenuItem *item, const char_t *text);
item | The item. |
text | UTF8 C-string terminated in null character |
menuitem_image ()
Set the icon that will display the item.
void menuitem_image(MenuItem *item, const Image *image);
item | The item. |
image | Image. |
menuitem_key ()
Set a keyboard shortcut to select the menu item.
void menuitem_key(MenuItem *item, const vkey_t key, const uint32_t modifiers);
item | The item. |
key | Key code. |
modifiers | Modifiers. |
menuitem_submenu ()
Assign a drop-down submenu when selecting the item.
void menuitem_submenu(MenuItem *item, Menu **submenu);
item | The item. |
submenu | The submenu. |
menuitem_state ()
Set the status of the item, which will be reflected with a mark next to the text.
void menuitem_state(MenuItem *item, const gui_state_t state);
item | The item. |
state | State. |