完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
/********************************************************************* * * * SEGGER Microcontroller GmbH & Co. KG * * Solutions for real time microcontroller applications * * * ********************************************************************** * * * C-file generated by: * * * * GUI_Builder for emWin version 5.26 * * Compiled Aug 8 2014, 14:49:54 * * (c) 2013 Segger Microcontroller GmbH & Co. KG * * * ********************************************************************** * * * Internet: www.segger.com Support: support@segger.com * * * ********************************************************************** */ // USER START (Optionally insert additional includes) // USER END #include "DIALOG.h" //#include "ButtonUse.h" #include #include #include #include "GUI.h" #include "FRAMEWIN.h" #include "MULTIPAGE.h" #include "EDIT.H" #include "FRAMEWIN.h" #include "BUTTON.H" #include "TEXT.H" #include "RADIO.H" #include "SLIDER.H" #include "DROPDOWN.H" #include "MULTIEDIT.H" /********************************************************************* * * Defines * ********************************************************************** */ #define ID_FRAMEWIN_0 (GUI_ID_USER + 0x00) #define ID_EDIT_0 (GUI_ID_USER + 0x1) #define ID_BUTTON_DEL (GUI_ID_USER + 0x02) #define ID_BUTTON_1 (GUI_ID_USER + 0x03) #define ID_BUTTON_2 (GUI_ID_USER + 0x04) #define ID_BUTTON_3 (GUI_ID_USER + 0x05) #define ID_BUTTON_4 (GUI_ID_USER + 0x06) #define ID_BUTTON_5 (GUI_ID_USER + 0x07) #define ID_BUTTON_6 (GUI_ID_USER + 0x08) #define ID_BUTTON_7 (GUI_ID_USER + 0x09) #define ID_BUTTON_8 (GUI_ID_USER + 0x0A) #define ID_BUTTON_9 (GUI_ID_USER + 0x0B) #define ID_BUTTON_0 (GUI_ID_USER + 0x0C) #define GUI_ID_CANCEL (GUI_ID_USER +0x0D) #define GUI_ID_OK (GUI_ID_USER + 0x0E) // USER START (Optionally insert additional defines) // USER END /********************************************************************* * * Static data * ********************************************************************** */ // USER START (Optionally insert additional static data) // USER END /********************************************************************* * * _aDialogCreate */ static const GUI_WIDGET_CREATE_INFO _aDialogCreate_kb[] = { { FRAMEWIN_CreateIndirect, "Framewin", ID_FRAMEWIN_0, 0, 0, 800, 480, 0, 0x0, 0 }, { EDIT_CreateIndirect, "", ID_EDIT_0, 30, 20, 250, 50, 0, 0x64, 0 }, { BUTTON_CreateIndirect, "DEL",ID_BUTTON_DEL, 637, 21, 120, 80, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "2", ID_BUTTON_1, 250, 100, 80, 80, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "1", ID_BUTTON_2, 120, 100, 80, 80, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "3", ID_BUTTON_3, 380, 100, 80, 80, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "4", ID_BUTTON_4, 120, 210, 80, 80, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "5", ID_BUTTON_5, 250, 210, 80, 80, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "6", ID_BUTTON_6, 380, 210, 80, 80, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "7", ID_BUTTON_7, 120, 320, 80, 80, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "8", ID_BUTTON_8, 250, 320, 80, 80, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "9", ID_BUTTON_9, 380, 320, 80, 80, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "0", ID_BUTTON_0, 510, 320, 80, 80, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "ESC",GUI_ID_CANCEL, 510, 210, 80, 80, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "OK", GUI_ID_OK, 510, 100, 80, 80, 0, 0x0, 0 }, // USER START (Optionally insert additional widgets) // USER END }; void PaintDialog_kb(WM_MESSAGE * pMsg) { WM_HWIN hWin = pMsg->hWin; } /********************************************************************* * * Static code * ********************************************************************** */ // USER START (Optionally insert additional static code) // USER END /********************************************************************* * * _cbDialog */ static void _cbCallback_kb(WM_MESSAGE * pMsg) { WM_HWIN hWin; int NCode; int Id; char BVtxt_temp[9]; char BVtxt[9]; // USER START (Optionally insert additional variables) // USER END switch (pMsg->MsgId) { case WM_INIT_DIALOG: hWin = pMsg->hWin; FRAMEWIN_SetTitleHeight(hWin, 60); // hWin = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0); EDIT_SetFont(WM_GetDialogItem(hWin,ID_EDIT_0),&GUI_Font13_1); // EDIT_SetValue(WM_GetDialogItem(hWin,GUI_ID_EDIT0),0); EDIT_SetMaxLen(WM_GetDialogItem(hWin,ID_EDIT_0),9); // EDIT_SetDecMode(WM_GetDialogItem(hWin,GUI_ID_EDIT0),0,0,999.9999,4,0); // // EDIT_SetText(hWin, ""); // EDIT_SetTextColor(hWin, EDIT_CI_ENABLED, 0x00000000); // EDIT_SetFont(hWin,&GUI_Font24_1); // EDIT_SetTextAlign(hWin, GUI_TA_LEFT | GUI_TA_VCENTER); // EDIT_SetDecMode(WM_GetDialogItem(hWin,ID_EDIT_0),0,0,256,2,0); // // Initialization of 'ESC' // hWin = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_DEL); BUTTON_SetFont(hWin,&GUI_Font24_1); // // Initialization of '2' // hWin = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1); BUTTON_SetFont(hWin,&GUI_Font24_1); // // Initialization of '1' // hWin = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_2); BUTTON_SetFont(hWin,&GUI_Font24_1); // // Initialization of '3' // hWin = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_3); BUTTON_SetFont(hWin,&GUI_Font24_1); // // Initialization of '4' // hWin = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_4); BUTTON_SetFont(hWin,&GUI_Font24_1); // // Initialization of '5' // hWin = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_5); BUTTON_SetFont(hWin,&GUI_Font24_1); // // Initialization of '6' // hWin = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_6); BUTTON_SetFont(hWin,&GUI_Font24_1); // // Initialization of '7' // hWin = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_7); BUTTON_SetFont(hWin,&GUI_Font24_1); // // Initialization of '8' // hWin = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_8); BUTTON_SetFont(hWin,&GUI_Font24_1); // // Initialization of '9' // hWin = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_9); BUTTON_SetFont(hWin,&GUI_Font24_1); // // Initialization of '0' // hWin = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0); BUTTON_SetFont(hWin,&GUI_Font24_1); // // Initialization of 'DEL' // hWin = WM_GetDialogItem(pMsg->hWin, GUI_ID_CANCEL); BUTTON_SetFont(hWin,&GUI_Font24_1); // // Initialization of 'OK' // hWin = WM_GetDialogItem(pMsg->hWin, GUI_ID_OK); BUTTON_SetFont(hWin,&GUI_Font24_1); // USER START (Optionally insert additional code for further widget initialization) // USER END break; case WM_PAINT: PaintDialog_kb(pMsg); break; case WM_KEY: switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key) { case GUI_KEY_ESCAPE: GUI_EndDialog(hWin, 1); break; case GUI_KEY_ENTER: GUI_EndDialog(hWin, 0); break; } break; case WM_NOTIFY_PARENT: Id = WM_GetId(pMsg->hWinSrc); NCode = pMsg->Data.v; switch(NCode) { case WM_NOTIFICATION_RELEASED: switch (Id) { case GUI_ID_OK: EDIT_AddKey(WM_GetDialogItem(hWin,ID_EDIT_0),' |