没有加操作系统,只有ucGUI
之前在创建按钮控件的时候
hButton1 = BUTTON_CreateAsChild(40,20,60,30,hFrame,GUI_ID_OK,WM_CF_SHOW);
发现不不显示,就在后面加了一句WM_Paint(hButton1);就显示出来了,
现在创建了一个对话框,上面有两个button
static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] =
{
{ FRAMEWIN_CreateIndirect, "PassWord", ID_FRAMEWIN_0, 0, 0, 200, 100, 0, 0 },
{ BUTTON_CreateIndirect, "Button", ID_BUTTON_0, 1, 56, 80, 20, 0, 0 },
{ BUTTON_CreateIndirect, "Button", ID_BUTTON_1, 108, 55, 80, 20, 0, 0 }
// USER START (Optionally insert additional widgets)
// USER END
};
WM_HWIN hWin;
hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbDialog, WM_HBKWIN, 0, 0);
WM_Paint(hWin);
发现有对话框,但是两个按钮没显示出来啊,后来我跟踪了下
将下面函数里的
WM_ShowWindow 换成了
WM_Paint 结果什么也显示不出来了,请教大家怎么办啊? 为什么ucGUI手册上面的例程在创建一个控件之后没有调用WM_Paint之类的函数就能显示出来了?谢谢了。
WM_HWIN GUI_CreateDialogBox(const GUI_WIDGET_CREATE_INFO* paWidget, int NumWidgets, WM_CALLBACK* cb, WM_HWIN hParent,
int x0, int y0)
{
WM_HWIN hDialog = paWidget->pfCreateIndirect(paWidget, hParent, x0, y0, cb); /* Create parent window */
WM_HWIN hDialogClient = WM_GetClientWindow(hDialog);
WIDGET_OrState(hDialog, paWidget->Flags);
//WM_ShowWindow(hDialog);
//WM_ShowWindow(hDialogClient);
WM_Paint(hDialog);
WM_Paint(hDialogClient);
while (--NumWidgets > 0) {
WM_HWIN hChild;
paWidget++;
hChild = paWidget->pfCreateIndirect(paWidget, hDialogClient, 0, 0, 0); /* Create child window */
// WM_ShowWindow(hChild);
WM_Paint(hChild);
}
WM_SetFocusOnNextChild(hDialog); /* Set the focus to the first child */
WM_SendMessageNoPara(hDialogClient, WM_INIT_DIALOG);
return hDialog;
}
|