对话框标题栏设置32,标题栏字体设置20*20(自己建的库),然而标题栏的高度不到32,大概20多的样子,这是怎么回事?资源列表
static const GUI_WIDGET_CREATE_INFO _aDialogMainInterface[] =
{
{FRAMEWIN_CreateIndirect,"****",0,0,0,320,480,FRAMEWIN_CF_ACTIVE,0},
{BUTTON_CreateIndirect,"****",GUI_ID_MEASUREBUTTON,50,62,80,80,0,0},
{BUTTON_CreateIndirect,"****",GUI_ID_TRENDCHARTBUTTON,190,62,80,80,0,0},
{BUTTON_CreateIndirect,"****",GUI_ID_MANAGEBUTTON,50,184,80,80,0,0},
{BUTTON_CreateIndirect,"****",GUI_ID_CALIBRATIONBUTTON,190,184,80,80,0,0},
{BUTTON_CreateIndirect,"****",GUI_ID_SYSTEMBUTTON,50,316,80,80,0,0},
{BUTTON_CreateIndirect,"****",GUI_ID_HELPBUTTON,190,316,80,80,0,0},
};
这是回调函数
static void _cbDialogMainInterface(WM_MESSAGE * pMsg)
{
int NCode, Id;
WM_HWIN hDlg;
hDlg = pMsg->hWin; // 获得窗口的句柄
switch (pMsg->MsgId) { //根据窗口的消息类型执行相应的内容
case WM_PAINT: //窗口重绘 此处绘出了面板的边框
break;
case WM_INIT_DIALOG: //窗口的初始化 控件的各种属性 颜色 文本
FRAMEWIN_SetDefaultCaptionSize(32); //标题栏高度32
FRAMEWIN_SetTextAlign(hDlg,GUI_TA_BOTTOM|GUI_TA_HCENTER);//垂直和水平居中
break;
case WM_NOTIFY_PARENT: //通知父窗口控件发生了改变
Id = WM_GetId(pMsg->hWinSrc); /* Id of widget */ // 得到窗口控件的ID号
NCode = pMsg->Data.v; /* Notification code */// 控件的消息类型
switch (NCode)
{
// case WM_NOTIFICATION_CLICKED:
case WM_NOTIFICATION_RELEASED: //如果释放按键起作用
switch(Id)
{
case GUI_ID_MEASUREBUTTON:
ID_Measure = GUI_CreateDialogBox(_aDialogMeasure, GUI_COUNTOF(_aDialogMeasure), _cbDialogMeasure, hDlg, 0, 32);
break;
case GUI_ID_TRENDCHARTBUTTON:
break;
case GUI_ID_MANAGEBUTTON:
break;
case GUI_ID_CALIBRATIONBUTTON:
break;
case GUI_ID_SYSTEMBUTTON:
break;
case GUI_ID_HELPBUTTON:
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
}
}
ID_MainInterface = GUI_CreateDialogBox(_aDialogMainInterface, GUI_COUNTOF(_aDialogMainInterface), _cbDialogMainInterface, 0, 0, 0);
|