Hello All,
I am experiencing problem with Modal functionality on STemwin 1.2 (emwin 5.32) as well on STemwin 1.1.2 (emwin 5.22).
Problem is when I close top(child) modal window I loose Modal behaviour of bottom(Parent of top child) window. And then I am able to touch background window .
Although If I dont create another child from parent window parent window sustains its modality throughout its life time.
Its only when I create another child with modal(Or even MESSAGEBOX_Create("xxx","Error",GUI_MESSAGEBOX_CF_MODAL);) and close that child window parent win looses modality.
My code is a follows could some buddy recreate this issue?
//----------------Parent win creation----------------------------------------------
hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, hWin, 0, 0);
WM_MakeModal(hWin );
//---------------Call Back Routine-------------------------------------------------
static void _cbDialog(WM_MESSAGE * pMsg) {
switch (pMsg->MsgId) {
WM_HWIN hItem;
int NCode;
int Id;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON_0:
switch(NCode) {
case WM_NOTIFICATION_RELEASED:
//-----------------------------------------------------------------------Try one of following block ------------------------------------------------------
//--------------Another Modal Child creation on top of parent-------------------------------
hItem= GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0); //Child win creation
WM_MakeModal(hItem);
//-------------OR evenModal Msgbox()--------------------------------------------------------
MESSAGEBOX_Create("This is Modal type", "Error",GUI_MESSAGEBOX_CF_MODAL);
break;
}
break;
}
}
I am experiencing problem with Modal functionality on STemwin 1.2 (emwin 5.32) as well on STemwin 1.1.2 (emwin 5.22).
Problem is when I close top(child) modal window I loose Modal behaviour of bottom(Parent of top child) window. And then I am able to touch background window .
Although If I dont create another child from parent window parent window sustains its modality throughout its life time.
Its only when I create another child with modal(Or even MESSAGEBOX_Create("xxx","Error",GUI_MESSAGEBOX_CF_MODAL);) and close that child window parent win looses modality.
My code is a follows could some buddy recreate this issue?
//----------------Parent win creation----------------------------------------------
hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, hWin, 0, 0);
WM_MakeModal(hWin );
//---------------Call Back Routine-------------------------------------------------
static void _cbDialog(WM_MESSAGE * pMsg) {
switch (pMsg->MsgId) {
WM_HWIN hItem;
int NCode;
int Id;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON_0:
switch(NCode) {
case WM_NOTIFICATION_RELEASED:
//-----------------------------------------------------------------------Try one of following block ------------------------------------------------------
//--------------Another Modal Child creation on top of parent-------------------------------
hItem= GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0); //Child win creation
WM_MakeModal(hItem);
//-------------OR evenModal Msgbox()--------------------------------------------------------
MESSAGEBOX_Create("This is Modal type", "Error",GUI_MESSAGEBOX_CF_MODAL);
break;
}
break;
}
}