#include "DIALOG.h"
/*
*********************************************************************************************************
* 变量
*********************************************************************************************************
*/
const char AddressURL[] = "www.armfly.comn"
"STM32-V1n"
"STM32-V2n"
"STM32-V3n"
"STM32-V4n"
"STM32-V5n"
"STM32-V6n"
"STM32-V7n"
"STM32-V8n"
"STM32-V9n"
"STM32-V10n";
/*
*********************************************************************************************************
* 宏定义
*********************************************************************************************************
*/
#define ID_FRAMEWIN_0 (GUI_ID_USER + 0x00)
#define ID_MULTIEDIT_0 (GUI_ID_USER + 0x01)
/*
*********************************************************************************************************
* GUI_WIDGET_CREATE_INFO类型数组
*********************************************************************************************************
*/
static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] =
{
{ FRAMEWIN_CreateIndirect, "Framewin", ID_FRAMEWIN_0, 0, 0, 800, 480, 0, 0x0, 0 },
{ MULTIEDIT_CreateIndirect, "Multiedit", ID_MULTIEDIT_0, 40, 30, 200, 120, 0, 0x0, 0 },
};
/*
*********************************************************************************************************
* 函 数 名: _cbDialog
* 功能说明: 对话框回调函数
* 形 参: pMsg 回调参数
* 返 回 值: 无
*********************************************************************************************************
*/
static void _cbDialog(WM_MESSAGE * pMsg)
{
WM_HWIN hItem;
SCROLLBAR_Handle hScroll;
int NCode;
int Id;
switch (pMsg->MsgId)
{
case WM_INIT_DIALOG:
//
// 初始化框架窗口
//
hItem = pMsg->hWin;
FRAMEWIN_SetFont(hItem, GUI_FONT_32B_ASCII);
FRAMEWIN_SetText(hItem, "armfly");
FRAMEWIN_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
//
// 初始化多行文本控件
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_MULTIEDIT_0);
MULTIEDIT_SetText(hItem, AddressURL);
MULTIEDIT_SetFont(hItem, GUI_FONT_16_ASCII);
/* 使能多行文本的插入模式 */
MULTIEDIT_SetInsertMode(hItem, 1);
/* 将滚动条附加到多行文本控件 */
hScroll = SCROLLBAR_CreateAttached(hItem, GUI_ID_VSCROLL);
/* 设置滚动条的宽度 */
SCROLLBAR_SetWidth(hScroll, 15);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id)
{
case ID_MULTIEDIT_0:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
break;
case WM_NOTIFICATION_VALUE_CHANGED:
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
/*
*********************************************************************************************************
* 函 数 名: CreateFramewin
* 功能说明: 创建对话框
* 形 参: 无
* 返 回 值: 返回对话框句柄
*********************************************************************************************************
*/
WM_HWIN CreateFramewin(void)
{
WM_HWIN hWin;
hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
return hWin;
} |