lv_scale.h
API reference for lv_scale.h
Functions
lv_scale_set_mode
Set scale mode. See lv_scale_mode_t.
void lv_scale_set_mode(lv_obj_t *obj, lv_scale_mode_t mode)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
mode | lv_scale_mode_t | the new scale mode |
lv_scale_set_total_tick_count
Set scale total tick count (including minor and major ticks).
void lv_scale_set_total_tick_count(lv_obj_t *obj, uint32_t total_tick_count)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
total_tick_count | uint32_t | New total tick count |
lv_scale_set_major_tick_every
Sets how often major ticks are drawn.
void lv_scale_set_major_tick_every(lv_obj_t *obj, uint32_t major_tick_every)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
major_tick_every | uint32_t | the new count for major tick drawing |
lv_scale_set_label_show
Sets label visibility.
void lv_scale_set_label_show(lv_obj_t *obj, bool show_label)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
show_label | bool | true/false to enable tick label |
lv_scale_set_range
Set minimum and maximum values on Scale.
void lv_scale_set_range(lv_obj_t *obj, int32_t min, int32_t max)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
min | int32_t | minimum value of Scale |
max | int32_t | maximum value of Scale |
lv_scale_set_min_value
Set minimum values on Scale.
void lv_scale_set_min_value(lv_obj_t *obj, int32_t min)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
min | int32_t | minimum value of Scale |
lv_scale_set_max_value
Set maximum values on Scale.
void lv_scale_set_max_value(lv_obj_t *obj, int32_t max)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
max | int32_t |
lv_scale_set_angle_range
Set angle between the low end and the high end of the Scale. (Applies only to round Scales.)
void lv_scale_set_angle_range(lv_obj_t *obj, uint32_t angle_range)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
angle_range | uint32_t |
lv_scale_set_rotation
Set angular offset from the 3-o'clock position of the low end of the Scale. (Applies only to round Scales.)
void lv_scale_set_rotation(lv_obj_t *obj, int32_t rotation)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
rotation | int32_t | 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 |
lv_scale_set_line_needle_value
Point line needle to specified value.
void lv_scale_set_line_needle_value(lv_obj_t *obj, lv_obj_t *needle_line, int32_t needle_length, int32_t value)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
needle_line | lv_obj_t * | 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 | int32_t | length of the needle - needle_length>0: needle_length=needle_length; - needle_length<0: needle_length=radius-|needle_length|; |
value | int32_t | Scale value needle will point to |
lv_scale_set_image_needle_value
Point image needle to specified value; image must point to the right. E.g. -O---—>
void lv_scale_set_image_needle_value(lv_obj_t *obj, lv_obj_t *needle_img, int32_t value)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
needle_img | lv_obj_t * | pointer to needle's Image |
value | int32_t | Scale value needle will point to |
lv_scale_set_text_src
Set custom text source for major ticks labels.
void lv_scale_set_text_src(lv_obj_t *obj, const char *txt_src[])| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
txt_src | const char * | pointer to an array of strings which will be display at major ticks; last element must be a NULL pointer. |
lv_scale_set_post_draw
Draw Scale after all its children are drawn.
void lv_scale_set_post_draw(lv_obj_t *obj, bool en)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
en | bool | true: enable post draw |
lv_scale_set_draw_ticks_on_top
Draw Scale ticks on top of all other parts.
void lv_scale_set_draw_ticks_on_top(lv_obj_t *obj, bool en)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Scale Widget |
en | bool | true: enable draw ticks on top of all parts |
lv_scale_section_set_range
DEPRECATED, use lv_scale_set_section_range instead. Set range for specified Scale Section
void lv_scale_section_set_range(lv_scale_section_t *section, int32_t min, int32_t max)| Name | Type | Description |
|---|---|---|
section | lv_scale_section_t * | pointer to Section |
min | int32_t | |
max | int32_t |
lv_scale_set_section_range
Set the range of a scale section
void lv_scale_set_section_range(lv_obj_t *scale, lv_scale_section_t *section, int32_t min, int32_t max)| Name | Type | Description |
|---|---|---|
scale | lv_obj_t * | pointer to scale |
section | lv_scale_section_t * | pointer to section |
min | int32_t | |
max | int32_t |
lv_scale_set_section_min_value
Set the minimum value of a scale section
void lv_scale_set_section_min_value(lv_obj_t *scale, lv_scale_section_t *section, int32_t min)| Name | Type | Description |
|---|---|---|
scale | lv_obj_t * | pointer to scale |
section | lv_scale_section_t * | pointer to section |
min | int32_t | the section's new minimum value |
lv_scale_set_section_max_value
Set the maximum value of a scale section
void lv_scale_set_section_max_value(lv_obj_t *scale, lv_scale_section_t *section, int32_t max)| Name | Type | Description |
|---|---|---|
scale | lv_obj_t * | pointer to scale |
section | lv_scale_section_t * | pointer to section |
max | int32_t | the section's new maximum value |
lv_scale_section_set_style
DEPRECATED, use lv_scale_set_section_style_main/indicator/items instead. Set style for specified part of Section.
void lv_scale_section_set_style(lv_scale_section_t *section, lv_part_t part, lv_style_t *section_part_style)| Name | Type | Description |
|---|---|---|
section | lv_scale_section_t * | pointer to Section |
part | lv_part_t | the part of the Scale the style will apply to, e.g. LV_PART_INDICATOR |
section_part_style | lv_style_t * | pointer to style to apply |
lv_scale_set_section_style_main
Set the style of the line on a section.
void lv_scale_set_section_style_main(lv_obj_t *scale, lv_scale_section_t *section, const lv_style_t *style)| Name | Type | Description |
|---|---|---|
scale | lv_obj_t * | pointer to scale |
section | lv_scale_section_t * | pointer to section |
style | const lv_style_t * | point to a style |
lv_scale_set_section_style_indicator
Set the style of the major ticks and label on a section.
void lv_scale_set_section_style_indicator(lv_obj_t *scale, lv_scale_section_t *section, const lv_style_t *style)| Name | Type | Description |
|---|---|---|
scale | lv_obj_t * | pointer to scale |
section | lv_scale_section_t * | pointer to section |
style | const lv_style_t * | point to a style |
lv_scale_set_section_style_items
Set the style of the minor ticks on a section.
void lv_scale_set_section_style_items(lv_obj_t *scale, lv_scale_section_t *section, const lv_style_t *style)| Name | Type | Description |
|---|---|---|
scale | lv_obj_t * | pointer to scale |
section | lv_scale_section_t * | pointer to section |
style | const lv_style_t * | point to a style |
Enums
lv_scale_mode_t
Scale mode
| Name | Value |
|---|---|
LV_SCALE_MODE_HORIZONTAL_TOP | 0x00U |
LV_SCALE_MODE_HORIZONTAL_BOTTOM | 0x01U |
LV_SCALE_MODE_VERTICAL_LEFT | 0x02U |
LV_SCALE_MODE_VERTICAL_RIGHT | 0x04U |
LV_SCALE_MODE_ROUND_INNER | 0x08U |
LV_SCALE_MODE_ROUND_OUTER | 0x10U |
LV_SCALE_MODE_LAST |
Used by 1 function
lv_scale_set_mode— parammode
_lv_property_scale_id_t
| Name | Value |
|---|---|
LV_PROPERTY_SCALE_MODE | (LV_PROPERTY_SCALE_START + ((int) 0 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SCALE_TOTAL_TICK_COUNT | (LV_PROPERTY_SCALE_START + ((int) 1 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SCALE_MAJOR_TICK_EVERY | (LV_PROPERTY_SCALE_START + ((int) 2 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SCALE_LABEL_SHOW | (LV_PROPERTY_SCALE_START + ((int) 3 )) | (( 11 ) << 28 ) |
LV_PROPERTY_SCALE_ANGLE_RANGE | (LV_PROPERTY_SCALE_START + ((int) 4 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SCALE_ROTATION | (LV_PROPERTY_SCALE_START + ((int) 5 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SCALE_RANGE_MIN_VALUE | (LV_PROPERTY_SCALE_START + ((int) 6 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SCALE_RANGE_MAX_VALUE | (LV_PROPERTY_SCALE_START + ((int) 7 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SCALE_END |
Macros
LV_SCALE_TOTAL_TICK_COUNT_DEFAULT
#define LV_SCALE_TOTAL_TICK_COUNT_DEFAULT (11U)Default value of total minor ticks.
LV_SCALE_MAJOR_TICK_EVERY_DEFAULT
#define LV_SCALE_MAJOR_TICK_EVERY_DEFAULT (5U)Default value of major tick every nth ticks.
LV_SCALE_LABEL_ENABLED_DEFAULT
#define LV_SCALE_LABEL_ENABLED_DEFAULT (1U)Default value of scale label enabled.
LV_SCALE_LABEL_ROTATE_MATCH_TICKS
#define LV_SCALE_LABEL_ROTATE_MATCH_TICKS 0x100000LV_SCALE_LABEL_ROTATE_KEEP_UPRIGHT
#define LV_SCALE_LABEL_ROTATE_KEEP_UPRIGHT 0x80000LV_SCALE_ROTATION_ANGLE_MASK
#define LV_SCALE_ROTATION_ANGLE_MASK 0x7FFFFVariables
lv_scale_class
const lv_obj_class_t lv_scale_classDependencies
Indirect dependencies
lv_anim.hlv_area.hlv_array.hlv_assert.hlv_bidi.hlv_color.hlv_color_op.hlv_conf_kconfig.hlv_display.hlv_draw.hlv_draw_arc.hlv_draw_blur.hlv_draw_buf.hlv_draw_image.hlv_draw_label.hlv_draw_line.hlv_draw_rect.hlv_draw_triangle.hlv_event.hlv_ext_data.hlv_flex.hlv_font.hlv_fs.hlv_grad.hlv_grid.hlv_group.hlv_image_decoder.hlv_image_dsc.hlv_indev.hlv_layout.hlv_ll.hlv_log.hlv_math.hlv_matrix.hlv_mem.hlv_obj_class.hlv_obj_draw.hlv_obj_event.hlv_obj_pos.hlv_obj_property.hlv_obj_property_names.hlv_obj_scroll.hlv_obj_style.hlv_obj_style_gen.hlv_obj_tree.hlv_palette.hlv_profiler.hlv_profiler_builtin.hlv_sprintf.hlv_string.hlv_style.hlv_style_gen.hlv_style_properties.hlv_symbol_def.hlv_text.hlv_tick.hlv_timer.hlv_types.h
How is this guide?
Last updated on