当前位置:网站首页>LVGL 8.2 Spinbox
LVGL 8.2 Spinbox
2022-07-25 04:17:00 【Fairy sword love】
Simple Spinbox
static lv_obj_t* spinbox;
static void lv_spinbox_increment_event_cb(lv_event_t* e)
{
lv_event_code_t code = lv_event_get_code(e);
if (code == LV_EVENT_SHORT_CLICKED || code == LV_EVENT_LONG_PRESSED_REPEAT) {
lv_spinbox_increment(spinbox);
}
}
static void lv_spinbox_decrement_event_cb(lv_event_t* e)
{
lv_event_code_t code = lv_event_get_code(e);
if (code == LV_EVENT_SHORT_CLICKED || code == LV_EVENT_LONG_PRESSED_REPEAT) {
lv_spinbox_decrement(spinbox);
}
}
static void lv_example_spinbox_1(void)
{
spinbox = lv_spinbox_create(lv_scr_act());
lv_spinbox_set_range(spinbox, -1000, 25000);
lv_spinbox_set_digit_format(spinbox, 5, 2);
lv_spinbox_step_prev(spinbox);
lv_obj_set_width(spinbox, 100);
lv_obj_center(spinbox);
lv_coord_t h = lv_obj_get_height(spinbox);
lv_obj_t* btn = lv_btn_create(lv_scr_act());
lv_obj_set_size(btn, h, h);
lv_obj_align_to(btn, spinbox, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
lv_obj_set_style_bg_img_src(btn, LV_SYMBOL_PLUS, 0);
lv_obj_add_event_cb(btn, lv_spinbox_increment_event_cb, LV_EVENT_ALL, NULL);
btn = lv_btn_create(lv_scr_act());
lv_obj_set_size(btn, h, h);
lv_obj_align_to(btn, spinbox, LV_ALIGN_OUT_LEFT_MID, -5, 0);
lv_obj_set_style_bg_img_src(btn, LV_SYMBOL_MINUS, 0);
lv_obj_add_event_cb(btn, lv_spinbox_decrement_event_cb, LV_EVENT_ALL, NULL);
}
- Running effect

边栏推荐
- [golang from introduction to practice] stone scissors paper game
- Numpy overview
- Divide candy Huawei od JS
- Multithreading advanced Step2
- Infinite connection · infinite collaboration | the first global enterprise communication cloud conference WECC is coming
- Original | record a loophole excavation in Colleges and Universities
- ES(8.1)认证题目
- Win11 experience
- Large screen visual adaptation file
- Debezium series: optimize cluster parameters and support personalized settings of debezium connector
猜你喜欢

Analytic hierarchy process of MATLAB

Roleapp focuses on Web3 and opens the door of Web3 with the key of "data can be held"

基于ABP实现DDD--领域逻辑和应用逻辑

ECCV 2022 | rethinking image blending for data enhancement in vision transformers

DNS domain name resolution service

Tiktok live broadcast brings goods to help the industry go to sea, and Fastdata observation industry boutique salon helps the ecological development

Construction of data center (I): background of the emergence of data center

Jenkins continues to integrate entry to mastery

C language file operation

Cluster clock synchronization configuration
随机推荐
Serial adder / subtracter
Eve-ng lab simulator Cisco, H3C test host alias
Which stock exchange has the lowest commission? Is online account manager safe to open an account
The LAF protocol elephant of defi 2.0 may be one of the few profit-making means in your bear market
Creativity: Modern Art anonymous oil painting AI works presentation
Tiktok live broadcast brings goods to help the industry go to sea, and Fastdata observation industry boutique salon helps the ecological development
基于ABP实现DDD--领域逻辑和应用逻辑
Solve "nothing added to commit but untracked files present"“
Multithreading advanced Step2
Creativity: presentation of AI oil paintings with high imitation mineral pigments
数据中台建设(一):数据中台出现的背景
Do you really understand images? (machine vision)
场景之在线人数或者粉丝查询实现
Project launch process of software testing technology
Detailed explanation of kubernetes network plug-in - flannel chapter
Traditional architecture of enterprise digital transformation to medium platform micro service architecture
What are the models of asemi from the manufacturer of rectifier bridge and how about the electroplating process of the manufacturer of rectifier bridge?
Large screen visual adaptation file
Penetration test target combat SQL injection getshell
Optimize bubble sorting