Hello,
I'm trying to create the following application model:
User clicks on the EDIT widget -> Modal window (screen keyboard) appears -> User input is stored -> The program reaches next line after virtual keyboard execution.
Code:
Display All
Please look at the lines 11-13. Blocking dialog is created and it returns value using GUI_EndDialog() function. Actually everything works fine, but this line in documentation makes me mad:
"Blocking functions should never be called from within a callback function. This may cause malfunction of the application".
And the question is how to create blocking dialog and wait until it's closed. Of course I can create dialog at the same level the Window Manager is executed but in this case how to wait until dialog is closed properly? Or maybe my thinking isn't good enough and this can be done in other way.
Thanks for your answers!
-------- EDIT----------
I have an idea. I can create dialog at the same level the Window Manager is executed and when ending dialog I wll send custom message to the calling window. I think it will work fine.
I'm trying to create the following application model:
User clicks on the EDIT widget -> Modal window (screen keyboard) appears -> User input is stored -> The program reaches next line after virtual keyboard execution.
Code:
C Source Code
- void desktopCallback(WM_MESSAGE *pMsg)
- {
- int widgetId;
- static EDIT_Handle e;
- int res;
- switch (pMsg->MsgId) {
- case WM_NOTIFY_PARENT:
- widgetId = WM_GetId(pMsg->hWinSrc);
- if (pMsg->Data.v == WM_NOTIFICATION_CLICKED && widgetId == GUI_ID_EDIT0) {
- VKParams_t params = {0}; /* Some params passed to the virtual keyboard */
- res = VK_GetInput(¶ms)/*Creates dialog andexecutes it using GUI_ExecCreatedDialog() function */
- if (res == RES_OK) { /* Do some stuff */ }
- }
- break;
- case WM_SET_CALLBACK:
- e = EDIT_CreateEx(10, 90, 150, 40, WM_HBKWIN, WM_CF_SHOW, 0, GUI_ID_EDIT0, 20);
- EDIT_SetText(e, "Edit me");
- break;
- case WM_PAINT:
- GUI_SetBkColor(GUI_LIGHTBLUE);
- GUI_Clear();
- default:
- WM_DefaultProc(pMsg);
- }
- }
Please look at the lines 11-13. Blocking dialog is created and it returns value using GUI_EndDialog() function. Actually everything works fine, but this line in documentation makes me mad:
"Blocking functions should never be called from within a callback function. This may cause malfunction of the application".
And the question is how to create blocking dialog and wait until it's closed. Of course I can create dialog at the same level the Window Manager is executed but in this case how to wait until dialog is closed properly? Or maybe my thinking isn't good enough and this can be done in other way.
Thanks for your answers!
-------- EDIT----------
I have an idea. I can create dialog at the same level the Window Manager is executed and when ending dialog I wll send custom message to the calling window. I think it will work fine.
The post was edited 2 times, last by mati1485 ().