lv_scale.hΒΆ
Defines
-
LV_SCALE_TOTAL_TICK_COUNT_DEFAULTΒΆ
Default value of total minor ticks.
-
LV_SCALE_MAJOR_TICK_EVERY_DEFAULTΒΆ
Default value of major tick every nth ticks.
-
LV_SCALE_LABEL_ENABLED_DEFAULTΒΆ
Default value of scale label enabled.
-
LV_SCALE_LABEL_ROTATE_MATCH_TICKSΒΆ
-
LV_SCALE_LABEL_ROTATE_KEEP_UPRIGHTΒΆ
-
LV_SCALE_ROTATION_ANGLE_MASKΒΆ
Enums
-
enum lv_scale_mode_tΒΆ
Scale mode
Values:
-
enumerator LV_SCALE_MODE_HORIZONTAL_TOPΒΆ
-
enumerator LV_SCALE_MODE_HORIZONTAL_BOTTOMΒΆ
-
enumerator LV_SCALE_MODE_VERTICAL_LEFTΒΆ
-
enumerator LV_SCALE_MODE_VERTICAL_RIGHTΒΆ
-
enumerator LV_SCALE_MODE_ROUND_INNERΒΆ
-
enumerator LV_SCALE_MODE_ROUND_OUTERΒΆ
-
enumerator LV_SCALE_MODE_LASTΒΆ
-
enumerator LV_SCALE_MODE_HORIZONTAL_TOPΒΆ
Functions
-
lv_obj_t *lv_scale_create(lv_obj_t *parent)ΒΆ
Create an scale object
- Parameters:
parent β pointer to an object, it will be the parent of the new scale
- Returns:
pointer to created Scale Widget
-
void lv_scale_set_mode(lv_obj_t *obj, lv_scale_mode_t mode)ΒΆ
Set scale mode. See lv_scale_mode_t.
- Parameters:
obj β pointer to Scale Widget
mode β the new scale mode
-
void lv_scale_set_total_tick_count(lv_obj_t *obj, uint32_t total_tick_count)ΒΆ
Set scale total tick count (including minor and major ticks).
- Parameters:
obj β pointer to Scale Widget
total_tick_count β New total tick count
-
void lv_scale_set_major_tick_every(lv_obj_t *obj, uint32_t major_tick_every)ΒΆ
Sets how often major ticks are drawn.
- Parameters:
obj β pointer to Scale Widget
major_tick_every β the new count for major tick drawing
-
void lv_scale_set_label_show(lv_obj_t *obj, bool show_label)ΒΆ
Sets label visibility.
- Parameters:
obj β pointer to Scale Widget
show_label β true/false to enable tick label
-
void lv_scale_set_range(lv_obj_t *obj, int32_t min, int32_t max)ΒΆ
Set minimum and maximum values on Scale.
- Parameters:
obj β pointer to Scale Widget
min β minimum value of Scale
max β maximum value of Scale
-
void lv_scale_set_min_value(lv_obj_t *obj, int32_t min)ΒΆ
Set minimum values on Scale.
- Parameters:
obj β pointer to Scale Widget
min β minimum value of Scale
-
void lv_scale_set_max_value(lv_obj_t *obj, int32_t max)ΒΆ
Set maximum values on Scale.
- Parameters:
obj β pointer to Scale Widget
min β minimum value of Scale
-
void lv_scale_set_angle_range(lv_obj_t *obj, uint32_t angle_range)ΒΆ
Set angle between the low end and the high end of the Scale. (Applies only to round Scales.)
- Parameters:
obj β pointer to Scale Widget
max_angle β angle in degrees from Scale minimum where top end of Scale will be drawn
-
void lv_scale_set_rotation(lv_obj_t *obj, int32_t rotation)ΒΆ
Set angular offset from the 3-o'clock position of the low end of the Scale. (Applies only to round Scales.)
- Parameters:
obj β pointer to Scale Widget
rotation β clockwise angular offset (in degrees) from the 3-o'clock position of the low end of the scale; negative and >360 values are first normalized to range [0..360]. Examples:
0 = 3 o'clock (right side)
30 = 4 o'clock
60 = 5 o'clock
90 = 6 o'clock
135 = midway between 7 and 8 o'clock (default)
180 = 9 o'clock
270 = 12 o'clock
300 = 1 o'clock
330 = 2 o'clock
-30 = 2 o'clock
390 = 4 o'clock
-
void lv_scale_set_line_needle_value(lv_obj_t *obj, lv_obj_t *needle_line, int32_t needle_length, int32_t value)ΒΆ
Point line needle to specified value.
- Parameters:
obj β pointer to Scale Widget
needle_line β needle_line of the Scale. The line points will be allocated and managed by the Scale unless the line point array was previously set using
lv_line_set_points_mutable.needle_length β length of the needle
needle_length>0: needle_length=needle_length;
needle_length<0: needle_length=radius-|needle_length|;
value β Scale value needle will point to
-
void lv_scale_set_image_needle_value(lv_obj_t *obj, lv_obj_t *needle_img, int32_t value)ΒΆ
Point image needle to specified value; image must point to the right. E.g. -Oβ—>
- Parameters:
obj β pointer to Scale Widget
needle_img β pointer to needle's Image
value β Scale value needle will point to
-
void lv_scale_set_text_src(lv_obj_t *obj, const char *txt_src[])ΒΆ
Set custom text source for major ticks labels.
- Parameters:
obj β pointer to Scale Widget
txt_src β pointer to an array of strings which will be display at major ticks; last element must be a NULL pointer.
-
void lv_scale_set_post_draw(lv_obj_t *obj, bool en)ΒΆ
Draw Scale after all its children are drawn.
- Parameters:
obj β pointer to Scale Widget
en β true: enable post draw
-
void lv_scale_set_draw_ticks_on_top(lv_obj_t *obj, bool en)ΒΆ
Draw Scale ticks on top of all other parts.
- Parameters:
obj β pointer to Scale Widget
en β true: enable draw ticks on top of all parts
-
lv_scale_section_t *lv_scale_add_section(lv_obj_t *obj)ΒΆ
Add a Section to specified Scale. Section will not be drawn until a valid range is set for it using
lv_scale_set_section_range().- Parameters:
obj β pointer to Scale Widget
- Returns:
pointer to new Section
-
void lv_scale_section_set_range(lv_scale_section_t *section, int32_t min, int32_t max)ΒΆ
DEPRECATED, use lv_scale_set_section_range instead. Set range for specified Scale Section
- Parameters:
section β pointer to Section
range_min β Section new minimum value
range_max β Section new maximum value
-
void lv_scale_set_section_range(lv_obj_t *scale, lv_scale_section_t *section, int32_t min, int32_t max)ΒΆ
Set the range of a scale section
- Parameters:
scale β pointer to scale
section β pointer to section
range_min β the section's new minimum value
range_max β the section's new maximum value
-
void lv_scale_set_section_min_value(lv_obj_t *scale, lv_scale_section_t *section, int32_t min)ΒΆ
Set the minimum value of a scale section
- Parameters:
scale β pointer to scale
section β pointer to section
min β the section's new minimum value
-
void lv_scale_set_section_max_value(lv_obj_t *scale, lv_scale_section_t *section, int32_t max)ΒΆ
Set the maximum value of a scale section
- Parameters:
scale β pointer to scale
section β pointer to section
max β the section's new maximum value
-
void lv_scale_section_set_style(lv_scale_section_t *section, lv_part_t part, lv_style_t *section_part_style)ΒΆ
DEPRECATED, use lv_scale_set_section_style_main/indicator/items instead. Set style for specified part of Section.
- Parameters:
section β pointer to Section
part β the part of the Scale the style will apply to, e.g. LV_PART_INDICATOR
section_part_style β pointer to style to apply
-
void lv_scale_set_section_style_main(lv_obj_t *scale, lv_scale_section_t *section, const lv_style_t *style)ΒΆ
Set the style of the line on a section.
- Parameters:
scale β pointer to scale
section β pointer to section
style β point to a style
-
void lv_scale_set_section_style_indicator(lv_obj_t *scale, lv_scale_section_t *section, const lv_style_t *style)ΒΆ
Set the style of the major ticks and label on a section.
- Parameters:
scale β pointer to scale
section β pointer to section
style β point to a style
-
void lv_scale_set_section_style_items(lv_obj_t *scale, lv_scale_section_t *section, const lv_style_t *style)ΒΆ
Set the style of the minor ticks on a section.
- Parameters:
scale β pointer to scale
section β pointer to section
style β point to a style
-
lv_scale_mode_t lv_scale_get_mode(lv_obj_t *obj)ΒΆ
Get scale mode. See lv_scale_mode_t
- Parameters:
obj β pointer to Scale Widget
- Returns:
Scale mode
-
int32_t lv_scale_get_total_tick_count(lv_obj_t *obj)ΒΆ
Get scale total tick count (including minor and major ticks)
- Parameters:
obj β pointer to Scale Widget
- Returns:
Scale total tick count
-
int32_t lv_scale_get_major_tick_every(lv_obj_t *obj)ΒΆ
Get how often the major tick will be drawn
- Parameters:
obj β pointer to Scale Widget
- Returns:
Scale major tick every count
-
int32_t lv_scale_get_rotation(lv_obj_t *obj)ΒΆ
Get angular location of low end of Scale.
- Parameters:
obj β pointer to Scale Widget
- Returns:
Scale low end angular location
-
bool lv_scale_get_label_show(lv_obj_t *obj)ΒΆ
Gets label visibility
- Parameters:
obj β pointer to Scale Widget
- Returns:
true if tick label is enabled, false otherwise
-
uint32_t lv_scale_get_angle_range(lv_obj_t *obj)ΒΆ
Get Scale's range in degrees
- Parameters:
obj β pointer to Scale Widget
- Returns:
Scale's angle_range
-
int32_t lv_scale_get_range_min_value(lv_obj_t *obj)ΒΆ
Get minimum value for Scale
- Parameters:
obj β pointer to Scale Widget
- Returns:
Scale's minimum value
-
int32_t lv_scale_get_range_max_value(lv_obj_t *obj)ΒΆ
Get maximum value for Scale
- Parameters:
obj β pointer to Scale Widget
- Returns:
Scale's maximum value
-
lv_observer_t *lv_scale_bind_section_min_value(lv_obj_t *obj, lv_scale_section_t *section, lv_subject_t *subject)ΒΆ
Bind an integer subject to a scales section minimum value
- Parameters:
obj β pointer to a Scale
section β pointer to a Scale section
subject β pointer to a Subject
- Returns:
pointer to newly-created Observer
-
lv_observer_t *lv_scale_bind_section_max_value(lv_obj_t *obj, lv_scale_section_t *section, lv_subject_t *subject)ΒΆ
Bind an integer subject to a scales section maximum value
- Parameters:
obj β pointer to an Scale
section β pointer to a Scale section
subject β pointer to a Subject
- Returns:
pointer to newly-created Observer
Variables
-
const lv_obj_class_t lv_scale_classΒΆ