/*
*********************************************************************************************************
* GUI_WIDGET_CREATE_INFO类型数组
*********************************************************************************************************
*/
static const GUI_WIDGET_CREATE_INFO _aDialogCreate2[] =
{
{ FRAMEWIN_CreateIndirect, "Framewin", ID_FRAMEWIN_0, 0, 0, 800, 480, 0, 0x64, 0 },
{ BUTTON_CreateIndirect, "Button", ID_BUTTON_0, 34, 35, 177, 52, 0, 0x0, 0 },
{ BUTTON_CreateIndirect, "Button", ID_BUTTON_1, 34, 130, 177, 52, 0, 0x0, 0 },
{ SLIDER_CreateIndirect, "Slider", ID_SLIDER_0, 285, 230, 189, 37, 0, 0x0, 0 },
};
/*
*********************************************************************************************************
* 函 数 名: _cbDialog2
* 功能说明: 对话框回调函数
* 形 参: pMsg 回调参数
* 返 回 值: 无
*********************************************************************************************************
*/
static void _cbDialog2(WM_MESSAGE * pMsg)
{
WM_HWIN hItem;
int NCode;
int Id;
switch (pMsg->MsgId)
{
case WM_INIT_DIALOG:
//
// 初始化框架窗口
//
hItem = pMsg->hWin;
FRAMEWIN_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
FRAMEWIN_SetFont(hItem, GUI_FONT_32B_ASCII);
FRAMEWIN_SetText(hItem, "Screen 2");
//
// 初始按钮控件
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
BUTTON_SetFont(hItem, GUI_FONT_20_1);
BUTTON_SetText(hItem, "Screen 1");
//
// 初始化按钮控件
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1);
BUTTON_SetFont(hItem, GUI_FONT_20_1);
BUTTON_SetText(hItem, "Screen 3");
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id)
{
case ID_BUTTON_0:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
break;
/* 关闭当前对话框, 创建对话框1 */
case WM_NOTIFICATION_RELEASED:
GUI_EndDialog(pMsg->hWin, 0);
CreateFramewin1();
break;
}
break;
case ID_BUTTON_1:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
break;
/* 关闭当前对话框, 创建对话框3 */
case WM_NOTIFICATION_RELEASED:
GUI_EndDialog(pMsg->hWin, 0);
CreateFramewin3();
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
} |