fix(comment): remove the space after /* and before */
This commit is contained in:
@@ -31,8 +31,8 @@ void lv_example_arc_2(void)
|
||||
lv_arc_set_angles(arc, 270, 270);
|
||||
lv_obj_align(arc, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
/* Create an `lv_timer` to update the arc.
|
||||
* Store the `arc` in the user data*/
|
||||
/*Create an `lv_timer` to update the arc.
|
||||
*Store the `arc` in the user data*/
|
||||
lv_timer_create(arc_loader, 20, arc);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
txt_area.x1 = txt_area.x2 - txt_size.x + 1;
|
||||
dsc.color = lv_color_white();
|
||||
}
|
||||
/*If the indicator is still short put the text out of it on the right */
|
||||
/*If the indicator is still short put the text out of it on the right*/
|
||||
else {
|
||||
txt_area.x1 = bar->indic_area.x2 + 5;
|
||||
txt_area.x2 = txt_area.x1 + txt_size.x - 1;
|
||||
|
||||
@@ -22,13 +22,13 @@ void lv_example_btn_3(void)
|
||||
lv_anim_path_set_cb(&path_overshoot, lv_anim_path_overshoot);
|
||||
|
||||
|
||||
/* Transition descriptor when going back to the default state.
|
||||
* Add some delay to be sure the press transition is visible even if the press was very short*/
|
||||
/*Transition descriptor when going back to the default state.
|
||||
*Add some delay to be sure the press transition is visible even if the press was very short*/
|
||||
static lv_style_transition_dsc_t transition_dsc_def;
|
||||
lv_style_transition_dsc_init(&transition_dsc_def, props, &path_overshoot, 250, 100);
|
||||
|
||||
/* Transition descriptor when going to pressed state.
|
||||
* No delay, go to presses state immediately*/
|
||||
/*Transition descriptor when going to pressed state.
|
||||
*No delay, go to presses state immediately*/
|
||||
static lv_style_transition_dsc_t transition_dsc_pr;
|
||||
lv_style_transition_dsc_init(&transition_dsc_pr, props, &path_ease_in_out, 250, 0);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
if(e == LV_EVENT_DRAW_PART_BEGIN) {
|
||||
lv_obj_draw_dsc_t * dsc = lv_event_get_param();
|
||||
|
||||
/*Change the draw descriptor the 2nd button */
|
||||
/*Change the draw descriptor the 2nd button*/
|
||||
if(dsc->id == 1) {
|
||||
dsc->rect_dsc->radius = 0;
|
||||
if(lv_btnmatrix_get_selected_btn(obj) == dsc->id) dsc->rect_dsc->bg_color = lv_color_blue_darken_3();
|
||||
@@ -18,7 +18,7 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
dsc->rect_dsc->shadow_ofs_y = 3;
|
||||
dsc->label_dsc->color = lv_color_white();
|
||||
}
|
||||
/*Change the draw descriptor the 3rd button */
|
||||
/*Change the draw descriptor the 3rd button*/
|
||||
else if(dsc->id == 2) {
|
||||
dsc->rect_dsc->radius = LV_RADIUS_CIRCLE;
|
||||
if(lv_btnmatrix_get_selected_btn(obj) == dsc->id) dsc->rect_dsc->bg_color = lv_color_red_darken_3();
|
||||
|
||||
@@ -36,8 +36,8 @@ void lv_example_canvas_1(void)
|
||||
|
||||
lv_canvas_draw_text(canvas, 40, 20, 100, &label_dsc, "Some text on text canvas");
|
||||
|
||||
/* Test the rotation. It requires an other buffer where the orignal image is stored.
|
||||
* So copy the current image to buffer and rotate it to the canvas */
|
||||
/*Test the rotation. It requires an other buffer where the orignal image is stored.
|
||||
*So copy the current image to buffer and rotate it to the canvas*/
|
||||
static lv_color_t cbuf_tmp[CANVAS_WIDTH * CANVAS_HEIGHT];
|
||||
memcpy(cbuf_tmp, cbuf, sizeof(cbuf_tmp));
|
||||
lv_img_dsc_t img;
|
||||
|
||||
@@ -7,7 +7,7 @@ static lv_chart_series_t * ser2;
|
||||
|
||||
static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
{
|
||||
/*Add the faded area before the lines are drawn */
|
||||
/*Add the faded area before the lines are drawn*/
|
||||
if(e == LV_EVENT_DRAW_PART_BEGIN) {
|
||||
lv_obj_draw_dsc_t * dsc = lv_event_get_param();
|
||||
if(dsc->part != LV_PART_ITEMS) return;
|
||||
|
||||
@@ -33,7 +33,7 @@ void lv_example_dropdown_3(void)
|
||||
lv_dropdown_set_symbol(dropdown, &img_caret_down);
|
||||
lv_obj_set_style_transform_angle(dropdown, LV_PART_MAIN, LV_STATE_CHECKED, 1800);
|
||||
|
||||
/* In a menu we don't need to show the last clicked item*/
|
||||
/*In a menu we don't need to show the last clicked item*/
|
||||
lv_dropdown_set_selected_highlight(dropdown, false);
|
||||
|
||||
lv_obj_add_event_cb(dropdown, event_cb, NULL);
|
||||
|
||||
@@ -29,7 +29,7 @@ void lv_example_img_2(void)
|
||||
lv_obj_align(blue_slider, green_slider, LV_ALIGN_OUT_RIGHT_MID, 25, 0);
|
||||
lv_obj_align(intense_slider, blue_slider, LV_ALIGN_OUT_RIGHT_MID, 25, 0);
|
||||
|
||||
/* Now create the actual image */
|
||||
/*Now create the actual image*/
|
||||
LV_IMG_DECLARE(img_cogwheel_argb)
|
||||
img1 = lv_img_create(lv_scr_act(), NULL);
|
||||
lv_img_set_src(img1, &img_cogwheel_argb);
|
||||
@@ -43,7 +43,7 @@ static void slider_event_cb(lv_obj_t * slider, lv_event_t event)
|
||||
LV_UNUSED(slider);
|
||||
|
||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||
/* Recolor the image based on the sliders' values */
|
||||
/*Recolor the image based on the sliders' values*/
|
||||
lv_color_t color = lv_color_make(lv_slider_get_value(red_slider), lv_slider_get_value(green_slider), lv_slider_get_value(blue_slider));
|
||||
lv_opa_t intense = lv_slider_get_value(intense_slider);
|
||||
lv_obj_set_style_img_recolor_opa(img1, LV_PART_MAIN, LV_STATE_DEFAULT, intense);
|
||||
|
||||
@@ -19,7 +19,7 @@ void lv_example_img_3(void)
|
||||
{
|
||||
LV_IMG_DECLARE(img_cogwheel_argb);
|
||||
|
||||
/* Now create the actual image */
|
||||
/*Now create the actual image*/
|
||||
lv_obj_t * img = lv_img_create(lv_scr_act(), NULL);
|
||||
lv_img_set_src(img, &img_cogwheel_argb);
|
||||
lv_obj_align(img, NULL, LV_ALIGN_CENTER, 50, 50);
|
||||
|
||||
@@ -7,7 +7,7 @@ void lv_example_imgbtn_1(void)
|
||||
LV_IMG_DECLARE(imgbtn_right);
|
||||
LV_IMG_DECLARE(imgbtn_mid);
|
||||
|
||||
/* Create a transition animation on width transformation and recolor.*/
|
||||
/*Create a transition animation on width transformation and recolor.*/
|
||||
static lv_style_prop_t tr_prop[] = {LV_STYLE_TRANSFORM_WIDTH, LV_STYLE_IMG_RECOLOR_OPA, 0};
|
||||
static lv_style_transition_dsc_t tr;
|
||||
lv_style_transition_dsc_init(&tr, tr_prop, &lv_anim_path_def, 200, 0);
|
||||
|
||||
@@ -6,17 +6,17 @@
|
||||
*/
|
||||
void lv_example_label_2(void)
|
||||
{
|
||||
/* Create a style for the shadow*/
|
||||
/*Create a style for the shadow*/
|
||||
static lv_style_t style_shadow;
|
||||
lv_style_init(&style_shadow);
|
||||
lv_style_set_text_opa(&style_shadow, LV_OPA_30);
|
||||
lv_style_set_text_color(&style_shadow, lv_color_black());
|
||||
|
||||
/*Create a label for the shadow first (it's in the background) */
|
||||
/*Create a label for the shadow first (it's in the background)*/
|
||||
lv_obj_t * shadow_label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_obj_add_style(shadow_label, LV_PART_MAIN, LV_STATE_DEFAULT, &style_shadow);
|
||||
|
||||
/* Create the main label */
|
||||
/*Create the main label*/
|
||||
lv_obj_t * main_label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_label_set_text(main_label, "A simple method to create\n"
|
||||
"shadows on a text.\n"
|
||||
@@ -26,10 +26,10 @@ void lv_example_label_2(void)
|
||||
/*Set the same text for the shadow label*/
|
||||
lv_label_set_text(shadow_label, lv_label_get_text(main_label));
|
||||
|
||||
/* Position the main label */
|
||||
/*Position the main label*/
|
||||
lv_obj_align(main_label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
/* Shift the second label down and to the right by 2 pixel */
|
||||
/*Shift the second label down and to the right by 2 pixel*/
|
||||
lv_obj_align(shadow_label, main_label, LV_ALIGN_IN_TOP_LEFT, 2, 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ void lv_example_win_1(void);
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif /*LV_EX_WIDGETS_H*/
|
||||
|
||||
@@ -23,7 +23,7 @@ void lv_example_meter_1(void)
|
||||
|
||||
lv_meter_indicator_t * indic;
|
||||
|
||||
/*Add a blue arc to the start */
|
||||
/*Add a blue arc to the start*/
|
||||
indic = lv_meter_add_arc(meter, scale, 3, lv_color_blue(), 0);
|
||||
lv_meter_set_indicator_start_value(meter, indic, 0);
|
||||
lv_meter_set_indicator_end_value(meter, indic, 20);
|
||||
@@ -33,7 +33,7 @@ void lv_example_meter_1(void)
|
||||
lv_meter_set_indicator_start_value(meter, indic, 0);
|
||||
lv_meter_set_indicator_end_value(meter, indic, 20);
|
||||
|
||||
/*Add a red arc to the end */
|
||||
/*Add a red arc to the end*/
|
||||
indic = lv_meter_add_arc(meter, scale, 3, lv_color_red(), 0);
|
||||
lv_meter_set_indicator_start_value(meter, indic, 80);
|
||||
lv_meter_set_indicator_end_value(meter, indic, 100);
|
||||
|
||||
@@ -26,7 +26,7 @@ void lv_example_meter_2(void)
|
||||
lv_meter_set_scale_major_ticks(meter, scale, 1, 2, 30, lv_color_hex3(0xeee), 10);
|
||||
lv_meter_set_scale_range(meter, scale, 0, 100, 270, 90);
|
||||
|
||||
/*Add a three arc indicator */
|
||||
/*Add a three arc indicator*/
|
||||
lv_meter_indicator_t * indic1 = lv_meter_add_arc(meter, scale, 10, lv_color_red(), 0);
|
||||
lv_meter_indicator_t * indic2 = lv_meter_add_arc(meter, scale, 10, lv_color_green(), -10);
|
||||
lv_meter_indicator_t * indic3 = lv_meter_add_arc(meter, scale, 10, lv_color_blue(), -20);
|
||||
|
||||
@@ -31,7 +31,7 @@ void lv_example_meter_3(void)
|
||||
|
||||
LV_IMG_DECLARE(img_hand)
|
||||
|
||||
/*Add a the hands from images */
|
||||
/*Add a the hands from images*/
|
||||
lv_meter_indicator_t * indic_min = lv_meter_add_needle_img(meter, scale_min, &img_hand, 5, 5);
|
||||
lv_meter_indicator_t * indic_hour = lv_meter_add_needle_img(meter, scale_min, &img_hand, 5, 5);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ void lv_example_meter_4(void)
|
||||
lv_meter_set_scale_ticks(meter, scale, 0, 0, 0, lv_color_black());
|
||||
lv_meter_set_scale_range(meter, scale, 0, 100, 360, 0);
|
||||
|
||||
/*Add a three arc indicator */
|
||||
/*Add a three arc indicator*/
|
||||
lv_coord_t indic_w = lv_obj_get_width(meter) / 2;
|
||||
lv_meter_indicator_t * indic1 = lv_meter_add_arc(meter, scale, indic_w, lv_color_orange(), 0);
|
||||
lv_meter_set_indicator_start_value(meter, indic1, 0);
|
||||
|
||||
@@ -9,12 +9,12 @@ static lv_obj_t * slider_label;
|
||||
*/
|
||||
void lv_example_slider_1(void)
|
||||
{
|
||||
/* Create a slider in the center of the display */
|
||||
/*Create a slider in the center of the display*/
|
||||
lv_obj_t * slider = lv_slider_create(lv_scr_act(), NULL);
|
||||
lv_obj_align(slider, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_obj_add_event_cb(slider, slider_event_cb, NULL);
|
||||
|
||||
/* Create a label below the slider */
|
||||
/*Create a label below the slider*/
|
||||
slider_label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_label_set_text(slider_label, "0%");
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ void lv_example_slider_2(void)
|
||||
lv_style_set_content_opa(&style_pr, LV_OPA_COVER);
|
||||
lv_style_set_content_ofs_y(&style_pr, -15);
|
||||
|
||||
/* Create a slider in the center of the display */
|
||||
/*Create a slider in the center of the display*/
|
||||
lv_obj_t * slider;
|
||||
slider = lv_slider_create(lv_scr_act(), NULL);
|
||||
lv_obj_align(slider, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
@@ -9,7 +9,7 @@ static void slider_event_cb(lv_obj_t * slider, lv_event_t event);
|
||||
*/
|
||||
void lv_example_slider_3(void)
|
||||
{
|
||||
/* Create a slider in the center of the display */
|
||||
/*Create a slider in the center of the display*/
|
||||
lv_obj_t * slider;
|
||||
slider = lv_slider_create(lv_scr_act(), NULL);
|
||||
lv_obj_align(slider, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
@@ -64,7 +64,7 @@ void lv_example_table_2(void)
|
||||
lv_obj_set_size(table, 150, 200);
|
||||
|
||||
lv_table_set_col_width(table, 0, 150);
|
||||
lv_table_set_row_cnt(table, ITEM_CNT); /*Not required but avoids a lot of memory reallocation lv_table_set_set_value */
|
||||
lv_table_set_row_cnt(table, ITEM_CNT); /*Not required but avoids a lot of memory reallocation lv_table_set_set_value*/
|
||||
lv_table_set_col_cnt(table, 1);
|
||||
|
||||
/*Don't make the cell pressed, we will draw something different in the event*/
|
||||
|
||||
@@ -7,7 +7,7 @@ static lv_obj_t * kb;
|
||||
|
||||
void lv_example_textarea_2(void)
|
||||
{
|
||||
/* Create the password box */
|
||||
/*Create the password box*/
|
||||
lv_obj_t * pwd_ta = lv_textarea_create(lv_scr_act(), NULL);
|
||||
lv_textarea_set_text(pwd_ta, "");
|
||||
lv_textarea_set_password_mode(pwd_ta, true);
|
||||
@@ -16,33 +16,33 @@ void lv_example_textarea_2(void)
|
||||
lv_obj_set_pos(pwd_ta, 5, 20);
|
||||
lv_obj_add_event_cb(pwd_ta, ta_event_cb, NULL);
|
||||
|
||||
/* Create a label and position it above the text box */
|
||||
/*Create a label and position it above the text box*/
|
||||
lv_obj_t * pwd_label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_label_set_text(pwd_label, "Password:");
|
||||
lv_obj_align(pwd_label, pwd_ta, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
|
||||
|
||||
/* Create the one-line mode text area */
|
||||
/*Create the one-line mode text area*/
|
||||
lv_obj_t * oneline_ta = lv_textarea_create(lv_scr_act(), pwd_ta);
|
||||
lv_textarea_set_password_mode(oneline_ta, false);
|
||||
lv_obj_align(oneline_ta, NULL, LV_ALIGN_IN_TOP_RIGHT, -5, 20);
|
||||
|
||||
|
||||
/* Create a label and position it above the text box */
|
||||
/*Create a label and position it above the text box*/
|
||||
lv_obj_t * oneline_label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_label_set_text(oneline_label, "Text:");
|
||||
lv_obj_align(oneline_label, oneline_ta, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
|
||||
|
||||
/* Create a keyboard */
|
||||
/*Create a keyboard*/
|
||||
kb = lv_keyboard_create(lv_scr_act());
|
||||
lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2);
|
||||
|
||||
lv_keyboard_set_textarea(kb, pwd_ta); /* Focus it on one of the text areas to start */
|
||||
lv_keyboard_set_textarea(kb, pwd_ta); /*Focus it on one of the text areas to start*/
|
||||
}
|
||||
|
||||
static void ta_event_cb(lv_obj_t * ta, lv_event_t event)
|
||||
{
|
||||
if(event == LV_EVENT_CLICKED) {
|
||||
/* Focus on the clicked text area */
|
||||
/*Focus on the clicked text area*/
|
||||
if(kb != NULL)
|
||||
lv_keyboard_set_textarea(kb, ta);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ static lv_obj_t * kb;
|
||||
*/
|
||||
void lv_example_textarea_3(void)
|
||||
{
|
||||
/* Create the text area */
|
||||
/*Create the text area*/
|
||||
lv_obj_t * ta = lv_textarea_create(lv_scr_act(), NULL);
|
||||
lv_obj_add_event_cb(ta, ta_event_cb, NULL);
|
||||
lv_textarea_set_accepted_chars(ta, "0123456789:");
|
||||
@@ -19,7 +19,7 @@ void lv_example_textarea_3(void)
|
||||
lv_textarea_set_one_line(ta, true);
|
||||
lv_textarea_set_text(ta, "");
|
||||
|
||||
/* Create a keyboard*/
|
||||
/*Create a keyboard*/
|
||||
kb = lv_keyboard_create(lv_scr_act());
|
||||
lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2);
|
||||
lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_NUMBER);
|
||||
|
||||
Reference in New Issue
Block a user