/******************************************************************* * * MainTask * ******************************************************************** */ void MainTask_AppCalendar(void) { WM_HWIN hWinCalendar; u32 curtimestamp = 0; struct tm currUtime; //Init Time curtimestamp = Time_GetRTCTimeByUnix(); currUtime = Time_ConvUnixToCalendar(curtimestamp); cldDate.year = currUtime.tm_year; cldDate.month = currUtime.tm_mon+1; cldDate.day = currUtime.tm_mday; if (currUtime.tm_wday == 0) cldDate.weekday = 7; else cldDate.weekday = currUtime.tm_wday; //GUI_Init(); hWinCalendar = WM_CreateWindow(320, 0, 320, 240, WM_CF_SHOW, _cbCalendar, 0); WM_SetFocus(hWinCalendar); _MoveShiftWindow(&hWinCalendar, MEMDEV_ANIMATION_LEFT, WM_Shift_ToLCD, 0); WM_EnableMemdev(hWinCalendar); _ShowButton(hWinCalendar); while (!GUI_CheckCancel(APP_Calendar)) { //GUI_Delay(10); GUI_Exec(); GUI_X_ExecIdle(); } WM_DeleteWindow(hWinCalendar); hWinCalendar = 0; }
/******************************************************************* * * _GUI_Task * * Function description * This task does the background processing. * The MainTask job is to update invalid windows, but other things such as * evaluating mouse or touch input may also be done. */ static void _GUI_Task(void) { DELAY(500); while(1) { GUI_Exec(); // Do the background work ... Update windows etc.) GUI_X_ExecIdle(); // Nothing left to do for the moment ... Idle processing } }
void MainTask_DeskTop(void) { int i; WM_HWIN Win1,Button1,Button2; GUI_Init(); FS_Init(); AddRelateFile("TXT","文本",_DemoMultiedit); AddRelateFile("MP3","音乐",_DemoMp3); // ucfs_sim_init(); // Win1 = WM_CreateWindow(0,0,480,270,WM_CF_SHOW,NULL,0); Win1 = WM_CreateWindow(0,0,480,272,WM_CF_SHOW,_cbWindow1,0); //houhh 20061024... WM_SelectWindow(Win1); #if 1 GUI_SetColor(GUI_WHITE); GUI_SetBkColor(GUI_BLUE); GUI_SetFont(&GUI_FontHZ12); GUI_Clear(); #endif CreateButton(Win1,pButton,480,272); while (1) { if (!GUI_Exec()) GUI_X_ExecIdle(); } // ucfs_sim_deinit(); }