/************************************************************************ 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 ); }
///////////////////////////////////////////////////////////////////////////// // Function: WORD CreateMainMenu() // Input: none // Output: Returns 0 if the screen is created and 0 if not. // Overview: Creates the four icons to launch each of the application // note demos. ///////////////////////////////////////////////////////////////////////////// uint16_t CreateMainMenu() { int i; short left = 0, top = 0, right = 0, bottom = 0; while(GFX_DoubleBufferEnable() == GFX_STATUS_FAILURE); GFX_GOL_ButtonCreate ( ID_SCROLL1, // object�s ID 0, 26, 25, GFX_MaxYGet()-26, 0, GFX_GOL_BUTTON_DRAW_STATE, NULL, // use this bitmap NULL, Scroll[0], // use this text GFX_ALIGN_HCENTER, demoScheme); // use alternative style scheme GFX_GOL_ButtonCreate ( ID_SCROLL2, // object�s ID 0, 0, GFX_MaxXGet(), 25, 0, GFX_GOL_BUTTON_DRAW_STATE, NULL, // use this bitmap NULL, Scroll[1], // use this text GFX_ALIGN_HCENTER, demoScheme); // use alternative style scheme GFX_GOL_ButtonCreate ( ID_SCROLL3, // object�s ID GFX_MaxXGet()-25, 26, GFX_MaxXGet(), GFX_MaxYGet()-26, 0, // radius if rounded edge // draw the object after creation with // text drawn at the bottom and no panel GFX_GOL_BUTTON_DRAW_STATE, NULL, // use this bitmap NULL, Scroll[2], // use this text GFX_ALIGN_HCENTER, demoScheme); // use alternative style scheme GFX_GOL_ButtonCreate( ID_SCROLL4, // object�s ID 0, GFX_MaxYGet()-25, GFX_MaxXGet(), GFX_MaxYGet(), 0, GFX_GOL_BUTTON_DRAW_STATE, NULL, // use this bitmap NULL, Scroll[3], // use this text GFX_ALIGN_HCENTER, demoScheme); // use alternative style scheme // loop to create the four icons for (i=0; i<4; i++) { switch (i) { case 0: top = IconTop(0); bottom = IconBottom(0); left = IconLeft(0); right = IconRight(0); break; case 1: top = IconTop(0); bottom = IconBottom(0); left = IconLeft(1); right = IconRight(1); break; case 2: top = IconTop(1); bottom = IconBottom(1); left = IconLeft(0); right = IconRight(0); break; case 3: top = IconTop(1); bottom = IconBottom(1); left = IconLeft(1); right = IconRight(1); break; default: break; } if (!GFX_GOL_ButtonCreate ( ID_ICON1+i, // object�s ID left, top, right, bottom, 0, // radius if rounded edge // draw the object after creation with // text drawn at the bottom and no panel GFX_GOL_BUTTON_DRAW_STATE|GFX_GOL_BUTTON_NOPANEL_STATE, (void*) &MCHPFolderFile_8bpp_72x72, // use this bitmap (void*) &MCHPFolderEmpty_8bpp_72x72, Labels[i], // use this text GFX_ALIGN_HCENTER|GFX_ALIGN_BOTTOM, demoScheme // use alternative style scheme ) ) return 0; } return 1; }