mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-23 07:46:36 +08:00
docs(observer): fix minor typos
This commit is contained in:
@@ -456,7 +456,7 @@ Subject's value to be set to ``1`` or ``0`` respectively.
|
||||
Specific Widget Types
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To learn how to bind subjects to Arcs, Labels, Slider, etc. visit the "Data binding"
|
||||
To learn how to bind subjects to Arcs, Labels, Sliders, etc. visit the "Data binding"
|
||||
section of the given widget's documentation. For example: :ref:`Data binding for lv_label <lv_label_data_binding>`.
|
||||
|
||||
Change Subject on Event
|
||||
|
||||
@@ -197,7 +197,7 @@ To get familiar with observers, subjects, and data bindings in general visit the
|
||||
:ref:`Observer <observer_how_to_use>` page.
|
||||
|
||||
This method of subscribing to a Subject affects a Label Widget's
|
||||
``text``. The Subject can be an STRING, POINTER or INTEGER type.
|
||||
``text``. The Subject can be a STRING, POINTER, INTEGER, or FLOAT type.
|
||||
|
||||
When the subscription occurs, and each time the Subject's value is changed thereafter,
|
||||
the Subject's value is used to update the Label's text as follows:
|
||||
|
||||
@@ -236,9 +236,8 @@ bool lv_label_get_recolor(const lv_obj_t * obj);
|
||||
* @param fmt optional printf-like format string with 1 format specifier (e.g. "%d °C")
|
||||
* or NULL to bind to the value directly.
|
||||
* @return pointer to newly-created Observer
|
||||
* @note `fmt == NULL` can be used only with string and pointer Subjects.
|
||||
* @note If Subject is a pointer and `fmt == NULL`, pointer must point
|
||||
* to a `\0` terminated string.
|
||||
* @note If `fmt == NULL` strings and pointers (`\0` terminated string) will be shown
|
||||
* as text as they are, integers as %d, floats as %0.1f
|
||||
*/
|
||||
lv_observer_t * lv_label_bind_text(lv_obj_t * obj, lv_subject_t * subject, const char * fmt);
|
||||
#endif
|
||||
|
||||
@@ -528,7 +528,8 @@ int32_t lv_scale_get_range_max_value(lv_obj_t * obj)
|
||||
lv_observer_t * lv_scale_bind_section_min_value(lv_obj_t * obj, lv_scale_section_t * section, lv_subject_t * subject)
|
||||
{
|
||||
LV_ASSERT_NULL(subject);
|
||||
LV_ASSERT_NULL(obj);
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
LV_ASSERT_NULL(section);
|
||||
|
||||
if(subject->type != LV_SUBJECT_TYPE_INT) {
|
||||
LV_LOG_WARN("Incompatible subject type: %d", subject->type);
|
||||
@@ -543,7 +544,8 @@ lv_observer_t * lv_scale_bind_section_min_value(lv_obj_t * obj, lv_scale_section
|
||||
lv_observer_t * lv_scale_bind_section_max_value(lv_obj_t * obj, lv_scale_section_t * section, lv_subject_t * subject)
|
||||
{
|
||||
LV_ASSERT_NULL(subject);
|
||||
LV_ASSERT_NULL(obj);
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
LV_ASSERT_NULL(section);
|
||||
|
||||
if(subject->type != LV_SUBJECT_TYPE_INT) {
|
||||
LV_LOG_WARN("Incompatible subject type: %d", subject->type);
|
||||
|
||||
@@ -186,7 +186,7 @@ bool lv_slider_is_symmetrical(lv_obj_t * obj);
|
||||
|
||||
#if LV_USE_OBSERVER
|
||||
/**
|
||||
* Bind an integer Subject to a Slider's value.
|
||||
* Bind an integer or float Subject to a Slider's value.
|
||||
* @param obj pointer to Slider
|
||||
* @param subject pointer to Subject
|
||||
* @return pointer to newly-created Observer
|
||||
|
||||
@@ -49,6 +49,7 @@ typedef struct {
|
||||
void * element; /**< span of a span group*/
|
||||
const char * fmt;
|
||||
} bind_element_string_t;
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
@@ -345,7 +345,6 @@ void lv_spangroup_refresh(lv_obj_t * obj);
|
||||
* @param fmt optional printf-like format string with 1 format specifier (e.g. "%d °C")
|
||||
* or NULL to bind to the value directly.
|
||||
* @return pointer to newly-created Observer
|
||||
* @note `fmt == NULL` can be used only with string and pointer Subjects.
|
||||
* @note If `fmt == NULL` strings and pointers (`\0` terminated string) will be shown
|
||||
* as text as they are, integers as %d, floats as %0.1f
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user