初级会员
- 积分
- 57
- 金钱
- 57
- 注册时间
- 2015-6-23
- 在线时间
- 8 小时
|
最近在使用5.12版时发现生成的代码用不了,后来发现5.12版的宏定义地址和gui.h里面的对不上。特分享给各位同行。源码。。。[mw_shl_code=c,true]/*********************************************************************
* *
* 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 ****************************/
[/mw_shl_code]
|
|