新手上路
- 积分
- 47
- 金钱
- 47
- 注册时间
- 2016-8-2
- 在线时间
- 10 小时
|
1金钱
static void _cbDialog(WM_MESSAGE * pMsg)
{
WM_HWIN hItem;
int NCode;
int Id;
int TimeNextInc;
switch (pMsg->MsgId)
{
case WM_INIT_DIALOG: //′′½¨¶Ô»°¿òoóᢼ′·¢Ëí¸ø¶Ô»°¿ò′°¿ú
//
// 3õê¼»ˉ 'Framewin'êyÖμ
//
hItem = pMsg->hWin;
FRAMEWIN_SetFont(hItem, GUI_FONT_32B_ASCII);
FRAMEWIN_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
FRAMEWIN_SetText(hItem, "mumuda");
//
// ??? 'Button'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
BUTTON_SetFont(hItem, GUI_FONT_24B_ASCII);
BUTTON_SetText(hItem, "armfly");
ucBackColor = 0;
break;
case WM_PAINT: //ê1óÃáË′°¿úÎTD§£¬£¬è′êǽø2»á˸Ãoˉêy£¿£¿£¿¸Ã2¿·ÖóDÎêìa
GUI_SetBkColor(_acColor[ucBackColor]); //éèÖøü»»±3¾°é«
GUI_Clear(); //Çå3y′°¿ú
LED0 = ~LED0;
break;
case WM_MOUSEOVER_END: //μ±êó±êòÆ¿a′°¿úê±£¬£¬Ëù·¢ËíμÄÏûÏ¢
break;
case WM_KEY:
switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key)
{
case GUI_KEY_ESCAPE:
GUI_EndDialog(pMsg->hWin, 1);
break;
case GUI_KEY_ENTER:
GUI_EndDialog(pMsg->hWin, 0);
break;
}
break;
case WM_UPDATE:
{
ucBackColor++;
if (ucBackColor == 3)
{
ucBackColor = 0;
}
LED1 = ~LED1;
WM_InvalidateWindow(pMsg->hWin);
}
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id)
{
case ID_BUTTON_0:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
break;
}
break;
case ID_SCROLLBAR_0:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
break;
case WM_NOTIFICATION_VALUE_CHANGED:
break;
}
break;
case ID_SLIDER_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;
}
}
void MainTask(void)
{
WM_HWIN hDlg;
/* 3õê¼»ˉ emWin */
GUI_Init();
/* êó±ê */
GUI_CURSOR_Show();
/* ′′½¨′°¿ú2¢è¡′°¿ú¾ä±ú */
hDlg=CreateFramewin();
while(1)
{
WM_SendMessageNoPara(WM_GetClientWindow(hDlg), WM_UPDATE);
GUI_Delay(1000);
}
}
LED0一直不变,但是LED1可以改变,一直没有进入WM_PAINT
|
|