/*************************************************** * Function : CreatecurrentlyRecordingScreen * Parameters : none * Return : none * Description : Creates GOL widgets used in screen - currentlyRecordingScreen ***************************************************/ void CreatecurrentlyRecordingScreen(void) { GOLFree(); SetColor(50712); ClearDevice(); if(defscheme != NULL) free(defscheme); defscheme = GOLCreateScheme(); defscheme->Color0 = RGBConvert(72, 140, 248); defscheme->Color1 = RGBConvert(248, 184, 72); defscheme->TextColor0 = RGBConvert(248, 184, 72); defscheme->TextColor1 = RGBConvert(0, 0, 248); defscheme->EmbossDkColor = RGBConvert(24, 0, 224); defscheme->EmbossLtColor = RGBConvert(168, 216, 232); defscheme->TextColorDisabled = RGBConvert(184, 184, 184); defscheme->ColorDisabled = RGBConvert(208, 224, 240); defscheme->CommonBkColor = RGBConvert(208, 236, 240); defscheme->pFont = (void*)&Gentium_Plain_0_0_22; if(cardSpyScheme != NULL) free(cardSpyScheme); cardSpyScheme = GOLCreateScheme(); cardSpyScheme->Color0 = RGBConvert(48, 48, 48); cardSpyScheme->Color1 = RGBConvert(152, 152, 152); cardSpyScheme->TextColor0 = RGBConvert(200, 204, 200); cardSpyScheme->TextColor1 = RGBConvert(96, 100, 96); cardSpyScheme->EmbossDkColor = RGBConvert(200, 204, 200); cardSpyScheme->EmbossLtColor = RGBConvert(200, 204, 200); cardSpyScheme->TextColorDisabled = RGBConvert(184, 184, 184); cardSpyScheme->ColorDisabled = RGBConvert(200, 204, 248); cardSpyScheme->CommonBkColor = RGBConvert(248, 252, 248); cardSpyScheme->pFont = (void*)&Ubuntu_Bold_0_0_18; WINDOW *pcurrentlyRecordingScreen_currentlyRecordingScreen; pcurrentlyRecordingScreen_currentlyRecordingScreen=WndCreate(currentlyRecordingScreen_currentlyRecordingScreen,0,0,319,239,24576,NULL, (XCHAR*)currentlyRecordingScreen_currentlyRecordingScreentext,cardSpyScheme); if(pcurrentlyRecordingScreen_currentlyRecordingScreen==NULL) { CreateError(0); while(1); //Fatal Error, Check for memory leak or heap size } BUTTON *pcurrentlyRecordingScreen_BTN_2; pcurrentlyRecordingScreen_BTN_2=BtnCreate(currentlyRecordingScreen_BTN_2,0,195,110,235,0,16386 , NULL , (XCHAR*)currentlyRecordingScreen_BTN_2text,cardSpyScheme); if(pcurrentlyRecordingScreen_BTN_2==NULL) { CreateError(0); while(1); //Fatal Error, Check for memory leak or heap size } BUTTON *pcurrentlyRecordingScreen_BTN_3; pcurrentlyRecordingScreen_BTN_3=BtnCreate(currentlyRecordingScreen_BTN_3,205,195,315,235,0,16386 , NULL , (XCHAR*)currentlyRecordingScreen_BTN_3text,cardSpyScheme); if(pcurrentlyRecordingScreen_BTN_3==NULL) { CreateError(0); while(1); //Fatal Error, Check for memory leak or heap size } }
/*************************************************** * Function : CreaterecordScreen * Parameters : none * Return : none * Description : Creates GOL widgets used in screen - recordScreen ***************************************************/ void CreaterecordScreen(void) { GOLFree(); SetColor(50712); ClearDevice(); if(defscheme != NULL) free(defscheme); defscheme = GOLCreateScheme(); defscheme->Color0 = RGBConvert(72, 140, 248); defscheme->Color1 = RGBConvert(248, 184, 72); defscheme->TextColor0 = RGBConvert(248, 184, 72); defscheme->TextColor1 = RGBConvert(0, 0, 248); defscheme->EmbossDkColor = RGBConvert(24, 0, 224); defscheme->EmbossLtColor = RGBConvert(168, 216, 232); defscheme->TextColorDisabled = RGBConvert(184, 184, 184); defscheme->ColorDisabled = RGBConvert(208, 224, 240); defscheme->CommonBkColor = RGBConvert(208, 236, 240); defscheme->pFont = (void*)&Gentium_Plain_0_0_22; if(cardSpyScheme != NULL) free(cardSpyScheme); cardSpyScheme = GOLCreateScheme(); cardSpyScheme->Color0 = RGBConvert(48, 48, 48); cardSpyScheme->Color1 = RGBConvert(152, 152, 152); cardSpyScheme->TextColor0 = RGBConvert(200, 204, 200); cardSpyScheme->TextColor1 = RGBConvert(96, 100, 96); cardSpyScheme->EmbossDkColor = RGBConvert(200, 204, 200); cardSpyScheme->EmbossLtColor = RGBConvert(200, 204, 200); cardSpyScheme->TextColorDisabled = RGBConvert(184, 184, 184); cardSpyScheme->ColorDisabled = RGBConvert(200, 204, 248); cardSpyScheme->CommonBkColor = RGBConvert(248, 252, 248); cardSpyScheme->pFont = (void*)&Ubuntu_Bold_0_0_18; WINDOW *precordScreen_recordWindows; precordScreen_recordWindows=WndCreate(recordScreen_recordWindows,0,0,319,239,24576,NULL, (XCHAR*)recordScreen_recordWindowstext,cardSpyScheme); if(precordScreen_recordWindows==NULL) { CreateError(0); while(1); //Fatal Error, Check for memory leak or heap size } BUTTON *precordScreen_backToHomeButton; precordScreen_backToHomeButton=BtnCreate(recordScreen_backToHomeButton,207,197,319,239,0,16384 , NULL , (XCHAR*)recordScreen_backToHomeButtontext,cardSpyScheme); if(precordScreen_backToHomeButton==NULL) { CreateError(0); while(1); //Fatal Error, Check for memory leak or heap size } BUTTON *precordScreen_viewLastTraceButton; precordScreen_viewLastTraceButton=BtnCreate(recordScreen_viewLastTracedButton,0,197,112,239,0,16384 , NULL , (XCHAR*)recordScreen_viewLastTraceButtontext,cardSpyScheme); if(precordScreen_viewLastTraceButton==NULL) { CreateError(0); while(1); //Fatal Error, Check for memory leak or heap size } }
/************************************************************************ Function: void CreateAnimation(void) Overview: Creates the animation screen. Input: none Output: none ************************************************************************/ void CreateAnimation(void) { SHORT j, height, endPoint; // free memory for the objects in the previous linked list and start new list GOLFree(); SetColor(SCREEN_BACKGROUND_COLOR); ClearDevice(); // draw the band of lines with increasing thickness background of the demo height = 13; endPoint = GetMaxY() - 35; SetColor(RGB565CONVERT(0x4C, 0x8E, 0xFF)); for(j = 2; j <= endPoint; j += (height + 6)) { WAIT_UNTIL_FINISH(Bar(0, j, GetMaxX(), j + height)); if(height <= 0) height = 0; else height -= 1; } pPicture = PictCreate ( ID_PICTURE1, // ID PICTURE_XINDENT, PICTURE_YINDENT, PICTURE_XINDENT + PICTURE_WIDTH - 1, PICTURE_YINDENT + PICTURE_HEIGHT - 1, PICT_DRAW, // will be dislayed, has frame 2, // scale factor is x1 (void *) &Engine1, // bitmap altScheme ); // default GOL scheme pMeter = MtrCreate ( ID_METER2, (2 * PICTURE_XINDENT + PICTURE_WIDTH), PICTURE_YINDENT - 20, (2 * (PICTURE_XINDENT + PICTURE_WIDTH)), PICTURE_YINDENT + PICTURE_HEIGHT + 20, MTR_DRAW | MTR_RING | MTR_ACCURACY, // draw normal meter object MAX_METER_VALUE, // set initial value 0, MAX_METER_VALUE, // set range (void *) &GOLFontDefault, // Title font to be used (void *) &GOLMediumFont, // Value font to be used MeterStr, // meterScheme ); // alternative GOL scheme //pMeter->pTitleFont = (void*)&GOLFontDefault; //pMeter->pValueFont = (void*)&GOLMediumFont; // create the demo navigation/control buttons CreateCtrlButtons(ExitStr, ScaleStr, LeftArrowStr, RightArrowStr); }
/******************************************************************************* * FUNCTION: vCreateWallpaperPage * * PARAMETERS: * ~ void * * RETURN: * ~ void * * DESCRIPTIONS: * Create the page to show the wallpaper. * *******************************************************************************/ void vCreateWallpaperPage (void) { // Clear the GOL objects and screen. GOLFree(); SetColor(BLACK); ClearDevice(); // Create the wallpaper image. PictCreate( GID_IMG_WALLPAPPER, 0, 0, GetMaxX(), GetMaxY(), PICT_DRAW, 1, "/Theme/Wallpaper.bmp", pxDefaultScheme ); }
void CreateDemo(void) { GOLFree(); SetColor(GFX_SCHEMEDEFAULT.CommonBkColor); ClearDevice(); BtnCreate(ID_BUTTON, GetMaxX() * 1 / 4, GetMaxY() * 1 / 3, GetMaxX() * 3 / 4, GetMaxY() * 2 / 3, 0, BTN_DRAW, NULL, "Button", NULL); showDecoration = FALSE; showDecorationPrev = TRUE; // force redraw }
/************************************************************************ Function: void CreateAnimationDemo(void) Overview: Creates the animation screen. Input: none Output: none ************************************************************************/ void CreateAnimationDemo(void) { SHORT pixWidth, pixHeight; pixHeight = GetImageHeight((void *) &Engine1); pixWidth = GetImageWidth((void *) &Engine1); // free memory for the objects in the previous linked list and start new list GOLFree(); pPicture = PictCreate ( ID_PICTURE1, // ID PICTURE_XINDENT, PICTURE_YINDENT, PICTURE_XINDENT + PICTURE_WIDTH - 1, PICTURE_YINDENT + PICTURE_HEIGHT - 1, PICT_DRAW, // will be dislayed, has frame 2, // scale factor is x1 (void *) &Engine1, // bitmap altScheme ); // default GOL scheme pMeter = MtrCreate ( ID_METER1, (2 * PICTURE_XINDENT + PICTURE_WIDTH), PICTURE_YINDENT - 20, (2 * (PICTURE_XINDENT + PICTURE_WIDTH)), PICTURE_YINDENT + PICTURE_HEIGHT + 20, MTR_DRAW | MTR_RING | MTR_ACCURACY, // draw normal meter object MAX_METER_VALUE, // set initial value 0, MAX_METER_VALUE, // set range (void *) &GOLFontDefault, // Title font to be used (void *) &GOLMediumFont, // Value font to be used MeterStr, // meterScheme ); // alternative GOL scheme CreateCtrlButtons(ExitStr, ScaleStr, DownStr, UpStr); // draw the colorful background DrawBackgroundColorPalette(); }
/************************************************************************ Function: void CreateMultiFontsDemo(void) Overview: Creates the Multi-Font demo screen. Input: none Output: none ************************************************************************/ void CreateMultiFontsDemo(void) { SHORT i, j; // we need this since Static cannot have an uninitialized pointer to text // plus we need the static text area but we are only using it as a place // holder for the text that we will overwrite on the static text area static XCHAR spaceChar[2] = {0x20,0}; GOLFree(); // free memory for the objects in the previous linked list and start new list SetColor(SCREEN_BACKGROUND_COLOR); ClearDevice(); // draw the small squares SetColor(RGB565CONVERT(0x4C, 0x8E, 0xFF)); for(j = 5; j <= GetMaxY(); j += 16) { for(i = 5; i <= GetMaxX(); i += 16) { WAIT_UNTIL_FINISH(Bar(i, j, i + 3, j + 3)); } } InitHWData(); FontScheme2 = GOLCreateScheme(); // create alternative style scheme FontScheme2->pFont = pHWData->pHWFont; FontScheme2->Color0 = RGB565CONVERT(0xFF, 0xBB, 0x4C); FontScheme2->Color1 = RGB565CONVERT(0xFF, 0xBB, 0x4C); StCreate ( ID_STXT, STXXPOS, STXYPOS, STXXPOS + STXWIDTH, STXYPOS + STXHEIGHT, ST_DRAW | ST_FRAME, (void *) &spaceChar, FontScheme2 ); CreateCtrlButtons(ExitStr, LeftArrowStr, NULL, RightArrowStr); }
void InitializeScreen( void ) { GOLFree(); SetColor(BLACK); // set color to BLACK ClearDevice(); // set screen to all BLACK PictCreate( ID_ICON, // ID 0,0,15,15, // dimension PICT_DRAW, // will be dislayed, has frame 1, // scale factor is x1 &iconMicrochip, // bitmap NULL ); // default GOL scheme StCreate( ID_TITLE, 16, 0, GetMaxX()-11, GetTextHeight( (void *)&FONTDEFAULT )-1, ST_DRAW, pageInformation.title, NULL ); previousTick = tick; }
void CreateSetprog(void) { GOLFree(); SetColor(BLUE_LIGHT); ClearDevice(); BtnCreate(Setprog_OBJ_BUTTON_0,7,46,116,117,10,BTN_DRAW,(void*)prog_images[0],NULL,defscheme); BtnCreate(Setprog_OBJ_BUTTON_1,125,46,234,117,10,BTN_DRAW,(void*)prog_images[1],NULL,defscheme); BtnCreate(Setprog_OBJ_BUTTON_2,7,124,116,195,10,BTN_DRAW,(void*)prog_images[2],NULL,defscheme); BtnCreate(Setprog_OBJ_BUTTON_3,125,124,234,195,10,BTN_DRAW,(void*)prog_images[3],NULL,defscheme); BtnCreate(Setprog_OBJ_BUTTON_4,7,201,116,272,10,BTN_DRAW,(void*)prog_images[4],NULL,defscheme); BtnCreate(Setprog_OBJ_BUTTON_5,125,201,234,272,10,BTN_DRAW,(void*)prog_images[5],NULL,defscheme); BtnCreate(Setprog_OBJ_BUTTON_7,5,277,66,313,5,BTN_DRAW,NULL,(XCHAR*)EXIT_OBJ_BUTTON_text,botbar); // BtnCreate(Setprog_OBJ_BUTTON_8,92,277,152,313,5,BTN_DRAW,NULL,(XCHAR*)Setprog_OBJ_BUTTON_8_text,botbar); // BtnCreate(Setprog_OBJ_BUTTON_9,170,277,230,313,5,BTN_DRAW,NULL,(XCHAR*)Setprog_OBJ_BUTTON_9_text,botbar); StCreate(Setprog_OBJ_STATICTEXT_0,1,0,238,30,ST_DRAW|ST_CENTER_ALIGN,(XCHAR*)Setprog_OBJ_STATICTEXT_0_text,topbar); }
/************************************************************************ Function: WORD CreateJPEGDemo(void) Overview: Creates the JPEG demo screen. Input: none Output: Return 0 when memory is not enough for objects of the demo. ************************************************************************/ WORD CreateJPEGDemo(void) { BYTE TextHeight; WORD TextX; // Free memory for the objects in the previous linked list and start new list to display // the files seen on the media GOLFree(); // initialize the image decoder ImageDecoderInit(); // initialize the screen SetColor(WHITE); ClearDevice(); SetFont((void *) &GOLFontDefault); TextHeight = GetTextHeight((void *) &GOLFontDefault); SetColor(BRIGHTRED); TextX = (IMG_SCREEN_WIDTH - GetTextWidth((XCHAR *)ImageDisplayStr, (void *) &GOLFontDefault)) / 2; WAIT_UNTIL_FINISH(OutTextXY(TextX, 1 * TextHeight, (XCHAR *)ImageDisplayStr)); SetColor(BLACK); TextX = (IMG_SCREEN_WIDTH - GetTextWidth((XCHAR *)DetectingStr, (void *) &GOLFontDefault)) / 2; WAIT_UNTIL_FINISH(OutTextXY(TextX, 3 * TextHeight, (XCHAR *)DetectingStr)); TextX = (IMG_SCREEN_WIDTH - GetTextWidth((XCHAR *)ThumbDriveStr, (void *) &GOLFontDefault)) / 2; WAIT_UNTIL_FINISH(OutTextXY(TextX, 4 * TextHeight, (XCHAR *)ThumbDriveStr)); TextX = (IMG_SCREEN_WIDTH - GetTextWidth((XCHAR *)PleaseWaitStr, (void *) &GOLFontDefault)) / 2; WAIT_UNTIL_FINISH(OutTextXY(TextX, 6 * TextHeight, (XCHAR *)PleaseWaitStr)); #if defined(ENABLE_SD_MSD_DEMO) MDD_SDSPI_InitIO(); #endif MonitorDriveMedia(); if(mediaPresent == 0) { // erase the last line SetColor(WHITE); TextX = (IMG_SCREEN_WIDTH - GetTextWidth((XCHAR *)PleaseWaitStr, (void *) &GOLFontDefault)) / 2; WAIT_UNTIL_FINISH(OutTextXY(TextX, 6 * TextHeight, (XCHAR *)PleaseWaitStr)); // replace it with these SetColor(BRIGHTRED); TextX = (IMG_SCREEN_WIDTH - GetTextWidth((XCHAR *)Exiting1Str, (void *) &GOLFontDefault)) / 2; WAIT_UNTIL_FINISH(OutTextXY(TextX, 6 * TextHeight, (XCHAR *)Exiting1Str)); TextX = (IMG_SCREEN_WIDTH - GetTextWidth((XCHAR *)Exiting2Str, (void *) &GOLFontDefault)) / 2; WAIT_UNTIL_FINISH(OutTextXY(TextX, 7 * TextHeight, (XCHAR *)Exiting2Str)); DelayMs(1000); return (0); } blImageOnScreen = 0; blTextOnScreen = 0; pSave = NULL; blSlideShowOn = 0; NextSlide = 0xFF; // create the listbox, slider and buttons that will emulate a // list box with controls. pListBox = LbCreate ( ID_JPGLISTBOX, LBJPGXPOS, LBJPGYPOS, LBJPGXPOS + LBJPGWIDTH, LBJPGYPOS + LBJPGHEIGHT, LB_DRAW | LB_SINGLE_SEL, pJPGItemList, NULL ); if(pListBox == NULL) return (0); pSlider = SldCreate ( ID_SLD4LB, SLD4LBXPOS, SLD4LBYPOS, SLD4LBXPOS + SLD4LBWIDTH, SLD4LBYPOS + SLD4LBHEIGHT, SLD_DRAW | SLD_VERTICAL | SLD_SCROLLBAR, 2, 1, 1, // these are temporary fill items will set to proper values NULL ); if(pSlider == NULL) return (0); pBtnUp = BtnCreate ( ID_BTNUP4LB, BTNUP4LBXPOS, BTNUP4LBYPOS, BTNUP4LBXPOS + BTNUP4LBWIDTH, BTNUP4LBYPOS + BTNUP4LBHEIGHT, 0, BTN_DRAW, NULL, (XCHAR *)JpegUpArrowStr, NULL ); if(pBtnUp == NULL) return (0); pBtnDn = BtnCreate ( ID_BTNDN4LB, BTNDN4LBXPOS, BTNDN4LBYPOS, BTNDN4LBXPOS + BTNDN4LBWIDTH, BTNDN4LBYPOS + BTNDN4LBHEIGHT, 0, BTN_DRAW, NULL, (XCHAR *)JpegDownArrowStr, NULL ); if(pBtnUp == NULL) return (0); // create the control buttons at the bottom of the screen CreateCtrlButtons(ExitStr, NULL, NULL, RightArrowStr); // fill the list box with the file names of images in the media FillNewElements(); // set the first item to be focused LbSetFocusedItem(pListBox, 0); // successful creation of the JPEG demo screen return (1); }
/*************************************************** * Function : CreateanalysisScreen * Parameters : none * Return : none * Description : Creates GOL widgets used in screen - analysisScreen ***************************************************/ void CreateanalysisScreen(void) { GOLFree(); SetColor(50712); ClearDevice(); if(defscheme != NULL) free(defscheme); defscheme = GOLCreateScheme(); defscheme->Color0 = RGBConvert(72, 140, 248); defscheme->Color1 = RGBConvert(248, 184, 72); defscheme->TextColor0 = RGBConvert(248, 184, 72); defscheme->TextColor1 = RGBConvert(0, 0, 248); defscheme->EmbossDkColor = RGBConvert(24, 0, 224); defscheme->EmbossLtColor = RGBConvert(168, 216, 232); defscheme->TextColorDisabled = RGBConvert(184, 184, 184); defscheme->ColorDisabled = RGBConvert(208, 224, 240); defscheme->CommonBkColor = RGBConvert(208, 236, 240); defscheme->pFont = (void*)&Gentium_Plain_0_0_22; if(cardSpyScheme != NULL) free(cardSpyScheme); cardSpyScheme = GOLCreateScheme(); cardSpyScheme->Color0 = RGBConvert(48, 48, 48); cardSpyScheme->Color1 = RGBConvert(152, 152, 152); cardSpyScheme->TextColor0 = RGBConvert(200, 204, 200); cardSpyScheme->TextColor1 = RGBConvert(96, 100, 96); cardSpyScheme->EmbossDkColor = RGBConvert(200, 204, 200); cardSpyScheme->EmbossLtColor = RGBConvert(200, 204, 200); cardSpyScheme->TextColorDisabled = RGBConvert(184, 184, 184); cardSpyScheme->ColorDisabled = RGBConvert(200, 204, 248); cardSpyScheme->CommonBkColor = RGBConvert(248, 252, 248); cardSpyScheme->pFont = (void*)&Ubuntu_Bold_0_0_18; WINDOW *panalysisScreen_analysisScreen; panalysisScreen_analysisScreen=WndCreate(analysisScreen_analysisScreen,0,0,319,239,24576,NULL, (XCHAR*)analysisScreen_analysisScreentext,cardSpyScheme); if(panalysisScreen_analysisScreen==NULL) { CreateError(0); while(1); //Fatal Error, Check for memory leak or heap size } LISTBOX *plistTracesScreen_tracesList; plistTracesScreen_tracesList=LbCreate(listTracesScreen_tracesList,0,0,319,200,16392,(XCHAR*)listTracesScreen_tracesListtext,cardSpyScheme); if(plistTracesScreen_tracesList==NULL) { CreateError(0); while(1); //Fatal Error, Check for memory leak or heap size } BUTTON *panalysisScreen_changeLevelButton; panalysisScreen_changeLevelButton=BtnCreate(analysisScreen_changeLevelButton,207,197,319,239,0,16386 , NULL , (XCHAR*)analysisScreen_changeLevelButtontext,cardSpyScheme); if(panalysisScreen_changeLevelButton==NULL) { CreateError(0); while(1); //Fatal Error, Check for memory leak or heap size } BUTTON *panalysisScreen_replaceWithListTracesButton; panalysisScreen_replaceWithListTracesButton=BtnCreate(recordScreen_backToHomeButton,0,197,112,239,0,16384 , NULL , (XCHAR*)recordScreen_backToHomeButtontext,cardSpyScheme); if(panalysisScreen_replaceWithListTracesButton==NULL) { CreateError(0); while(1); //Fatal Error, Check for memory leak or heap size } }
void PerformBoardTest( void ) { static int elapsedSeconds = 0; static void *picture; RTCCProcessEvents(); if (previousSecond != _time_str[11]) { switch ( elapsedSeconds ) { case 0: // We will test to see if we are plugged into the PC as a // device (on the right side of the board) or if the debugger // side is plugged in (on the left side of the board). If // we are plugged in as a device, we will receive SOF tokens, // which sets the SOF interrupt. picture = &intro; // Turn on the USB module in device mode. First, disable all // USB interrupts, since we are just doing a local test. Then // enable the module in default device mode and turn on the // power. We will let the module take care of pulling up the // correct lines. Note that the interrupt flags in U1IR are // cleared by writing a "1" to each flag. U1IE = 0; U1IR = 0xFF; U1CONbits.USBEN = 1; U1PWRCbits.USBPWR = 1; // Fall through case 2: GOLFree(); SetColor( WHITE ); ClearDevice(); break; case 1: case 3: GOLFree(); SetColor( BLACK ); ClearDevice(); break; case 4: // See if we are plugged into the PC as a device. If so, we // will display a slightly different picture. if (U1IRbits.SOFIF) { // We are receiving SOF tokens, so we must be plugged // into a host. picture = &introDevice; } // Disable and power off the USB module. U1CONbits.USBEN = 1; U1PWRCbits.USBPWR = 0; // Display the selected graphic. PictCreate( ID_ICON, // ID 0,0,GetMaxX(),GetMaxY(), // dimension PICT_DRAW, // will be dislayed, has frame 1, // scale factor is x1 picture, // bitmap NULL ); // default GOL scheme break; case 5: RGBTurnOnLED( RGB_SATURATION_MINIMUM, RGB_SATURATION_MINIMUM, RGB_SATURATION_MINIMUM ); break; case 6: // Red RGBSetRed( RGB_SATURATION_MAXIMUM ); break; case 7: // Yellow RGBSetGreen( RGB_SATURATION_MAXIMUM ); break; case 8: // Green RGBSetRed( RGB_SATURATION_MINIMUM ); break; case 9: // Aqua RGBSetBlue( RGB_SATURATION_MAXIMUM ); break; case 10: // Blue RGBSetGreen( RGB_SATURATION_MINIMUM ); break; case 11: // Fuschia RGBSetRed( RGB_SATURATION_MAXIMUM ); break; case 12: // White RGBSetGreen( RGB_SATURATION_MAXIMUM ); break; case 13: // Pause break; case 14: RGBTurnOffLED(); screenState = SCREEN_DISPLAY_MAIN; previousSecond = ' '; elapsedSeconds = 0; return; break; } previousSecond = _time_str[11]; elapsedSeconds ++; } }
/******************************************************************************* * FUNCTION: vCreateNumericKeypadPage * * PARAMETERS: * ~ void * * RETURN: * ~ void * * DESCRIPTIONS: * Create the numeric keypad page. * *******************************************************************************/ void vCreateNumericKeypadPage(void) { // Determine the text based on the current page. char *szPageTitle = ""; char *szReadButton = ""; char *szTitle2 = ""; char *szRange = ""; unsigned short usEditBox2Length = 0; switch (eGetGuiPage()) { case PAGE_SET_ID: szPageTitle = "SET ID"; szReadButton = "Read ID"; szTitle2 = "Set ID to :"; szRange = "( 0 - 253 )"; usEditBox2Length = 3; break; case PAGE_SET_BT_PIN: szPageTitle = "SET BLUETOOTH PIN (EDR)"; szReadButton = "Read PIN"; szTitle2 = "Set PIN to :"; szRange = "( 0000 - 9999 )"; usEditBox2Length = 4; break; } GOLFree(); vCreatePageWindow(szPageTitle); // Create text "Message :". StCreate( GID_KEYPAD_TXT_TITLE1, TXT_TITLE1_L, TXT_TITLE1_T, TXT_TITLE1_R, TXT_TITLE1_B, ST_DRAW, "Message :", pxDefaultScheme ); // Create editbox for current value or message. EbCreate( GID_KEYPAD_EB_VALUE1, EB_VALUE1_L, EB_VALUE1_T, EB_VALUE1_R, EB_VALUE1_B, EB_DRAW | EB_CENTER_ALIGN, NULL, 15, pxEditboxScheme ); // Create the read value button. BtnCreate( GID_KEYPAD_BTN_READ, BTN_READ_L, BTN_READ_T, BTN_READ_R, BTN_READ_B, 1, BTN_DRAW, NULL, szReadButton, pxBtnScheme ); // Create title 2. StCreate( GID_KEYPAD_TXT_TITLE2, TXT_TITLE2_L, TXT_TITLE2_T, TXT_TITLE2_R, TXT_TITLE2_B, ST_DRAW, szTitle2, pxDefaultScheme ); // Create editbox for new value. EbCreate( GID_KEYPAD_EB_VALUE2, EB_VALUE2_L, EB_VALUE2_T, EB_VALUE2_R, EB_VALUE2_B, EB_DRAW | EB_CENTER_ALIGN, NULL, usEditBox2Length, pxEditboxScheme ); // Create text for new ID range. StCreate( GID_KEYPAD_TXT_RANGE, TXT_RANGE_L, TXT_RANGE_T, TXT_RANGE_R, TXT_RANGE_B, ST_DRAW | ST_CENTER_ALIGN, szRange, pxDefaultScheme ); // Create keypad. prv_vCreateKeypad(); }
/************************************************************************ Function: CreateHomeScreen() Overview: Creates the home screen of the demo. Input: none Output: none ************************************************************************/ void CreateHomeScreen(void) { GOLFree(); // free memory for the objects in the previous linked list and start new list HideScreenRendering(); CreateCommonObjects(); BtnCreate ( ID_TVICON, IconLeft(0), IconTop(0), IconRight(0), IconBottom(0), 0, BTN_DRAW | BTN_TEXTBOTTOM | BTN_NOPANEL, (void *) &TVICON, NULL, pRemoteScheme ); BtnCreate ( ID_FAVICON, IconLeft(1), IconTop(0), IconRight(1), IconBottom(0), 0, BTN_DRAW | BTN_TEXTBOTTOM | BTN_NOPANEL, (void *) &FAVICON, NULL, pRemoteScheme ); BtnCreate ( ID_INTICON, IconLeft(0), IconTop(1), IconRight(0), IconBottom(1), 0, BTN_DRAW | BTN_TEXTBOTTOM | BTN_NOPANEL, (void *) &INTERICON, NULL, pRemoteScheme ); BtnCreate ( ID_PDICON, IconLeft(1), IconTop(1), IconRight(1), IconBottom(1), 0, BTN_DRAW | BTN_TEXTBOTTOM | BTN_NOPANEL, (void *) &PDICON, NULL, pRemoteScheme ); BtnCreate ( ID_SETICON, IconLeft(0), IconTop(2), IconRight(0), IconBottom(2), 0, BTN_DRAW | BTN_TEXTBOTTOM | BTN_NOPANEL, (void *) &SETICON, NULL, pRemoteScheme ); BtnCreate ( ID_REMOTEMODE, IconLeft(1), IconTop(2), IconRight(1), IconBottom(2), 0, //BTN_DRAW | BTN_NOPANEL | BTN_PRESSED, BTN_DRAW, NULL, UnivRemoteStr, pVersionScheme ); }