初级会员

- 积分
- 64
- 金钱
- 64
- 注册时间
- 2016-3-17
- 在线时间
- 12 小时
|

楼主 |
发表于 2016-3-17 23:21:47
|
显示全部楼层
#include "DIALOG.h"
#define ID_FRAMEWIN_0 (GUI_ID_USER + 0x00)
static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
{ FRAMEWIN_CreateIndirect, "Framewin", ID_FRAMEWIN_0, -1, 0, 240, 320, 0, 0x0, 0 },
// USER START (Optionally insert additional widgets)
// USER END
};
static void _cbDialog(WM_MESSAGE * pMsg) {
// USER START (Optionally insert additional variables)
// USER END
BUTTON_Handle bt;
int id;
switch (pMsg->MsgId) {
// USER START (Optionally insert additional message handling)
// USER END
case WM_INIT_DIALOG:{
bt = BUTTON_CreateEx(0,0,80,80,pMsg->hWin,WM_CF_SHOW,0,GUI_ID_BUTTON1);
BUTTON_SetText(bt,"hahah");
}break;
case WM_NOTIFY_PARENT:{
id = WM_GetId(pMsg->hWinSrc);
switch (id)
{
case GUI_ID_BUTTON1:{
switch (pMsg->Data.v)
{
case WM_NOTIFICATION_RELEASED:GUI_DispStringAt("the button is clicked",200,200);
default:
break;
}
}break;
default:
break;
}
}break;
default:
WM_DefaultProc(pMsg);
break;
}
}
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;
}
void MainTask(void)
{
GUI_HWIN hWin;
GUI_Init();
GUI_SetBkColor(GUI_BLACK);
GUI_Clear();
hWin = CreateFramewin();
while (1)
{
// display();
GUI_Delay(100);
}
}
就这个 麻烦看一下 |
|