bug:10376串口打印按键提示问题
This commit is contained in:
parent
ec1c2bf6ad
commit
975233c403
|
@ -552,8 +552,8 @@ void show_Network_Selection_page(lv_obj_t* obj, lv_obj_t* menu_obj)
|
|||
plabel = lv_label_create(obj, NULL);
|
||||
lv_label_set_long_mode(plabel, LV_LABEL_LONG_BREAK);
|
||||
// lv_label_set_align(plabel, LV_LABEL_ALIGN_CENTER);
|
||||
lv_label_set_text(plabel, "");
|
||||
lv_obj_set_pos(plabel, 32, 55);
|
||||
//lv_label_set_text(plabel, "Searching...");
|
||||
lv_obj_set_pos(plabel, 32, 60);
|
||||
lv_obj_set_width(plabel, 256);
|
||||
lv_obj_add_style(plabel, 0, &gMatrixStylebtn);
|
||||
|
||||
|
|
|
@ -961,9 +961,11 @@ static void UIFlowMenuCommonItem_Key(lv_obj_t* obj, uint32_t key)
|
|||
|
||||
printf("[UIFlowMenuCommonItem_Key]key: %d\n",key);
|
||||
|
||||
|
||||
switch(key)
|
||||
{
|
||||
case LV_USER_KEY_UP:
|
||||
|
||||
case LV_USER_KEY_DOWN:
|
||||
{
|
||||
printf("[UIFlowMenuCommonItem_Key]error input\n",key);
|
||||
|
@ -971,18 +973,21 @@ static void UIFlowMenuCommonItem_Key(lv_obj_t* obj, uint32_t key)
|
|||
|
||||
case LV_USER_KEY_NEXT:
|
||||
{
|
||||
printf("[UIFlowMenuCommonItem_Key]>>>DOWN\n");
|
||||
LV_MenuItem_OnNext(obj);
|
||||
break;
|
||||
}
|
||||
|
||||
case LV_USER_KEY_PREV:
|
||||
{
|
||||
printf("[UIFlowMenuCommonItem_Key]>>>UP\n");
|
||||
LV_MenuItem_OnPrev(obj);
|
||||
break;
|
||||
}
|
||||
|
||||
case LV_KEY_LEFT:
|
||||
{
|
||||
printf("[UIFlowMenuCommonItem_Key]>>>LEFT\n");
|
||||
load_info_from_sf();
|
||||
LV_MenuItem_OnUp(obj);
|
||||
break;
|
||||
|
@ -990,6 +995,7 @@ static void UIFlowMenuCommonItem_Key(lv_obj_t* obj, uint32_t key)
|
|||
|
||||
case LV_KEY_RIGHT:
|
||||
{
|
||||
printf("[UIFlowMenuCommonItem_Key]>>>RIGHT\n");
|
||||
load_info_from_sf();
|
||||
LV_MenuItem_OnDown(obj);
|
||||
break;
|
||||
|
|
|
@ -360,14 +360,14 @@ static void LV_MenuCommonOption_UpdateContent(TM_MENU *pMenu)
|
|||
printf("\033[33m[LV_MenuCommonOption_UpdateContent] 3 \033[0m\n");
|
||||
lv_plugin_menu_set_item_string_id(menu_option, i, LV_PLUGIN_MENU_ITEM_VISIBLE_STATE_NUM, pOption->TextId);
|
||||
|
||||
printf("[*x]s_SelOption: %d", s_SelOption);
|
||||
printf("s_SelOption: %d", s_SelOption);
|
||||
//first init page add select icon
|
||||
if (s_SelOption == 100 && enableIndex[i+(Selindex * OPTION_PAGE_NUM)] == SelOption)
|
||||
{
|
||||
s_SelOption = i + (Selindex * OPTION_PAGE_NUM);
|
||||
if (i == 1)
|
||||
{
|
||||
printf("[*x]first init and is on\n");
|
||||
printf("first init and is on\n");
|
||||
itemIconId = LV_PLUGIN_IMG_ID_SF_LIST_SELECTED_NEXT2;//black > √
|
||||
}
|
||||
else{
|
||||
|
@ -377,7 +377,7 @@ static void LV_MenuCommonOption_UpdateContent(TM_MENU *pMenu)
|
|||
|
||||
}
|
||||
else if(s_SelOption == 100 && enableIndex[i+(Selindex * OPTION_PAGE_NUM)] != SelOption && i == 1){
|
||||
printf("[*x]first init and is off\n");
|
||||
printf("first init and is off\n");
|
||||
switch (pItem->ItemId) {
|
||||
case IDM_DELAY:{}
|
||||
case IDM_OPERATING_TIME:{}
|
||||
|
@ -400,31 +400,33 @@ static void LV_MenuCommonOption_UpdateContent(TM_MENU *pMenu)
|
|||
}
|
||||
else if (i == 1 && s_SelOption < 100)
|
||||
{
|
||||
printf("[*x][LV_MenuCommonOption_UpdateContent] add > icon\n");
|
||||
//printf("[LV_MenuCommonOption_UpdateContent] add > icon\n");
|
||||
switch (pItem->ItemId) {
|
||||
case IDM_DELAY:{}
|
||||
case IDM_OPERATING_TIME:{}
|
||||
case IDM_DATE_AND_TIME:{}
|
||||
case IDM_MAX_NUM_DAY:{}
|
||||
case IDM_PASSWORD:{}
|
||||
case IDM_CAMERA_NAME:
|
||||
{
|
||||
|
||||
if (s_SelOption == 0 && enableIndex[i+(Selindex * OPTION_PAGE_NUM)] == SelOption){
|
||||
printf("[*x][LV_MenuCommonOption_UpdateContent] add black > \n");
|
||||
printf("[LV_MenuCommonOption_UpdateContent] add black > \n");
|
||||
itemIconId = LV_PLUGIN_IMG_ID_SF_NEXT2;//black >
|
||||
lv_obj_set_pos(image_option2_scr_uiflowmenucommonoption, 288, 0);
|
||||
}
|
||||
else if (s_SelOption == 0 && enableIndex[i+(Selindex * OPTION_PAGE_NUM)] != SelOption){
|
||||
printf("[*x][LV_MenuCommonOption_UpdateContent] add white > \n");
|
||||
printf("[LV_MenuCommonOption_UpdateContent] add white > \n");
|
||||
itemIconId = LV_PLUGIN_IMG_ID_SF_NEXT1;//white >
|
||||
lv_obj_set_pos(image_option2_scr_uiflowmenucommonoption, 288, 0);
|
||||
}
|
||||
else if (s_SelOption == 1 && enableIndex[i+(Selindex * OPTION_PAGE_NUM)] == SelOption){
|
||||
printf("[*x][LV_MenuCommonOption_UpdateContent] add black √ > \n");
|
||||
printf("[LV_MenuCommonOption_UpdateContent] add black √ > \n");
|
||||
itemIconId = LV_PLUGIN_IMG_ID_SF_LIST_SELECTED_NEXT2;//*black > √
|
||||
lv_obj_set_pos(image_option2_scr_uiflowmenucommonoption, 262, 0);
|
||||
}
|
||||
else{
|
||||
printf("[*x][LV_MenuCommonOption_UpdateContent] add white √ > \n");
|
||||
printf("[LV_MenuCommonOption_UpdateContent] add white √ > \n");
|
||||
itemIconId = LV_PLUGIN_IMG_ID_SF_LIST_SELECTED_NEXT1;//*white > √
|
||||
lv_obj_set_pos(image_option2_scr_uiflowmenucommonoption, 262, 0);
|
||||
}
|
||||
|
@ -433,7 +435,7 @@ static void LV_MenuCommonOption_UpdateContent(TM_MENU *pMenu)
|
|||
}
|
||||
default:
|
||||
{
|
||||
printf("[*x][LV_MenuCommonOption_UpdateContent] add √ \n");
|
||||
printf("[LV_MenuCommonOption_UpdateContent] add √ \n");
|
||||
itemIconId = LV_PLUGIN_IMG_ID_SF_LIST_SELECTED;//√
|
||||
lv_obj_set_pos(image_option2_scr_uiflowmenucommonoption, 272, 0);
|
||||
if (s_SelOption == 1)
|
||||
|
@ -450,7 +452,6 @@ static void LV_MenuCommonOption_UpdateContent(TM_MENU *pMenu)
|
|||
lv_plugin_menu_set_item_hidden(menu_option, i, false);
|
||||
|
||||
if (enableIndex[i+(Selindex * OPTION_PAGE_NUM)] == SelOption){
|
||||
printf("[*x]select item\n");
|
||||
lv_plugin_menu_select_item(menu_option, i);
|
||||
}
|
||||
|
||||
|
@ -578,6 +579,7 @@ static void LV_MenuOption_OnNext(lv_obj_t* obj)
|
|||
// DBG_DUMP("%s SelItem=%d\r\n", __func__,pPage->SelItem);
|
||||
// DBG_DUMP("%s Count=%d\r\n", __func__,pItem->Count);
|
||||
// DBG_DUMP("%s SelOption=%d\r\n", __func__,SelOption);
|
||||
|
||||
SelOption++;
|
||||
if (SelOption >= pItem->Count){
|
||||
// Close current UI Window now
|
||||
|
@ -605,6 +607,7 @@ static void LV_MenuOption_OnPrev(lv_obj_t* obj)
|
|||
pPage = &pMenu->pPages[pMenu->SelPage];
|
||||
pItem = &pPage->pItems[pPage->SelItem];
|
||||
SelOption = SysGetFlag(pItem->SysFlag);
|
||||
|
||||
if (SelOption == 0) {
|
||||
// Close current UI Window now
|
||||
//SysSetFlag(pItem->SysFlag, PrevOption);
|
||||
|
@ -1017,8 +1020,42 @@ static void CommondOptionKeyCallback(lv_obj_t* obj, uint32_t* key)
|
|||
pPage = &pMenu->pPages[pMenu->SelPage];
|
||||
pItem = &pPage->pItems[pPage->SelItem];
|
||||
UINT16 itemID = pItem->ItemId;
|
||||
printf("\033[33m[UIFlowMenuCommonOptionEventCallback]LV_USER_EVENT_KEY_RELEASE key:%d\033[0m\n", *key);
|
||||
printf("\033[33m[CommondOptionKeyCallback]LV_USER_EVENT_KEY_RELEASE key:%d\033[0m\n", *key);
|
||||
/* handle key event */
|
||||
switch(*key)
|
||||
{
|
||||
case LV_USER_KEY_NEXT:
|
||||
case LV_USER_KEY_DOWN:
|
||||
{
|
||||
printf("[CommondOptionKeyCallback]>>>DOWN\n");
|
||||
break;
|
||||
}
|
||||
|
||||
case LV_USER_KEY_PREV:
|
||||
case LV_USER_KEY_UP:
|
||||
{
|
||||
printf("[CommondOptionKeyCallback]>>>UP\n");
|
||||
break;
|
||||
}
|
||||
|
||||
case LV_KEY_LEFT:
|
||||
{
|
||||
printf("[CommondOptionKeyCallback]>>>LEFT\n");
|
||||
break;
|
||||
}
|
||||
|
||||
case LV_KEY_RIGHT:
|
||||
{
|
||||
printf("[CommondOptionKeyCallback]>>>RIGHT\n");
|
||||
break;
|
||||
}
|
||||
case LV_KEY_ENTER:
|
||||
{
|
||||
printf("[CommondOptionKeyCallback]>>>ENTER\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch(itemID)
|
||||
{
|
||||
case IDM_NETWORK_SELECTION:
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -360,14 +360,14 @@ static void LV_MenuCommonOption_UpdateContent(TM_MENU *pMenu)
|
|||
printf("\033[33m[LV_MenuCommonOption_UpdateContent] 3 \033[0m\n");
|
||||
lv_plugin_menu_set_item_string_id(menu_option, i, LV_PLUGIN_MENU_ITEM_VISIBLE_STATE_NUM, pOption->TextId);
|
||||
|
||||
printf("[*x]s_SelOption: %d", s_SelOption);
|
||||
printf("s_SelOption: %d", s_SelOption);
|
||||
//first init page add select icon
|
||||
if (s_SelOption == 100 && enableIndex[i+(Selindex * OPTION_PAGE_NUM)] == SelOption)
|
||||
{
|
||||
s_SelOption = i + (Selindex * OPTION_PAGE_NUM);
|
||||
if (i == 1)
|
||||
{
|
||||
printf("[*x]first init and is on\n");
|
||||
printf("first init and is on\n");
|
||||
itemIconId = LV_PLUGIN_IMG_ID_SF_LIST_SELECTED_NEXT2;//black > √
|
||||
}
|
||||
else{
|
||||
|
@ -377,7 +377,7 @@ static void LV_MenuCommonOption_UpdateContent(TM_MENU *pMenu)
|
|||
|
||||
}
|
||||
else if(s_SelOption == 100 && enableIndex[i+(Selindex * OPTION_PAGE_NUM)] != SelOption && i == 1){
|
||||
printf("[*x]first init and is off\n");
|
||||
printf("first init and is off\n");
|
||||
switch (pItem->ItemId) {
|
||||
case IDM_DELAY:{}
|
||||
case IDM_OPERATING_TIME:{}
|
||||
|
@ -400,31 +400,33 @@ static void LV_MenuCommonOption_UpdateContent(TM_MENU *pMenu)
|
|||
}
|
||||
else if (i == 1 && s_SelOption < 100)
|
||||
{
|
||||
printf("[*x][LV_MenuCommonOption_UpdateContent] add > icon\n");
|
||||
//printf("[LV_MenuCommonOption_UpdateContent] add > icon\n");
|
||||
switch (pItem->ItemId) {
|
||||
case IDM_DELAY:{}
|
||||
case IDM_OPERATING_TIME:{}
|
||||
case IDM_DATE_AND_TIME:{}
|
||||
case IDM_MAX_NUM_DAY:{}
|
||||
case IDM_PASSWORD:{}
|
||||
case IDM_CAMERA_NAME:
|
||||
{
|
||||
|
||||
if (s_SelOption == 0 && enableIndex[i+(Selindex * OPTION_PAGE_NUM)] == SelOption){
|
||||
printf("[*x][LV_MenuCommonOption_UpdateContent] add black > \n");
|
||||
printf("[LV_MenuCommonOption_UpdateContent] add black > \n");
|
||||
itemIconId = LV_PLUGIN_IMG_ID_SF_NEXT2;//black >
|
||||
lv_obj_set_pos(image_option2_scr_uiflowmenucommonoption, 288, 0);
|
||||
}
|
||||
else if (s_SelOption == 0 && enableIndex[i+(Selindex * OPTION_PAGE_NUM)] != SelOption){
|
||||
printf("[*x][LV_MenuCommonOption_UpdateContent] add white > \n");
|
||||
printf("[LV_MenuCommonOption_UpdateContent] add white > \n");
|
||||
itemIconId = LV_PLUGIN_IMG_ID_SF_NEXT1;//white >
|
||||
lv_obj_set_pos(image_option2_scr_uiflowmenucommonoption, 288, 0);
|
||||
}
|
||||
else if (s_SelOption == 1 && enableIndex[i+(Selindex * OPTION_PAGE_NUM)] == SelOption){
|
||||
printf("[*x][LV_MenuCommonOption_UpdateContent] add black √ > \n");
|
||||
printf("[LV_MenuCommonOption_UpdateContent] add black √ > \n");
|
||||
itemIconId = LV_PLUGIN_IMG_ID_SF_LIST_SELECTED_NEXT2;//*black > √
|
||||
lv_obj_set_pos(image_option2_scr_uiflowmenucommonoption, 262, 0);
|
||||
}
|
||||
else{
|
||||
printf("[*x][LV_MenuCommonOption_UpdateContent] add white √ > \n");
|
||||
printf("[LV_MenuCommonOption_UpdateContent] add white √ > \n");
|
||||
itemIconId = LV_PLUGIN_IMG_ID_SF_LIST_SELECTED_NEXT1;//*white > √
|
||||
lv_obj_set_pos(image_option2_scr_uiflowmenucommonoption, 262, 0);
|
||||
}
|
||||
|
@ -433,7 +435,7 @@ static void LV_MenuCommonOption_UpdateContent(TM_MENU *pMenu)
|
|||
}
|
||||
default:
|
||||
{
|
||||
printf("[*x][LV_MenuCommonOption_UpdateContent] add √ \n");
|
||||
printf("[LV_MenuCommonOption_UpdateContent] add √ \n");
|
||||
itemIconId = LV_PLUGIN_IMG_ID_SF_LIST_SELECTED;//√
|
||||
lv_obj_set_pos(image_option2_scr_uiflowmenucommonoption, 272, 0);
|
||||
if (s_SelOption == 1)
|
||||
|
@ -450,7 +452,6 @@ static void LV_MenuCommonOption_UpdateContent(TM_MENU *pMenu)
|
|||
lv_plugin_menu_set_item_hidden(menu_option, i, false);
|
||||
|
||||
if (enableIndex[i+(Selindex * OPTION_PAGE_NUM)] == SelOption){
|
||||
printf("[*x]select item\n");
|
||||
lv_plugin_menu_select_item(menu_option, i);
|
||||
}
|
||||
|
||||
|
@ -578,6 +579,7 @@ static void LV_MenuOption_OnNext(lv_obj_t* obj)
|
|||
// DBG_DUMP("%s SelItem=%d\r\n", __func__,pPage->SelItem);
|
||||
// DBG_DUMP("%s Count=%d\r\n", __func__,pItem->Count);
|
||||
// DBG_DUMP("%s SelOption=%d\r\n", __func__,SelOption);
|
||||
|
||||
SelOption++;
|
||||
if (SelOption >= pItem->Count){
|
||||
// Close current UI Window now
|
||||
|
@ -605,6 +607,7 @@ static void LV_MenuOption_OnPrev(lv_obj_t* obj)
|
|||
pPage = &pMenu->pPages[pMenu->SelPage];
|
||||
pItem = &pPage->pItems[pPage->SelItem];
|
||||
SelOption = SysGetFlag(pItem->SysFlag);
|
||||
|
||||
if (SelOption == 0) {
|
||||
// Close current UI Window now
|
||||
//SysSetFlag(pItem->SysFlag, PrevOption);
|
||||
|
@ -1017,8 +1020,42 @@ static void CommondOptionKeyCallback(lv_obj_t* obj, uint32_t* key)
|
|||
pPage = &pMenu->pPages[pMenu->SelPage];
|
||||
pItem = &pPage->pItems[pPage->SelItem];
|
||||
UINT16 itemID = pItem->ItemId;
|
||||
printf("\033[33m[UIFlowMenuCommonOptionEventCallback]LV_USER_EVENT_KEY_RELEASE key:%d\033[0m\n", *key);
|
||||
printf("\033[33m[CommondOptionKeyCallback]LV_USER_EVENT_KEY_RELEASE key:%d\033[0m\n", *key);
|
||||
/* handle key event */
|
||||
switch(*key)
|
||||
{
|
||||
case LV_USER_KEY_NEXT:
|
||||
case LV_USER_KEY_DOWN:
|
||||
{
|
||||
printf("[CommondOptionKeyCallback]>>>DOWN\n");
|
||||
break;
|
||||
}
|
||||
|
||||
case LV_USER_KEY_PREV:
|
||||
case LV_USER_KEY_UP:
|
||||
{
|
||||
printf("[CommondOptionKeyCallback]>>>UP\n");
|
||||
break;
|
||||
}
|
||||
|
||||
case LV_KEY_LEFT:
|
||||
{
|
||||
printf("[CommondOptionKeyCallback]>>>LEFT\n");
|
||||
break;
|
||||
}
|
||||
|
||||
case LV_KEY_RIGHT:
|
||||
{
|
||||
printf("[CommondOptionKeyCallback]>>>RIGHT\n");
|
||||
break;
|
||||
}
|
||||
case LV_KEY_ENTER:
|
||||
{
|
||||
printf("[CommondOptionKeyCallback]>>>ENTER\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch(itemID)
|
||||
{
|
||||
case IDM_NETWORK_SELECTION:
|
||||
|
|
Loading…
Reference in New Issue
Block a user