void GUIDEMO_Graph(void) { GUIDEMO_ShowIntro("Drawing a graph", "\nOptimized drawing routine for" "\ndrawing graph data"); GUI_Clear(); _Label(); _DemoRandomGraph(); GUIDEMO_NotifyStartNext(); _DemoSineWave(); GUIDEMO_NotifyStartNext(); _DemoOrData(); }
/******************************************************************* * * _DemoBringToBottom Demonstrates the use of WM_BringToBottom */ static void _DemoBringToBottom(void) { _ChangeInfoText("WM_BringToBottom()"); // GUIDEMO_Delay(SPEED); WM_BringToBottom(_hWindow1); GUIDEMO_Delay(SPEED); GUIDEMO_NotifyStartNext(); }
void GUIDEMO_ShowIntro(const char * s, const char * sExp) { GUI_CONTEXT ContextOld; GUI_SaveContext(&ContextOld); _sInfo = s; _sExplain = sExp; GUI_SetDefault(); GUIDEMO_HideInfoWin(); GUI_SetBkColor(GUI_BLUE); GUI_SetColor(GUI_WHITE); GUI_Clear(); //GUI_SetFont(&GUI_FontComic18B_ASCII); GUI_SetFont(&GUI_FontHZ12); GUI_DispStringHCenterAt(s, LCD_GET_XSIZE() / 2, LCD_GET_YSIZE() / 3 - 10); if (_sExplain) { GUI_SetFont(&GUI_Font8_ASCII); GUI_DispStringHCenterAt(_sExplain, LCD_GET_XSIZE() / 2, LCD_GET_YSIZE() / 2 - 10); } GUIDEMO_Delay(_sExplain ? 2000 : 4000); #if GUI_WINSUPPORT _UpdateInfoWin(); _UpdateCmdWin(); #endif GUI_RestoreContext(&ContextOld); #if GUI_WINSUPPORT WM_ExecIdle(); #endif GUIDEMO_NotifyStartNext(); GUI_SetBkColor(GUI_RED); GUI_Clear(); }
void GUIDEMO_WM(void) { /* Show message */ /* GUIDEMO_ShowIntro("Windows Manager", "\nExamples for the" "\nWindows manager"); */ GUIDEMO_NotifyStartNext(); GUI_SetBkColor(GUI_BLACK); GUI_Clear(); WM_SetCreateFlags(WM_CF_MEMDEV); WM_EnableMemdev(WM_HBKWIN); GUIDEMO_HideInfoWin(); _DemoSetDesktopColor(); _DemoCreateWindow(); _DemoCreateWindowAsChild(); _DemoInvalidateWindow(); _DemoBringToTop(); _DemoMoveTo(); _DemoBringToBottom(); _DemoMoveWindow(); _DemoHideShowParent(); _DemoHideShowChild(); //_DemoClipping(); _DemoRedrawing(); _DemoResizeWindow(); _DemoSetCallback(); _DemoDeleteWindow(); }
/******************************************************************* * * _DemoResizeWindow Demonstrates the use of WM_ResizeWindow */ static void _DemoResizeWindow(void) { int i, tm,tDiff; _ChangeInfoText("WM_ResizeWindow()"); // GUIDEMO_Delay(SPEED); _LiftUp(30); for (i = 0; i < 40; i++) { tm = GUI_GetTime(); WM_ResizeWindow(_hWindow1, 1, 1); WM_ResizeWindow(_hWindow2, -1, -1); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } for (i = 0; i < 80; i++) { tm = GUI_GetTime(); WM_ResizeWindow(_hWindow1, -1, -1); WM_ResizeWindow(_hWindow2, 1, 1); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } for (i = 0; i < 40; i++) { tm = GUI_GetTime(); WM_ResizeWindow(_hWindow1, 1, 1); WM_ResizeWindow(_hWindow2, -1, -1); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } _LiftDown(30); GUIDEMO_Delay(SPEED); GUIDEMO_NotifyStartNext(); }
void GUIDEMO_Graph(void) { #if GUIDEMO_LARGE _YSize = (LCD_YSIZE - 100); #else _YSize = (LCD_YSIZE - 30); #endif GUIDEMO_ShowIntro("Drawing a graph", "\nOptimized drawing routine" "\nfor drawing graph data"); GUI_Clear(); _Label(); _DemoRandomGraph(); GUIDEMO_NotifyStartNext(); _DemoSineWave(); GUIDEMO_NotifyStartNext(); _DemoOrData(); }
/******************************************************************* * * _DemoInvalidateWindow Demonstrates the use of WM_InvalidateWindow */ static void _DemoInvalidateWindow(void) { _ChangeInfoText("WM_InvalidateWindow()"); _WindowColor1 = GUI_BLUE; // GUIDEMO_Delay(SPEED); WM_InvalidateWindow(_hWindow1); GUIDEMO_Delay(SPEED); GUIDEMO_NotifyStartNext(); }
/******************************************************************* * * _DemoHideShowChild Demonstrates the use of WM_HideWindow and WM_ShowWindow */ static void _DemoHideShowChild(void) { _ChangeInfoText("WM_HideWindow(Child)"); // GUIDEMO_Delay(SPEED); WM_HideWindow(_hChild); GUIDEMO_Delay(SPEED); _ChangeInfoText("WM_ShowWindow(Child)"); GUIDEMO_Delay(SPEED); WM_ShowWindow(_hChild); GUIDEMO_Delay(SPEED); GUIDEMO_NotifyStartNext(); }
static void _ShowJapaneseSample(void) { int i; _Label("Japanese text\nmixed with\nASCIItext"); GUI_SetFont(&_FontSJIS16); for (i=0;i<sizeof(_apSJIS)/sizeof(_apSJIS[0]);i++) { GUI_DispStringHCenterAt(_apSJIS[i], LCD_GetXSize() / 2, _GetYPos() + 20); GUI_DispNextLine(); } GUIDEMO_Wait(); GUIDEMO_NotifyStartNext(); }
void GUIDEMO_Graph(void) { _YSize = (LCD_GetYSize() - 100); GUIDEMO_ShowIntro("Drawing a graph", "\nOptimized drawing routine" "\nfor drawing graph data"); GUI_Clear(); _Label(); _DemoRandomGraph(); GUIDEMO_NotifyStartNext(); _DemoSineWave(); }
/******************************************************************* * * _DemoCreateWindow Demonstrates the use of WM_CreateWindow */ static void _DemoCreateWindow(void) { /* Set callback for background window */ _cbBkWindowOld = WM_SetCallback(WM_HBKWIN, _cbBkWindow); /* Create windows */ _ChangeInfoText("WM_CreateWindow()"); // GUIDEMO_Delay(SPEED); _hWindow1 = WM_CreateWindow( 50, 70, 165, 100, WM_CF_SHOW | WM_CF_MEMDEV, _cbWindow1, 0); GUIDEMO_Delay(SPEED/3); _hWindow2 = WM_CreateWindow(105, 125, 165, 100, WM_CF_SHOW | WM_CF_MEMDEV, _cbWindow2, 0); GUIDEMO_Delay(SPEED); GUIDEMO_NotifyStartNext(); }
static void _ShowFonts(const char *s, const char *pMessage, const GUI_FONT **pPropFonts) { int i; _Label(s); GUI_GotoXY(0, _GetYPos()); for (i=0;pPropFonts[i];i++) { GUI_SetFont(pPropFonts[i]); GUI_DispString(pMessage); GUI_DispNextLine(); } GUIDEMO_Wait(); GUIDEMO_NotifyStartNext(); }
void GUIDEMO_Messagebox(void) { GUI_COLOR Color; GUIDEMO_ShowIntro("Message boxes", "Message boxes" "\ncan easily be created"); Color = WM_SetDesktopColor(GUI_RED); GUI_MessageBox("Message", "Text", 0); GUI_Delay(1000); GUI_MessageBox("2. Message", "Text", 0); GUI_Delay(1000); WM_SetDesktopColor(Color); GUIDEMO_NotifyStartNext(); }
/******************************************************************* * * _DemoSetDesktopColor Demonstrates the use of WM_SetDesktopColor */ static void _DemoSetDesktopColor(void) { GUI_SetBkColor(GUI_BLUE); GUI_Clear(); _DrawInfoText("WM_SetDesktopColor()"); // GUIDEMO_Delay(SPEED*2); WM_SetDesktopColor(GUI_BLACK); GUIDEMO_Delay(SPEED/2); /* Set background color and invalidate desktop color. This is needed for the later redrawing demo. */ GUI_SetBkColor(GUI_BLACK); WM_SetDesktopColor(GUI_INVALID_COLOR); GUIDEMO_NotifyStartNext(); }
void GUIDEMO_Speed(void) { int t = GUI_GetTime(); int i = 0; int XSize = LCD_GET_XSIZE(); int YSize = LCD_GET_YSIZE(); I32 NumPixels=0; U16 aColorIndex[8]; GUIDEMO_ShowIntro("High speed", "Multi layer clipping" "\nHighly optimized drivers" ); for (i = 0; i< 8; i++) { aColorIndex[i] = GUI_Color2Index(_aColor[i]); } for (i = 0; (((t + 8000) - (int)GUI_GetTime()) > 0) && !GUIDEMO_CheckCancel(); i++) { GUI_RECT r; GUI_SetColorIndex(aColorIndex[i&7]); /* Calculate random positions */ r.x0 = rand() % XSize - XSize / 2; r.y0 = rand() % YSize - YSize / 2; r.x1 = r.x0 + rand() % XSize; r.y1 = r.y0 + rand() % YSize; GUI_FillRect(r.x0, r.y0, r.x1, r.y1); /* Clip rectangle to visible area and add the number of pixels (for speed computation) */ if (r.x1 >= XSize) r.x1 = XSize - 1; if (r.y1 >= YSize) r.y1 = YSize - 1; if (r.x0 < 0 ) r.x0 = 0; if (r.y1 < 0) r.y1 = 0; NumPixels += (r.x1 - r.x0) * (r.y1 - r.y0); /* Allow short breaks so we do not use all available CPU time ... */ } t = (GUI_GetTime() - t) / 100; GUI_Clear(); GUIDEMO_NotifyStartNext(); #if GUIDEMO_LARGE GUI_SetFont(&GUI_FontComic24B_ASCII); #else GUI_SetFont(&GUI_Font16B_ASCII); #endif GUI_SetColor(GUI_WHITE); GUI_DispStringAt("Pixels/sec: ", 10, (LCD_GetYSize() - GUI_GetFontSizeY()) / 2); if (t == 0) t++; GUI_DispDecMin(10 * (NumPixels / t)); GUIDEMO_Wait(); }
/******************************************************************* * * _DemoRedrawing Demonstrates how useful can be a callback */ static void _DemoRedrawing(void) { int i, tm, tDiff; _ChangeInfoText("Demonstrating redrawing"); // GUIDEMO_Delay(SPEED); _LiftUp(40); GUIDEMO_Delay(SPEED/3); _ChangeInfoText("Using a callback for redrawing"); GUIDEMO_Delay(SPEED/3); for (i = 0; i < 55; i++) { tm = GUI_GetTime(); WM_MoveWindow(_hWindow1, 1, 1); WM_MoveWindow(_hWindow2, -1, -1); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } for (i = 0; i < 55; i++) { tm = GUI_GetTime(); WM_MoveWindow(_hWindow1, -1, -1); WM_MoveWindow(_hWindow2, 1, 1); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } GUIDEMO_Delay(SPEED/4); _LiftDown(30); GUIDEMO_Delay(SPEED/2); _ChangeInfoText("Without redrawing"); GUIDEMO_Delay(SPEED); _LiftUp(30); GUIDEMO_Delay(SPEED/4); WM_SetCallback(WM_HBKWIN, _cbBkWindowOld); for (i = 0; i < 55; i++) { tm = GUI_GetTime(); WM_MoveWindow(_hWindow1, 1, 1); WM_MoveWindow(_hWindow2, -1, -1); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } for (i = 0; i < 55; i++) { tm = GUI_GetTime(); WM_MoveWindow(_hWindow1, -1, -1); WM_MoveWindow(_hWindow2, 1, 1); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } GUIDEMO_Delay(SPEED/3); WM_SetCallback(WM_HBKWIN, _cbBkWindow); _LiftDown(40); GUIDEMO_Delay(SPEED); GUIDEMO_NotifyStartNext(); }
/********************************************************************* * * _ShowGraph */ static void _ShowGraph(GRAPH_Handle hGraph, GRAPH_DATA_Handle hData[], int DataCount, void (* pfAddData)(GRAPH_DATA_Handle hData, int DataID)) { int Data_xSize; int NextState; int TimeStart; int TimeDiff; int TimeStep; int Count; int xSize; int i; xSize = LCD_GetXSize(); Data_xSize = xSize - (DIST_TO_BORDER << 1) - (BORDER_LEFT + BORDER_RIGHT); Count = 0; // // Attach data objects // for (i = 0; i < DataCount; i++) { GRAPH_AttachData(hGraph, hData[i]); } // // Add values before GRAPH is displayed // while (Count < Data_xSize) { for (i = 0; i < DataCount; i++) { pfAddData(hData[i], i); } Count++; } // // Add values depending on time // TimeStart = GUIDEMO_GetTime(); do { TimeDiff = GUIDEMO_GetTime() - TimeStart; for (i = 0; i < DataCount; i++) { pfAddData(hData[i], i); } NextState = GUIDEMO_CheckCancel(); TimeStep = GUIDEMO_GetTime() - TimeStart; if ((TimeStep - TimeDiff) < TIME_STEP) { GUI_Delay(TIME_STEP - (TimeStep - TimeDiff)); } } while ((TimeDiff < TIME_RUN) && (NextState == 0)); for (i = 0; i < DataCount; i++) { GRAPH_DetachData(hGraph, hData[i]); } GUIDEMO_NotifyStartNext(); }
/******************************************************************* * * _DemoCreateWindowAsChild Demonstrates the use of WM_CreateWindowAsChild */ static void _DemoCreateWindowAsChild(void) { /* Create windows */ _ChangeInfoText("WM_CreateWindowAsChild()"); // GUIDEMO_Delay(SPEED); /* _hMEdit = MULTIEDIT_Create(10, 50, 145, 40, _hWindow2, 10, WM_CF_SHOW | WM_CF_MEMDEV, MULTIEDIT_CF_AUTOSCROLLBAR_V, "This is a test of multi edit box\n", 200); */ // MULTIEDIT_SetAutoScrollV(_hMEdit, 1); _hChild = WM_CreateWindowAsChild(10, 50, 145, 40, _hWindow2, WM_CF_SHOW | WM_CF_MEMDEV, _cbChild, 0); GUIDEMO_Delay(SPEED); GUIDEMO_NotifyStartNext(); }
/******************************************************************* * * _DemoHideShowParent Demonstrates the use of WM_HideWindow and WM_ShowWindow */ static void _DemoHideShowParent(void) { _ChangeInfoText("WM_HideWindow(Parent)"); // GUIDEMO_Delay(SPEED); WM_HideWindow(_hWindow2); GUIDEMO_Delay(SPEED/3); WM_HideWindow(_hWindow1); GUIDEMO_Delay(SPEED); _ChangeInfoText("WM_ShowWindow(Parent)"); GUIDEMO_Delay(SPEED); WM_ShowWindow(_hWindow1); GUIDEMO_Delay(SPEED/3); WM_ShowWindow(_hWindow2); GUIDEMO_Delay(SPEED); GUIDEMO_NotifyStartNext(); }
void GUIDEMO_Touch(void) { #define ID_KEYBOARD 1 #define ID_TESTCAL 2 #define ID_CALIBRATE 3 int i, r; int XSize = LCD_GetXSize(); int YSize = LCD_GetYSize(); int XMid = XSize / 2; int YMid = YSize / 2; GUIDEMO_NotifyStartNext(); GUIDEMO_HideInfoWin(); do { GUI_RECT rText;/*= {0, 80, XSize, 120};*/ BUTTON_Handle ahButton[3]; rText.x0=0; rText.y0=80; rText.x1=XSize; rText.y1=120; GUI_SetBkColor(GUI_BLUE); GUI_Clear(); GUI_DrawBitmap(&bmSeggerLogoBlue, (XSize - 1 - bmSeggerLogoBlue.XSize) / 2, 15); GUI_SetFont(&GUI_FontComic18B_ASCII); GUI_DispStringInRect("emWin Touch screen demo", &rText, GUI_TA_HCENTER | GUI_TA_VCENTER); ahButton[0] = BUTTON_Create( XMid - 50, YMid - 20, 100, 50, ID_CALIBRATE,BUTTON_CF_SHOW ); ahButton[1] = BUTTON_Create( XMid - 90, YMid + 40, 80, 30, ID_KEYBOARD, BUTTON_CF_SHOW ); ahButton[2] = BUTTON_Create( XMid + 10, YMid + 40, 80, 30, ID_TESTCAL,BUTTON_CF_SHOW ); BUTTON_SetText (ahButton[0], "Calibrate"); BUTTON_SetBkColor(ahButton[0], 0, GUI_RED); BUTTON_SetText (ahButton[1], "Keyboard"); BUTTON_SetText (ahButton[2], "Test calibration"); BUTTON_SetFont(ahButton[0], &GUI_FontComic18B_ASCII); r = GUIDEMO_WaitKey(); if (r==0) { r = ID_KEYBOARD; BUTTON_SetState(ahButton[1], BUTTON_STATE_PRESSED); GUIDEMO_Delay(500); } for (i=0; i< countof(ahButton); i++) { BUTTON_Delete(ahButton[i]); } switch (r) { case ID_KEYBOARD: r= _ExecKeyboard(); break; case ID_CALIBRATE: _ExecCalibration(); break; case ID_TESTCAL: _TestCalibration(); break; } } while (r && (r!='n') && (r!='N')); }
void GUIDEMO_Cursor(void) { int i = 0; GUIDEMO_ShowIntro("Cursor", "\nuC/GUI supports" "\nsoftware cursor"); GUI_SetBkColor(GUI_BLUE); GUI_Clear(); _DispCursor(); GUIDEMO_Delay(2000); GUIDEMO_NotifyStartNext(); GUI_CURSOR_Show(); for ( i = 0;(i < countof(_aCursor) && !GUIDEMO_CheckCancel()); i++) { _MoveCursor(_aCursor[i]); } GUI_CURSOR_SetPosition(0,0); GUI_CURSOR_Select(&GUI_CursorArrowM); }
/******************************************************************* * * _DemoSetCallback Demonstrates the use of WM_SetCallback */ static void _DemoSetCallback(void) { _ChangeInfoText("WM_SetCallback()"); // GUIDEMO_Delay(SPEED); WM_SetCallback(_hWindow1, _cbDemoCallback1); WM_InvalidateWindow(_hWindow1); GUIDEMO_Delay(SPEED/2); WM_SetCallback(_hWindow2, _cbDemoCallback2); WM_InvalidateWindow(_hWindow2); GUIDEMO_Delay(SPEED*3); WM_SetCallback(_hWindow1, _cbWindow1); WM_InvalidateWindow(_hWindow1); GUIDEMO_Delay(SPEED/2); WM_SetCallback(_hWindow2, _cbWindow2); WM_InvalidateWindow(_hWindow2); GUIDEMO_Delay(SPEED); GUIDEMO_NotifyStartNext(); }
/********************************************************************* * * GUIDEMO_Dialog */ void GUIDEMO_Dialog(void) { int i; WM_HWIN hWin; GUI_COLOR DesktopColorOld; GUIDEMO_ShowIntro("Dialog boxes", "\nDialog boxes\ncan easily be created"); GUIDEMO_HideInfoWin(); DesktopColorOld = WM_SetDesktopColor(GUI_RED); /* Automatically update desktop window */ hWin = GUI_CreateDialogBox(aDialogCreate, GUI_COUNTOF(aDialogCreate), _cbCallback, 0, 0, 0); for (i = 0; i < GUI_COUNTOF(_aID); i++) { GUIDEMO_Delay(_aID[i].Time); GUI_SendKeyMsg(_aID[i].Id, 1); /* 把消息发送至指定键,把键盘数据发送到输入焦点所在窗口,1表示放开状态 */ } #if !(GUIDEMO_TINY) #if !(GUIDEMO_LARGE) if (LCD_GetYSize() < 120) { } else #endif { GUIDEMO_Delay(1000); for (i = 0; i <= 100; i += 10) { if (WM_IsWindow(hWin)) { /* 确定指定句柄是否是有效的窗口句柄,0:句柄不是有效的窗口句柄,1:句柄是有效的窗口句柄 */ SLIDER_SetValue(WM_GetDialogItem(hWin, GUI_ID_SLIDER0), i); /* 返回对话框项目(小工具)的窗口句柄, 设置滑动条的当前值 */ } GUIDEMO_Delay(100); } } #endif GUIDEMO_Delay(800); if (WM_IsWindow(hWin)) { WM_MoveTo(hWin, 20, 20); /* 将指定窗口移动到某个位置。 */ GUIDEMO_Delay(500); } if (WM_IsWindow(hWin)) { WM_MoveTo(hWin, 60, 20); GUIDEMO_Delay(800); } /* Cleanup ... */ if (WM_IsWindow(hWin)) { WM_DeleteWindow(hWin); /* 删除窗口。 */ } GUIDEMO_NotifyStartNext(); WM_SetDesktopColor(DesktopColorOld); /* Restore old settings */ }
/********************************************************************* * * GUIDEMO_Dialog */ void GUIDEMO_Dialog(void) { int i; WM_HWIN hWin; GUI_COLOR DesktopColorOld; GUIDEMO_ShowIntro("Dialog boxes", "\nDialog boxes\ncan easily be created"); GUIDEMO_HideInfoWin(); DesktopColorOld = GUIDEMO_SetBkColor(GUI_RED); DesktopColorOld = WM_SetDesktopColor(DesktopColorOld); /* Automatically update desktop window */ hWin = GUI_CreateDialogBox(aDialogCreate, GUI_COUNTOF(aDialogCreate), _cbCallback, 0, 0, 0); for (i = 0; i < GUI_COUNTOF(_aID); i++) { GUIDEMO_Delay(_aID[i].Time); GUI_SendKeyMsg(_aID[i].Id, 1); } #if !(GUIDEMO_TINY) #if !(GUIDEMO_LARGE) if (LCD_GetYSize() < 120) { } else #endif { GUIDEMO_Delay(1000); for (i = 0; i <= 100; i += 10) { if (WM_IsWindow(hWin)) { SLIDER_SetValue(WM_GetDialogItem(hWin, GUI_ID_SLIDER0), i); } GUIDEMO_Delay(100); } } #endif GUIDEMO_Delay(800); if (WM_IsWindow(hWin)) { WM_MoveTo(hWin, 20, 20); GUIDEMO_Delay(500); } if (WM_IsWindow(hWin)) { WM_MoveTo(hWin, 60, 20); GUIDEMO_Delay(800); } /* Cleanup ... */ if (WM_IsWindow(hWin)) { WM_DeleteWindow(hWin); } GUIDEMO_NotifyStartNext(); WM_SetDesktopColor(DesktopColorOld); /* Restore old settings */ }
/******************************************************************* * * _DemoMoveTo Demonstrates the use of WM_MoveTo */ static void _DemoMoveTo(void) { int i, tm, tDiff; _ChangeInfoText("WM_MoveTo()"); // GUIDEMO_Delay(SPEED); for (i = 1; i < 56; i++) { tm = GUI_GetTime(); WM_MoveTo(_hWindow1, 50 + i, 70 + i); WM_MoveTo(_hWindow2, 105 - i, 125 - i); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } for (i = 1; i < 56; i++) { tm = GUI_GetTime(); WM_MoveTo(_hWindow1, 105 - i, 125 - i); WM_MoveTo(_hWindow2, 50 + i, 70 + i); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } GUIDEMO_Delay(SPEED); GUIDEMO_NotifyStartNext(); }
/******************************************************************* * * _DemoMoveWindow Demonstrates the use of WM_MoveWindow */ static void _DemoMoveWindow(void) { int i, tm, tDiff; _ChangeInfoText("WM_MoveWindow()"); // GUIDEMO_Delay(SPEED); for (i = 0; i < 55; i++) { tm = GUI_GetTime(); WM_MoveWindow(_hWindow1, 1, 1); WM_MoveWindow(_hWindow2, -1, -1); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } for (i = 0; i < 55; i++) { tm = GUI_GetTime(); WM_MoveWindow(_hWindow1, -1, -1); WM_MoveWindow(_hWindow2, 1, 1); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } GUIDEMO_Delay(SPEED); GUIDEMO_NotifyStartNext(); }
static void _ShowCharacters(const char*s, const GUI_FONT* pFont, int IncX) { int i; int ix=0, y; int FontSizeY; GUI_SetFont(pFont); FontSizeY = GUI_GetFontSizeY(); _Label(s); GUI_SetFont(pFont); y = _GetYPos(); for (i = 0; i < 20000; i++) { if (GUI_IsInFont(NULL, (U16)i)) { GUI_GotoXY(ix * IncX, y); if (ix++ > 20) { ix = 0; y += FontSizeY; } GUI_DispChar((U16)i); } } GUIDEMO_Delay(2000); GUIDEMO_NotifyStartNext(); }
/******************************************************************* * * _DemoClipping Demonstrates clipping at parent borders */ static void _DemoClipping(void) { int i, tm, tDiff; _ChangeInfoText("Demonstrating clipping of child"); // GUIDEMO_Delay(SPEED); for (i = 0; i < 25; i++) { tm = GUI_GetTime(); WM_MoveWindow(_hChild, 1, 0); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } for (i = 0; i < 25; i++) { tm = GUI_GetTime(); WM_MoveWindow(_hChild, 0, 1); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } for (i = 0; i < 50; i++) { tm = GUI_GetTime(); WM_MoveWindow(_hChild, -1, 0); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } for (i = 0; i < 25; i++) { tm = GUI_GetTime(); WM_MoveWindow(_hChild, 0, -1); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } for (i = 0; i < 25; i++) { tm = GUI_GetTime(); WM_MoveWindow(_hChild, 1, 0); tDiff = 15 - (GUI_GetTime() - tm); GUI_Delay(tDiff); } GUIDEMO_Delay(SPEED); GUIDEMO_NotifyStartNext(); }
void GUIDEMO_ShowInternationalFonts(void) { GUIDEMO_ShowIntro("International fonts", "uC/GUI supports UNICODE" "\n(all characters)and" "\nShift JIS (Japan)" ); /* Show japanese text */ _ShowJapaneseSample(); /* Show some character sets */ _ShowCharacters("ASCII characters\n& European\nextensions", &GUI_Font13_1, 13); _ShowCharacters("Hiragana &\nKatakana", &GUI_Font16_HK, 16); /* Show fonts */ _ShowFonts("Proportional\nFonts", "FontConverter available to create your own fonts...", _apPropFonts); _ShowFonts("Monospaced\nFonts", "Fonts with fixed character width...", _apMonoFonts); _ShowFonts("Digits", "\n+- 0.1234", _apDigitFonts); /* Show alignments */ GUIDEMO_NotifyStartNext(); }
/********************************************************************* * * GUIDEMO_Wait * * This function has to be called if the current step is a static * frame and another step will follow */ void GUIDEMO_Wait(int TimeWait) { GUIDEMO_Delay(TimeWait); GUIDEMO_NotifyStartNext(); }