feat(docs): batch 6 of proofread/edited docs (#7277)

This commit is contained in:
Victor Wheeler
2024-11-25 08:20:26 -07:00
committed by GitHub
parent 804aaede39
commit 8c2289f87f
6 changed files with 389 additions and 196 deletions

View File

@@ -4,39 +4,42 @@
Menu (lv_menu)
==============
Overview
********
The menu widget can be used to easily create multi-level menus. It
handles the traversal between pages automatically.
The Menu Widget can be used to easily create multi-level menus. It
handles the traversal between Pages automatically.
.. _lv_menu_parts_and_styles:
Parts and Styles
****************
The menu widget is built from the following Widgets:
The Menu Widget is built from the following Widgets:
- Main container: :cpp:type:`lv_menu_main_cont`
- Main header: :cpp:type:`lv_menu_main_header_cont`
- Back button: :ref:`lv_button`
- Back button icon: :ref:`lv_image`
- Main page: :cpp:type:`lv_menu_page`
- Main Page: :cpp:type:`lv_menu_page`
- Sidebar container: :cpp:type:`lv_menu_sidebar_cont`
- Sidebar header: :cpp:type:`lv_menu_sidebar_header_cont`
- Back button: :ref:`lv_button`
- Back button icon: :ref:`lv_image`
- Sidebar page: :cpp:type:`lv_menu_page`
- Sidebar Page: :cpp:type:`lv_menu_page`
.. _lv_menu_usage:
Usage
*****
Create a menu
Create a Menu
-------------
:cpp:expr:`lv_menu_create(parent)` creates a new empty menu.
:cpp:expr:`lv_menu_create(parent)` creates a new empty Menu.
Header mode
-----------
@@ -60,41 +63,41 @@ The following root back button modes exist:
You can set root back button modes with
:cpp:expr:`lv_menu_set_mode_root_back_button(menu, LV_MENU_ROOT_BACK_BTN...)`.
Create a menu page
Create a Menu Page
------------------
:cpp:expr:`lv_menu_page_create(menu, title)` creates a new empty menu page. You
can add any widgets to the page.
:cpp:expr:`lv_menu_page_create(menu, title)` creates a new empty Menu Page. You
can add any Widgets to the Page.
Set a menu page in the main area
Set a Menu Page in the main area
--------------------------------
Once a menu page has been created, you can set it to the main area with
:cpp:expr:`lv_menu_set_page(menu, page)`. ``NULL`` to clear main and clear menu
Once a Menu Page has been created, you can set it to the main area with
:cpp:expr:`lv_menu_set_page(menu, page)`. ``NULL`` to clear main and clear Menu
history.
Set a menu page in the sidebar
Set a Menu Page in the sidebar
------------------------------
Once a menu page has been created, you can set it to the sidebar with
Once a Menu Page has been created, you can set it to the sidebar with
:cpp:expr:`lv_menu_set_sidebar_page(menu, page)`. ``NULL`` to clear sidebar.
Linking between menu pages
Linking between Menu Pages
--------------------------
For instance, you have created a button obj in the main page. When you
click the button Widget, you want it to open up a new page, use
If you have, for instance, created a button obj in the main Page. When you
click the button Widget, you want it to open up a new Page, use
:cpp:expr:`lv_menu_set_load_page_event(menu, btn, new page)`.
Create a menu container, section, separator
Create a Menu container, section, separator
-------------------------------------------
The following objects can be created so that it is easier to style the
menu:
Menu:
- :cpp:expr:`lv_menu_cont_create(parent page)` creates a new empty container.
- :cpp:expr:`lv_menu_section_create(parent page)` creates a new empty section.
- :cpp:expr:`lv_menu_separator_create(parent page)` creates a separator.
- :cpp:expr:`lv_menu_cont_create(parent_page)` creates a new empty container.
- :cpp:expr:`lv_menu_section_create(parent_page)` creates a new empty section.
- :cpp:expr:`lv_menu_separator_create(parent_page)` creates a separator.
@@ -103,19 +106,19 @@ menu:
Events
******
- :cpp:enumerator:`LV_EVENT_VALUE_CHANGED` Sent when a page is shown.
- :cpp:enumerator:`LV_EVENT_VALUE_CHANGED` Sent when a Page is shown.
- :cpp:expr:`lv_menu_get_cur_main_page(menu)` returns a pointer to menu page
that is currently displayed in main.
- :cpp:expr:`lv_menu_get_cur_sidebar_page(menu)` returns a pointer to menu
page that is currently displayed in sidebar.
- :cpp:expr:`lv_menu_get_cur_main_page(menu)` returns a pointer to Menu Page
that is currently displayed in the main container.
- :cpp:expr:`lv_menu_get_cur_sidebar_page(menu)` returns a pointer to Menu
Page that is currently displayed in the sidebar container.
- :cpp:enumerator:`LV_EVENT_CLICKED` Sent when a back button in a header from either
main or sidebar is clicked. :cpp:enumerator:`LV_OBJ_FLAG_EVENT_BUBBLE` is enabled
on the buttons so you can add events to the menu itself.
on the buttons so you can add events to the Menu itself.
- :cpp:expr:`lv_menu_back_button_is_root(menu, button)` to check if button is root
back button
back button.
.. admonition:: Further Reading