完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
最近在使用5.12版时发现生成的代码用不了,后来发现5.12版的宏定义地址和gui.h里面的对不上。特分享给各位同行。源码。。。[C] 纯文本查看 复制代码
/********************************************************************** ** SEGGER Microcontroller GmbH & Co. KG ** Solutions for real time microcontroller applications ** ************************************************************************ ** C-file generated by: ** ** GUI_Builder for emWin version 5.22 ** Compiled Jul 4 2013, 15:16:01 ** (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"/*********************************************************************** Defines************************************************************************/#define ID_WINDOW_0 0#define ID_BUTTON_0 0x170#define ID_BUTTON_1 0x171#define ID_ICONVIEW_0 0x250#define ID_DROPDOWN_0 0X180#define ID_GRAPH_0 0x220#define ID_EDIT_0 0x100// 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[] = { { WINDOW_CreateIndirect, "Window", ID_WINDOW_0, 2, 0, 240, 320, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "Button", ID_BUTTON_0, 79, 268, 80, 20, 0, 0x0, 0 }, { GRAPH_CreateIndirect, "Graph", ID_GRAPH_0, 20, 110, 200, 100, 0, 0x0, 0 }, { EDIT_CreateIndirect, "Edit", ID_EDIT_0, 58, 35, 120, 63, 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; int NCode; int Id; // USER START (Optionally insert additional variables) // USER END switch (pMsg->MsgId) { case WM_INIT_DIALOG: // // Initialization of 'Edit' // hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0); EDIT_SetText(hItem, "ZHANG YI"); // 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; 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 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; }}/*********************************************************************** Public code************************************************************************//*********************************************************************** CreateWindow*/void Main_Task(void) { //??? GUI_Init(); WM_SetDesktopColor(GUI_WHITE); /* Automacally update desktop window */ WM_SetCreateFlags(WM_CF_MEMDEV); /* Use memory devices on all windows to avoid flicker */ //PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX); //FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX); //PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX); //BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX); //CHECKBOX_SetDefaultSkin(CHECKBOX_SKIN_FLEX); //DROPDOWN_SetDefaultSkin(DROPDOWN_SKIN_FLEX); //SCROLLBAR_SetDefaultSkin(SCROLLBAR_SKIN_FLEX); //SLIDER_SetDefaultSkin(SLIDER_SKIN_FLEX); //HEADER_SetDefaultSkin(HEADER_SKIN_FLEX); //RADIO_SetDefaultSkin(RADIO_SKIN_FLEX); //???????? GUI_ExecDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbDialog, 0, 0, 0);}// USER START (Optionally insert additional public code) //USER END/*************************** End of file ****************************/ |
|
相关推荐
2个回答
|
|
|
这个ID不需要修改的吧,GUIbulider 5.12生成的控件ID是从GUI_ID_USER开始定义的用户自定义ID,而GUI代码中的是GUI定义好的一些控件ID,没有影响的吧
|
|
|
|
|
|
这个我还真不知道,谢谢提醒
|
|
|
|
|
只有小组成员才能发言,加入小组>>
1027 浏览 1 评论
1856 浏览 0 评论
1837 浏览 1 评论
3261 浏览 5 评论
3587 浏览 9 评论
1034浏览 1评论
1856浏览 1评论
如何知道嵌入式电子控制单元 (ECU) 中的RAM使用情况?
1370浏览 1评论
1861浏览 0评论
1186浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-3 19:08 , Processed in 0.607818 second(s), Total 76, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1521