我使用 g_DoseAlarm.hFrame = GUI_CreateDialogBox(DoseAlarm_Create, GUI_COUNTOF(DoseAlarm_Create), _cbDoseAlarm_Dialog,0/* WM_HBKWIN*/, 0, 0);
创建了一个对话框。
//-------------------------------------------------------------------------------------------------------------------以下是对话框的资源列表---------------------------------------------------------------------------------------------------
static const GUI_WIDGET_CREATE_INFO DoseAlarm_Create[] =
{
{ FRAMEWIN_CreateIndirect, NULL, ID_FRAMEWIN_MENU, 0, 30, 400, 210, 0, 0x64, 0 },
{ BUTTON_CreateIndirect, "alarm setup", ID_BUTTON_SETUP_M, 0,40, 390,40 , 0, 0, 0 },
{ BUTTON_CreateIndirect, "thread setup", ID_BUTTON_ALSET_M, 0, 85, 390,40 , 0, 0, 0 },
// { BUTTON_CreateIndirect, "clear setup", ID_BUTTON_THRESHOLDSET_M, 0, 130, 390,40 , 0, 0, 0 },
};
//--------------------------------------------------------------------------------------------------------------以下是回调函数----------------------------------------------------------------------------------------------------------------------------
case WM_INIT_DIALOG:
hItem = pMsg->hWin;
FRAMEWIN_SetTitleVis(hItem,0);
hWin = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_ALSET_M);
Draw_BtnBmp(hWin,THR_Val_B,105,8);
Draw_BtnBmp_of(hWin,THR_Val_W,105,8);
BUTTON_SetFocusColor(hWin,GUI_BLACK);
BUTTON_SetPressed(hWin,1);
result = BUTTON_IsPressed(hWin);
BUTTON_SetFont(hWin, &XBF_Font16);
BUTTON_SetText(hWin,"阈值设置");
BUTTON_SetFocussable(hWin,1);
WM_SetCallback(hWin, _cbBtnWizzardItem);
//------------------------------------------------------------------------------------------------对其中一个button使用了自定义回调函数。----------------------------------------------------------------------------------------------------------
WM_SetCallback(hWin, _cbBtnWizzardItem); 去掉这个函数是可以显示button的。但是使用了自定义回调,button就消失了。是不是不能再窗口的回调函数里,再使用回调函数的?
我的目的是,使用机械键盘从页面聚焦到button上。但是焦点一直找不到。有大神能告诉我该怎么处理吗?
|