|

楼主 |
发表于 2019-7-3 16:16:58
|
显示全部楼层
- /*********************************************************************
- * *
- * SEGGER Microcontroller GmbH & Co. KG *
- * Solutions for real time microcontroller applications *
- * *
- **********************************************************************
- * *
- * C-file generated by: *
- * *
- * GUI_Builder for emWin version 5.44 *
- * Compiled Nov 10 2017, 08:53:57 *
- * (c) 2017 Segger Microcontroller GmbH & Co. KG *
- * *
- **********************************************************************
- * *
- * Internet: www.segger.com Support: support@segger.com *
- * *
- **********************************************************************
- */
- // USER START (Optionally insert additional includes)
- #include "main.h"
- // USER END
- #include "DIALOG.h"
- /*********************************************************************
- *
- * Defines
- *
- **********************************************************************
- */
- #define ID_WINDOW_0 (GUI_ID_USER + 0x00)
- #define ID_TEXT_0 (GUI_ID_USER + 0x01)
- #define ID_TEXT_1 (GUI_ID_USER + 0x02)
- // USER START (Optionally insert additional defines)
- extern GUI_CONST_STORAGE GUI_FONT GUI_FontSong32Cu;
- #define ID_SYSINFO_TIMER_TIME (GUI_ID_USER + 0x9A)
- extern WM_HWIN pWin;
- // USER END
- /*********************************************************************
- *
- * Static data
- *
- **********************************************************************
- */
- // USER START (Optionally insert additional static data)
- // USER END
- /*********************************************************************
- *
- * _aDialogCreate
- */
- static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
- { WINDOW_CreateIndirect, "SysStatus", ID_WINDOW_0, 0, 0, 128, 64, 0, 0x0, 0 },
- { TEXT_CreateIndirect, "Text", ID_TEXT_0, 0, 5, 128, 35, 0, 0x64, 0 },
- { TEXT_CreateIndirect, "DEVICESERIESNUMBER", ID_TEXT_1, 40, 44, 85, 20, 0, 0x64, 0 },
- // USER START (Optionally insert additional widgets)
- // USER END
- };
- /*********************************************************************
- *
- * Static code
- *
- **********************************************************************
- */
- // USER START (Optionally insert additional static code)
- // USER END
- /*********************************************************************
- *
- * _cbDialog
- */
- static void _cbDialog(WM_MESSAGE * pMsg) {
- WM_HWIN hItem;
- // USER START (Optionally insert additional variables)
- WM_HWIN hWin = pMsg->hWin;
- static uint8_t TempStr[25];
- // USER END
- switch (pMsg->MsgId) {
- case WM_INIT_DIALOG:
- //
- // Initialization of 'Text'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
- TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
- TEXT_SetFont(hItem, GUI_FONT_32B_ASCII);
- TEXT_SetText(hItem, "LOGGING");
- //
- // Initialization of 'DEVICESERIESNUMBER'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_1);
- TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
- TEXT_SetFont(hItem, GUI_FONT_20B_ASCII);
- TEXT_SetText(hItem, "0001");
- // USER START (Optionally insert additional code for further widget initialization)
- hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
- TEXT_SetFont(hItem, &GUI_FontSong32Cu);
- WM_SetFocus(pMsg->hWin);
- // USER END
- break;
- // USER START (Optionally insert additional message handling)
- case WM_CREATE:
- WM_CreateTimer(hWin, ID_SYSINFO_TIMER_TIME, 1000, 0);
- break;
-
- case WM_TIMER:
- /* Refrish real time display */
- //WM_InvalidateWindow(pMsg->hWin);
- WM_RestartTimer(pMsg->Data.v, 1000);
- if(WM_IsCompletelyCovered(pMsg->hWin)) break; //当切换到其他页面什么都不做
- //refresh data display
- // GUI_PollKeyMsg();
-
- break;
-
- case WM_KEY:
- switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key)
- {
- case GUI_KEY_POWERONOFF:
- //GUI_Delay(10);
- WM_InvalidateWindow(WM_GetParent(pMsg->hWin));
- GUI_EndDialog(pMsg->hWin, 0);
- break;
- case GUI_KEY_ACQ:
- GUI_Delay(10);
- //WM_InvalidateWindow(WM_GetParent(pMsg->hWin));
- //GUI_EndDialog(pMsg->hWin, 0);
- break;
- case GUI_KEY_SELECT:
- //GUI_Delay(10);
- WM_InvalidateWindow(WM_GetParent(pMsg->hWin));
- GUI_EndDialog(pMsg->hWin, 0);
- break;
- case GUI_KEY_RETURN:
- //GUI_Delay(10);
- WM_InvalidateWindow(WM_GetParent(pMsg->hWin));
- GUI_EndDialog(pMsg->hWin, 0);
- break;
- case GUI_KEY_PRINT:
- //GUI_Delay(10);
- pWin = WM_GetPrevSibling(pMsg->hWin);
- // WM_InvalidateWindow(WM_GetParent(pMsg->hWin));
- GUI_EndDialog(pMsg->hWin, 0);
- // WM_SelectWindow(hWin);
- WM_SetFocus(pWin);
- break;
- }
- break;
- // USER END
- default:
- WM_DefaultProc(pMsg);
- break;
- }
- }
- /*********************************************************************
- *
- * Public code
- *
- **********************************************************************
- */
- /*********************************************************************
- *
- * CreateSysStatus
- */
- WM_HWIN CreateSysStatus(void);
- WM_HWIN CreateSysStatus(void) {
- WM_HWIN hWin;
- hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
- return hWin;
- }
- // USER START (Optionally insert additional public code)
- WM_HWIN CreateSysStatus1(void);
- WM_HWIN CreateSysStatus1(void) {
- WM_HWIN hWin;
-
- WM_SetCreateFlags(WM_CF_MEMDEV);
- GUI_EnableAlpha(1);
- WM_MULTIBUF_Enable(1);
- WM_SetDesktopColor(GUI_WHITE);
- WM_EnableMemdev(WM_GetDesktopWindow());
- GUI_UC_SetEncodeUTF8();
- //hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
- hWin = WM_CreateWindow(0, 0, 128, 64, WM_CF_MEMDEV_ON_REDRAW | WM_CF_FGND | WM_CF_SHOW, _cbDialog, sizeof(WM_HWIN));
- WM_SelectWindow(hWin);
- WM_Exec();
- GUI_Exec();
- // WM_CreateWindowAsChild(0,
- // 0,
- // 128,//LCD_GetXSize(),
- // 64,
- // //WM_HBKWIN,
- // WM_GetDesktopWindow(),
- // WM_CF_SHOW /*| WM_CF_HASTRANS */,
- // _cbDialog,
- // 0);
- // WM_CreateTimer(WM_GetClientWindow(hWin), ID_SYSINFO_TIMER_TIME, 1000, 0);
- return hWin;
- }
- // USER END
- /*************************** End of file ****************************/
复制代码 |
|