mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-26 04:36:38 +00:00
Add auto_close and btn_pos attributes
This commit is contained in:
parent
5157dcfeea
commit
c5178f5856
@ -61,7 +61,7 @@ build_flags =
|
|||||||
-D HASP_VER_MAJ=0
|
-D HASP_VER_MAJ=0
|
||||||
-D HASP_VER_MIN=6
|
-D HASP_VER_MIN=6
|
||||||
-D HASP_VER_REV=0
|
-D HASP_VER_REV=0
|
||||||
-D HASP_LOG_LEVEL=LOG_LEVEL_TRACE
|
-D HASP_LOG_LEVEL=LOG_LEVEL_OUTPUT
|
||||||
${override.build_flags}
|
${override.build_flags}
|
||||||
|
|
||||||
; -- Shared library dependencies in all environments
|
; -- Shared library dependencies in all environments
|
||||||
|
@ -1299,7 +1299,13 @@ static void hasp_process_obj_attribute_txt(lv_obj_t* obj, const char* attr, cons
|
|||||||
return attr_out_str(obj, attr, buffer);
|
return attr_out_str(obj, attr, buffer);
|
||||||
}
|
}
|
||||||
if(check_obj_type(obj, LV_HASP_MSGBOX)) {
|
if(check_obj_type(obj, LV_HASP_MSGBOX)) {
|
||||||
return update ? lv_msgbox_set_text(obj, payload) : attr_out_str(obj, attr, lv_msgbox_get_text(obj));
|
if(update) {
|
||||||
|
lv_msgbox_set_text(obj, payload);
|
||||||
|
lv_obj_align(obj, NULL, LV_ALIGN_CENTER, 0, 0); /*Align to the corner*/
|
||||||
|
} else {
|
||||||
|
attr_out_str(obj, attr, lv_msgbox_get_text(obj));
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
#if LV_USE_WIN != 0
|
#if LV_USE_WIN != 0
|
||||||
if(check_obj_type(obj, LV_HASP_WINDOW)) {
|
if(check_obj_type(obj, LV_HASP_WINDOW)) {
|
||||||
@ -1713,6 +1719,33 @@ void hasp_process_obj_attribute(lv_obj_t* obj, const char* attr_p, const char* p
|
|||||||
} else {
|
} else {
|
||||||
attr_out_int(obj, attr_p, lv_btnmatrix_get_one_check(obj));
|
attr_out_int(obj, attr_p, lv_btnmatrix_get_one_check(obj));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
goto attribute_not_found;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ATTR_BTN_POS:
|
||||||
|
if(check_obj_type(obj, LV_HASP_TABVIEW)) {
|
||||||
|
if(update) {
|
||||||
|
lv_tabview_set_btns_pos(obj, val);
|
||||||
|
} else {
|
||||||
|
attr_out_int(obj, attr_p, lv_tabview_get_btns_pos(obj));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
goto attribute_not_found;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
// case ATTR_MODAL:
|
||||||
|
case ATTR_AUTO_CLOSE:
|
||||||
|
if(check_obj_type(obj, LV_HASP_MSGBOX)) {
|
||||||
|
if(update) {
|
||||||
|
lv_msgbox_start_auto_close(obj, val);
|
||||||
|
} else {
|
||||||
|
lv_msgbox_stop_auto_close(obj);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
goto attribute_not_found;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1760,6 +1793,7 @@ void hasp_process_obj_attribute(lv_obj_t* obj, const char* attr_p, const char* p
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* ***** Methods ***** */
|
||||||
case ATTR_DELETE:
|
case ATTR_DELETE:
|
||||||
if(!lv_obj_get_parent(obj)) {
|
if(!lv_obj_get_parent(obj)) {
|
||||||
LOG_ERROR(TAG_ATTR, F(D_ATTRIBUTE_PAGE_METHOD_INVALID), attr_p);
|
LOG_ERROR(TAG_ATTR, F(D_ATTRIBUTE_PAGE_METHOD_INVALID), attr_p);
|
||||||
|
@ -324,6 +324,13 @@ _HASP_ATTRIBUTE(SCALE_END_LINE_WIDTH, scale_end_line_width, lv_style_int_t)
|
|||||||
// Buttonmatrix
|
// Buttonmatrix
|
||||||
#define ATTR_ONE_CHECK 45935
|
#define ATTR_ONE_CHECK 45935
|
||||||
|
|
||||||
|
// Tabview
|
||||||
|
#define ATTR_BTN_POS 35697
|
||||||
|
|
||||||
|
// Msgbox
|
||||||
|
#define ATTR_MODAL 7405
|
||||||
|
#define ATTR_AUTO_CLOSE 7880
|
||||||
|
|
||||||
/* hasp user data */
|
/* hasp user data */
|
||||||
#define ATTR_ACTION 42102
|
#define ATTR_ACTION 42102
|
||||||
#define ATTR_TRANSITION 10933
|
#define ATTR_TRANSITION 10933
|
||||||
|
Loading…
x
Reference in New Issue
Block a user