初级会员
- 积分
- 166
- 金钱
- 166
- 注册时间
- 2018-8-4
- 在线时间
- 38 小时
|
做了一个界面,有触摸屏幕空白处就返回上一层界面。现在的问题是明明没有触摸界面,他就自己自动返回上一层界面
代码如下:
void _cbCallback_MeasOnLine(WM_MESSAGE * pMsg)
{
int NCode, Id;
WM_HWIN hWin = pMsg->hWin;
switch (pMsg->MsgId)
{
case WM_PAINT:
PaintDialog_MeasOnLine(pMsg);
break;
case WM_INIT_DIALOG:
InitDialog_MeasOnLine(pMsg);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch (Id)
{
case GUI_ID_BUTTON0://开始测量 也就是手动测量
switch (NCode)
{
case WM_NOTIFICATION_CLICKED:
WM_SetFocus(WM_GetDialogItem(hWin,GUI_ID_BUTTON0));
break;
case WM_NOTIFICATION_RELEASED:
GUI_EndDialog(pMsg->hWin, 0);
CreateSetDojob();
break;
}
break;
case GUI_ID_BUTTON1://条件按钮
switch (NCode)
{
case WM_NOTIFICATION_CLICKED:
WM_SetFocus(WM_GetDialogItem(hWin,GUI_ID_BUTTON1));
break;
case WM_NOTIFICATION_RELEASED:
ActionType = 0;
_MessageConfirm();
break;
}
break;
case GUI_ID_DROPDOWN0:
switch(NCode)
{
case WM_NOTIFICATION_SEL_CHANGED://选择的索引发生改变
OnlineObj.OperationMode = DROPDOWN_GetSel(WM_GetDialogItem(hOnlineWin,GUI_ID_DROPDOWN0));
AT24CXX_Write(OnlineObjAddr,(void *)&OnlineObj,sizeof(MeasureOnline));
break;
default:
break;
}
break;
case GUI_ID_DROPDOWN1:
switch(NCode)
{
case WM_NOTIFICATION_SEL_CHANGED://选择的索引发生改变
OnlineObj.AdjustFlag = DROPDOWN_GetSel(WM_GetDialogItem(hOnlineWin,GUI_ID_DROPDOWN1));
AT24CXX_Write(OnlineObjAddr,(void *)&OnlineObj,sizeof(MeasureOnline));
break;
default:
break;
}
break;
}
break;
case WM_TOUCH:
if(((GUI_PID_STATE *)pMsg->Data.p)->Pressed == 1)
{
if(WM_GetFocussedWindow() != pMsg->hWin)
{
GUI_EndDialog(hWin, 0);
CreateMenuWin();//上一层界面
}
}
break;
default:
WM_DefaultProc(pMsg);
}
}
这是一个回调函数 问题就是红色部分。没有触摸屏幕,自己自动进到case WM_TOUCH中。
|
|