1.完成设置菜单中的密码功能

This commit is contained in:
zyj 2023-10-23 14:31:11 +08:00
parent 0a4ce6f506
commit e274d2035b

View File

@ -81,6 +81,126 @@ int Qr_MenuCallback(UINT32 uiMessage, UINT32 uiParam)
return TMF_PROCESSED;
}
// --------------------------------------------------------------------------
// Common Function
// --------------------------------------------------------------------------
static lv_style_t gMatrixStylebg;
static lv_style_t gMatrixStylebtn;
static void init_Matrix_style(void)
{
static int isinitialized = 0;
if(isinitialized)
return;
lv_color_t color = {0};
lv_style_init(&gMatrixStylebg);
lv_style_set_pad_top(&gMatrixStylebg,LV_STATE_DEFAULT,0);
lv_style_set_pad_bottom(&gMatrixStylebg,LV_STATE_DEFAULT,0);
lv_style_set_pad_left(&gMatrixStylebg,LV_STATE_DEFAULT,0);
lv_style_set_pad_right(&gMatrixStylebg,LV_STATE_DEFAULT,0);
lv_style_set_pad_inner(&gMatrixStylebg,LV_STATE_DEFAULT,0);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebg, LV_STATE_DEFAULT, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebg, LV_STATE_DEFAULT, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebg, LV_STATE_DEFAULT, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebg, LV_STATE_CHECKED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebg, LV_STATE_CHECKED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebg, LV_STATE_CHECKED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebg, LV_STATE_FOCUSED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebg, LV_STATE_FOCUSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebg, LV_STATE_FOCUSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebg, LV_STATE_EDITED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebg, LV_STATE_EDITED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebg, LV_STATE_EDITED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebg, LV_STATE_HOVERED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebg, LV_STATE_HOVERED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebg, LV_STATE_HOVERED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebg, LV_STATE_PRESSED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebg, LV_STATE_PRESSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebg, LV_STATE_PRESSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebg, LV_STATE_DISABLED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebg, LV_STATE_DISABLED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebg, LV_STATE_DISABLED, color);
lv_style_init(&gMatrixStylebtn);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebtn, LV_STATE_DEFAULT, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebtn, LV_STATE_DEFAULT, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebtn, LV_STATE_DEFAULT, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_outline_color(&gMatrixStylebtn, LV_STATE_DEFAULT, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_shadow_color(&gMatrixStylebtn, LV_STATE_DEFAULT, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_pattern_recolor(&gMatrixStylebtn, LV_STATE_DEFAULT, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_value_color(&gMatrixStylebtn, LV_STATE_DEFAULT, color);
lv_style_set_value_font(&gMatrixStylebtn,LV_STATE_DEFAULT,&sf_ui_text_bold_20_8bpp);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_text_color(&gMatrixStylebtn, LV_STATE_DEFAULT, color);
lv_style_set_text_font(&gMatrixStylebtn,LV_STATE_DEFAULT,&sf_ui_text_bold_20_8bpp);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_color(&gMatrixStylebtn, LV_STATE_DEFAULT, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_bg_color(&gMatrixStylebtn, LV_STATE_DEFAULT, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebtn, LV_STATE_CHECKED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebtn, LV_STATE_CHECKED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebtn, LV_STATE_CHECKED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_outline_color(&gMatrixStylebtn, LV_STATE_CHECKED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_shadow_color(&gMatrixStylebtn, LV_STATE_CHECKED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_pattern_recolor(&gMatrixStylebtn, LV_STATE_CHECKED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_value_color(&gMatrixStylebtn, LV_STATE_CHECKED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_text_color(&gMatrixStylebtn, LV_STATE_CHECKED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_color(&gMatrixStylebtn, LV_STATE_CHECKED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_bg_color(&gMatrixStylebtn, LV_STATE_CHECKED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebtn, LV_STATE_FOCUSED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebtn, LV_STATE_FOCUSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebtn, LV_STATE_FOCUSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_outline_color(&gMatrixStylebtn, LV_STATE_FOCUSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_shadow_color(&gMatrixStylebtn, LV_STATE_FOCUSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_pattern_recolor(&gMatrixStylebtn, LV_STATE_FOCUSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_value_color(&gMatrixStylebtn, LV_STATE_FOCUSED, color);
STYLE_COLOR_PROP(0xc8, 0x00, 0x00, 0x00) ; lv_style_set_text_color(&gMatrixStylebtn, LV_STATE_FOCUSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_color(&gMatrixStylebtn, LV_STATE_FOCUSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_bg_color(&gMatrixStylebtn, LV_STATE_FOCUSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebtn, LV_STATE_EDITED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebtn, LV_STATE_EDITED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebtn, LV_STATE_EDITED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_outline_color(&gMatrixStylebtn, LV_STATE_EDITED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_shadow_color(&gMatrixStylebtn, LV_STATE_EDITED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_pattern_recolor(&gMatrixStylebtn, LV_STATE_EDITED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_value_color(&gMatrixStylebtn, LV_STATE_EDITED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_text_color(&gMatrixStylebtn, LV_STATE_EDITED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_color(&gMatrixStylebtn, LV_STATE_EDITED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_bg_color(&gMatrixStylebtn, LV_STATE_EDITED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebtn, LV_STATE_HOVERED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebtn, LV_STATE_HOVERED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebtn, LV_STATE_HOVERED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_outline_color(&gMatrixStylebtn, LV_STATE_HOVERED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_shadow_color(&gMatrixStylebtn, LV_STATE_HOVERED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_pattern_recolor(&gMatrixStylebtn, LV_STATE_HOVERED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_value_color(&gMatrixStylebtn, LV_STATE_HOVERED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_text_color(&gMatrixStylebtn, LV_STATE_HOVERED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_color(&gMatrixStylebtn, LV_STATE_HOVERED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_bg_color(&gMatrixStylebtn, LV_STATE_HOVERED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebtn, LV_STATE_PRESSED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebtn, LV_STATE_PRESSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebtn, LV_STATE_PRESSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_outline_color(&gMatrixStylebtn, LV_STATE_PRESSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_shadow_color(&gMatrixStylebtn, LV_STATE_PRESSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_pattern_recolor(&gMatrixStylebtn, LV_STATE_PRESSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_value_color(&gMatrixStylebtn, LV_STATE_PRESSED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_text_color(&gMatrixStylebtn, LV_STATE_PRESSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_color(&gMatrixStylebtn, LV_STATE_PRESSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_bg_color(&gMatrixStylebtn, LV_STATE_PRESSED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&gMatrixStylebtn, LV_STATE_DISABLED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_bg_grad_color(&gMatrixStylebtn, LV_STATE_DISABLED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&gMatrixStylebtn, LV_STATE_DISABLED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_outline_color(&gMatrixStylebtn, LV_STATE_DISABLED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_shadow_color(&gMatrixStylebtn, LV_STATE_DISABLED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_pattern_recolor(&gMatrixStylebtn, LV_STATE_DISABLED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_value_color(&gMatrixStylebtn, LV_STATE_DISABLED, color);
STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_text_color(&gMatrixStylebtn, LV_STATE_DISABLED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_color(&gMatrixStylebtn, LV_STATE_DISABLED, color);
STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_text_sel_bg_color(&gMatrixStylebtn, LV_STATE_DISABLED, color);
isinitialized = 1;
}
// --------------------------------------------------------------------------
// QR CODE
// --------------------------------------------------------------------------
char *qr_code_str = "{\"imei\":\"%s\",\"verizonICCID\":\"%s\",\"attICCID\":\"%s\",\"isEsim\":%s}";
static lv_obj_t *qr = NULL;
static lv_obj_t *label = NULL;
@ -132,71 +252,88 @@ void hidde_qr_picture_page(void)
// Password
// --------------------------------------------------------------------------
static int PasswordIndex = 0;
static lv_obj_t* PasswordArray[4];
static lv_obj_t* PasswordMatrixObj = NULL;
static char PasswordBuf1[2] = "0";
static char PasswordBuf2[2] = "0";
static char PasswordBuf3[2] = "0";
static char PasswordBuf4[2] = "0";
static char PasswordBuf5[2] = "0";
static char PasswordBuf6[2] = "0";
static const char* PasswordMap[7] =
{
PasswordBuf1,
PasswordBuf2,
PasswordBuf3,
PasswordBuf4,
PasswordBuf5,
PasswordBuf6,
""
};
static void update_Password_msg(lv_obj_t* obj)
{
UIMenuStoreInfo *puiPara = sf_ui_para_get();
snprintf(PasswordBuf1, 2, "%c", puiPara->PwdStr[0]);
snprintf(PasswordBuf2, 2, "%c", puiPara->PwdStr[1]);
snprintf(PasswordBuf3, 2, "%c", puiPara->PwdStr[2]);
snprintf(PasswordBuf4, 2, "%c", puiPara->PwdStr[3]);
snprintf(PasswordBuf5, 2, "%c", puiPara->PwdStr[4]);
snprintf(PasswordBuf6, 2, "%c", puiPara->PwdStr[5]);
lv_btnmatrix_set_focused_btn(PasswordMatrixObj, PasswordIndex);
}
void show_Password_page(lv_obj_t* obj)
{
// char result[2];
// UIMenuStoreInfo *puiPara = sf_ui_para_get();
// lv_color_t color = {0};
PasswordIndex = 0;
// CameraNameIndex = 0;
// static lv_style_t Camera_Name_style;
// lv_style_init(&Camera_Name_style);
// STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&Camera_Name_style, LV_STATE_DEFAULT, color);
// STYLE_COLOR_PROP(0x02, 0xff, 0xff, 0xff) ; lv_style_set_text_color(&Camera_Name_style, LV_STATE_DEFAULT, color);
// lv_style_set_text_font(&Camera_Name_style,LV_STATE_DEFAULT,&sf_ui_text_bold_20_8bpp);
// STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_bg_color(&Camera_Name_style, LV_STATE_FOCUSED, color);
// STYLE_COLOR_PROP(0x06, 0x24, 0xfd, 0x0d) ; lv_style_set_text_color(&Camera_Name_style, LV_STATE_FOCUSED, color);
init_Matrix_style();
// for(int i = 0; i < 4; i++) {
// if (!(puiPara->CamNameStr[i] >= '0' && puiPara->CamNameStr[i] <= '9') &&
// !(puiPara->CamNameStr[i] >= 'A' && puiPara->CamNameStr[i] <= 'Z') &&
// puiPara->CamNameStr[i] != ' ')
// {
// memset(puiPara->CamNameStr, ' ', 4);
// break;
// }
// }
UIMenuStoreInfo *puiPara = sf_ui_para_get();
if(!puiPara->PwdSwitch)
{
memset(puiPara->PwdStr, '0' ,sizeof(puiPara->PwdStr));
}
snprintf(PasswordBuf1, 2, "%c", puiPara->PwdStr[0]);
snprintf(PasswordBuf2, 2, "%c", puiPara->PwdStr[1]);
snprintf(PasswordBuf3, 2, "%c", puiPara->PwdStr[2]);
snprintf(PasswordBuf4, 2, "%c", puiPara->PwdStr[3]);
snprintf(PasswordBuf5, 2, "%c", puiPara->PwdStr[4]);
snprintf(PasswordBuf6, 2, "%c", puiPara->PwdStr[5]);
// for(int i = 0; i < 6; i++)
// {
// sprintf(result, "%c", puiPara->CamNameStr[i]);
// CameraNameArray[i] = lv_label_create(obj, NULL);
// lv_obj_set_pos(CameraNameArray[i], 78+32*i, 108);
// lv_obj_set_size(CameraNameArray[i], 14, 24);
// lv_obj_add_style(CameraNameArray[i], 0, &Camera_Name_style);
// lv_obj_set_state(CameraNameArray[i], LV_STATE_DEFAULT);
// lv_label_set_text(CameraNameArray[i], result);
// }
// lv_obj_set_state(CameraNameArray[CameraNameIndex], LV_STATE_FOCUSED);
PasswordMatrixObj = lv_btnmatrix_create(obj, NULL);
lv_obj_set_hidden(PasswordMatrixObj, false);
lv_obj_set_click(PasswordMatrixObj, true);
lv_obj_set_drag(PasswordMatrixObj, false);
lv_obj_set_pos(PasswordMatrixObj, 92, 58);
lv_obj_set_size(PasswordMatrixObj, 136, 140);
lv_btnmatrix_set_map(PasswordMatrixObj, PasswordMap);
lv_btnmatrix_set_one_check(PasswordMatrixObj, true);
lv_btnmatrix_set_align(PasswordMatrixObj, LV_LABEL_ALIGN_CENTER);
lv_btnmatrix_set_focused_btn(PasswordMatrixObj,0);
lv_btnmatrix_set_one_check(PasswordMatrixObj, false);
lv_obj_add_style(PasswordMatrixObj, 0, &gMatrixStylebg);
lv_obj_add_style(PasswordMatrixObj, 1, &gMatrixStylebtn);
}
void hidde_Password_page(void)
{
PasswordIndex = 0;
for(int i = 0; i < 4; i++)
if(PasswordMatrixObj)
{
if(PasswordArray[i])
{
lv_obj_del(PasswordArray[i]);
}
lv_obj_del(PasswordMatrixObj);
}
}
void Option_Password_Key(lv_obj_t* obj, uint32_t key)
{
for(int i = 0; i < 4; i++)
if(PasswordMatrixObj == NULL)
{
if(PasswordArray[i] == NULL)
{
printf("CameraNameArray is NULL");
return;
}
printf("PasswordMatrixObj is NULL");
return;
}
// UIMenuStoreInfo *puiPara = sf_ui_para_get();
UIMenuStoreInfo *puiPara = sf_ui_para_get();
// char result[2];
// char tmpchar;
// char* p;
@ -206,18 +343,33 @@ void Option_Password_Key(lv_obj_t* obj, uint32_t key)
{
case LV_USER_KEY_NEXT:
printf("\033[33m[Option_Password_Key]s\033[0m\n");
if(PasswordIndex >= 0 && PasswordIndex <= 5)
{
puiPara->PwdStr[PasswordIndex] = (puiPara->PwdStr[PasswordIndex] - '0' + 10 - 1) % 10 + '0';
}
update_Password_msg(obj);
break;
case LV_USER_KEY_PREV:
printf("\033[33m[Option_Password_Key]w\033[0m\n");
if(PasswordIndex >= 0 && PasswordIndex <= 5)
{
puiPara->PwdStr[PasswordIndex] = (puiPara->PwdStr[PasswordIndex] - '0' + 1) % 10 + '0';
}
update_Password_msg(obj);
break;
case LV_USER_KEY_LEFT:
printf("\033[33m[Option_Password_Key]a\033[0m\n");
PasswordIndex = (PasswordIndex + 6 - 1) % 6;
update_Password_msg(obj);
break;
case LV_USER_KEY_RIGHT:
printf("\033[33m[Option_Password_Key]d\033[0m\n");
PasswordIndex = (PasswordIndex + 1) % 6;
update_Password_msg(obj);
break;
case LV_KEY_ENTER:
printf("\033[33m[Option_Password_Key]SELECT\033[0m\n");
puiPara->PwdSwitch = 1;
lv_plugin_scr_close(obj, gen_nvtmsg_data(NVTRET_ENTER_MENU, 0));
hidde_Password_page();
break;