大学生
最后登录1970-1-1
在线时间 小时
注册时间2020-1-15
|
/*********************************************************************
*
* _aDialogCreate
*/
static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
{ WINDOW_CreateIndirect, NULL, ID_WINDOW_Menu, 0, 64, 693, 416, 0, 0x0, 0 },
{ ICONVIEW_CreateIndirect, NULL, ID_ICONVIEW_Config, 50, 30, 693, 416, 0, 0x00640078, 0 },
// USER START (Optionally insert additional widgets)
// USER END
};
/*********************************************************************
*
* Static code
*
**********************************************************************
*/
// USER START (Optionally insert additional static code)
// USER END
/*********************************************************************
*
* _cbDialog
*/
static void _cbDialog(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
int NCode;
int Id;
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_PAINT:
GUI_SetColor(0x00000000);
GUI_FillRect(0, 0, 693, 416);
break;
case WM_INIT_DIALOG:
hItem = pMsg->hWin;
WINDOW_SetBkColor(hItem, 0x00000000);
hICON = WM_GetDialogItem(pMsg->hWin,ID_ICONVIEW_Config);
ICONVIEW_SetBkColor(hICON,ICONVIEW_CI_SEL,GUI_DARKGRAY);
ICONVIEW_SetTextColor(hICON,ICONVIEW_CI_UNSEL,GUI_WHITE);
ICONVIEW_SetTextColor(hICON,ICONVIEW_CI_SEL,0x00FF0000);
ICONVIEW_SetBkColor(hICON,ICONVIEW_CI_BK,0x00000000);
if(Language)
;
else
ICONVIEW_SetFont(hICON,&GUI_Font24B_ASCII);
/*设置item之间的距离*/
ICONVIEW_SetSpace(hICON,GUI_COORD_X,50);
ICONVIEW_SetSpace(hICON,GUI_COORD_Y,50);
ICONVIEW_AddStreamedBitmapItem(hICON,&_acicon_config,ButtonText[Language][8]);
ICONVIEW_AddStreamedBitmapItem(hICON,&_acicon_config,ButtonText[Language][9]);
ICONVIEW_AddStreamedBitmapItem(hICON,&_acicon_config,ButtonText[Language][10]);
ICONVIEW_AddStreamedBitmapItem(hICON,&_acicon_config,ButtonText[Language][11]);
ICONVIEW_AddStreamedBitmapItem(hICON,&_acicon_config,ButtonText[Language][12]);
ICONVIEW_AddStreamedBitmapItem(hICON,&_acicon_config,ButtonText[Language][13]);
//ICONVIEW_SetSel(hICON,Icon_sel++);
WM_SetFocus(pMsg->hWin);
// USER START (Optionally insert additional code for further widget initialization)
// USER END
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
GUI_RECT rect;
switch (Id) {
case ID_ICONVIEW_Config:
switch (NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
printf("123");
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
// USER START (Optionally insert additional code for further Ids)
// USER END
}
break;
// USER START (Optionally insert additional message handling)
// USER END
default:
WM_DefaultProc(pMsg);
break;
}
}
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* CreateWindow
*/
WM_HWIN Create_MainActivity_Menu(WM_HWIN hParent);
WM_HWIN Create_MainActivity_Menu(WM_HWIN hParent) {
WM_HWIN hWin;
hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, hParent, 0, 0);
return hWin;
}
// USER START (Optionally insert additional public code)
// USER END
/*************************** End of file ****************************/
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
if(GPIO_Pin == USER_Btn_Pin)
{
HAL_Delay(20);
if(HAL_GPIO_ReadPin(USER_Btn_GPIO_Port,USER_Btn_Pin) == GPIO_PIN_SET)
{
ICONVIEW_SetSel(hICON,Icon_sel++);
if(Icon_sel >5)
Icon_sel = 0;
}
}
}
为什么我的iconview 轻触点击无效,一定要 长按n秒后再次点击才会 缓慢的更新 选中item,比我 用按键中断更新要慢。 有大佬能解决下吗
|
|