In a Keil RTX environment I have my own PID driver, for a touch screen. It correctly gets interrupts and correctly retrieves touch information. I want to convey this information to Emwin, so that I can interact with GUI buttons and other controls. In my PID driver, in the interrupt routine, I have the following statements:
GUI_PID_STATE pState;
pState.x = touch.x;
pState.y = touch.y;
pState.Pressed = touch.pen_state;
pState.Layer = 0;
GUI_PID_StoreState(&pState);
In a separate RTX task, I have displayed a dialog on the screen with a button. This displays
correctly, and I am expecting a "clicked" type of event. The following code gets about 8 messages pertaining to the initial display of the dialog and button, but it never gets any other messages. I would expect WM_NOTIFICATION messages, but there are none. I made the dialog and the button the size of the entire screen, so I know I'm pressing it, and the coordinates in pState are in the button area.
static void _cbDialog(WM_MESSAGE * pMsg) {
int Id, NCode;
switch (pMsg->MsgId) {
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON_0: // Notifications sent by 'Button'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
In another RTX task, I call GUI_Exec() periodically, which is supposed to service any
window callbacks.
My touch events/info never interact with my dialog/button. Why not? There are no
sources for emwin, so I can't debug this.
Thank You,
Chuck
GUI_PID_STATE pState;
pState.x = touch.x;
pState.y = touch.y;
pState.Pressed = touch.pen_state;
pState.Layer = 0;
GUI_PID_StoreState(&pState);
In a separate RTX task, I have displayed a dialog on the screen with a button. This displays
correctly, and I am expecting a "clicked" type of event. The following code gets about 8 messages pertaining to the initial display of the dialog and button, but it never gets any other messages. I would expect WM_NOTIFICATION messages, but there are none. I made the dialog and the button the size of the entire screen, so I know I'm pressing it, and the coordinates in pState are in the button area.
static void _cbDialog(WM_MESSAGE * pMsg) {
int Id, NCode;
switch (pMsg->MsgId) {
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON_0: // Notifications sent by 'Button'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
In another RTX task, I call GUI_Exec() periodically, which is supposed to service any
window callbacks.
My touch events/info never interact with my dialog/button. Why not? There are no
sources for emwin, so I can't debug this.
Thank You,
Chuck