-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Sub-menu item | ||
------------- | ||
|
||
The sub-menu item is a menu item that opens a new menu screen when selected. | ||
It is used to create a hierarchical menu structure with multiple levels of navigation. | ||
|
||
This can be useful for organizing menu items into categories or sub-menus, making it easier for users to navigate through the menu system. | ||
|
||
A sub-menu item can be created using the following syntax: | ||
|
||
You first need to define the sub-menu screen with the desired menu items: | ||
|
||
.. code-block:: cpp | ||
MENU_SCREEN(subMenuScreen, subMenuItems, | ||
ITEM_BASIC("Sub-item 1"), | ||
ITEM_BASIC("Sub-item 2"), | ||
ITEM_BASIC("Sub-item 3"), | ||
ITEM_BASIC("Sub-item 4")); | ||
Then you can create a sub-menu item entry that links to the sub-menu screen in the parent menu: | ||
|
||
.. code-block:: cpp | ||
// ... More menu items | ||
ITEM_SUBMENU("Sub-menu 1", subMenuScreen) | ||
// ... More menu items | ||
When the ``Sub-menu 1`` menu item is selected, the sub-menu screen will be displayed, showing the list of sub-items. | ||
|
||
.. image:: images/item-submenu.gif | ||
:alt: Example of a sub-menu item | ||
|
||
You can create multiple levels of sub-menus by nesting sub-menu items within other sub-menu screens. | ||
|
||
Find more information about the sub-menu item in the :doc:`API reference </reference/api/ItemSubMenu>`. |