Beispiel #1
0
/****************************************************************************
  Function:
    void ShowScreenGeneric( void )
  Description:
    This function erases the currently displayed screen and replaces it with
    a screen of a generic format.  The screen consists of:
            * the Microchip icon
            * a one line title
            * four buttons
            * one line of instructions
    The information for the screen contents is obtained from the global
    pageInformation structure.
  Precondition:
    None
  Parameters:
    None
  Returns:
    None
  Remarks:
    The global list of graphics objects is destroyed and replaced.  Therefore,
    this function cannot be called during the message processing of
    GOLMsgCallback().  It must be called during GOLDrawCallback() processing.
  ***************************************************************************/
void ShowScreenGeneric( void )
{
    InitializeScreen();

    BtnCreate(      ID_TOP_LEFT,                // ID
                    0,LOCATION_MIN_Y,62,38,2,   // dimension and radius
                    BTN_DRAW|BTN_PRESSED,       // will be displayed after creation
                    pageInformation.buttonBitmapTopLeft, // bitmap
                    pageInformation.buttonTextTopLeft,   // text
                    NULL );                     // Default scheme

    BtnCreate(      ID_BOTTOM_LEFT,             // ID
                    0,40,62,62,2,               // dimension and radius
                    BTN_DRAW,                   // will be displayed after creation
                    pageInformation.buttonBitmapBottomLeft, // bitmap
                    pageInformation.buttonTextBottomLeft,   // text
                    NULL );                     // Default scheme

    BtnCreate(      ID_TOP_RIGHT,               // ID
                    64,LOCATION_MIN_Y,125,38,2, // dimension and radius
                    BTN_DRAW,                   // will be displayed after creation
                    pageInformation.buttonBitmapTopRight, // bitmap
                    pageInformation.buttonTextTopRight,   // text
                    NULL );                     // Default scheme

    BtnCreate(      ID_BOTTOM_RIGHT,            // ID
                    64,40,125,62,2,             // dimension and radius
                    BTN_DRAW,                   // will be displayed after creation
                    pageInformation.buttonBitmapBottomRight,
                    pageInformation.buttonTextBottomRight,
                    NULL );                     // Default scheme

}
Beispiel #2
0
/***************************************************
* 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
    }

}
Beispiel #3
0
  Function:
    void ShowScreenGeneric( void )

  Description:
    This function erases the currently displayed screen and replaces it with
    a screen of a generic format.  The screen consists of:
            * the Microchip icon
            * a one line title
            * four buttons
            * one line of instructions

    The information for the screen contents is obtained from the global
    pageInformation structure.

  Precondition:
    None

  Parameters:
    None

  Returns:
    None

  Remarks:
    The global list of graphics objects is destroyed and replaced.  Therefore,
    this function cannot be called during the message processing of
    GOLMsgCallback().  It must be called during GOLDrawCallback() processing.
  ***************************************************************************/

void ShowScreenGeneric( void )
{
    InitializeScreen();

    BtnCreate(      ID_TOP_LEFT,                // ID
                    0,LOCATION_MIN_Y,62,30,2,   // dimension and radius
                    BTN_DRAW|BTN_PRESSED,       // will be displayed after creation
                    pageInformation.buttonBitmapTopLeft, // bitmap
                    pageInformation.buttonTextTopLeft,   // text
                    NULL );                     // Default scheme

    BtnCreate(      ID_BOTTOM_LEFT,             // ID
                    0,32,62,46,2,               // dimension and radius
                    BTN_DRAW,                   // will be displayed after creation
                    pageInformation.buttonBitmapBottomLeft, // bitmap
                    pageInformation.buttonTextBottomLeft,   // text
                    NULL );                     // Default scheme

    BtnCreate(      ID_TOP_RIGHT,               // ID
                    64,LOCATION_MIN_Y,125,30,2, // dimension and radius
                    BTN_DRAW,                   // will be displayed after creation
                    pageInformation.buttonBitmapTopRight, // bitmap
                    pageInformation.buttonTextTopRight,   // text
                    NULL );                     // Default scheme

    BtnCreate(      ID_BOTTOM_RIGHT,            // ID
                    64,32,125,46,2,             // dimension and radius
                    BTN_DRAW,                   // will be displayed after creation
                    pageInformation.buttonBitmapBottomRight,
                    pageInformation.buttonTextBottomRight,
                    NULL );                     // Default scheme

	
	if(!strcmp(pageInformation.buttonTextThirdrow,"Cap Touch"))
	BtnCreate(		ID_THIRDROW,
					0,48,62,62,2,
					BTN_DRAW,
					pageInformation.buttonBitmapThirdrow,
					pageInformation.buttonTextThirdrow,
					NULL );	else 

    StCreate(       ID_INSTRUCTIONS,
                    0, 47, 127, 47+GetTextHeight( (void *)&FONTDEFAULT )-1,
                    ST_DRAW,
                    pageInformation.instructions,
                    NULL );
}
Beispiel #4
0
/*****************************************
 * void CreateMainPage(void)
 *****************************************/
void CreateMainDemoPage(void)
{
	WndCreate
	(
	    ID_WINDOW1,                 // ID
	    0,
	    0,
	    GetMaxX(),
	    GetMaxY(),                  // dimension
	    WND_DRAW,                   // will be dislayed after creation
	    NULL,                       // icon
	    NULL,                       // set text
	    NULL                        // default GOL scheme
	);                              
	
	BtnCreate
	(
	    ID_BUTTON_BACK,             // button ID
	    0,
	    40,                         // left, top corner	
	    NAV_BTN_WIDTH,
	    GetMaxY(),
	    0,                          // right, bottom corner (with radius = 0)
	    BTN_DRAW,                   // will be dislayed after creation
	    NULL,                       // no bitmap	
	    (XCHAR *)"<",               // LEFT arrow as text
	    NULL                        // default GOL scheme
	);                              
	
	BtnCreate
	(
	    ID_BUTTON_NEXT,             // button ID
	    GetMaxX() - NAV_BTN_WIDTH,
	    40,
	    GetMaxX(),
	    GetMaxY(),
	    0,                          // dimension (with radius = 0)
	    BTN_DRAW,                   // will be dislayed and disabled after creation
	    NULL,                       // no bitmap
	    (XCHAR *)">",               // RIGHT arrow as text
	    NULL                        // default GOL scheme
	);                          	 
	 
} 
Beispiel #5
0
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
}
Beispiel #6
0
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);

}
Beispiel #7
0
/////////////////////////////////////////////////////////////////////////////
// Function: WORD CreateAN1227(void)
// Input: None
// Output: Returns non-zero if the objects are created 
//         returns 0 when one of the objects was not created.
// Overview: Creates the AN1227 Demo screen.
/////////////////////////////////////////////////////////////////////////////
WORD CreateAN1227(void)
{

    SetColor(BLACK);
    ClearDevice();

    // HardwareButtonInit() to initialize the hardware buttons
    // should be called prior to the call to this function.
    
    /**
     * Carriage Return button
     * Explorer 16 + GFX PICTail    - S3 (8 bit PMP)
     * Explorer 16 + GFX PICTail    - S5 (16 bit PMP)
     * Starter Kit + GFX PICTail    - S0 (8 bit PMP)
     * Multimedia Expansion Board   - Fire Button
     * DA210 Developement Board     - S1
     * NOTE:    Starter Kit + GFX PICTail will switches are shared
     *          with the 16 bit PMP data bus.
     **/
    previousKey1State = GetHWButtonCR();  // previous state equals the current state
    /**
     * Change Focus button
     * Explorer 16 + GFX PICTail    - S6 (8 bit PMP)
     * Starter Kit + GFX PICTail    - S1 or S2 (8 bit PMP)
     * Multimedia Expansion Board   - left or right
     * DA210 Developement Board     - S2 or S3
     **/
    previousKey2State = GetHWButtonFocus(); // previous state equals the current state

    // create button widgets
    if (!BtnCreate (
        BUTTON1_ID,             // button unique ID
        BTN_X_START, 40,        // left, top corner coordinates
        BTN_X_END, 90,          // right, bottom corner
        0,                      // corner radius is zero, it’s a square button
        BTN_DRAW,               // will be dislayed after creation
        NULL,                   // no bitmap
        (XCHAR*)ReleaseStr,     // text for released state
        NULL                    // default color scheme is used
    ))
        return 0;

    if (!BtnCreate (
        BUTTON2_ID,             // button unique ID
        BTN_X_START, 100,       // left, top corner coordinates
        BTN_X_END, 150,         // right, bottom corner
        0,                      // corner radius is zero, it’s a square button
        BTN_DRAW,               // will be dislayed after creation
        NULL,                   // no bitmap
        (XCHAR*)Button2Str,     // text
        NULL                    // default color scheme is used
    ))
        return 0;

    if (!BtnCreate (
        BUTTON3_ID,             // button unique ID
        BTN_X_START, 160,       // left, top corner coordinates
        BTN_X_END, 210,         // right, bottom corner
        0,                      // corner radius is zero, it’s a square button
        BTN_DRAW |
        BTN_DISABLED,           // will be dislayed and disabled after creation
        NULL,                   // no bitmap
        (XCHAR*)DisabledStr,    // text
        NULL                    // default color scheme is used
    ))
        return 0;

    pFocusedObj = NULL;                 // there are no widgets in focus
    
    return (1);
}       
Beispiel #8
0
    /************************************************************************
 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);
}
Beispiel #9
0
void ShowScreenTime( void )
{
    WORD    textHeight;
    WORD    textWidth;

    strcpy( pageInformation.title, "Set Date/Time" );

    InitializeScreen();

    RTCCProcessEvents();

    // Draw the hidden controls.

    BtnCreate(
                        ID_RTCC_BUTTON_HOME,
                        GetMaxX()-8, 0, GetMaxX()-6, 4, 0,
                        BTN_HIDE,
                        NULL,
                        NULL,
                        NULL );

    BtnCreate(
                        ID_RTCC_BUTTON_NEXT,
                        GetMaxX()-6, 0, GetMaxX()-4, 4, 0,
                        BTN_HIDE,
                        NULL,
                        NULL,
                        NULL );

    BtnCreate(
                        ID_RTCC_BUTTON_PREVIOUS,
                        GetMaxX()-4, 0, GetMaxX()-2, 4, 0,
                        BTN_HIDE,
                        NULL,
                        NULL,
                        NULL );

    // -------------------------------------------------------------------------
    // Create Month, Day and Year Edit Boxes and Buttons

    textWidth  = GetTextWidth( "Mmm", (void *)&FONTDEFAULT );
    textHeight = GetTextHeight( (void *)&FONTDEFAULT ) + 2*GOL_EMBOSS_SIZE;

    // Create the month components

    EbCreate(
                ID_MONTH,
                MONTH_START_X,
                MONTH_START_Y,
                MONTH_END_X,
                MONTH_END_Y,
                EB_DRAW,                    // will be dislayed after creation
                &_date_str[0],              // use the month string value
                3,                          // max characters is 3
                NULL );                     // default GOL scheme

    BtnCreate(
                ID_MONTH_PLUS,
                MONTH_BUTTON_START_X,
                MONTH_START_Y,
                MONTH_BUTTON_END_X,
                MONTH_START_Y + (textHeight >> 1),
                0,                          // draw rectangular button
                BTN_DRAW,                   // will be dislayed after creation
                NULL,                       // no bitmap
                "+",                        // DOWN arrow as text
                NULL );                     // use navigation scheme

    BtnCreate(  ID_MONTH_MINUS,
                MONTH_BUTTON_START_X,
                MONTH_START_Y + (textHeight >> 1),
                MONTH_BUTTON_END_X,
                MONTH_END_Y,
                0,                          // draw rectangular button
                BTN_DRAW,                   // will be dislayed after creation
                NULL,                       // no bitmap
                "-",                        // DOWN arrow as text
                NULL );                     // use navigation scheme

    // Create the day components

    textWidth  = GetTextWidth( "MM", (void *)&FONTDEFAULT );

    EbCreate(
                ID_DAY,
                DAY_START_X,
                DAY_START_Y,
                DAY_END_X,
                DAY_END_Y,
                EB_DRAW,                    // will be dislayed after creation
                &_date_str[4],              // use the day string value
                2,                          // max characters is 3
                NULL );                     // default GOL scheme

    BtnCreate(
                ID_DAY_PLUS,
                DAY_BUTTON_START_X,
                DAY_START_Y,
                DAY_BUTTON_END_X,
                DAY_START_Y + (textHeight >> 1),
                0,                          // draw rectangular button
                BTN_DRAW,                   // will be dislayed after creation
                NULL,                       // no bitmap
                "+",                        // DOWN arrow as text
                NULL );                     // use navigation scheme

    BtnCreate(  ID_DAY_MINUS,
                DAY_BUTTON_START_X,
                DAY_START_Y + (textHeight >> 1),
                DAY_BUTTON_END_X,
                DAY_END_Y,
                0,                          // draw rectangular button
                BTN_DRAW,                   // will be dislayed after creation
                NULL,                       // no bitmap
                "-",                        // DOWN arrow as text
                NULL );                     // use navigation scheme

    // Create the year components

    textWidth  = GetTextWidth( "MM00", (void *)&FONTDEFAULT );

    EbCreate(
                ID_YEAR,
                YEAR_START_X,
                YEAR_START_Y,
                YEAR_END_X,
                YEAR_END_Y,
                EB_DRAW,                // will be dislayed after creation
                &_date_str[8],          // use the year string value
                4,                      // max characters is 4
                NULL );                 // default GOL scheme

    BtnCreate(
                ID_YEAR_PLUS,
                YEAR_BUTTON_START_X,
                YEAR_START_Y,
                YEAR_BUTTON_END_X,
                YEAR_START_Y + (textHeight >> 1),
                0,                          // draw rectangular button
                BTN_DRAW,                   // will be dislayed after creation
                NULL,                       // no bitmap
                "+",                        // DOWN arrow as text
                NULL );                     // use navigation scheme

    BtnCreate(  ID_YEAR_MINUS,
                YEAR_BUTTON_START_X,
                YEAR_START_Y + (textHeight >> 1),
                YEAR_BUTTON_END_X,
                YEAR_END_Y,
                0,                          // draw rectangular button
                BTN_DRAW,                   // will be dislayed after creation
                NULL,                       // no bitmap
                "-",                        // DOWN arrow as text
                NULL );                     // use navigation scheme

    // -------------------------------------------------------------------------
    // Create the Hour and Minute Edit Boxes and Buttons

    textWidth  = GetTextWidth( "MM", (void *)&FONTDEFAULT ) + (GOL_EMBOSS_SIZE<<1);

    // Create the hour components

    EbCreate(
                ID_HOUR,
                HOUR_START_X,
                HOUR_START_Y,
                HOUR_END_X,
                HOUR_END_Y,
                EB_DRAW,
                &_time_str[4],
                2,
                NULL );

    BtnCreate(
                ID_HOUR_PLUS,
                HOUR_BUTTON_START_X,
                HOUR_START_Y,
                HOUR_BUTTON_END_X,
                HOUR_START_Y + (textHeight >> 1),
                0,
                BTN_DRAW,
                NULL,
                "+",
                NULL );

    BtnCreate(  ID_HOUR_MINUS,
                HOUR_BUTTON_START_X,
                HOUR_START_Y + (textHeight >> 1),
                HOUR_BUTTON_END_X,
                HOUR_END_Y,
                0,
                BTN_DRAW,
                NULL,
                "-",
                NULL );

    // Create the minute components

    EbCreate(
                ID_MINUTE,
                MINUTE_START_X,
                MINUTE_START_Y,
                MINUTE_END_X,
                MINUTE_END_Y,
                EB_DRAW,                // will be dislayed after creation
                &_time_str[7],          // use minute string value
                2,                      // max characters is 2
                NULL );                 // default GOL scheme

    BtnCreate(
                ID_MINUTE_PLUS,
                MINUTE_BUTTON_START_X,
                MINUTE_START_Y,
                MINUTE_BUTTON_END_X,
                MINUTE_START_Y + (textHeight >> 1),
                0,                          // draw rectangular button
                BTN_DRAW,                   // will be dislayed after creation
                NULL,                       // no bitmap
                "+",                        // DOWN arrow as text
                NULL );                     // use navigation scheme

    BtnCreate(  ID_MINUTE_MINUS,
                MINUTE_BUTTON_START_X,
                MINUTE_START_Y + (textHeight >> 1),
                MINUTE_BUTTON_END_X,
                MINUTE_END_Y,
                0,                          // draw rectangular button
                BTN_DRAW,                   // will be dislayed after creation
                NULL,                       // no bitmap
                "-",                        // DOWN arrow as text
                NULL );                     // use navigation scheme


    currentControlSet = CONTROL_SET_MONTH;
    IndicateFocus( WHITE );

}
Beispiel #10
0
/***************************************************
* 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
    }

}
Beispiel #11
0
/************************************************************************
 Function: CreateCommonObjects()

 Overview: Creates the common objects present in all screens

 Input: none

 Output: none
************************************************************************/
void CreateCommonObjects(void)
{
    WORD timeStartX;
    WORD timeWidth, textHeight;

    SetColor(BACKGROUND_COLOR);
    ClearDevice();

    BtnCreate
    (
        ID_MCHPICON,
        MCHP_LOGO_STARTX, MCHP_LOGO_STARTY,
        MCHP_LOGO_STARTX + (MCHP_LOGO_WIDTH - 5),
        MCHP_LOGO_STARTY + (MCHP_LOGO_HEIGHT - 5),
        0, BTN_DRAW,
        (void *) &MICROCHIP_LOGO, NULL,
        pBatStyleScheme
    );

    PbCreate
    (
        ID_BATLEVEL,
        BAT_STARTX, BAT_STARTY,
        BAT_STARTX + BAT_WIDTH,
        BAT_STARTY + BAT_HEIGHT,
        PB_DRAW | PB_NOPROGRESS,
        GetBatteryLevel(),
        GetBatteryRange(),
        pBatStyleScheme
    );

    // calculate the positions of the date and time info
    strcpy(CurrentTimeStr, "Mon 10:10 AM ");

    timeWidth = GetTextWidth(CurrentTimeStr, (void *)&TIMEDATEFONT);
    textHeight = GetTextHeight((void *)&TIMEDATEFONT);

    timeStartX = BAT_STARTX - timeWidth - 5;

    StCreate
    (
        ID_TIME,
        timeStartX,
        DATE_TIME_STARTY,
        timeStartX + timeWidth,
        DATE_TIME_STARTY + textHeight,
        ST_DRAW,
        CurrentTimeStr,
        pTimeDateStyleScheme
    );

    // This is the battery primitives
    SetColor(TEXTCOLOR_UNPRESSED);
    // draw the outline first
    while(!Bar(	BAT_STARTX - 1, BAT_STARTY - 1,
                BAT_STARTX + BAT_WIDTH + 1, BAT_STARTY + BAT_HEIGHT + 1));
    // draw the battery head
    while(!Bar(	BAT_STARTX - 3, BAT_STARTY + ((BAT_HEIGHT>>1)-1),
                BAT_STARTX - 2, BAT_STARTY + ((BAT_HEIGHT>>1)+1)));

    UpdateTime(FORCE_UPDATE);
}
Beispiel #12
0
// *****************************************************************************
// Function Name  : main
// Description    : Main program.
// Input          : None
// Output         : None
// Return         : None
// *****************************************************************************
int main(void)
{
#ifdef DEBUG
	debug();
#endif
	int i,j;
		WINDOW * wnd;
		BUTTON * btn;
		GOL_SCHEME *pScheme;


    //  System clock configuration
    RCC_Configuration();  
		  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);  
    // Nested Vector Interrupt Controller configuration
    NVIC_Configuration();   

		LCD_GPIO_Configuration();
		FSMC_LCD_Init();
		USART1_Init();
		ILI9325_Init();
		ILI9325_VerticalScreen();
		ILI9325_GRAMOperation();  //Tell ILI9325 that I'm now starting to write GRAM.
    for(i=0;i<240;i++)
    {
       for(j=0;j<320;j++)
       {
          unsigned int n=i*320+j;
          if(n<25600)
          { 
            ILI9325_WriteWDR(n);
          }   
    
          else if(n<51200)
          { 
            ILI9325_WriteWDR(n);
          }
    
          else if(n<76800)
          { 
            ILI9325_WriteWDR(0xf800);
          }
      } 
		}
			

		ILI9325_FillWindowArea(10,10,100,100,0x001f);

		pScheme = GOLCreateScheme();


		wnd=WndCreate(0,                // ID
                         0,0,GetMaxX(),GetMaxY(),   // whole screen dimension
                         WND_DRAW,                  // set state to draw all
                         NULL,             // icon
                         "Place Title Here.",       // text
                         pScheme);                     // use default GOL scheme
		WndDraw(wnd);

		btn=BtnCreate(1,20,64,50,118,0, BTN_DRAW, NULL, "ON", pScheme);
		BtnDraw(btn);



						    
    while(1)
    {

		}
		

		    
}
Beispiel #13
0
/*****************************************************************************
 * void CreateSecurityScreen(void)
 *****************************************************************************/
void CreateSecurityScreen(void)
{
    GOL_SCHEME *currentScheme;

    currentScheme = GFX_SchemeGetCurrentScheme();

    CreatePanelScreen();                    // This adds the widgets seen on the left of the screen

    SetState(GOLFindObject(PANEL_SCREEN_ID_SECURITY_BUT), BTN_DISABLED);

    if(GetState(GOLFindObject(PANEL_SCREEN_ID_COMFORT_BUT),BTN_DISABLED))
    {
        ClrState(GOLFindObject(PANEL_SCREEN_ID_COMFORT_BUT), BTN_DISABLED);
        SetState(GOLFindObject(PANEL_SCREEN_ID_COMFORT_BUT),BTN_DRAW);
    }

    if(GetState(GOLFindObject(PANEL_SCREEN_ID_LIGHTING_BUT),BTN_DISABLED))
    {
        ClrState(GOLFindObject(PANEL_SCREEN_ID_LIGHTING_BUT), BTN_DISABLED);
        SetState(GOLFindObject(PANEL_SCREEN_ID_LIGHTING_BUT),BTN_DRAW);
    }

    if(GetState(GOLFindObject(PANEL_SCREEN_ID_ENERGY_USAGE_BUT),BTN_DISABLED))
    {
        ClrState(GOLFindObject(PANEL_SCREEN_ID_ENERGY_USAGE_BUT), BTN_DISABLED);
        SetState(GOLFindObject(PANEL_SCREEN_ID_ENERGY_USAGE_BUT),BTN_DRAW);
    }


    SetFont((void *) &FONTDEFAULT);
    SetColor(WHITE);
    OutTextXY(SECURITY_EB_ORIGIN_X + 70,SECURITY_EB_ORIGIN_Y -25, (XCHAR *)EnterPINStr);
    OutTextXY(SECURITY_BUTTON_ORIGIN,SECURITY_EB_ORIGIN_Y -25, (XCHAR *)SecurityOptionsStr);

    BtnCreate    //Disarmed
    (
        SERCURITY_SCREEN_ID_DISARMED_BUT,                         // button ID
        SECURITY_BUTTON_ORIGIN,
        SECURITY_EB_ORIGIN_Y,
        SECURITY_BUTTON_ORIGIN + (SECURITY_KEYSIZEX << 1),
        SECURITY_EB_ORIGIN_Y + 1 * SECURITY_KEYSIZEY,                                // dimension
        5,                                 // set radius
        BTN_DRAW,                           // draw a beveled button
        NULL,                               // no bitmap
        (XCHAR *)DisarmedStr,                 // "Button",     	// text
        currentScheme
    );

    BtnCreate    //Armed
    (
        SERCURITY_SCREEN_ID_ARMED_BUT,                         // button ID
        SECURITY_BUTTON_ORIGIN,
        SECURITY_EB_ORIGIN_Y + 1 * SECURITY_KEYSIZEY + 3,
        SECURITY_BUTTON_ORIGIN + (SECURITY_KEYSIZEX << 1),
        SECURITY_EB_ORIGIN_Y + 2 * SECURITY_KEYSIZEY,                                // dimension
        5,                                 // set radius
        BTN_DRAW,                           // draw a beveled button
        NULL,                               // no bitmap
        (XCHAR *)ArmedStr,                 // "Button",     	// text
        currentScheme
    );

    BtnCreate         //Sleeping
    (
        SERCURITY_SCREEN_ID_SLEEPING_BUT,                         // button ID
        SECURITY_BUTTON_ORIGIN,
        SECURITY_EB_ORIGIN_Y + 2 * SECURITY_KEYSIZEY +3,
        SECURITY_BUTTON_ORIGIN + (SECURITY_KEYSIZEX << 1),
        SECURITY_EB_ORIGIN_Y + 3 * SECURITY_KEYSIZEY,                                // dimension
        5,                                 // set radius
        BTN_DRAW,               // draw a beveled button
        NULL,                               // no bitmap
        (XCHAR *)SleepingStr,                 // "Button",     	// text
        currentScheme
    );

    BtnCreate         //Vacation
    (
        SERCURITY_SCREEN_ID_VACATION_BUT,                         // button ID
        SECURITY_BUTTON_ORIGIN,
        SECURITY_EB_ORIGIN_Y + 3 * SECURITY_KEYSIZEY +3,
        SECURITY_BUTTON_ORIGIN + (SECURITY_KEYSIZEX << 1),
        SECURITY_EB_ORIGIN_Y + 4 * SECURITY_KEYSIZEY,                                // dimension
        5,                                 // set radius
        BTN_DRAW,                           // draw a beveled button
        NULL,                               // no bitmap
        (XCHAR *)VacationStr,                 // "Button",     	// text
        currentScheme
    );

    BtnCreate       //Entertaining
    (
        SERCURITY_SCREEN_ID_ENTERTAINING_BUT,                         // button ID
        SECURITY_BUTTON_ORIGIN,
        SECURITY_EB_ORIGIN_Y + 4 * SECURITY_KEYSIZEY +3,
        SECURITY_BUTTON_ORIGIN + (SECURITY_KEYSIZEX << 1),
        SECURITY_EB_ORIGIN_Y + 5 * SECURITY_KEYSIZEY,                                // dimension
        5,                                 // set radius
        BTN_DRAW,                           // draw a beveled button
        NULL,                               // no bitmap
        (XCHAR *)EntertainingStr,                 // "Button",     	// text
        currentScheme
    );

    EbCreate
    (
        SERCURITY_SCREEN_ID_CODE_EDIT_BOX,    // ID
        SECURITY_KEYSTARTX+5,
        SECURITY_KEYSTARTY + 1,
        SECURITY_KEYSTARTX + (3 * SECURITY_KEYSIZEX)-5,
        SECURITY_KEYSTARTY + 1 * SECURITY_KEYSIZEY - GOL_EMBOSS_SIZE, // dimension
        EB_DRAW | EB_CARET | EB_FOCUSED,            // will be dislayed after creation
        NULL,
        17,
        currentScheme
    );                              // default GOL scheme


    BtnCreate
    (
        SERCURITY_SCREEN_ID_KEYPAD_0_BUT,              // ID
        SECURITY_KEYSTARTX + 1 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 4 * SECURITY_KEYSIZEY,
        SECURITY_KEYSTARTX + 2 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 5 * SECURITY_KEYSIZEY,   // dimension
        5,
        BTN_DRAW,                   // will be dislayed after creation
        NULL,                       // no bitmap
        padNumbers[0],              // text
        currentScheme
    );                              // alternative GOL scheme
    BtnCreate
    (
        SERCURITY_SCREEN_ID_KEYPAD_1_BUT,              // ID
        SECURITY_KEYSTARTX + 0 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 1 * SECURITY_KEYSIZEY,
        SECURITY_KEYSTARTX + 1 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 2 * SECURITY_KEYSIZEY,   // dimension
        5,
        BTN_DRAW,                   // will be dislayed after creation
        NULL,                       // no bitmap
        padNumbers[1],              // text
        currentScheme
    );                              // alternative GOL scheme
    BtnCreate
    (
        SERCURITY_SCREEN_ID_KEYPAD_2_BUT,              // ID
        SECURITY_KEYSTARTX + 1 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 1 * SECURITY_KEYSIZEY,
        SECURITY_KEYSTARTX + 2 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 2 * SECURITY_KEYSIZEY,   // dimension
        5,
        BTN_DRAW,                   // will be dislayed after creation
        NULL,                       // no bitmap
        padNumbers[2],              // text
        currentScheme
    );                              // alternative GOL scheme
    BtnCreate
    (
        SERCURITY_SCREEN_ID_KEYPAD_3_BUT,              // ID
        SECURITY_KEYSTARTX + 2 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 1 * SECURITY_KEYSIZEY,
        SECURITY_KEYSTARTX + 3 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 2 * SECURITY_KEYSIZEY,   // dimension
        5,
        BTN_DRAW,                   // will be dislayed after creation
        NULL,                       // no bitmap
        padNumbers[3],              // text
        currentScheme
    );                              // alternative GOL scheme
    BtnCreate
    (
        SERCURITY_SCREEN_ID_KEYPAD_4_BUT,              // ID
        SECURITY_KEYSTARTX + 0 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 2 * SECURITY_KEYSIZEY,
        SECURITY_KEYSTARTX + 1 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 3 * SECURITY_KEYSIZEY,   // dimension
        5,
        BTN_DRAW,                   // will be dislayed after creation
        NULL,                       // no bitmap
        padNumbers[4],              // text
        currentScheme
    );                              // alternative GOL scheme
    BtnCreate
    (
        SERCURITY_SCREEN_ID_KEYPAD_5_BUT,              // ID
        SECURITY_KEYSTARTX + 1 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 2 * SECURITY_KEYSIZEY,
        SECURITY_KEYSTARTX + 2 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 3 * SECURITY_KEYSIZEY,   // dimension
        5,
        BTN_DRAW,                   // will be dislayed after creation
        NULL,                       // no bitmap
        padNumbers[5],              // text
        currentScheme
    );                              // alternative GOL scheme
    BtnCreate
    (
        SERCURITY_SCREEN_ID_KEYPAD_6_BUT,              // ID
        SECURITY_KEYSTARTX + 2 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 2 * SECURITY_KEYSIZEY,
        SECURITY_KEYSTARTX + 3 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 3 * SECURITY_KEYSIZEY,   // dimension
        5,
        BTN_DRAW,                   // will be dislayed after creation
        NULL,                       // no bitmap
        padNumbers[6],              // text
        currentScheme
    );                              // alternative GOL scheme
    BtnCreate
    (
        SERCURITY_SCREEN_ID_KEYPAD_7_BUT,              // ID
        SECURITY_KEYSTARTX + 0 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 3 * SECURITY_KEYSIZEY,
        SECURITY_KEYSTARTX + 1 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 4 * SECURITY_KEYSIZEY,   // dimension
        5,
        BTN_DRAW,                   // will be dislayed after creation
        NULL,                       // no bitmap
        padNumbers[7],              // text
        currentScheme
    );                              // alternative GOL scheme
    BtnCreate
    (
        SERCURITY_SCREEN_ID_KEYPAD_8_BUT,              // ID
        SECURITY_KEYSTARTX + 1 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 3 * SECURITY_KEYSIZEY,
        SECURITY_KEYSTARTX + 2 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 4 * SECURITY_KEYSIZEY,   // dimension
        5,
        BTN_DRAW,                   // will be dislayed after creation
        NULL,                       // no bitmap
        padNumbers[8],              // text
        currentScheme
    );                              // alternative GOL scheme
    BtnCreate
    (
        SERCURITY_SCREEN_ID_KEYPAD_9_BUT,              // ID
        SECURITY_KEYSTARTX + 2 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 3 * SECURITY_KEYSIZEY,
        SECURITY_KEYSTARTX + 3 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 4 * SECURITY_KEYSIZEY,   // dimension
        5,
        BTN_DRAW,                   // will be dislayed after creation
        NULL,                       // no bitmap
        padNumbers[9],              // text
        currentScheme
    );                              // alternative GOL scheme

    BtnCreate
    (
        SERCURITY_SCREEN_ID_CLEAR_BUT,                // ID
        SECURITY_KEYSTARTX + 0 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 4 * SECURITY_KEYSIZEY,
        SECURITY_KEYSTARTX + 1 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 5 * SECURITY_KEYSIZEY,   // dimension
        5,
        BTN_DRAW,                   // will be dislayed after creation
        NULL,                       // no bitmap
        (XCHAR *)ClearStr,             // text
        currentScheme
    );                              // alternative GOL scheme
    BtnCreate
    (
        SERCURITY_SCREEN_ID_ENTER_BUT,                   // ID
        SECURITY_KEYSTARTX + 2 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 4 * SECURITY_KEYSIZEY,
        SECURITY_KEYSTARTX + 3 * SECURITY_KEYSIZEX,
        SECURITY_KEYSTARTY + 5 * SECURITY_KEYSIZEY,   // dimension
        5,
        BTN_DRAW,                   // will be dislayed after creation
        NULL,                       // no bitmap
        (XCHAR *)EnterStr,             // text
        currentScheme
    );                              // alternative GOL scheme


}
/*******************************************************************************
 * FUNCTION: prv_vCreateKeypad
 *
 * PARAMETERS:
 * ~ void
 * 
 * RETURN:
 * ~ void
 *
 * DESCRIPTIONS:
 * Create a numberic keypad.
 *
 *******************************************************************************/
static void prv_vCreateKeypad(void)
{
    // Create key 1 - 9.
    static const char aszNumber[][2] = {"1", "2", "3", "4", "5", "6", "7", "8", "9"};
    unsigned char ucRow = 0;
    unsigned char ucColumm = 0;
    unsigned char ucNumber = 0;

    signed short ssLeftTemp = KEYPAD_L;
    signed short ssTopTemp = KEYPAD_T;
    
    for (ucRow = 0; ucRow < 3; ucRow++) {
        for (ucColumm = 0; ucColumm < 3; ucColumm++) {
            BtnCreate(  GID_KEYPAD_1 + ucNumber,
                        ssLeftTemp,              ssTopTemp,
                        ssLeftTemp + BTN_KEY_WIDTH, ssTopTemp + BTN_KEY_HEIGHT,
                        BTN_RADIUS, BTN_DRAW, NULL, (char *)aszNumber[ucNumber], pxBtnScheme
                     );

            // Increase the X position and number.
            ssLeftTemp += BTN_KEY_WIDTH + BTN_KEY_GAP_X;
            ucNumber++;
        }

        // Reset X position and increase Y position.
        ssLeftTemp = KEYPAD_L;
        ssTopTemp += BTN_KEY_HEIGHT + BTN_KEY_GAP_Y;
    }



    // Create key "DEL".
    BtnCreate(  GID_KEYPAD_DEL,
                ssLeftTemp,              ssTopTemp,
                ssLeftTemp + BTN_KEY_WIDTH, ssTopTemp + BTN_KEY_HEIGHT,
                BTN_RADIUS, BTN_DRAW, NULL, "DEL", pxBtnScheme
             );

    // Increase the X position.
    ssLeftTemp += BTN_KEY_WIDTH + BTN_KEY_GAP_X;



    // Create key 0.
    BtnCreate(  GID_KEYPAD_0,
                ssLeftTemp,              ssTopTemp,
                ssLeftTemp + BTN_KEY_WIDTH, ssTopTemp + BTN_KEY_HEIGHT,
                BTN_RADIUS, BTN_DRAW, NULL, "0", pxBtnScheme
             );

    // Increase the X position.
    ssLeftTemp += BTN_KEY_WIDTH + BTN_KEY_GAP_X;



    // Create key "OK".
    BtnCreate(  GID_KEYPAD_OK,
                ssLeftTemp,              ssTopTemp,
                ssLeftTemp + BTN_KEY_WIDTH, ssTopTemp + BTN_KEY_HEIGHT,
                BTN_RADIUS, BTN_DRAW, NULL, "OK", pxBtnScheme
             );
}
/*******************************************************************************
 * 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();
}
Beispiel #16
0
void CreateListBox(void)
{
    LISTBOX *pLb;

    DelayMs(50);
    
    if ( CreateListBoxScheme() )
    {
		GFX_DRIVER_CreateLayer( GFX_PIP_LAYER, 0, LB_ORIGIN_START_X, LB_ORIGIN_START_Y, LB_ORIGIN_END_X, LB_ORIGIN_END_Y );
	    GFX_DRIVER_ShowLayer(GFX_PIP_LAYER); 
	    GFX_DRIVER_ShowLayer( GFX_CURSOR_LAYER );
	    GFX_DRIVER_ActivateLayer( GFX_PIP_LAYER );
	        	
	    pLb = LbCreate
	    (
	         ID_LBS_LISTBOX1,                           // ID
	         0, 										// Start X
	         0,                                         // Start Y
	         LB_WIDTH-30,                               // End X
	         LB_HEIGHT,                                 // End Y dimension
	         LB_DRAW /*| LB_FOCUSED*/,                  // will be dislayed after creation
	         (XCHAR*)ListboxLstStr, //pMyItemList,
	         altScheme                                  // use alternate scheme
	    );                                          
	        
	    SHORT count = LbGetCount(pLb);
	        
	    SldCreate
	    (
	        ID_LBS_SLIDER1,                             // ID
	        LB_WIDTH-30,                                // Start X
	        32,                                         // Start Y
	        LB_WIDTH,                                   // End X
	        110,                                        // End Y dimension
	        SLD_DRAW | SLD_SCROLLBAR | SLD_VERTICAL,    // vertical, will be dislayed after creation
	        count - 1,                                  // range
	        1,                                          // page
	        count - 1,                                  // pos
	        altScheme                                   // use alternate scheme
	    );                              
	    BtnCreate
	    (
	        ID_LBS_BUTTON1,                             // ID
	        LB_WIDTH-30,                                // Start X
	        0,                                          // Start Y
	        LB_WIDTH,                                   // End X 
	        32,                                         // End Y 
	        0,                                          // dimension (no radius)
	        BTN_DRAW,                                   // will be dislayed after creation
	        NULL,                                       // no bitmap
	        (XCHAR *)UpArrowStr,                        // Up Arrow
	        altScheme                                   // use alternate scheme
	    );                              
	    BtnCreate
	    (
	        ID_LBS_BUTTON2,                             // ID
	        LB_WIDTH-30,                                        // Start X
	        110,                                        // Start Y 
	        LB_WIDTH,                                        // End X
	        142,                                        // End Y 
	        0,                                          // dimension (no radius)
	        BTN_DRAW,                                   // will be dislayed after creation
	        NULL,                                       // no bitmap
	        (XCHAR *)DownArrowStr,                      // Down Arrow
	        altScheme                                   // use alternate scheme
	    );
	    
	    
		WORD y = GetTextHeight((void *) altScheme->pFont)/2;
		GFX_DRIVER_MoveLayer( GFX_CURSOR_LAYER, LB_ORIGIN_START_X + 180, LB_ORIGIN_START_Y + y/2 ); 
	}
    
}
Beispiel #17
0
/************************************************************************
 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
    );

}