|
楼主 |
发表于 2014-8-26 10:54:39
|
显示全部楼层
回 eric2013 的帖子
eric2013:这个uGUIBulder4.0有bug,并不是很好用,设计界面还行,如果要运行的话,最好还是用官方的模拟器。 (2014-08-26 10:51)  下到单片机上了死机了
tatic const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
{ FRAMEWIN_CreateIndirect, "Caption", 0, 0, 0, 800,480,FRAMEWIN_CF_MOVEABLE,0},
{ LISTVIEW_CreateIndirect, NULL, GUI_ID_LISTVIEW0, 269,208,165,92, 0,0}
};
/*****************************************************************
** FunctionName:void PaintDialog(WM_MESSAGE * pMsg)
** Function: to initialize the Dialog items
**
** call this function in _cbCallback --> WM_PAINT
*****************************************************************/
void PaintDialog(WM_MESSAGE * pMsg)
{
WM_HWIN hWin = pMsg->hWin;
}
/*****************************************************************
** FunctionName:void InitDialog(WM_MESSAGE * pMsg)
** Function: to initialize the Dialog items
**
** call this function in _cbCallback --> WM_INIT_DIALOG
*****************************************************************/
void InitDialog(WM_MESSAGE * pMsg)
{
WM_HWIN hWin = pMsg->hWin;
//
//FRAMEWIN
//
FRAMEWIN_SetClientColor(hWin,0x000000);
FRAMEWIN_SetTitleVis(hWin,0);
//
//GUI_ID_LISTVIEW0
//
LISTBOX_SetBkColor(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW0),0,0xffffff);
//LISTVIEW_SetAutoScrollH(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW0),1);
//LISTVIEW_SetAutoScrollV(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW0),1);
LISTVIEW_AddColumn(WM_GetDialogItem(hWin,GUI_ID_LISTVIEW0),60,"ColumnHeader",GUI_TA_VCENTER|GUI_TA_LEFT);
}
/*********************************************************************
*
* Dialog callback routine
*/
static void _cbCallback(WM_MESSAGE * pMsg)
{
int NCode, Id;
WM_HWIN hWin = pMsg->hWin;
switch (pMsg->MsgId)
{
case WM_PAINT:
PaintDialog(pMsg);
break;
case WM_INIT_DIALOG:
InitDialog(pMsg);
break;
case WM_KEY:
switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key)
{
case GUI_KEY_ESCAPE:
GUI_EndDialog(hWin, 1);
break;
case GUI_KEY_ENTER:
GUI_EndDialog(hWin, 0);
break;
}
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch (Id)
{
case GUI_ID_OK:
if(NCode==WM_NOTIFICATION_RELEASED)
GUI_EndDialog(hWin, 0);
break;
case GUI_ID_CANCEL:
if(NCode==WM_NOTIFICATION_RELEASED)
GUI_EndDialog(hWin, 0);
break;
}
break;
default:
WM_DefaultProc(pMsg);
}
}
void MyGUI_Init(void)
{
WM_SetDesktopColor(GUI_BLACK); /* Automacally update desktop window */
// GUI_Clear();
WM_SetCreateFlags(WM_CF_MEMDEV); /* Use memory devices on all windows to avoid flicker */
GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbCallback, 0, 0, 0);
} |
|