mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
Merge remote-tracking branch 'littlevgl/dev-6.1' into dev-6.1
This commit is contained in:
commit
c5e7fbd953
@ -60,6 +60,13 @@ void lv_draw_label(const lv_area_t * coords, const lv_area_t * mask, const lv_st
|
||||
{
|
||||
const lv_font_t * font = style->text.font;
|
||||
lv_coord_t w;
|
||||
|
||||
/*No need to waste processor time if string is empty*/
|
||||
if (txt[0] == '\0')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if((flag & LV_TXT_FLAG_EXPAND) == 0) {
|
||||
/*Normally use the label's width as width*/
|
||||
w = lv_area_get_width(coords);
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -11,57 +11,72 @@ extern "C" {
|
||||
#include "../../../lv_conf.h"
|
||||
#endif
|
||||
|
||||
/* In the font converter use this list as range:
|
||||
61441, 61448, 61451, 61452, 61452, 61453, 61457, 61459, 61461, 61465,
|
||||
61468, 61473, 61478, 61479, 61480, 61502, 61512, 61515, 61516, 61517,
|
||||
61521, 61522, 61523, 61524, 61543, 61544, 61550, 61552, 61553, 61556,
|
||||
61559, 61560, 61561, 61563, 61587, 61589, 61636, 61637, 61639, 61671,
|
||||
61674, 61683, 61724, 61732, 61787, 61931, 62016, 62017, 62018, 62019,
|
||||
62020, 62087, 62099, 62212, 62189, 62810, 63426, 63650
|
||||
*/
|
||||
|
||||
#define LV_SYMBOL_AUDIO "\xef\x80\x81"
|
||||
#define LV_SYMBOL_VIDEO "\xef\x80\x88"
|
||||
#define LV_SYMBOL_LIST "\xef\x80\x8b"
|
||||
#define LV_SYMBOL_OK "\xef\x80\x8c"
|
||||
#define LV_SYMBOL_CLOSE "\xef\x80\x8d"
|
||||
#define LV_SYMBOL_POWER "\xef\x80\x91"
|
||||
#define LV_SYMBOL_SETTINGS "\xef\x80\x93"
|
||||
#define LV_SYMBOL_TRASH "\xef\x80\x94"
|
||||
#define LV_SYMBOL_HOME "\xef\x80\x95"
|
||||
#define LV_SYMBOL_DOWNLOAD "\xef\x80\x99"
|
||||
#define LV_SYMBOL_DRIVE "\xef\x80\x9c"
|
||||
#define LV_SYMBOL_REFRESH "\xef\x80\xa1"
|
||||
#define LV_SYMBOL_MUTE "\xef\x80\xa6"
|
||||
#define LV_SYMBOL_VOLUME_MID "\xef\x80\xa7"
|
||||
#define LV_SYMBOL_VOLUME_MAX "\xef\x80\xa8"
|
||||
#define LV_SYMBOL_IMAGE "\xef\x80\xbe"
|
||||
#define LV_SYMBOL_EDIT "\xef\x81\x80"
|
||||
#define LV_SYMBOL_PREV "\xef\x81\x88"
|
||||
#define LV_SYMBOL_PLAY "\xef\x81\x8b"
|
||||
#define LV_SYMBOL_PAUSE "\xef\x81\x8c"
|
||||
#define LV_SYMBOL_STOP "\xef\x81\x8d"
|
||||
#define LV_SYMBOL_NEXT "\xef\x81\x91"
|
||||
#define LV_SYMBOL_EJECT "\xef\x81\x92"
|
||||
#define LV_SYMBOL_LEFT "\xef\x81\x93"
|
||||
#define LV_SYMBOL_RIGHT "\xef\x81\x94"
|
||||
#define LV_SYMBOL_PLUS "\xef\x81\xa7"
|
||||
#define LV_SYMBOL_MINUS "\xef\x81\xa8"
|
||||
#define LV_SYMBOL_WARNING "\xef\x81\xb1"
|
||||
#define LV_SYMBOL_SHUFFLE "\xef\x81\xb4"
|
||||
#define LV_SYMBOL_UP "\xef\x81\xb7"
|
||||
#define LV_SYMBOL_DOWN "\xef\x81\xb8"
|
||||
#define LV_SYMBOL_LOOP "\xef\x81\xb9"
|
||||
#define LV_SYMBOL_DIRECTORY "\xef\x81\xbb"
|
||||
#define LV_SYMBOL_UPLOAD "\xef\x82\x93"
|
||||
#define LV_SYMBOL_CALL "\xef\x82\x95"
|
||||
#define LV_SYMBOL_CUT "\xef\x83\x84"
|
||||
#define LV_SYMBOL_COPY "\xef\x83\x85"
|
||||
#define LV_SYMBOL_SAVE "\xef\x83\x87"
|
||||
#define LV_SYMBOL_CHARGE "\xef\x83\xa7"
|
||||
#define LV_SYMBOL_BELL "\xef\x83\xb3"
|
||||
#define LV_SYMBOL_KEYBOARD "\xef\x84\x9c"
|
||||
#define LV_SYMBOL_GPS "\xef\x84\xa4"
|
||||
#define LV_SYMBOL_FILE "\xef\x85\x9b"
|
||||
#define LV_SYMBOL_WIFI "\xef\x87\xab"
|
||||
#define LV_SYMBOL_BATTERY_FULL "\xef\x89\x80"
|
||||
#define LV_SYMBOL_BATTERY_3 "\xef\x89\x81"
|
||||
#define LV_SYMBOL_BATTERY_2 "\xef\x89\x82"
|
||||
#define LV_SYMBOL_BATTERY_1 "\xef\x89\x83"
|
||||
#define LV_SYMBOL_BATTERY_EMPTY "\xef\x89\x84"
|
||||
#define LV_SYMBOL_BLUETOOTH "\xef\x8a\x93"
|
||||
#define LV_SYMBOL_AUDIO "\xef\x80\x81" /*61441, 0xF001*/
|
||||
#define LV_SYMBOL_VIDEO "\xef\x80\x88" /*61448, 0xF008*/
|
||||
#define LV_SYMBOL_LIST "\xef\x80\x8b" /*61451, 0xF00B*/
|
||||
#define LV_SYMBOL_OK "\xef\x80\x8c" /*61452, 0xF00C*/
|
||||
#define LV_SYMBOL_CLOSE "\xef\x80\x8d" /*61453, 0xF00D*/
|
||||
#define LV_SYMBOL_POWER "\xef\x80\x91" /*61457, 0xF011*/
|
||||
#define LV_SYMBOL_SETTINGS "\xef\x80\x93" /*61459, 0xF013*/
|
||||
#define LV_SYMBOL_HOME "\xef\x80\x95" /*61461, 0xF015*/
|
||||
#define LV_SYMBOL_DOWNLOAD "\xef\x80\x99" /*61465, 0xF019*/
|
||||
#define LV_SYMBOL_DRIVE "\xef\x80\x9c" /*61468, 0xF01C*/
|
||||
#define LV_SYMBOL_REFRESH "\xef\x80\xa1" /*61473, 0xF021*/
|
||||
#define LV_SYMBOL_MUTE "\xef\x80\xa6" /*61478, 0xF026*/
|
||||
#define LV_SYMBOL_VOLUME_MID "\xef\x80\xa7" /*61479, 0xF027*/
|
||||
#define LV_SYMBOL_VOLUME_MAX "\xef\x80\xa8" /*61480, 0xF028*/
|
||||
#define LV_SYMBOL_IMAGE "\xef\x80\xbe" /*61502, 0xF03E*/
|
||||
#define LV_SYMBOL_EDIT "\xef\x8C\x84" /*62212, 0xF304*/
|
||||
#define LV_SYMBOL_PREV "\xef\x81\x88" /*61512, 0xF048*/
|
||||
#define LV_SYMBOL_PLAY "\xef\x81\x8b" /*61515, 0xF04B*/
|
||||
#define LV_SYMBOL_PAUSE "\xef\x81\x8c" /*61516, 0xF04C*/
|
||||
#define LV_SYMBOL_STOP "\xef\x81\x8d" /*61517, 0xF04D*/
|
||||
#define LV_SYMBOL_NEXT "\xef\x81\x91" /*61521, 0xF051*/
|
||||
#define LV_SYMBOL_EJECT "\xef\x81\x92" /*61522, 0xF052*/
|
||||
#define LV_SYMBOL_LEFT "\xef\x81\x93" /*61523, 0xF053*/
|
||||
#define LV_SYMBOL_RIGHT "\xef\x81\x94" /*61524, 0xF054*/
|
||||
#define LV_SYMBOL_PLUS "\xef\x81\xa7" /*61543, 0xF067*/
|
||||
#define LV_SYMBOL_MINUS "\xef\x81\xa8" /*61544, 0xF068*/
|
||||
#define LV_SYMBOL_EYE_OPEN "\xef\x81\xae" /*61550, 0xF06E*/
|
||||
#define LV_SYMBOL_EYE_CLOSE "\xef\x81\xb0" /*61552, 0xF070*/
|
||||
#define LV_SYMBOL_WARNING "\xef\x81\xb1" /*61553, 0xF071*/
|
||||
#define LV_SYMBOL_SHUFFLE "\xef\x81\xb4" /*61556, 0xF074*/
|
||||
#define LV_SYMBOL_UP "\xef\x81\xb7" /*61559, 0xF077*/
|
||||
#define LV_SYMBOL_DOWN "\xef\x81\xb8" /*61560, 0xF078*/
|
||||
#define LV_SYMBOL_LOOP "\xef\x81\xb9" /*61561, 0xF079*/
|
||||
#define LV_SYMBOL_DIRECTORY "\xef\x81\xbb" /*61563, 0xF07B*/
|
||||
#define LV_SYMBOL_UPLOAD "\xef\x82\x93" /*61587, 0xF093*/
|
||||
#define LV_SYMBOL_CALL "\xef\x82\x95" /*61589, 0xF095*/
|
||||
#define LV_SYMBOL_CUT "\xef\x83\x84" /*61636, 0xF0C4*/
|
||||
#define LV_SYMBOL_COPY "\xef\x83\x85" /*61637, 0xF0C5*/
|
||||
#define LV_SYMBOL_SAVE "\xef\x83\x87" /*61639, 0xF0C7*/
|
||||
#define LV_SYMBOL_CHARGE "\xef\x83\xa7" /*61671, 0xF0E7*/
|
||||
#define LV_SYMBOL_PASTE "\xef\x83\xAA" /*61674, 0xF0EA*/
|
||||
#define LV_SYMBOL_BELL "\xef\x83\xb3" /*61683, 0xF0F3*/
|
||||
#define LV_SYMBOL_KEYBOARD "\xef\x84\x9c" /*61724, 0xF11C*/
|
||||
#define LV_SYMBOL_GPS "\xef\x84\xa4" /*61732, 0xF124*/
|
||||
#define LV_SYMBOL_FILE "\xef\x85\x9b" /*61787, 0xF158*/
|
||||
#define LV_SYMBOL_WIFI "\xef\x87\xab" /*61931, 0xF1EB*/
|
||||
#define LV_SYMBOL_BATTERY_FULL "\xef\x89\x80" /*62016, 0xF240*/
|
||||
#define LV_SYMBOL_BATTERY_3 "\xef\x89\x81" /*62017, 0xF241*/
|
||||
#define LV_SYMBOL_BATTERY_2 "\xef\x89\x82" /*62018, 0xF242*/
|
||||
#define LV_SYMBOL_BATTERY_1 "\xef\x89\x83" /*62019, 0xF243*/
|
||||
#define LV_SYMBOL_BATTERY_EMPTY "\xef\x89\x84" /*62020, 0xF244*/
|
||||
#define LV_SYMBOL_USB "\xef\x8a\x87" /*62087, 0xF287*/
|
||||
#define LV_SYMBOL_BLUETOOTH "\xef\x8a\x93" /*62099, 0xF293*/
|
||||
#define LV_SYMBOL_TRASH "\xef\x8B\xAD" /*62189, 0xF2ED*/
|
||||
#define LV_SYMBOL_BACKSPACE "\xef\x95\x9A" /*62810, 0xF55A*/
|
||||
#define LV_SYMBOL_SD_CARD "\xef\x9F\x82" /*63426, 0xF7C2*/
|
||||
#define LV_SYMBOL_NEW_LINE "\xef\xA2\xA2" /*63650, 0xF8A2*/
|
||||
|
||||
/** Invalid symbol at (U+F8FF). If written before a string then `lv_img` will show it as a label*/
|
||||
#define LV_SYMBOL_DUMMY "\xEF\xA3\xBF"
|
||||
|
@ -24,11 +24,22 @@
|
||||
#define LV_CHART_AXIS_TO_LABEL_DISTANCE 4
|
||||
#define LV_CHART_AXIS_MAJOR_TICK_LEN_COE 1 / 15
|
||||
#define LV_CHART_AXIS_MINOR_TICK_LEN_COE 2 / 3
|
||||
#define LV_CHART_AXIS_PRIMARY_Y 1
|
||||
#define LV_CHART_AXIS_SECONDARY_Y 0
|
||||
#define LV_CHART_LABEL_ITERATOR_FORWARD 1
|
||||
#define LV_CHART_LABEL_ITERATOR_REVERSE 0
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
typedef struct {
|
||||
const char * list_start;
|
||||
const char * current_pos;
|
||||
uint8_t items_left;
|
||||
uint8_t is_reverse_iter;
|
||||
} lv_chart_label_iterator_t;
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
@ -44,6 +55,9 @@ static void lv_chart_draw_axes(lv_obj_t * chart, const lv_area_t * mask);
|
||||
static void lv_chart_inv_lines(lv_obj_t * chart, uint16_t i);
|
||||
static void lv_chart_inv_points(lv_obj_t * chart, uint16_t i);
|
||||
static void lv_chart_inv_cols(lv_obj_t * chart, uint16_t i);
|
||||
static void lv_chart_get_next_label(lv_chart_label_iterator_t * iterator, char * buf);
|
||||
static inline bool lv_chart_is_tick_with_label(uint8_t tick_num, lv_chart_axis_cfg_t * axis);
|
||||
static lv_chart_label_iterator_t lv_chart_create_label_iter(const char * list, uint8_t iterator_dir);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@ -96,10 +110,13 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->margin = 0;
|
||||
memset(&ext->x_axis, 0, sizeof(ext->x_axis));
|
||||
memset(&ext->y_axis, 0, sizeof(ext->y_axis));
|
||||
memset(&ext->secondary_y_axis, 0, sizeof(ext->secondary_y_axis));
|
||||
ext->x_axis.major_tick_len = LV_CHART_TICK_LENGTH_AUTO;
|
||||
ext->x_axis.minor_tick_len = LV_CHART_TICK_LENGTH_AUTO;
|
||||
ext->y_axis.major_tick_len = LV_CHART_TICK_LENGTH_AUTO;
|
||||
ext->y_axis.minor_tick_len = LV_CHART_TICK_LENGTH_AUTO;
|
||||
ext->secondary_y_axis.major_tick_len = LV_CHART_TICK_LENGTH_AUTO;
|
||||
ext->secondary_y_axis.minor_tick_len = LV_CHART_TICK_LENGTH_AUTO;
|
||||
|
||||
if(ancestor_design_f == NULL) ancestor_design_f = lv_obj_get_design_cb(new_chart);
|
||||
if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_chart);
|
||||
@ -132,6 +149,7 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->margin = ext_copy->margin;
|
||||
memcpy(&ext->x_axis, &ext_copy->x_axis, sizeof(lv_chart_axis_cfg_t));
|
||||
memcpy(&ext->y_axis, &ext_copy->y_axis, sizeof(lv_chart_axis_cfg_t));
|
||||
memcpy(&ext->secondary_y_axis, &ext_copy->secondary_y_axis, sizeof(lv_chart_axis_cfg_t));
|
||||
|
||||
/*Refresh the style with new signal function*/
|
||||
lv_obj_refresh_style(new_chart);
|
||||
@ -463,6 +481,21 @@ void lv_chart_set_y_tick_length(lv_obj_t * chart, uint8_t major_tick_len, uint8_
|
||||
ext->y_axis.minor_tick_len = minor_tick_len;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the length of the tick marks on the secondary y axis
|
||||
* @param chart pointer to the chart
|
||||
* @param major_tick_len the length of the major tick or `LV_CHART_TICK_LENGTH_AUTO` to set automatically
|
||||
* (where labels are added)
|
||||
* @param minor_tick_len the length of the minor tick, `LV_CHART_TICK_LENGTH_AUTO` to set automatically
|
||||
* (where no labels are added)
|
||||
*/
|
||||
void lv_chart_set_secondary_y_tick_length(lv_obj_t * chart, uint8_t major_tick_len, uint8_t minor_tick_len)
|
||||
{
|
||||
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
|
||||
ext->secondary_y_axis.major_tick_len = major_tick_len;
|
||||
ext->secondary_y_axis.minor_tick_len = minor_tick_len;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the x-axis tick count and labels of a chart
|
||||
* @param chart pointer to a chart object
|
||||
@ -497,6 +530,23 @@ void lv_chart_set_y_tick_texts(lv_obj_t * chart, const char * list_of_values, ui
|
||||
ext->y_axis.options = options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the secondary y-axis tick count and labels of a chart
|
||||
* @param chart pointer to a chart object
|
||||
* @param list_of_values list of string values, terminated with \n, except the last
|
||||
* @param num_tick_marks if list_of_values is NULL: total number of ticks per axis
|
||||
* else number of ticks between two value labels
|
||||
* @param options extra options
|
||||
*/
|
||||
void lv_chart_set_secondary_y_tick_texts(lv_obj_t * chart, const char * list_of_values, uint8_t num_tick_marks,
|
||||
lv_chart_axis_options_t options)
|
||||
{
|
||||
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
|
||||
ext->secondary_y_axis.num_tick_marks = num_tick_marks;
|
||||
ext->secondary_y_axis.list_of_values = list_of_values;
|
||||
ext->secondary_y_axis.options = options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the margin around the chart, used for axes value and ticks
|
||||
* @param chart pointer to an chart object
|
||||
@ -1046,65 +1096,187 @@ static void lv_chart_draw_areas(lv_obj_t * chart, const lv_area_t * mask)
|
||||
}
|
||||
}
|
||||
|
||||
static void lv_chart_draw_y_ticks(lv_obj_t * chart, const lv_area_t * mask)
|
||||
/**
|
||||
* Create iterator for newline-separated list
|
||||
* @param list pointer to newline-separated labels list
|
||||
* @param iterator_dir LV_CHART_ITERATOR_FORWARD or LV_CHART_LABEL_ITERATOR_REVERSE
|
||||
* @return lv_chart_label_iterator_t
|
||||
*/
|
||||
static lv_chart_label_iterator_t lv_chart_create_label_iter(const char * list, uint8_t iterator_dir)
|
||||
{
|
||||
lv_chart_label_iterator_t iterator = {0};
|
||||
uint8_t j;
|
||||
|
||||
iterator.list_start = list;
|
||||
|
||||
/* count number of list items */
|
||||
for(j = 0; list[j] != '\0'; j++) {
|
||||
if(list[j] == '\n')
|
||||
iterator.items_left++;
|
||||
}
|
||||
|
||||
if(iterator_dir == LV_CHART_LABEL_ITERATOR_FORWARD) {
|
||||
iterator.is_reverse_iter = 0;
|
||||
iterator.current_pos = list;
|
||||
} else {
|
||||
iterator.is_reverse_iter = 1;
|
||||
// -1 to skip '\0' at the end of the string
|
||||
iterator.current_pos = list + j - 1;
|
||||
}
|
||||
iterator.items_left++;
|
||||
return iterator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get next label from iterator created by lv_chart_create_label_iter()
|
||||
* @param iterator iterator to get label from
|
||||
* @param[out] buf buffer to point next label to
|
||||
*/
|
||||
static void lv_chart_get_next_label(lv_chart_label_iterator_t * iterator, char * buf)
|
||||
{
|
||||
uint8_t label_len = 0;
|
||||
if (iterator->is_reverse_iter) {
|
||||
const char * label_start;
|
||||
/* count the length of the current label*/
|
||||
while ((*iterator->current_pos != '\n') &&
|
||||
(iterator->current_pos != iterator->list_start)) {
|
||||
iterator->current_pos--;
|
||||
label_len++;
|
||||
}
|
||||
|
||||
label_start = iterator->current_pos;
|
||||
|
||||
if (*iterator->current_pos == '\n') {
|
||||
/* do not copy \n symbol, +1 to skip it*/
|
||||
label_start++;
|
||||
/* skip newline*/
|
||||
iterator->current_pos--;
|
||||
} else {
|
||||
/* it is last label in list (first one from the beginning )*/
|
||||
label_len++;
|
||||
}
|
||||
|
||||
/* do not allow output buffer overflow */
|
||||
if (label_len > LV_CHART_AXIS_TICK_LABEL_MAX_LEN) {
|
||||
label_len = LV_CHART_AXIS_TICK_LABEL_MAX_LEN;
|
||||
}
|
||||
|
||||
strncpy(buf, label_start, label_len);
|
||||
} else {
|
||||
/* search for tick string */
|
||||
while(iterator->current_pos[label_len] != '\n' &&
|
||||
iterator->current_pos[label_len] != '\0') {
|
||||
/* do not overflow the buffer, but move to the end of the current label */
|
||||
if(label_len < LV_CHART_AXIS_TICK_LABEL_MAX_LEN) {
|
||||
buf[label_len] = iterator->current_pos[label_len];
|
||||
label_len++;
|
||||
} else {
|
||||
label_len++;
|
||||
}
|
||||
}
|
||||
|
||||
iterator->current_pos += label_len;
|
||||
|
||||
/* do not allow output buffer overflow */
|
||||
if (label_len > LV_CHART_AXIS_TICK_LABEL_MAX_LEN) {
|
||||
label_len = LV_CHART_AXIS_TICK_LABEL_MAX_LEN;
|
||||
}
|
||||
|
||||
if(*iterator->current_pos == '\n') iterator->current_pos++;
|
||||
}
|
||||
|
||||
/* terminate the string */
|
||||
buf[label_len] = '\0';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether there should be a label next to tick with given
|
||||
* number
|
||||
* @param tick_num number of the tick to check
|
||||
* @param axis pointer to struct containing info on the axis
|
||||
* @return true if label should be located next to current tick
|
||||
*/
|
||||
static inline bool lv_chart_is_tick_with_label(uint8_t tick_num, lv_chart_axis_cfg_t * axis)
|
||||
{
|
||||
return ((tick_num == 0) || ((tick_num % axis->num_tick_marks) == 0));
|
||||
}
|
||||
|
||||
static void lv_chart_draw_y_ticks(lv_obj_t * chart, const lv_area_t * mask, uint8_t which_axis)
|
||||
{
|
||||
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
|
||||
lv_chart_axis_cfg_t * y_axis = (which_axis == LV_CHART_AXIS_PRIMARY_Y) ?
|
||||
&ext->y_axis : &ext->secondary_y_axis;
|
||||
|
||||
if(ext->y_axis.list_of_values != NULL || ext->y_axis.num_tick_marks != 0) {
|
||||
if(y_axis->list_of_values != NULL || y_axis->num_tick_marks != 0) {
|
||||
|
||||
const lv_style_t * style = lv_obj_get_style(chart);
|
||||
lv_opa_t opa_scale = lv_obj_get_opa_scale(chart);
|
||||
|
||||
uint8_t i, j;
|
||||
uint8_t list_index;
|
||||
uint8_t num_of_labels;
|
||||
uint8_t num_scale_ticks;
|
||||
uint8_t major_tick_len, minor_tick_len;
|
||||
int8_t major_tick_len, minor_tick_len;
|
||||
uint8_t iter_dir;
|
||||
|
||||
lv_point_t p1;
|
||||
lv_point_t p2;
|
||||
lv_coord_t x_ofs = chart->coords.x1;
|
||||
lv_coord_t x_ofs;
|
||||
lv_chart_label_iterator_t iter;
|
||||
lv_coord_t y_ofs = chart->coords.y1;
|
||||
lv_coord_t h = lv_obj_get_height(chart);
|
||||
lv_coord_t w = lv_obj_get_width(chart);
|
||||
char buf[LV_CHART_AXIS_TICK_LABEL_MAX_LEN + 1]; /* up to N symbols per label + null terminator */
|
||||
|
||||
/* chose correct side of the chart */
|
||||
if(which_axis == LV_CHART_AXIS_PRIMARY_Y)
|
||||
x_ofs = chart->coords.x1;
|
||||
else
|
||||
x_ofs = chart->coords.x2;
|
||||
|
||||
/* calculate the size of tick marks */
|
||||
if(ext->y_axis.major_tick_len == LV_CHART_TICK_LENGTH_AUTO)
|
||||
if(y_axis->major_tick_len == LV_CHART_TICK_LENGTH_AUTO)
|
||||
major_tick_len = (int32_t)w * LV_CHART_AXIS_MAJOR_TICK_LEN_COE;
|
||||
else
|
||||
major_tick_len = ext->y_axis.major_tick_len;
|
||||
major_tick_len = y_axis->major_tick_len;
|
||||
|
||||
if(ext->y_axis.minor_tick_len == LV_CHART_TICK_LENGTH_AUTO)
|
||||
if(y_axis->minor_tick_len == LV_CHART_TICK_LENGTH_AUTO)
|
||||
minor_tick_len = major_tick_len * LV_CHART_AXIS_MINOR_TICK_LEN_COE;
|
||||
else
|
||||
minor_tick_len = ext->y_axis.minor_tick_len;
|
||||
minor_tick_len = y_axis->minor_tick_len;
|
||||
|
||||
/* count the '\n'-s to determine the number of options */
|
||||
list_index = 0;
|
||||
num_of_labels = 0;
|
||||
if(ext->y_axis.list_of_values != NULL) {
|
||||
for(j = 0; ext->y_axis.list_of_values[j] != '\0'; j++) {
|
||||
if(ext->y_axis.list_of_values[j] == '\n') num_of_labels++;
|
||||
}
|
||||
|
||||
num_of_labels++; /* last option in the at row*/
|
||||
/* tick lines on secondary y axis are drawn in other direction*/
|
||||
if(which_axis == LV_CHART_AXIS_SECONDARY_Y) {
|
||||
major_tick_len *= -1;
|
||||
minor_tick_len *= -1;
|
||||
}
|
||||
|
||||
iter_dir = (y_axis->options & LV_CHART_AXIS_INVERSE_LABELS_ORDER) ? LV_CHART_LABEL_ITERATOR_REVERSE : LV_CHART_LABEL_ITERATOR_FORWARD;
|
||||
iter = lv_chart_create_label_iter(y_axis->list_of_values, iter_dir);
|
||||
|
||||
/*determine the number of options */
|
||||
num_of_labels = iter.items_left;
|
||||
|
||||
/* we can't have string labels without ticks step, set to 1 if not specified */
|
||||
if(ext->y_axis.num_tick_marks == 0) ext->y_axis.num_tick_marks = 1;
|
||||
if(y_axis->num_tick_marks == 0) y_axis->num_tick_marks = 1;
|
||||
|
||||
/* calculate total number of ticks */
|
||||
if(num_of_labels < 2)
|
||||
num_scale_ticks = ext->y_axis.num_tick_marks;
|
||||
num_scale_ticks = y_axis->num_tick_marks;
|
||||
else
|
||||
num_scale_ticks = (ext->y_axis.num_tick_marks * (num_of_labels - 1));
|
||||
num_scale_ticks = (y_axis->num_tick_marks * (num_of_labels - 1));
|
||||
|
||||
for(i = 0; i < (num_scale_ticks + 1); i++) { /* one extra loop - it may not exist in the list, empty label */
|
||||
/* first point of the tick */
|
||||
p1.x = x_ofs - 1;
|
||||
p1.x = x_ofs;
|
||||
|
||||
/* move extra pixel out of chart boundary */
|
||||
if (which_axis == LV_CHART_AXIS_PRIMARY_Y)
|
||||
p1.x--;
|
||||
else
|
||||
p1.x++;
|
||||
|
||||
/* second point of the tick */
|
||||
if((num_of_labels != 0) && (i == 0 || i % ext->y_axis.num_tick_marks == 0))
|
||||
if((num_of_labels != 0) && (i == 0 || i % y_axis->num_tick_marks == 0))
|
||||
p2.x = p1.x - major_tick_len; /* major tick */
|
||||
else
|
||||
p2.x = p1.x - minor_tick_len; /* minor tick */
|
||||
@ -1113,31 +1285,25 @@ static void lv_chart_draw_y_ticks(lv_obj_t * chart, const lv_area_t * mask)
|
||||
p2.y = p1.y =
|
||||
y_ofs + (int32_t)((int32_t)(h - style->line.width) * i) / num_scale_ticks;
|
||||
|
||||
if(i != num_scale_ticks)
|
||||
lv_draw_line(&p1, &p2, mask, style, opa_scale);
|
||||
else if((ext->y_axis.options & LV_CHART_AXIS_DRAW_LAST_TICK) != 0)
|
||||
lv_draw_line(&p1, &p2, mask, style, opa_scale);
|
||||
if(y_axis->options & LV_CHART_AXIS_INVERSE_LABELS_ORDER) {
|
||||
/*if label order is inversed last tick have number 0*/
|
||||
if(i != 0)
|
||||
lv_draw_line(&p1, &p2, mask, style, opa_scale);
|
||||
else if((y_axis->options & LV_CHART_AXIS_DRAW_LAST_TICK) != 0)
|
||||
lv_draw_line(&p1, &p2, mask, style, opa_scale);
|
||||
} else {
|
||||
if(i != num_scale_ticks)
|
||||
lv_draw_line(&p1, &p2, mask, style, opa_scale);
|
||||
else if((y_axis->options & LV_CHART_AXIS_DRAW_LAST_TICK) != 0)
|
||||
lv_draw_line(&p1, &p2, mask, style, opa_scale);
|
||||
}
|
||||
|
||||
/* draw values if available */
|
||||
if(num_of_labels != 0) {
|
||||
/* add text only to major tick */
|
||||
if(i == 0 || i % ext->y_axis.num_tick_marks == 0) {
|
||||
/* search for tick string */
|
||||
j = 0;
|
||||
while(ext->y_axis.list_of_values[list_index] != '\n' &&
|
||||
ext->y_axis.list_of_values[list_index] != '\0') {
|
||||
/* do not overflow the buffer, but move to the end of the current label */
|
||||
if(j < LV_CHART_AXIS_TICK_LABEL_MAX_LEN)
|
||||
buf[j++] = ext->y_axis.list_of_values[list_index++];
|
||||
else
|
||||
list_index++;
|
||||
}
|
||||
if(lv_chart_is_tick_with_label(i, y_axis)) {
|
||||
|
||||
/* this was a string, but not end of the list, so jump to the next string */
|
||||
if(ext->y_axis.list_of_values[list_index] == '\n') list_index++;
|
||||
|
||||
/* terminate the string */
|
||||
buf[j] = '\0';
|
||||
lv_chart_get_next_label(&iter, buf);
|
||||
|
||||
/* reserve appropriate area */
|
||||
lv_point_t size;
|
||||
@ -1145,8 +1311,16 @@ static void lv_chart_draw_y_ticks(lv_obj_t * chart, const lv_area_t * mask)
|
||||
LV_COORD_MAX, LV_TXT_FLAG_CENTER);
|
||||
|
||||
/* set the area at some distance of the major tick len left of the tick */
|
||||
lv_area_t a = {(p2.x - size.x - LV_CHART_AXIS_TO_LABEL_DISTANCE), (p2.y - size.y / 2),
|
||||
(p2.x - LV_CHART_AXIS_TO_LABEL_DISTANCE), (p2.y + size.y / 2)};
|
||||
lv_area_t a = {.y1 = p2.y - size.y / 2, .y2 = p2.y + size.y / 2};
|
||||
|
||||
if(which_axis == LV_CHART_AXIS_PRIMARY_Y) {
|
||||
a.x1 = p2.x - size.x - LV_CHART_AXIS_TO_LABEL_DISTANCE;
|
||||
a.x2 = p2.x - LV_CHART_AXIS_TO_LABEL_DISTANCE;
|
||||
} else {
|
||||
a.x1 = p2.x + LV_CHART_AXIS_TO_LABEL_DISTANCE;
|
||||
a.x2 = p2.x + size.x + LV_CHART_AXIS_TO_LABEL_DISTANCE;
|
||||
}
|
||||
|
||||
lv_draw_label(&a, mask, style, opa_scale, buf, LV_TXT_FLAG_CENTER, NULL, -1, -1, NULL);
|
||||
}
|
||||
}
|
||||
@ -1169,6 +1343,7 @@ static void lv_chart_draw_x_ticks(lv_obj_t * chart, const lv_area_t * mask)
|
||||
uint8_t num_of_labels;
|
||||
uint8_t num_scale_ticks;
|
||||
uint8_t major_tick_len, minor_tick_len;
|
||||
lv_chart_label_iterator_t iter;
|
||||
lv_point_t p1;
|
||||
lv_point_t p2;
|
||||
lv_coord_t x_ofs = chart->coords.x1;
|
||||
@ -1188,16 +1363,9 @@ static void lv_chart_draw_x_ticks(lv_obj_t * chart, const lv_area_t * mask)
|
||||
else
|
||||
minor_tick_len = ext->x_axis.minor_tick_len;
|
||||
|
||||
/* count the '\n'-s to determine the number of options */
|
||||
list_index = 0;
|
||||
num_of_labels = 0;
|
||||
if(ext->x_axis.list_of_values != NULL) {
|
||||
for(j = 0; ext->x_axis.list_of_values[j] != '\0'; j++) {
|
||||
if(ext->x_axis.list_of_values[j] == '\n') num_of_labels++;
|
||||
}
|
||||
|
||||
num_of_labels++; /* last option in the at row*/
|
||||
}
|
||||
/*determine the number of options */
|
||||
iter = lv_chart_create_label_iter(ext->x_axis.list_of_values, LV_CHART_LABEL_ITERATOR_FORWARD);
|
||||
num_of_labels = iter.items_left;
|
||||
|
||||
/* we can't have string labels without ticks step, set to 1 if not specified */
|
||||
if(ext->x_axis.num_tick_marks == 0) ext->x_axis.num_tick_marks = 1;
|
||||
@ -1229,23 +1397,8 @@ static void lv_chart_draw_x_ticks(lv_obj_t * chart, const lv_area_t * mask)
|
||||
/* draw values if available */
|
||||
if(num_of_labels != 0) {
|
||||
/* add text only to major tick */
|
||||
if(i == 0 || i % ext->x_axis.num_tick_marks == 0) {
|
||||
/* search for tick string */
|
||||
j = 0;
|
||||
while(ext->x_axis.list_of_values[list_index] != '\n' &&
|
||||
ext->x_axis.list_of_values[list_index] != '\0') {
|
||||
/* do not overflow the buffer, but move to the end of the current label */
|
||||
if(j < LV_CHART_AXIS_TICK_LABEL_MAX_LEN)
|
||||
buf[j++] = ext->x_axis.list_of_values[list_index++];
|
||||
else
|
||||
list_index++;
|
||||
}
|
||||
|
||||
/* this was a string, but not end of the list, so jump to the next string */
|
||||
if(ext->x_axis.list_of_values[list_index] == '\n') list_index++;
|
||||
|
||||
/* terminate the string */
|
||||
buf[j] = '\0';
|
||||
if(lv_chart_is_tick_with_label(i, &(ext->x_axis))) {
|
||||
lv_chart_get_next_label(&iter, buf);
|
||||
|
||||
/* reserve appropriate area */
|
||||
lv_point_t size;
|
||||
@ -1264,7 +1417,8 @@ static void lv_chart_draw_x_ticks(lv_obj_t * chart, const lv_area_t * mask)
|
||||
|
||||
static void lv_chart_draw_axes(lv_obj_t * chart, const lv_area_t * mask)
|
||||
{
|
||||
lv_chart_draw_y_ticks(chart, mask);
|
||||
lv_chart_draw_y_ticks(chart, mask, LV_CHART_AXIS_PRIMARY_Y);
|
||||
lv_chart_draw_y_ticks(chart, mask, LV_CHART_AXIS_SECONDARY_Y);
|
||||
lv_chart_draw_x_ticks(chart, mask);
|
||||
}
|
||||
|
||||
|
@ -65,8 +65,9 @@ typedef struct
|
||||
|
||||
/** Data of axis */
|
||||
enum {
|
||||
LV_CHART_AXIS_SKIP_LAST_TICK = 0x00, /**< don't draw the last tick */
|
||||
LV_CHART_AXIS_DRAW_LAST_TICK = 0x01 /**< draw the last tick */
|
||||
LV_CHART_AXIS_SKIP_LAST_TICK = 0x00, /**< don't draw the last tick */
|
||||
LV_CHART_AXIS_DRAW_LAST_TICK = 0x01, /**< draw the last tick */
|
||||
LV_CHART_AXIS_INVERSE_LABELS_ORDER = 0x02 /**< draw tick labels in an inversed order*/
|
||||
};
|
||||
typedef uint8_t lv_chart_axis_options_t;
|
||||
|
||||
@ -93,6 +94,7 @@ typedef struct
|
||||
lv_chart_type_t type; /*Line, column or point chart (from 'lv_chart_type_t')*/
|
||||
lv_chart_axis_cfg_t y_axis;
|
||||
lv_chart_axis_cfg_t x_axis;
|
||||
lv_chart_axis_cfg_t secondary_y_axis;
|
||||
uint16_t margin;
|
||||
uint8_t update_mode : 1;
|
||||
struct
|
||||
@ -259,6 +261,16 @@ void lv_chart_set_x_tick_length(lv_obj_t * chart, uint8_t major_tick_len, uint8_
|
||||
*/
|
||||
void lv_chart_set_y_tick_length(lv_obj_t * chart, uint8_t major_tick_len, uint8_t minor_tick_len);
|
||||
|
||||
/**
|
||||
* Set the length of the tick marks on the secondary y axis
|
||||
* @param chart pointer to the chart
|
||||
* @param major_tick_len the length of the major tick or `LV_CHART_TICK_LENGTH_AUTO` to set automatically
|
||||
* (where labels are added)
|
||||
* @param minor_tick_len the length of the minor tick, `LV_CHART_TICK_LENGTH_AUTO` to set automatically
|
||||
* (where no labels are added)
|
||||
*/
|
||||
void lv_chart_set_secondary_y_tick_length(lv_obj_t * chart, uint8_t major_tick_len, uint8_t minor_tick_len);
|
||||
|
||||
/**
|
||||
* Set the x-axis tick count and labels of a chart
|
||||
* @param chart pointer to a chart object
|
||||
@ -270,6 +282,17 @@ void lv_chart_set_y_tick_length(lv_obj_t * chart, uint8_t major_tick_len, uint8_
|
||||
void lv_chart_set_x_tick_texts(lv_obj_t * chart, const char * list_of_values, uint8_t num_tick_marks,
|
||||
lv_chart_axis_options_t options);
|
||||
|
||||
/**
|
||||
* Set the secondary y-axis tick count and labels of a chart
|
||||
* @param chart pointer to a chart object
|
||||
* @param list_of_values list of string values, terminated with \n, except the last
|
||||
* @param num_tick_marks if list_of_values is NULL: total number of ticks per axis
|
||||
* else number of ticks between two value labels
|
||||
* @param options extra options
|
||||
*/
|
||||
void lv_chart_set_secondary_y_tick_texts(lv_obj_t * chart, const char * list_of_values, uint8_t num_tick_marks,
|
||||
lv_chart_axis_options_t options);
|
||||
|
||||
/**
|
||||
* Set the y-axis tick count and labels of a chart
|
||||
* @param chart pointer to a chart object
|
||||
|
@ -32,8 +32,8 @@ static lv_res_t lv_kb_signal(lv_obj_t * kb, lv_signal_t sign, void * param);
|
||||
**********************/
|
||||
static lv_signal_cb_t ancestor_signal;
|
||||
/* clang-format off */
|
||||
static const char * kb_map_lc[] = {"1#", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "Bksp", "\n",
|
||||
"ABC", "a", "s", "d", "f", "g", "h", "j", "k", "l", "Enter", "\n",
|
||||
static const char * kb_map_lc[] = {"1#", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", LV_SYMBOL_BACKSPACE, "\n",
|
||||
"ABC", "a", "s", "d", "f", "g", "h", "j", "k", "l", LV_SYMBOL_NEW_LINE, "\n",
|
||||
"_", "-", "z", "x", "c", "v", "b", "n", "m", ".", ",", ":", "\n",
|
||||
LV_SYMBOL_CLOSE, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, ""};
|
||||
|
||||
@ -43,8 +43,8 @@ static const lv_btnm_ctrl_t kb_ctrl_lc_map[] = {
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
LV_KB_CTRL_BTN_FLAGS | 2, 2, 6, 2, LV_KB_CTRL_BTN_FLAGS | 2};
|
||||
|
||||
static const char * kb_map_uc[] = {"1#", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "Bksp", "\n",
|
||||
"abc", "A", "S", "D", "F", "G", "H", "J", "K", "L", "Enter", "\n",
|
||||
static const char * kb_map_uc[] = {"1#", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", LV_SYMBOL_BACKSPACE, "\n",
|
||||
"abc", "A", "S", "D", "F", "G", "H", "J", "K", "L", LV_SYMBOL_NEW_LINE, "\n",
|
||||
"_", "-", "Z", "X", "C", "V", "B", "N", "M", ".", ",", ":", "\n",
|
||||
LV_SYMBOL_CLOSE, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, ""};
|
||||
|
||||
@ -54,7 +54,7 @@ static const lv_btnm_ctrl_t kb_ctrl_uc_map[] = {
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
LV_KB_CTRL_BTN_FLAGS | 2, 2, 6, 2, LV_KB_CTRL_BTN_FLAGS | 2};
|
||||
|
||||
static const char * kb_map_spec[] = {"0", "1", "2", "3", "4" ,"5", "6", "7", "8", "9", "Bksp", "\n",
|
||||
static const char * kb_map_spec[] = {"0", "1", "2", "3", "4" ,"5", "6", "7", "8", "9", LV_SYMBOL_BACKSPACE, "\n",
|
||||
"abc", "+", "-", "/", "*", "=", "%", "!", "?", "#", "<", ">", "\n",
|
||||
"\\", "@", "$", "(", ")", "{", "}", "[", "]", ";", "\"", "'", "\n",
|
||||
LV_SYMBOL_CLOSE, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, ""};
|
||||
@ -67,7 +67,7 @@ static const lv_btnm_ctrl_t kb_ctrl_spec_map[] = {
|
||||
|
||||
static const char * kb_map_num[] = {"1", "2", "3", LV_SYMBOL_CLOSE, "\n",
|
||||
"4", "5", "6", LV_SYMBOL_OK, "\n",
|
||||
"7", "8", "9", "Bksp", "\n",
|
||||
"7", "8", "9", LV_SYMBOL_BACKSPACE, "\n",
|
||||
"+/-", "0", ".", LV_SYMBOL_LEFT, LV_SYMBOL_RIGHT, ""};
|
||||
|
||||
static const lv_btnm_ctrl_t kb_ctrl_num_map[] = {
|
||||
@ -376,7 +376,7 @@ void lv_kb_def_event_cb(lv_obj_t * kb, lv_event_t event)
|
||||
lv_ta_cursor_left(ext->ta);
|
||||
else if(strcmp(txt, LV_SYMBOL_RIGHT) == 0)
|
||||
lv_ta_cursor_right(ext->ta);
|
||||
else if(strcmp(txt, "Bksp") == 0)
|
||||
else if(strcmp(txt, LV_SYMBOL_BACKSPACE) == 0)
|
||||
lv_ta_del_char(ext->ta);
|
||||
else if(strcmp(txt, "+/-") == 0) {
|
||||
uint16_t cur = lv_ta_get_cursor_pos(ext->ta);
|
||||
|
@ -162,6 +162,23 @@ lv_obj_t * lv_ta_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->cursor.pos = copy_ext->cursor.pos;
|
||||
ext->cursor.valid_x = copy_ext->cursor.valid_x;
|
||||
ext->cursor.type = copy_ext->cursor.type;
|
||||
|
||||
if(ext->pwd_mode != 0) pwd_char_hider( new_ta);
|
||||
|
||||
if(copy_ext->placeholder != NULL)
|
||||
ext->placeholder = lv_label_create(new_ta, copy_ext->placeholder);
|
||||
else
|
||||
ext->placeholder = NULL;
|
||||
|
||||
if(copy_ext->pwd_tmp) {
|
||||
uint16_t len = lv_mem_get_size(copy_ext->pwd_tmp);
|
||||
ext->pwd_tmp = lv_mem_alloc(len);
|
||||
lv_mem_assert(ext->pwd_tmp);
|
||||
if(ext->pwd_tmp == NULL) return NULL;
|
||||
|
||||
memcpy(ext->pwd_tmp, copy_ext->pwd_tmp, len);
|
||||
}
|
||||
|
||||
if(copy_ext->one_line) lv_ta_set_one_line(new_ta, true);
|
||||
|
||||
lv_ta_set_style(new_ta, LV_TA_STYLE_CURSOR, lv_ta_get_style(copy, LV_TA_STYLE_CURSOR));
|
||||
@ -652,7 +669,8 @@ void lv_ta_set_pwd_mode(lv_obj_t * ta, bool en)
|
||||
strcpy(ext->pwd_tmp, txt);
|
||||
|
||||
uint16_t i;
|
||||
for(i = 0; i < len; i++) {
|
||||
uint16_t encoded_len = lv_txt_get_encoded_length(txt);
|
||||
for(i = 0; i < encoded_len; i++) {
|
||||
txt[i] = '*'; /*All char to '*'*/
|
||||
}
|
||||
txt[i] = '\0';
|
||||
@ -917,7 +935,7 @@ const char * lv_ta_get_placeholder_text(lv_obj_t * ta)
|
||||
|
||||
const char * txt = NULL;
|
||||
|
||||
if(ext->placeholder) txt = lv_label_get_text(ext->label);
|
||||
if(ext->placeholder) txt = lv_label_get_text(ext->placeholder);
|
||||
|
||||
return txt;
|
||||
}
|
||||
|
@ -228,6 +228,18 @@ void lv_win_set_btn_size(lv_obj_t * win, lv_coord_t size)
|
||||
lv_win_realign(win);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the size of the content area.
|
||||
* @param win pointer to a window object
|
||||
* @param w width
|
||||
* @param h height (the window will be higher with the height of the header)
|
||||
*/
|
||||
void lv_win_set_content_size(lv_obj_t * win, lv_coord_t w, lv_coord_t h)
|
||||
{
|
||||
lv_win_ext_t * ext = lv_obj_get_ext_attr(win);
|
||||
h += lv_obj_get_height(ext->header);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the layout of the window
|
||||
* @param win pointer to a window object
|
||||
|
@ -132,6 +132,15 @@ void lv_win_set_title(lv_obj_t * win, const char * title);
|
||||
*/
|
||||
void lv_win_set_btn_size(lv_obj_t * win, lv_coord_t size);
|
||||
|
||||
|
||||
/**
|
||||
* Set the size of the content area.
|
||||
* @param win pointer to a window object
|
||||
* @param w width
|
||||
* @param h height (the window will be higher with the height of the header)
|
||||
*/
|
||||
void lv_win_set_content_size(lv_obj_t * win, lv_coord_t w, lv_coord_t h);
|
||||
|
||||
/**
|
||||
* Set the layout of the window
|
||||
* @param win pointer to a window object
|
||||
|
@ -15,9 +15,9 @@ extern "C" {
|
||||
*********************/
|
||||
/*Current version of LittlevGL*/
|
||||
#define LVGL_VERSION_MAJOR 6
|
||||
#define LVGL_VERSION_MINOR 0
|
||||
#define LVGL_VERSION_PATCH 2
|
||||
#define LVGL_VERSION_INFO ""
|
||||
#define LVGL_VERSION_MINOR 1
|
||||
#define LVGL_VERSION_PATCH 0
|
||||
#define LVGL_VERSION_INFO "dev"
|
||||
|
||||
|
||||
/*********************
|
||||
|
Loading…
x
Reference in New Issue
Block a user