mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-28 22:30:49 +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
|
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>`.
|
section of the given widget's documentation. For example: :ref:`Data binding for lv_label <lv_label_data_binding>`.
|
||||||
|
|
||||||
Change Subject on Event
|
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.
|
:ref:`Observer <observer_how_to_use>` page.
|
||||||
|
|
||||||
This method of subscribing to a Subject affects a Label Widget's
|
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,
|
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:
|
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")
|
* @param fmt optional printf-like format string with 1 format specifier (e.g. "%d °C")
|
||||||
* or NULL to bind to the value directly.
|
* or NULL to bind to the value directly.
|
||||||
* @return pointer to newly-created Observer
|
* @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
|
||||||
* @note If Subject is a pointer and `fmt == NULL`, pointer must point
|
* as text as they are, integers as %d, floats as %0.1f
|
||||||
* to a `\0` terminated string.
|
|
||||||
*/
|
*/
|
||||||
lv_observer_t * lv_label_bind_text(lv_obj_t * obj, lv_subject_t * subject, const char * fmt);
|
lv_observer_t * lv_label_bind_text(lv_obj_t * obj, lv_subject_t * subject, const char * fmt);
|
||||||
#endif
|
#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_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(subject);
|
||||||
LV_ASSERT_NULL(obj);
|
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||||
|
LV_ASSERT_NULL(section);
|
||||||
|
|
||||||
if(subject->type != LV_SUBJECT_TYPE_INT) {
|
if(subject->type != LV_SUBJECT_TYPE_INT) {
|
||||||
LV_LOG_WARN("Incompatible subject type: %d", subject->type);
|
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_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(subject);
|
||||||
LV_ASSERT_NULL(obj);
|
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||||
|
LV_ASSERT_NULL(section);
|
||||||
|
|
||||||
if(subject->type != LV_SUBJECT_TYPE_INT) {
|
if(subject->type != LV_SUBJECT_TYPE_INT) {
|
||||||
LV_LOG_WARN("Incompatible subject type: %d", subject->type);
|
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
|
#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 obj pointer to Slider
|
||||||
* @param subject pointer to Subject
|
* @param subject pointer to Subject
|
||||||
* @return pointer to newly-created Observer
|
* @return pointer to newly-created Observer
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ typedef struct {
|
|||||||
void * element; /**< span of a span group*/
|
void * element; /**< span of a span group*/
|
||||||
const char * fmt;
|
const char * fmt;
|
||||||
} bind_element_string_t;
|
} bind_element_string_t;
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC PROTOTYPES
|
* 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")
|
* @param fmt optional printf-like format string with 1 format specifier (e.g. "%d °C")
|
||||||
* or NULL to bind to the value directly.
|
* or NULL to bind to the value directly.
|
||||||
* @return pointer to newly-created Observer
|
* @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
|
* @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
|
* as text as they are, integers as %d, floats as %0.1f
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user