docs: bring back flat widget directory structure
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
The Button Matrix object is a lightweight way to display multiple buttons in rows and columns. Lightweight because the buttons are not actually created but just virtually drawn on the fly. This way, one button use only eight extra bytes of memory instead of the ~100-150 bytes a normal [Button](/widgets/core/btn) object plus the 100 or so bytes for the [Label](/widgets/core/label) object.
|
||||
The Button Matrix object is a lightweight way to display multiple buttons in rows and columns. Lightweight because the buttons are not actually created but just virtually drawn on the fly. This way, one button use only eight extra bytes of memory instead of the ~100-150 bytes a normal [Button](/widgets/btn) object plus the 100 or so bytes for the [Label](/widgets/label) object.
|
||||
|
||||
The Button matrix is added to the default group (if one is set). Besides the Button matrix is an editable object to allow selecting and clicking the buttons with encoder navigation too.
|
||||
|
||||
@@ -13,7 +13,7 @@ The Calendar is added to the default group (if it is set). Calendar is an editab
|
||||
To make the Calendar flexible, by default it doesn't show the current year or month. Instead, there are optional "headers" that can be attached to the calendar.
|
||||
|
||||
## Parts and Styles
|
||||
The calendar object uses the [Button matrix](/widgets/core/btnmatrix) object under the hood to arrange the days into a matrix.
|
||||
The calendar object uses the [Button matrix](/widgets/btnmatrix) object under the hood to arrange the days into a matrix.
|
||||
- `LV_PART_MAIN` The background of the calendar. Uses all the background related style properties.
|
||||
- `LV_PART_ITEMS` Refers to the dates and day names. Button matrix control flags are set to differentiate the buttons and a custom drawer event is added modify the properties of the buttons as follows:
|
||||
- day names have no border, no background and drawn with a gray color
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
A Canvas inherits from [Image](/widgets/core/img) where the user can draw anything.
|
||||
A Canvas inherits from [Image](/widgets/img) where the user can draw anything.
|
||||
Rectangles, texts, images, lines, arcs can be drawn here using lvgl's drawing engine.
|
||||
Additionally "effects" can be applied, such as rotation, zoom and blur.
|
||||
|
||||
@@ -77,7 +77,7 @@ A given area of the canvas can be blurred horizontally with `lv_canvas_blur_hor(
|
||||
No special events are sent by canvas objects.
|
||||
The same events are sent as for the
|
||||
|
||||
See the events of the [Images](/widgets/core/img) too.
|
||||
See the events of the [Images](/widgets/img) too.
|
||||
|
||||
Learn more about [Events](/overview/event).
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# Core widgets
|
||||
|
||||
```eval_rst
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
arc
|
||||
bar
|
||||
btn
|
||||
btnmatrix
|
||||
canvas
|
||||
checkbox
|
||||
dropdown
|
||||
img
|
||||
label
|
||||
line
|
||||
roller
|
||||
slider
|
||||
switch
|
||||
table
|
||||
textarea
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# Extra widgets
|
||||
|
||||
```eval_rst
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
animimg
|
||||
calendar
|
||||
chart
|
||||
colorwheel
|
||||
imgbtn
|
||||
keyboard
|
||||
led
|
||||
list
|
||||
menu
|
||||
meter
|
||||
msgbox
|
||||
span
|
||||
spinbox
|
||||
spinner
|
||||
tabview
|
||||
tileview
|
||||
win
|
||||
```
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ To use external files, you also need to convert the image files using the online
|
||||
You also need to use LVGL's file system module and register a driver with some functions for the basic file operation. Go to the [File system](/overview/file-system) to learn more.
|
||||
To set an image sourced from a file, use `lv_img_set_src(img, "S:folder1/my_img.bin")`.
|
||||
|
||||
You can also set a symbol similarly to [Labels](/widgets/core/label). In this case, the image will be rendered as text according to the *font* specified in the style. It enables to use of light-weight monochrome "letters" instead of real images. You can set symbol like `lv_img_set_src(img1, LV_SYMBOL_OK)`.
|
||||
You can also set a symbol similarly to [Labels](/widgets/label). In this case, the image will be rendered as text according to the *font* specified in the style. It enables to use of light-weight monochrome "letters" instead of real images. You can set symbol like `lv_img_set_src(img1, LV_SYMBOL_OK)`.
|
||||
|
||||
### Label as an image
|
||||
Images and labels are sometimes used to convey the same thing. For example, to describe what a button does.
|
||||
@@ -16,7 +16,7 @@ You can set a left, right and center image, and the center image will be repeate
|
||||
### Image sources
|
||||
To set the image in a state, use the `lv_imgbtn_set_src(imgbtn, LV_IMGBTN_STATE_..., src_left, src_center, src_right)`.
|
||||
|
||||
The image sources work the same as described in the [Image object](/widgets/core/img) except that "Symbols" are not supported by the Image button.
|
||||
The image sources work the same as described in the [Image object](/widgets/img) except that "Symbols" are not supported by the Image button.
|
||||
Any of the sources can `NULL`.
|
||||
|
||||
The possible states are:
|
||||
@@ -6,8 +6,39 @@
|
||||
:maxdepth: 1
|
||||
|
||||
obj
|
||||
core/index
|
||||
extra/index
|
||||
arc
|
||||
animimg
|
||||
bar
|
||||
btn
|
||||
btnmatrix
|
||||
calendar
|
||||
chart
|
||||
colorwheel
|
||||
canvas
|
||||
checkbox
|
||||
dropdown
|
||||
img
|
||||
imgbtn
|
||||
keyboard
|
||||
label
|
||||
led
|
||||
line
|
||||
list
|
||||
menu
|
||||
meter
|
||||
msgbox
|
||||
roller
|
||||
slider
|
||||
span
|
||||
spinbox
|
||||
spinner
|
||||
switch
|
||||
table
|
||||
tabview
|
||||
textarea
|
||||
tileview
|
||||
win
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
The Keyboard object is a special [Button matrix](/widgets/core/btnmatrix) with predefined keymaps and other features to realize a virtual keyboard to write texts into a [Text area](/widgets/core/textarea).
|
||||
The Keyboard object is a special [Button matrix](/widgets/btnmatrix) with predefined keymaps and other features to realize a virtual keyboard to write texts into a [Text area](/widgets/textarea).
|
||||
|
||||
## Parts and Styles
|
||||
Similarly to Button matrices Keyboards consist of 2 part:
|
||||
@@ -26,7 +26,7 @@ The `TEXT` modes' layout contains buttons to change mode.
|
||||
To set the mode manually, use `lv_keyboard_set_mode(kb, mode)`. The default mode is `LV_KEYBOARD_MODE_TEXT_UPPER`.
|
||||
|
||||
### Assign Text area
|
||||
You can assign a [Text area](/widgets/core/textarea) to the Keyboard to automatically put the clicked characters there.
|
||||
You can assign a [Text area](/widgets/textarea) to the Keyboard to automatically put the clicked characters there.
|
||||
To assign the text area, use `lv_keyboard_set_textarea(kb, ta)`.
|
||||
|
||||
### Key Popovers
|
||||
@@ -37,7 +37,7 @@ Note that popovers for keys in the top row will draw outside the widget boundari
|
||||
The popovers currently are merely a visual effect and don't allow selecting additional characters such as accents yet.
|
||||
|
||||
### New Keymap
|
||||
You can specify a new map (layout) for the keyboard with `lv_keyboard_set_map(kb, LV_KEYBOARD_MODE_..., kb_map, kb_ctrl);`. See the [Button matrix](/widgets/core/btnmatrix) for more information about creating new maps a ctrls.
|
||||
You can specify a new map (layout) for the keyboard with `lv_keyboard_set_map(kb, LV_KEYBOARD_MODE_..., kb_map, kb_ctrl);`. See the [Button matrix](/widgets/btnmatrix) for more information about creating new maps a ctrls.
|
||||
|
||||
Keep in mind that using following keywords will have the same effect as with the original map:
|
||||
- `LV_SYMBOL_OK` Send `LV_EVENT_RADY` to the assigend Text area.
|
||||
@@ -48,7 +48,7 @@ This feature can be enabled individually for each label by `lv_label_set_recolor
|
||||
|
||||
### Text selection
|
||||
If enabled by `LV_LABEL_TEXT_SELECTION` part of the text can be selected. It's similar to when you use your mouse on a PC to select a text.
|
||||
The whole mechanism (click and select the text as you drag your finger/mouse) is implemented in [Text area](/widgets/core/textarea) and the Label widget only allows manual text selection with
|
||||
The whole mechanism (click and select the text as you drag your finger/mouse) is implemented in [Text area](/widgets/textarea) and the Label widget only allows manual text selection with
|
||||
`lv_label_get_text_selection_start(label, start_char_index)` and `lv_label_get_text_selection_start(label, end_char_index)`.
|
||||
|
||||
### Very long texts
|
||||
@@ -10,7 +10,7 @@ The List is basically a rectangle with vertical layout to which Buttons and Text
|
||||
- `LV_PART_SCROLLBAR` The scrollbar. See the [Base objects](/widgets/obj) documentation for details.
|
||||
|
||||
**Buttons and Texts**
|
||||
See the [Button](/widgets/core/btn)'s and [Label](/widgets/core/label)'s documentation.
|
||||
See the [Button](/widgets/btn)'s and [Label](/widgets/label)'s documentation.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,13 +7,13 @@ The menu widget can be used to easily create multi-level menus. It handles the t
|
||||
The menu widget is built from the following objects:
|
||||
- Main container: lv_menu_main_cont
|
||||
- Main header: lv_menu_main_header_cont
|
||||
- Back btn: [lv_btn](/widgets/core/btn)
|
||||
- Back btn icon: [lv_img](/widgets/core/img)
|
||||
- Back btn: [lv_btn](/widgets/btn)
|
||||
- Back btn icon: [lv_img](/widgets/img)
|
||||
- Main page: lv_menu_page
|
||||
- Sidebar container: lv_menu_sidebar_cont
|
||||
- Sidebar header: lv_menu_sidebar_header_cont
|
||||
- Back btn: [lv_btn](/widgets/core/btn)
|
||||
- Back btn icon: [lv_img](/widgets/core/img)
|
||||
- Back btn: [lv_btn](/widgets/btn)
|
||||
- Back btn icon: [lv_img](/widgets/img)
|
||||
- Sidebar page: lv_menu_page
|
||||
|
||||
## Usage
|
||||
@@ -11,9 +11,9 @@ The message box can be modal (blocking clicks on the rest of the screen) or not
|
||||
## Parts and Styles
|
||||
The message box is built from other widgets, so you can check these widgets' documentation for details.
|
||||
- Background: [lv_obj](/widgets/obj)
|
||||
- Close button: [lv_btn](/widgets/core/btn)
|
||||
- Title and text: [lv_label](/widgets/core/label)
|
||||
- Buttons: [lv_btnmatrix](/widgets/core/btnmatrix)
|
||||
- Close button: [lv_btn](/widgets/btn)
|
||||
- Title and text: [lv_label](/widgets/label)
|
||||
- Buttons: [lv_btnmatrix](/widgets/btnmatrix)
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
The Slider object looks like a [Bar](/widgets/core/bar) supplemented with a knob. The knob can be dragged to set a value. Just like Bar, Slider can be vertical or horizontal.
|
||||
The Slider object looks like a [Bar](/widgets/bar) supplemented with a knob. The knob can be dragged to set a value. Just like Bar, Slider can be vertical or horizontal.
|
||||
|
||||
|
||||
## Parts and Styles
|
||||
@@ -46,7 +46,7 @@ The extended click area (set by `lv_obj_set_ext_click_area(slider, value)`) incr
|
||||
- `rect_dsc`
|
||||
- `id`: 1
|
||||
|
||||
See the events of the [Bar](/widgets/core/bar) too.
|
||||
See the events of the [Bar](/widgets/bar) too.
|
||||
|
||||
Learn more about [Events](/overview/event).
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
## Overview
|
||||
The Spinbox contains a number as text which can be increased or decreased by *Keys* or API functions.
|
||||
Under the hood the Spinbox is a modified [Text area](/widgets/core/textarea).
|
||||
Under the hood the Spinbox is a modified [Text area](/widgets/textarea).
|
||||
|
||||
## Parts and Styles
|
||||
The parts of the Spinbox are identical to the [Text area](/widgets/core/textarea).
|
||||
The parts of the Spinbox are identical to the [Text area](/widgets/textarea).
|
||||
|
||||
### Value, range and step
|
||||
`lv_spinbox_set_value(spinbox, 1234)` sets a new value on the Spinbox.
|
||||
@@ -31,7 +31,7 @@ If an encoder is used as input device, the selected digit is shifted to the righ
|
||||
## Events
|
||||
- `LV_EVENT_VALUE_CHANGED` Sent when the value has changed.
|
||||
|
||||
See the events of the [Text area](/widgets/core/textarea) too.
|
||||
See the events of the [Text area](/widgets/textarea) too.
|
||||
|
||||
Learn more about [Events](/overview/event).
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
The Spinner object is a spinning arc over a ring.
|
||||
|
||||
## Parts and Styles
|
||||
The parts are identical to the parts of [lv_arc](/widgets/core/arc).
|
||||
The parts are identical to the parts of [lv_arc](/widgets/arc).
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -15,7 +15,7 @@ To create a spinner use `lv_spinner_create(parent, spin_time, arc_length)`. `spi
|
||||
## Events
|
||||
No special events are sent to the Spinner.
|
||||
|
||||
See the events of the [Arc](/widgets/core/arc) too.
|
||||
See the events of the [Arc](/widgets/arc) too.
|
||||
|
||||
Learn more about [Events](/overview/event).
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The Tab view object can be used to organize content in tabs.
|
||||
The Tab view is built from other widgets:
|
||||
- Main container: [lv_obj](/widgets/obj))
|
||||
- Tab buttons: [lv_btnmatrix](/widgets/core/btnmatrix)
|
||||
- Tab buttons: [lv_btnmatrix](/widgets/btnmatrix)
|
||||
- Container for the tabs: [lv_obj](/widgets/obj)
|
||||
- Content of the tabs: [lv_obj](/widgets/obj)
|
||||
|
||||
@@ -41,7 +41,7 @@ To select a new tab you can:
|
||||
|
||||
### Get the parts
|
||||
|
||||
`lv_tabview_get_content(tabview)` returns the container for the tabs, `lv_tabview_get_tab_btns(tabview)` returns the Tab buttons object which is a [Button matrix](/widgets/core/btnmatrix).
|
||||
`lv_tabview_get_content(tabview)` returns the container for the tabs, `lv_tabview_get_tab_btns(tabview)` returns the Tab buttons object which is a [Button matrix](/widgets/btnmatrix).
|
||||
|
||||
## Events
|
||||
- `LV_EVENT_VALUE_CHANGED` Sent when a new tab is selected by sliding or clicking the tab button. `lv_tabview_get_tab_act(tabview)` returns the zero based index of the current tab.
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
The Text Area is a [Base object](widgets/obj) with a [Label](/widgets/core/label) and a cursor on it.
|
||||
The Text Area is a [Base object](widgets/obj) with a [Label](/widgets/label) and a cursor on it.
|
||||
Texts or characters can be added to it.
|
||||
Long lines are wrapped and when the text becomes long enough the Text area can be scrolled.
|
||||
|
||||
@@ -11,7 +11,7 @@ One line mode and password modes are supported.
|
||||
## Parts and Styles
|
||||
- `LV_PART_MAIN` The background of the text area. Uses all the typical background style properties and the text related style properties including `text_align` to align the text to the left, right or center.
|
||||
- `LV_PART_SCROLLBAR` The scrollbar that is shown when the text is too long.
|
||||
- `LV_PART_SELECTED` Determines the style of the [selected text](/widgets/core/label.html#text-selection). Only `text_color` and `bg_color` style properties can be used. `bg_color` should be set directly on the label of the text area.
|
||||
- `LV_PART_SELECTED` Determines the style of the [selected text](/widgets/label.html#text-selection). Only `text_color` and `bg_color` style properties can be used. `bg_color` should be set directly on the label of the text area.
|
||||
- `LV_PART_CURSOR` Marks the position where the characters are inserted. The cursor's area is always the bounding box of the current character.
|
||||
A block cursor can be created by adding a background color and background opacity to `LV_PART_CURSOR`'s style. The create line cursor leave the cursor transparent and set a left border.
|
||||
The `anim_time` style property sets the cursor's blink time.
|
||||
@@ -8,8 +8,8 @@ The Window is container-like object built from a header with title and buttons a
|
||||
The Window is built from other widgets so you can check their documentation for details:
|
||||
- Background: [lv_obj](/widgets/obj)
|
||||
- Header on the background: [lv_obj](/widgets/obj)
|
||||
- Title on the header: [lv_label](/widgets/core/label)
|
||||
- Buttons on the header: [lv_btn](/widgets/core/btn)
|
||||
- Title on the header: [lv_label](/widgets/label)
|
||||
- Buttons on the header: [lv_btn](/widgets/btn)
|
||||
- Content area on the background: [lv_obj](/widgets/obj)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user