BigW Consortium Gitlab

Commit 7f799100 by Kiss-Vamosi Gabor

lv_pb: slider function added

parent a97d4b6a
......@@ -23,6 +23,7 @@
#include "../lv_obj/lv_obj.h"
#include "lv_rect.h"
#include "lv_btn.h"
#include "lv_label.h"
/*********************
......@@ -38,11 +39,13 @@ typedef struct
{
lv_rect_ext_t rect_ext; /*Ext. of ancestor*/
/*New data for this type */
lv_obj_t * label; /*Pointer to the label on the progress bar*/
uint16_t act_value; /*Current value of the progress bar*/
uint16_t min_value; /*Minimum value of the progress bar*/
uint16_t max_value; /*Maximum value of the progress bar*/
char * format_str; /*Format string of the label. E.g. "Progress: %d"*/
lv_obj_t * label; /*Pointer to the label on the progress bar*/
int16_t act_value; /*Current value of the progress bar*/
int16_t tmp_value; /*Value when settings from a display input*/
int16_t min_value; /*Minimum value of the progress bar*/
int16_t max_value; /*Maximum value of the progress bar*/
char * format_str; /*Format string of the label. E.g. "Progress: %d"*/
uint8_t set_in_prog :1;/*Indicates the setting by display input is in progress*/
}lv_pb_ext_t;
/*Style of progress bar*/
......@@ -50,13 +53,19 @@ typedef struct
{
lv_rects_t bg; /*Style of the background (inherited)*/
lv_rects_t bar; /*Style of the bar*/
lv_labels_t label; /*Style of the label*/
lv_labels_t label; /*Style of the label*/
lv_rects_t btn; /*Style of the button (it is rectangle but acts as a button)*/
color_t tmp_bar_mcolor; /*Main color of temporal bar when settings by hand*/
color_t tmp_bar_gcolor; /*Gradient color of temporal bar when settings by hand*/
cord_t btn_size; /*Width or height of the button (depending on the orientation of the pb)*/
uint8_t tmp_bar_opa; /*Opacity of temporal bar in percentage of the object opacity [%]*/
}lv_pbs_t;
/*Built-in styles of progress bar*/
typedef enum
{
LV_PBS_DEF,
LV_PBS_SLIDER,
}lv_pbs_builtin_t;
/**********************
......@@ -84,7 +93,7 @@ bool lv_pb_signal(lv_obj_t * pb, lv_signal_t sign, void * param);
* @param pb pointer to a progress bar object
* @param value new value
*/
void lv_pb_set_value(lv_obj_t * pb, uint16_t value);
void lv_pb_set_value(lv_obj_t * pb, int16_t value);
/**
* Set minimum and the maximum values of a progress bar
......@@ -92,7 +101,7 @@ void lv_pb_set_value(lv_obj_t * pb, uint16_t value);
* @param min minimum value
* @param max maximum value
*/
void lv_pb_set_min_max_value(lv_obj_t * pb, uint16_t min, uint16_t max);
void lv_pb_set_min_max_value(lv_obj_t * pb, int16_t min, int16_t max);
/**
* Set format string for the label of the progress bar
......@@ -106,7 +115,7 @@ void lv_pb_set_format_str(lv_obj_t * pb, const char * format);
* @param pb pointer to a progress bar object
* @return the value of the progress bar
*/
uint16_t lv_pb_get_value(lv_obj_t * pb);
int16_t lv_pb_get_value(lv_obj_t * pb);
/**
* Return with a pointer to a built-in style and/or copy it to a variable
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment