2017-07-06 02:45 AM
hi,
I am trying to create window menu as per below code that got 4-5 edit text box in it.
Issue is how to get acknowledgement of clicked edit text box
void vCreateNewTestWindow(void){
GUI_RECT rect;
int16_t yPos;
LCD_Clear(LCD_COLOR_WHITE);
GUI_SetTextMode(GUI_TM_TRANS);
GUI_DrawBitmap(&bmnew_test, 5, 150);
GUI_SetColor (GUI_GRAY);
GUI_SetFont (&GUI_FontArial32);
GUI_SetTextMode (GUI_TM_TRANS);
GUI_DispStringAt ('Text1' , 250, 200 );
GUI_DispStringAt ('Text2' , 250, 200+50 );
GUI_DispStringAt ('Text3' , 250, 200+100);
GUI_DispStringAt ('Text4' , 250, 200+150);
GUI_DispStringAt ('Text5' , 250, 200+200);
yPos = 200;
for (lp=0; lp<5; lp++) {
hWin = EDIT_CreateEx (550, yPos, 300, 30, WM_HBKWIN, WM_CF_SHOW , 0, GUI_ID_TEXT0, 25);
EDIT_SetFont (hWin, &GUI_FontArial24);
EDIT_SetTextColor (hWin, EDIT_CI_ENABLED , GUI_AIMIL_HARD);
EDIT_SetText (hWin, _aBitmapItemSetup[lp].pText);
yPos = yPos + 50;
}
WM_SetFocus (hWin);
WM_DisableMemdev(WM_HBKWIN); /* Handle of background window */
GUI_Exec();
while (1){
GUI_Delay(100);
}
}
#edit-click #stemwin #stm32f42017-07-24 02:56 AM
anyone on,
how to get acknowledgement of clicked edit text box
2017-07-24 06:01 AM
Hello
Inside your parent window main callback function (of the edit box)
put an extra case 'WM_NOTIFY_PARENT' if not exist.
static void _cbCallback(WM_MESSAGE * pMsg)
{
int NotCode;int ID;switch (pMsg->MsgId)
{
case WM_.........://......... bla bla
case WM_NOTIFY_PARENT:
ID = WM_GetId(pMsg->hWinSrc); // your widget IDNotCode = pMsg->Data.v; // notification code from widget!// do what you want with theese parameters (including your 'click acknoledgment routine')
//.......bla bla.
}
}