-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup_scr_Test.cpp
66 lines (58 loc) · 3.08 KB
/
setup_scr_Test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* @Description: None
* @Author: LILYGO_L
* @Date: 2023-12-08 10:45:26
* @LastEditTime: 2024-11-11 14:09:59
* @License: GPL 3.0
*/
#include "lvgl.h"
#include <stdio.h>
#include "gui_guider.h"
#include "events_init.h"
#include "widgets_init.h"
#include "custom.h"
void setup_scr_Test(lv_ui *ui)
{
// Write codes Test
ui->Test = lv_obj_create(NULL);
lv_obj_set_size(ui->Test, 128, 128);
lv_obj_set_scrollbar_mode(ui->Test, LV_SCROLLBAR_MODE_OFF);
// Write style for Test, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_bg_opa(ui->Test, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui->Test, lv_color_hex(0xffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
// Write codes Test_btnm_1
ui->Test_btnm_1 = lv_btnmatrix_create(ui->Test);
static const char *Test_btnm_1_text_map[] = {
"Pass",
"Fail",
"",
};
lv_btnmatrix_set_map(ui->Test_btnm_1, Test_btnm_1_text_map);
lv_obj_set_pos(ui->Test_btnm_1, 0, CIT_UI.LCD_Height - (CIT_UI.LCD_Height / 5.12));
lv_obj_set_size(ui->Test_btnm_1, CIT_UI.LCD_Width, CIT_UI.LCD_Height / 5.12);
lv_obj_set_scrollbar_mode(ui->Test_btnm_1, LV_SCROLLBAR_MODE_OFF);
// Write style for Test_btnm_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_border_width(ui->Test_btnm_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_top(ui->Test_btnm_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_bottom(ui->Test_btnm_1, 2, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_left(ui->Test_btnm_1, 2, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_right(ui->Test_btnm_1, 2, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_column(ui->Test_btnm_1, 2, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_radius(ui->Test_btnm_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui->Test_btnm_1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui->Test_btnm_1, lv_color_hex(0xffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
// Write style for Test_btnm_1, Part: LV_PART_ITEMS, State: LV_STATE_DEFAULT.
lv_obj_set_style_border_width(ui->Test_btnm_1, 1, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_border_opa(ui->Test_btnm_1, 255, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_border_color(ui->Test_btnm_1, lv_color_hex(0xc9c9c9), LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_text_color(ui->Test_btnm_1, lv_color_hex(0xffffff), LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui->Test_btnm_1, &lv_font_arial_14, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_radius(ui->Test_btnm_1, 4, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui->Test_btnm_1, 255, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui->Test_btnm_1, lv_color_hex(0x2195f6), LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_shadow_width(ui->Test_btnm_1, 0, LV_PART_ITEMS | LV_STATE_DEFAULT);
// Update current screen layout.
lv_obj_update_layout(ui->Test);
// Init events for screen.
events_init_Test(ui);
}