/********************************************************************* * * _MessageBox */ static void _MessageBox(const char* pText, const char* pCaption) { WM_HWIN hWin; hWin = MESSAGEBOX_Create(pText, pCaption, 0); WM_MakeModal(hWin); GUI_ExecCreatedDialog(hWin); }
/********************************************************************* * * _CreateMessageBox */ static WM_HWIN _CreateMessageBox(const char * sMessage, const char * sCaption, int Flags, const GUI_FONT * pFont) { WM_HWIN hWin, hItem; GUI_RECT Rect; hWin = MESSAGEBOX_Create(sMessage, sCaption, Flags); /* * Change font of message box window */ FRAMEWIN_SetFont(hWin, pFont); /* * Adjust size */ WM_GetWindowRectEx(hWin, &Rect); WM_SetWindowPos(hWin, Rect.x0 - 15, Rect.y0 - 15, Rect.x1 - Rect.x0 + 1 + 30, Rect.y1 - Rect.y0 + 1 + 30); /* * Change font of button widget */ hItem = WM_GetDialogItem(hWin, GUI_ID_OK); BUTTON_SetFont(hItem, pFont); /* * Adjust size of button widget */ WM_GetWindowRectEx(hItem, &Rect); WM_SetWindowPos(hItem, Rect.x0, Rect.y0 + 10, Rect.x1 - Rect.x0 + 1 + 30, Rect.y1 - Rect.y0 + 1 + 5); /* * Change font of text widget */ hItem = WM_GetDialogItem(hWin, GUI_ID_TEXT0); TEXT_SetFont(hItem, pFont); /* * Adjust size text widget */ WM_GetWindowRectEx(hItem, &Rect); WM_SetWindowPos(hItem, Rect.x0, Rect.y0, Rect.x1 - Rect.x0 + 1 + 30, Rect.y1 - Rect.y0 + 1 + 12); return hWin; }
/********************************************************************* * * GUI_MessageBox */ int GUI_MessageBox(const char * sMessage, const char * sCaption, int Flags) { WM_HWIN hWin; hWin = MESSAGEBOX_Create(sMessage, sCaption, Flags); /* Exec dialog */ return GUI_ExecCreatedDialog(hWin); }
/********************************************************************* * * _cbDialog */ static void _cbDialog(WM_MESSAGE * pMsg) { WM_HWIN hItem; int NCode; int Id; // USER START (Optionally insert additional variables) // USER END switch (pMsg->MsgId) { case WM_INIT_DIALOG: { // hItem = WM_GetDialogItem(pMsg->hWin, ID_FRAMEWIN_0); //// FRAMEWIN_SetResizeable(hItem,1); // FRAMEWIN_SetFont(hItem,GUI_FONT_COMIC24B_ASCII); //// FRAMEWIN_SetMoveable(hItem,1); //// GUI_ExecCreatedDialog(hItem); hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0); BUTTON_SetSkin(hItem,BUTTON_SKIN_FLEX); hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1); BUTTON_SetSkin(hItem,BUTTON_SKIN_FLEX); // // Initialization of 'Edit' // hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0); EDIT_SetText(hItem, "blabalbalablablaba"); // // Initialization of 'Listwheel' // hItem = WM_GetDialogItem(pMsg->hWin, ID_LISTWHEEL_0); LISTWHEEL_SetLBorder(hItem,10); LISTWHEEL_SetFont(hItem,GUI_FONT_COMIC24B_ASCII); LISTWHEEL_AddString(hItem, "jeden"); LISTWHEEL_AddString(hItem, "dwa"); LISTWHEEL_AddString(hItem, "trzy"); LISTWHEEL_AddString(hItem, "cztery"); LISTWHEEL_AddString(hItem, "piec"); LISTWHEEL_AddString(hItem, "szesc"); LISTWHEEL_AddString(hItem, "siedem"); // // Initialization of 'Checkbox' // hItem = WM_GetDialogItem(pMsg->hWin, ID_CHECKBOX_0); CHECKBOX_SetText(hItem, "Check"); // // Initialization of 'Checkbox' // hItem = WM_GetDialogItem(pMsg->hWin, ID_CHECKBOX_1); CHECKBOX_SetText(hItem, "Check"); // USER START (Optionally insert additional code for further widget initialization) // USER END hItem=WM_GetDialogItem(pMsg->hWin,ID_PROGBAR_0); PROGBAR_SetMinMax(hItem,0,15); PROGBAR_SetSkin(hItem,PROGBAR_SKIN_FLEX); break; } case WM_NOTIFY_PARENT: Id = WM_GetId(pMsg->hWinSrc); NCode = pMsg->Data.v; switch(Id) { case ID_EDIT_0: // Notifications sent by 'Edit' switch(NCode) { case WM_NOTIFICATION_CLICKED: // USER START (Optionally insert code for reacting on notification message) // USER END WM_DeleteWindow(hBox); hBox = MESSAGEBOX_Create("Keyboard not supported yet!","ERROR", GUI_MESSAGEBOX_CF_MOVEABLE); break; case WM_NOTIFICATION_RELEASED: // USER START (Optionally insert code for reacting on notification message) // USER END break; case WM_NOTIFICATION_VALUE_CHANGED: // USER START (Optionally insert code for reacting on notification message) // USER END break; // USER START (Optionally insert additional code for further notification handling) // USER END } break; case ID_BUTTON_0: // Notifications sent by 'Button' switch(NCode) { case WM_NOTIFICATION_CLICKED: // USER START (Optionally insert code for reacting on notification message) // USER END break; case WM_NOTIFICATION_RELEASED: { CreateMojeokno2(); hItem=WM_GetDialogItem(pMsg->hWin,ID_PROGBAR_0); PROGBAR_SetValue(hItem,il++); break; } } break; case ID_BUTTON_1: // Notifications sent by 'Button' switch(NCode) { case WM_NOTIFICATION_CLICKED: { break; } case WM_NOTIFICATION_RELEASED: { CreateGraph(); // WM_DeleteWindow(hBox); // hBox = MESSAGEBOX_Create("Release the BUTTON !","ERROR", GUI_MESSAGEBOX_CF_MOVEABLE); // WM_DeleteWindow(hBox); break; } } break; case ID_LISTWHEEL_0: // Notifications sent by 'Listwheel' switch(NCode) { case WM_NOTIFICATION_CLICKED: // USER START (Optionally insert code for reacting on notification message) // USER END break; case WM_NOTIFICATION_RELEASED: // USER START (Optionally insert code for reacting on notification message) // USER END break; case WM_NOTIFICATION_SEL_CHANGED: // USER START (Optionally insert code for reacting on notification message) // USER END break; // USER START (Optionally insert additional code for further notification handling) // USER END } break; case ID_CHECKBOX_0: // Notifications sent by 'Checkbox' switch(NCode) { case WM_NOTIFICATION_CLICKED: // USER START (Optionally insert code for reacting on notification message) // USER END break; case WM_NOTIFICATION_RELEASED: // USER START (Optionally insert code for reacting on notification message) // USER END break; case WM_NOTIFICATION_VALUE_CHANGED: // USER START (Optionally insert code for reacting on notification message) // USER END break; // USER START (Optionally insert additional code for further notification handling) // USER END } break; case ID_CHECKBOX_1: // Notifications sent by 'Checkbox' switch(NCode) { case WM_NOTIFICATION_CLICKED: // USER START (Optionally insert code for reacting on notification message) // USER END break; case WM_NOTIFICATION_RELEASED: // USER START (Optionally insert code for reacting on notification message) // USER END break; case WM_NOTIFICATION_VALUE_CHANGED: // USER START (Optionally insert code for reacting on notification message) // USER END break; // USER START (Optionally insert additional code for further notification handling) // USER END } break; // USER START (Optionally insert additional code for further Ids) // USER END } break; // USER START (Optionally insert additional message handling) // USER END default: WM_DefaultProc(pMsg); break; } }