mirror of
https://github.com/lvgl/lvgl.git
synced 2026-03-23 22:39:09 +08:00
minor fixes
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_FLEX
|
||||
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* A simple row and a column layout with flexbox
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_FLEX
|
||||
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Arrange items in rows with wrap and place the items to get even space around them.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_FLEX
|
||||
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Use a built in flex layout and demonstrate flex grow.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_FLEX
|
||||
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Reverse the order of flex items
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_FLEX
|
||||
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||
|
||||
static void row_gap_anim(lv_obj_t * obj, lv_anim_value_t v)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_FLEX
|
||||
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* RTL base direction changes order of the items.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_GRID
|
||||
|
||||
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* A simple grid
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_GRID
|
||||
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_GRID
|
||||
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Demonstrate grid's "free unit"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_GRID
|
||||
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Demonstrate track placement
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_GRID
|
||||
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||
|
||||
static void row_gap_anim(lv_obj_t * obj, lv_anim_value_t v)
|
||||
{
|
||||
@@ -12,7 +11,7 @@ static void column_gap_anim(lv_obj_t * obj, lv_anim_value_t v)
|
||||
lv_obj_set_style_pad_column(obj, LV_PART_MAIN, LV_STATE_DEFAULT, v);
|
||||
}
|
||||
/**
|
||||
* Demonstrate margin in grid
|
||||
* Demonstrate column and row gap
|
||||
*/
|
||||
void lv_example_grid_5(void)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_GRID
|
||||
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Demonstrate RTL direction on grid
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_ARC
|
||||
#if LV_USE_ARC && LV_BUILD_EXAMPLES
|
||||
|
||||
void lv_example_arc_1(void)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_ARC
|
||||
|
||||
#if LV_USE_ARC && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* An `lv_task` to call periodically to set the angles of the arc
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_BAR
|
||||
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
||||
|
||||
void lv_example_bar_1(void)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_BAR
|
||||
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Example of styling the bar
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_BAR
|
||||
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
||||
|
||||
static void set_temp(lv_obj_t * bar, int32_t temp)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_BAR
|
||||
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Bar with stripe pattern and ranged value
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_BAR
|
||||
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Bar with LTR and RTL base direction
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_BAR
|
||||
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
||||
|
||||
static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
{
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
#include "../../../lvgl.h"
|
||||
#include <stdio.h>
|
||||
#if LV_USE_BTN
|
||||
#if LV_USE_BTN && LV_BUILD_EXAMPLES
|
||||
|
||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||
{
|
||||
if(event == LV_EVENT_CLICKED) {
|
||||
printf("Clicked\n");
|
||||
LV_LOG_USER("Clicked\n");
|
||||
}
|
||||
else if(event == LV_EVENT_VALUE_CHANGED) {
|
||||
printf("Toggled\n");
|
||||
LV_LOG_USER("Toggled\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#include <stdio.h>
|
||||
#if LV_USE_BTNMATRIX
|
||||
#if LV_USE_BTNMATRIX && LV_BUILD_EXAMPLES
|
||||
|
||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||
{
|
||||
@@ -8,7 +7,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||
uint32_t id = lv_btnmatrix_get_active_btn(obj);
|
||||
const char * txt = lv_btnmatrix_get_btn_text(obj, id);
|
||||
|
||||
printf("%s was pressed\n", txt);
|
||||
LV_LOG_USER("%s was pressed\n", txt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#include <stdio.h>
|
||||
#if LV_USE_BTNMATRIX
|
||||
#if LV_USE_BTNMATRIX && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#include <stdio.h>
|
||||
#if LV_USE_BTNMATRIX
|
||||
|
||||
#if LV_USE_BTNMATRIX && LV_BUILD_EXAMPLES
|
||||
|
||||
static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
{
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
#include "../../../lvgl.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#if LV_USE_CALENDAR
|
||||
#if LV_USE_CALENDAR && LV_BUILD_EXAMPLES
|
||||
|
||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||
{
|
||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||
lv_calendar_date_t date;
|
||||
if(lv_calendar_get_pressed_date(obj, &date)) {
|
||||
printf("Clicked date: %02d.%02d.%d\n", date.day, date.month, date.year);
|
||||
LV_LOG_USER("Clicked date: %02d.%02d.%d\n", date.day, date.month, date.year);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_CANVAS
|
||||
#if LV_USE_CANVAS && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
#define CANVAS_WIDTH 200
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_CANVAS
|
||||
#if LV_USE_CANVAS && LV_BUILD_EXAMPLES
|
||||
|
||||
#define CANVAS_WIDTH 50
|
||||
#define CANVAS_HEIGHT 50
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_CHART
|
||||
#if LV_USE_CHART && LV_BUILD_EXAMPLES
|
||||
|
||||
void lv_example_chart_1(void)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_CHART
|
||||
#if LV_USE_CHART && LV_DRAW_COMPLEX && LV_BUILD_EXAMPLES
|
||||
|
||||
static lv_obj_t * chart1;
|
||||
static lv_chart_series_t * ser1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_CHART
|
||||
#if LV_USE_CHART && LV_BUILD_EXAMPLES
|
||||
|
||||
static void event_cb(lv_obj_t * chart, lv_event_t e)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_CHART
|
||||
#if LV_USE_CHART && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
static void event_cb(lv_obj_t * chart, lv_event_t e)
|
||||
@@ -15,7 +15,7 @@ static void event_cb(lv_obj_t * chart, lv_event_t e)
|
||||
int32_t id = lv_chart_get_pressed_point(chart);
|
||||
if(id < 0) return;
|
||||
|
||||
printf("Selected point %d\n", id);
|
||||
LV_LOG_USER("Selected point %d\n", id);
|
||||
|
||||
lv_chart_series_t * ser = lv_chart_get_series_next(chart, NULL);
|
||||
while(ser) {
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
#include "../../../lvgl.h"
|
||||
#include <stdio.h>
|
||||
#if LV_USE_CHECKBOX
|
||||
#if LV_USE_CHECKBOX && LV_BUILD_EXAMPLES
|
||||
|
||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||
{
|
||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||
const char * txt = lv_checkbox_get_text(obj);
|
||||
const char * state = lv_obj_get_state(obj) & LV_STATE_CHECKED ? "Checked" : "Unchecked";
|
||||
printf("%s: %s\n", txt, state);
|
||||
LV_LOG_USER("%s: %s\n", txt, state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_COLORWHEEL
|
||||
#if LV_USE_COLORWHEEL && LV_BUILD_EXAMPLES
|
||||
|
||||
void lv_example_colorwheel_1(void)
|
||||
{
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
#include "../../../lvgl.h"
|
||||
#include <stdio.h>
|
||||
#if LV_USE_DROPDOWN
|
||||
|
||||
#if LV_USE_DROPDOWN && LV_BUILD_EXAMPLES
|
||||
|
||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||
{
|
||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||
char buf[32];
|
||||
lv_dropdown_get_selected_str(obj, buf, sizeof(buf));
|
||||
printf("Option: %s\n", buf);
|
||||
LV_LOG_USER("Option: %s\n", buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#include <stdio.h>
|
||||
#if LV_USE_DROPDOWN
|
||||
#if LV_USE_DROPDOWN && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#include <stdio.h>
|
||||
#if LV_USE_DROPDOWN
|
||||
|
||||
#if LV_USE_DROPDOWN && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Create a menu from a drop-down list and show some drop-down list features and styling
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_IMG
|
||||
#if LV_USE_IMG && LV_BUILD_EXAMPLES
|
||||
|
||||
/* Find the image here: https://github.com/lvgl/lv_examples/tree/master/assets */
|
||||
LV_IMG_DECLARE(img_cogwheel_argb);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_IMG
|
||||
#if LV_USE_IMG && LV_BUILD_EXAMPLES
|
||||
|
||||
static lv_obj_t * create_slider(lv_color_t color);
|
||||
static void slider_event_cb(lv_obj_t * slider, lv_event_t event);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_IMG
|
||||
#if LV_USE_IMG && LV_BUILD_EXAMPLES
|
||||
|
||||
LV_IMG_DECLARE(img_cogwheel_argb);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_IMG
|
||||
#if LV_USE_IMG && LV_BUILD_EXAMPLES
|
||||
|
||||
LV_IMG_DECLARE(img_skew_strip);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_USE_IMGBTN
|
||||
#if LV_USE_IMGBTN && LV_BUILD_EXAMPLES
|
||||
|
||||
void lv_example_imgbtn_1(void)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_KEYBOARD
|
||||
|
||||
#if LV_USE_KEYBOARD && LV_BUILD_EXAMPLES
|
||||
|
||||
static void ta_event_cb(lv_obj_t * ta, lv_event_t e)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_LABEL
|
||||
#if LV_USE_LABEL && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Show line wrap, re-color, line align and text scrolling.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_LABEL
|
||||
#if LV_USE_LABEL && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Create a fake text shadow
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_LED
|
||||
#if LV_USE_LED && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Create LED's with different brightness and color
|
||||
*/
|
||||
void lv_example_led_1(void)
|
||||
{
|
||||
/*Create a LED and switch it OFF*/
|
||||
@@ -11,7 +14,8 @@ void lv_example_led_1(void)
|
||||
/*Copy the previous LED and set a brightness*/
|
||||
lv_obj_t * led2 = lv_led_create(lv_scr_act());
|
||||
lv_obj_align(led2, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_led_set_bright(led2, 150);
|
||||
lv_led_set_brightness(led2, 150);
|
||||
lv_led_set_color(led2, LV_COLOR_RED);
|
||||
|
||||
/*Copy the previous LED and switch it ON*/
|
||||
lv_obj_t * led3 = lv_led_create(lv_scr_act());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_LINE
|
||||
#if LV_USE_LINE && LV_BUILD_EXAMPLES
|
||||
|
||||
void lv_example_line_1(void)
|
||||
{
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#include "../../../lvgl.h"
|
||||
#include <stdio.h>
|
||||
#if LV_USE_LIST
|
||||
#if LV_USE_LIST && LV_BUILD_EXAMPLES
|
||||
|
||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||
{
|
||||
if(event == LV_EVENT_CLICKED) {
|
||||
printf("Clicked: %s\n", lv_list_get_btn_text(obj));
|
||||
LV_LOG_USER("Clicked: %s\n", lv_list_get_btn_text(obj));
|
||||
}
|
||||
}
|
||||
void lv_list_example_1(void)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#include <stdio.h>
|
||||
#if LV_USE_METER
|
||||
#if LV_USE_METER && LV_BUILD_EXAMPLES
|
||||
|
||||
static lv_obj_t * meter;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#include <stdio.h>
|
||||
#if LV_USE_METER
|
||||
#if LV_USE_METER && LV_BUILD_EXAMPLES
|
||||
|
||||
static lv_obj_t * meter;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
#include <stdio.h>
|
||||
#if LV_USE_METER
|
||||
#if LV_USE_METER && LV_BUILD_EXAMPLES
|
||||
|
||||
static lv_obj_t * meter;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user