/******************************************************************* * * MainTask */ void MainTask(void) { int xPos; int yPos; int xSize; int i; i = 0; GUI_Init(); // // Check if recommended memory for the sample is available // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) { GUI_ErrorOut("Not enough memory available."); return; } xPos = LCD_GetXSize() / 2; yPos = LCD_GetYSize() / 3; GUI_SetTextMode(GUI_TM_REV); GUI_SetFont(GUI_FONT_20F_ASCII); GUI_DispStringHCenterAt("Hello world!", xPos, yPos); GUI_SetFont(GUI_FONT_D24X32); xSize = GUI_GetStringDistX("0000"); xPos -= xSize / 2; yPos += 24 + 10; while (1) { GUI_DispDecAt( i++, xPos, yPos, 4); if (i > 9999) { i = 0; } } }
/********************************************************************* * * MainTask */ void MainTask(void) { WM_SetCreateFlags(WM_CF_MEMDEV); // Use memory devices on all windows to avoid flicker GUI_Init(); // // Check if recommended memory for the sample is available // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) { GUI_ErrorOut("Not enough memory available."); return; } AzimuthalMotor.dutyCycle(0); AzimuthalMotor.start(); VerticalMotor.dutyCycle(0); VerticalMotor.start(); ClawMotor.dutyCycle(0); ClawMotor.start(); WM_SetCallback(WM_HBKWIN, _cbBkWindow); while (1) { GUI_ExecDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbCallback, 0, 0, 0); GUI_Delay(1000); } }
/********************************************************************* * * MainTask */ void MainTask(void) { GUI_Init(); // // Check if recommended memory for the sample is available // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) { GUI_ErrorOut("Not enough memory available."); return; } #if GUI_SUPPORT_MEMDEV WM_SetCreateFlags(WM_CF_MEMDEV); #endif WM_SetCallback(WM_HBKWIN, &_cbBkWindow); // // Create message box and wait until it is closed // while (1) { GUI_MessageBox("This text is shown\nin a message box", "Caption/Title", GUI_MESSAGEBOX_CF_MOVEABLE); GUI_Delay(750); // Wait for a short moment ... GUI_MessageBox("New message !", "Caption/Title", GUI_MESSAGEBOX_CF_MOVEABLE); GUI_Delay(750); } }
/********************************************************************* * * MainTask */ void CreateWindow(void) { WM_HWIN hMultiPage; WM_HWIN hFrameWin; WM_HWIN hDialog; // // Check if recommended memory for the sample is available // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) { GUI_ErrorOut("Not enough memory available."); return; } WM_SetCallback(WM_HBKWIN, _cbBkWindow); // // Create the frame window // hFrameWin = FRAMEWIN_Create("Sample", NULL, WM_CF_SHOW, 0, 0, 240, 152); FRAMEWIN_SetClientColor(hFrameWin, GUI_GREEN); FRAMEWIN_SetActive(hFrameWin, 1); FRAMEWIN_SetMoveable(hFrameWin, 1); // // Create the MULTIPAGE widget // hMultiPage = MULTIPAGE_CreateEx(7, 6, 220, 120, WM_GetClientWindow(hFrameWin), WM_CF_SHOW, 0, 0); GUI_Delay(500); // // Create and attach the MULTIPAGE dialog windows // hDialog = GUI_CreateDialogBox(_aDialogCreate1, GUI_COUNTOF(_aDialogCreate1), NULL, WM_UNATTACHED, 0, 0); MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 1"); GUI_Delay(500); hDialog = GUI_CreateDialogBox(_aDialogCreate2, GUI_COUNTOF(_aDialogCreate2), NULL, WM_UNATTACHED, 0, 0); MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 2"); GUI_Delay(500); hDialog = GUI_CreateDialogBox(_aDialogCreate3, GUI_COUNTOF(_aDialogCreate3), NULL, WM_UNATTACHED, 0, 0); MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 3"); GUI_Delay(500); hDialog = GUI_CreateDialogBox(_aDialogCreate4, GUI_COUNTOF(_aDialogCreate4), _cbDialog4, WM_UNATTACHED, 0, 0); MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 4"); GUI_Delay(500); hDialog = GUI_CreateDialogBox(_aDialogCreate5, GUI_COUNTOF(_aDialogCreate5), NULL, WM_UNATTACHED, 0, 0); MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 5"); GUI_Delay(500); hDialog = GUI_CreateDialogBox(_aDialogCreate6, GUI_COUNTOF(_aDialogCreate6), NULL, WM_UNATTACHED, 0, 0); MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 6"); GUI_Delay(500); // // Demonstrate the use of MULTIPAGE_SetAlign // MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_RIGHT); GUI_Delay(500); MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_RIGHT | MULTIPAGE_ALIGN_BOTTOM); GUI_Delay(500); MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_LEFT | MULTIPAGE_ALIGN_BOTTOM); while (1) { GUI_Delay(100); } }
/********************************************************************* * * GUI_ErrorOut1 */ void GUI_ErrorOut1(const char *s, int p0) { char ac[MAXLEN + 10]; char* sOut = ac; GUI_MEMSET((U8*)ac, 0, sizeof(ac)); _CopyString(ac, s, MAXLEN); sOut += strlen(sOut); GUI__AddSpaceHex(p0, 8, &sOut); GUI_ErrorOut(ac); }
void GUI_ErrorOut1(const char *s, int p0) { char ac[50 + 10]; char* sOut = ac; memset(ac, 0, sizeof(ac)); strncpy(ac, s, 49); sOut += strlen(sOut); GUI__AddSpaceHex(p0, 8, &sOut); GUI_ErrorOut(ac); }
/********************************************************************* * * MainTask */ void MainTask(void) { int Index; GUI_Init(); // // Check if recommended memory for the sample is available // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) { GUI_ErrorOut("Not enough memory available."); return; } #if GUI_SUPPORT_MEMDEV WM_SetCreateFlags(WM_CF_MEMDEV); #endif WM_SetDesktopColor(GUI_BLACK); // // Initialize the temperature arrays // _InitRandomData(_aTemp1, GUI_COUNTOF(_aTemp1)); _InitRandomData(_aTemp2, GUI_COUNTOF(_aTemp2)); // // Execute the intro dialog // GUI_ExecDialogBox(_aDialogIntro, GUI_COUNTOF(_aDialogIntro), _cbDialogIntro, WM_HBKWIN, 0, 0); // // Execute the color and the temperature dialog // _hDialogColor = GUI_CreateDialogBox(_aDialogColor, GUI_COUNTOF(_aDialogColor), _cbDialogColor, WM_HBKWIN, 0, 0); _hDialogMain = GUI_CreateDialogBox(_aDialogMain, GUI_COUNTOF(_aDialogMain), _cbDialogMain, WM_HBKWIN, 0, 0); // // Add new temperatures... // Index = GUI_COUNTOF(_aTemp1) - 1; while (1) { WM_HWIN hItem; GUI_Delay(100); // Wait a while // // Shift the color arrays // memmove(_aTemp1, _aTemp1 + 1, sizeof(_aTemp1) - 2); memmove(_aTemp2, _aTemp2 + 1, sizeof(_aTemp2) - 2); // // Add new values // _aTemp1[Index] = _GetRandomValue(_aTemp1[Index - 1]); _aTemp2[Index] = _GetRandomValue(_aTemp2[Index - 1]); // // Update windows // hItem = WM_GetClientWindow(WM_GetDialogItem(_hDialogMain, ID_TEMPERATURE)); WM_InvalidateWindow(hItem); _SetProgbarValue(GUI_ID_PROGBAR0, _aTemp1[Index]); _SetProgbarValue(GUI_ID_PROGBAR1, _aTemp2[Index]); } }
/********************************************************************* * * GUI_ErrorOut4 */ void GUI_ErrorOut4(const char *s, int p0, int p1, int p2, int p3) { char ac[MAXLEN + 40] = {0}; char* sOut = ac; GUI_MEMSET((U8*)ac, 0, sizeof(ac)); _CopyString(ac, s, MAXLEN); sOut += strlen(sOut); GUI__AddSpaceHex(p0, 8, &sOut); GUI__AddSpaceHex(p1, 8, &sOut); GUI__AddSpaceHex(p2, 8, &sOut); GUI__AddSpaceHex(p3, 8, &sOut); GUI_ErrorOut(ac); }
void GUI_ErrorOut4(const char *s, int p0, int p1, int p2, int p3) { char ac[50 + 40] = {0}; char* sOut = ac; memset(ac, 0, sizeof(ac)); strncpy(ac, s, 49); sOut += strlen(sOut); GUI__AddSpaceHex(p0, 8, &sOut); GUI__AddSpaceHex(p1, 8, &sOut); GUI__AddSpaceHex(p2, 8, &sOut); GUI__AddSpaceHex(p3, 8, &sOut); GUI_ErrorOut(ac); }
/********************************************************************* * * MainTask */ void MainTask(void) { WM_SetCreateFlags(WM_CF_MEMDEV); GUI_Init(); // // Check if recommended memory for the sample is available // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) { GUI_ErrorOut("Not enough memory available."); return; } _DemoTransWindow(); }
void MainTask(void) { static GUI_PID_STATE OldState; GUI_PID_STATE CurrentState; int tEnd; GUI_Init(); BUTTON_SetReactOnLevel(); // // Check if recommended memory for the sample is available // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) { GUI_ErrorOut("Not enough memory available."); return; } do { WM_HWIN hButton0, hButton1; WM_SetCallback(WM_HBKWIN, _cbBkWin); hButton0 = _CreateButton(100, 220, 170, 150, 5, 25, "Dashboard" , &bmDashboard , GUI_ID_BUTTON0); hButton1 = _CreateButton(370, 220, 170, 150, 5, 25, "Cash Terminal", &bmCashTerminal, GUI_ID_BUTTON1); WM_SetFocus(hButton0); tEnd = GUI_GetTime() + 4000; do { GUI_PID_GetState(&CurrentState); if ((OldState.x != CurrentState.x) || (OldState.y != CurrentState.y)) { tEnd = GUI_GetTime() + 10000; } OldState = CurrentState; GUI_Delay(100); if (GUI_GetTime() >= tEnd) { if (_AppSelectionOld) { _AppSelection = ((_AppSelectionOld - 1) ^ 1) + 1; } else { _AppSelection = APP_DASHBOARD; } } } while (!_AppSelection && !_Break); WM_DeleteWindow(hButton0); WM_DeleteWindow(hButton1); if (!_Break) { switch (_AppSelection) { case APP_DASHBOARD: AppDashBoard(); break; case APP_CASHTERMINAL: AppCashTerminal(); break; } GUI_CURSOR_Hide(); _AppSelectionOld = _AppSelection; _AppSelection = 0; } } while (!_Break); }
/********************************************************************* * * MainTask */ void MainTask(void) { GUI_Init(); // // Check if recommended memory for the sample is available // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) { GUI_ErrorOut("Not enough memory available."); return; } while (1) { _DrawJPEGsFromWindowsDir(); } }
/********************************************************************* * * MainTask */ void MainTask(void) { MYWIDGET_Handle hMyWidget; char acExtraBytes[] = "Extrabytes"; GUI_Init(); // // Check if recommended memory for the sample is available // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) { GUI_ErrorOut("Not enough memory available."); return; } hMyWidget = MYWIDGET_Create(10, 10, 100, 50, WM_HBKWIN, WM_CF_SHOW, NULL, _cbMyWidget, strlen(acExtraBytes)); MYWIDGET_SetUserData(hMyWidget, acExtraBytes, strlen(acExtraBytes)); BUTTON_Create(10, 100, 100, 50, 0, WM_CF_SHOW); while (1) { GUI_Delay(100); } }
/********************************************************************* * * MainTask */ void MainTask(void) { GUI_Init(); // // Check if recommended memory for the sample is available // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) { GUI_ErrorOut("Not enough memory available."); return; } #if GUI_SUPPORT_MEMDEV WM_SetCreateFlags(WM_CF_MEMDEV); #endif GUI_CURSOR_Show(); WM_SetCallback(WM_HBKWIN, _cbBkWin); while(1) { _DemoMultiedit(); *_acInfoText = 0; WM_InvalidateWindow(WM_HBKWIN); GUI_Delay(SPEED); } }
void MainTask(void) { WM_HWIN hWin; GUI_Init(); // // Check if recommended memory for the sample is available // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) { GUI_ErrorOut("Not enough memory available."); return; } GUI_CURSOR_Show(); WM_SetCreateFlags(WM_CF_MEMDEV); WM_EnableMemdev(WM_HBKWIN); WM_SetCallback(WM_HBKWIN, &_cbBkWindow); while (1) { hWin = GUI_CreateDialogBox(_aDialogOrder, GUI_COUNTOF(_aDialogOrder), &_cbDialogOrder, WM_HBKWIN, 0, 0); WM_MakeModal(hWin); GUI_ExecCreatedDialog(hWin); GUI_Delay(1500); } }
/********************************************************************* * * MainTask */ void MainTask(void) { GUI_Init(); // // Check if recommended memory for the sample is available // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) { GUI_ErrorOut("Not enough memory available."); return; } #if GUI_SUPPORT_MEMDEV WM_SetCreateFlags(WM_CF_MEMDEV); #endif FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX); BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX); RADIO_SetDefaultSkin(RADIO_SKIN_FLEX); CHECKBOX_SetDefaultSkin(CHECKBOX_SKIN_FLEX); HEADER_SetDefaultSkin(HEADER_SKIN_FLEX); GUI_CURSOR_Show(); WM_SetCallback(WM_HBKWIN, _cbBkWin); while (1) { GUI_ExecDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, 0, 0, 0); GUI_Delay(1000); } }