|

楼主 |
发表于 2019-5-17 11:16:12
|
显示全部楼层
本帖最后由 天涯海角 于 2019-5-17 11:17 编辑
- /*********************************************************************
- * *
- * SEGGER Microcontroller GmbH & Co. KG *
- * Solutions for real time microcontroller applications *
- * *
- **********************************************************************
- * *
- * C-file generated by: *
- * *
- * GUI_Builder for emWin version 5.32 *
- * Compiled Oct 8 2015, 11:59:02 *
- * (c) 2015 Segger Microcontroller GmbH & Co. KG *
- * *
- **********************************************************************
- * *
- * Internet: www.segger.com Support: support@segger.com *
- * *
- **********************************************************************
- */
- // USER START (Optionally insert additional includes)
- // USER END
- #include "DIALOG.h"
- /*********************************************************************
- *
- * Defines
- *
- **********************************************************************
- */
- #define ID_FRAMEWIN_0 (GUI_ID_USER + 0x00)
- #define ID_BUTTON_0 (GUI_ID_USER + 0x01)
- #define ID_IMAGE_0 (GUI_ID_USER + 0x03)
- #define ID_IMAGE_0_IMAGE_0 0x00
- // USER START (Optionally insert additional defines)
- // USER END
- /*********************************************************************
- *
- * Static data
- *
- **********************************************************************
- */
- /*********************************************************************
- *
- * _acImage_0, "E:\Project_TFT\02-ProgramDesign\02-STM32F103VET6\09-EmWin\Bmp\BMP\HBO.bmp", ID_IMAGE_0_IMAGE_0
- */
- static const U8 _acImage_0[20022] = {//////////省略///////
- };
- // USER START (Optionally insert additional static data)
- // USER END
- /*********************************************************************
- *
- * _aDialogCreate
- */
- static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
- { FRAMEWIN_CreateIndirect, "Framewin", ID_FRAMEWIN_0, 0, -5, 800, 480, 0, 0x0, 0 },
- { BUTTON_CreateIndirect, "Button", ID_BUTTON_0, 0, 0, 80, 20, 0, 0x0, 0 },
- { IMAGE_CreateIndirect, "Image", ID_IMAGE_0, 14, 34, 140, 50, 0, 0, 0 },
- // USER START (Optionally insert additional widgets)
- // USER END
- };
- /*********************************************************************
- *
- * Static code
- *
- **********************************************************************
- */
- /*********************************************************************
- *
- * _GetImageById
- */
- static const void * _GetImageById(U32 Id, U32 * pSize) {
- switch (Id) {
- case ID_IMAGE_0_IMAGE_0:
- *pSize = sizeof(_acImage_0);
- return (const void *)_acImage_0;
- }
- return NULL;
- }
- // USER START (Optionally insert additional static code)
- // USER END
- /*********************************************************************
- *
- * _cbDialog
- */
- static void _cbDialog(WM_MESSAGE * pMsg) {
- const void * pData;
- WM_HWIN hItem;
- U32 FileSize;
- int NCode;
- int Id;
- // USER START (Optionally insert additional variables)
- // USER END
- switch (pMsg->MsgId) {
- case WM_INIT_DIALOG:
- //
- // Initialization of 'Image'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_0);
- pData = _GetImageById(ID_IMAGE_0_IMAGE_0, &FileSize);
- IMAGE_SetBMP(hItem, pData, FileSize);
- // USER START (Optionally insert additional code for further widget initialization)
- // USER END
- break;
- case WM_NOTIFY_PARENT:
- Id = WM_GetId(pMsg->hWinSrc);
- NCode = pMsg->Data.v;
- switch(Id) {
- 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:
- // 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;
- }
- }
- /*********************************************************************
- *
- * Public code
- *
- **********************************************************************
- */
- /*********************************************************************
- *
- * CreateFramewin
- */
- WM_HWIN CreateFramewin(void);
- WM_HWIN CreateFramewin(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)
- // USER END
- /*************************** End of file ****************************/
- void ButtonUse_Demo(void)
- {
- WM_HWIN hWin;
- hWin=CreateFramewin();
- while(1)
- {
- GUI_Delay(100);
- }
- }
- /*************************** End of file ****************************/
复制代码 |
|