Fixed bug number 10297.

This commit is contained in:
xiaojiazhu 2023-12-08 09:23:48 +08:00
parent 8d1e130df8
commit 61ccc09bee

View File

@ -298,6 +298,7 @@ static void init_Matrix_style(void)
} }
static lv_obj_t* SelectedImage = NULL;
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// MaxNum // MaxNum
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -324,10 +325,17 @@ void show_MaxNum_page(lv_obj_t* obj)
sprintf(result, "%02d", puiPara->SendMaxNum); sprintf(result, "%02d", puiPara->SendMaxNum);
MaxNumValueLabel = lv_label_create(obj, NULL); MaxNumValueLabel = lv_label_create(obj, NULL);
lv_obj_set_pos(MaxNumValueLabel, 145, 93); lv_obj_set_pos(MaxNumValueLabel, 145, 93);
lv_obj_set_size(MaxNumValueLabel, 30, 24); lv_obj_set_size(MaxNumValueLabel, 32, 24);
lv_obj_add_style(MaxNumValueLabel, 0, &gMatrixStylebtn); lv_obj_add_style(MaxNumValueLabel, 0, &gMatrixStylebtn);
lv_obj_set_state(MaxNumValueLabel, LV_STATE_DEFAULT); lv_obj_set_state(MaxNumValueLabel, LV_STATE_FOCUSED);
lv_label_set_text(MaxNumValueLabel, result); lv_label_set_text(MaxNumValueLabel, result);
SelectedImage = lv_img_create(obj, NULL);
lv_obj_set_hidden(SelectedImage, false);
lv_obj_set_click(SelectedImage, false);
lv_obj_set_drag(SelectedImage, false);
lv_obj_set_size(SelectedImage, 32, 88);
lv_img_set_src(SelectedImage, &sf_pwd_down_up);
lv_obj_set_pos(SelectedImage, 145, 62);
} }
void hidde_MaxNum_page(void) void hidde_MaxNum_page(void)
@ -342,6 +350,11 @@ void hidde_MaxNum_page(void)
lv_obj_del(MaxNumValueLabel); lv_obj_del(MaxNumValueLabel);
MaxNumValueLabel = NULL; MaxNumValueLabel = NULL;
} }
if(SelectedImage)
{
lv_obj_del(SelectedImage);
SelectedImage = NULL;
}
} }
void Option_MaxNum_Key(lv_obj_t* obj, uint32_t key) void Option_MaxNum_Key(lv_obj_t* obj, uint32_t key)
@ -364,7 +377,7 @@ void Option_MaxNum_Key(lv_obj_t* obj, uint32_t key)
puiPara->SendMaxNum--; puiPara->SendMaxNum--;
else else
puiPara->SendMaxNum = 99; puiPara->SendMaxNum = 99;
sprintf(result, "%d", puiPara->SendMaxNum); sprintf(result, "%02d", puiPara->SendMaxNum);
lv_label_set_text(MaxNumValueLabel, result); lv_label_set_text(MaxNumValueLabel, result);
break; break;
case LV_USER_KEY_PREV: case LV_USER_KEY_PREV:
@ -373,7 +386,7 @@ void Option_MaxNum_Key(lv_obj_t* obj, uint32_t key)
puiPara->SendMaxNum++; puiPara->SendMaxNum++;
else else
puiPara->SendMaxNum = 1; puiPara->SendMaxNum = 1;
sprintf(result, "%d", puiPara->SendMaxNum); sprintf(result, "%02d", puiPara->SendMaxNum);
lv_label_set_text(MaxNumValueLabel, result); lv_label_set_text(MaxNumValueLabel, result);
break; break;
case LV_USER_KEY_LEFT: case LV_USER_KEY_LEFT:
@ -438,7 +451,6 @@ static const char* SendTimeMap_1[BUTTON_NUM_4] =
// static int CameraInfoIndex = 0; // static int CameraInfoIndex = 0;
// static lv_obj_t *CameraInfolabel = NULL; // static lv_obj_t *CameraInfolabel = NULL;
static lv_obj_t *SendTypeImage = NULL; static lv_obj_t *SendTypeImage = NULL;
static lv_obj_t* SelectedImage = NULL;
static lv_obj_t * btnm = NULL; static lv_obj_t * btnm = NULL;
static const char * map[] = {"1", "2", ""}; static const char * map[] = {"1", "2", ""};
@ -493,7 +505,6 @@ void show_send_time_page(lv_obj_t* obj, const int sendType)
SendTimeMatrixObj_1 = NULL; SendTimeMatrixObj_1 = NULL;
SendTimeMatrixObj_0 = NULL; SendTimeMatrixObj_0 = NULL;
btnm = NULL; btnm = NULL;
SelectedImage = NULL;
init_Matrix_style(); init_Matrix_style();