Пример #1
0
/////////////////////////////////////////////////////////////////////////////
// Function: WORD CreateBackButton()
// 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 CreateBackButton()
{
    GFX_GOL_BUTTON *pObj;

    pObj = GFX_GOL_ButtonCreate (
                        
                        ID_BACK,     // object�s ID
                        20, 10,
                        70, 35, 0,
                        GFX_GOL_BUTTON_DRAW_STATE,
                        NULL,
                        NULL,
                        MainMenuStr,
                        GFX_ALIGN_HCENTER,
                        demoScheme
                     );
                     
    if(pObj == NULL)
        return (0);        
        
    return 1;
    
}    
Пример #2
0
/**
 * Layout buttons on EPD
 */
void Show_Button(void)
{
    uint16_t Button_Width, Button_Height;

    Button_Width  = GFX_TextStringWidthGet(Button4_Str, scheme2.pFont) + 8;
    Button_Height = GFX_TextStringHeightGet(scheme2.pFont) + 2;

    GFX_GOL_ButtonCreate(
        ID_BUTTON1,                                    
        Button1_pos_x,
        Button1_pos_y,
        Button1_pos_x + Button_Width,
        Button1_pos_y + Button_Height,
        3,                                             
        GFX_GOL_BUTTON_DRAW_STATE,
        NULL, NULL,                                    
        Button1_Str,                                   
        GFX_ALIGN_LEFT | GFX_ALIGN_VCENTER,
        &scheme2);

     GFX_GOL_ButtonCreate(
        ID_BUTTON2,                                    
        Button2_pos_x,
        Button2_pos_y,
        Button2_pos_x + Button_Width,
        Button2_pos_y + Button_Height,
        3,                                             
        GFX_GOL_BUTTON_DRAW_STATE,
        NULL, NULL,                                    
        Button2_Str,                                   
        GFX_ALIGN_LEFT | GFX_ALIGN_VCENTER,
        &scheme2);

    GFX_GOL_ButtonCreate(
        ID_BUTTON3,                                    
        Button3_pos_x,
        Button3_pos_y,
        Button3_pos_x + Button_Width,
        Button3_pos_y + Button_Height,
        3,                                             
        GFX_GOL_BUTTON_DRAW_STATE,
        NULL, NULL,                                    
        Button3_Str,                                   
        GFX_ALIGN_LEFT | GFX_ALIGN_VCENTER,
        &scheme2);

    GFX_GOL_ButtonCreate(
        ID_BUTTON4,                                    
        Button4_pos_x,
        Button4_pos_y,
        Button4_pos_x + Button_Width,
        Button4_pos_y + Button_Height,
        3,                                             
        GFX_GOL_BUTTON_DRAW_STATE, 
        NULL, NULL,                                    
        Button4_Str,                                   
        GFX_ALIGN_LEFT | GFX_ALIGN_VCENTER,
        &scheme2);

    GFX_GOL_ButtonCreate(
        ID_BUTTON5,                                    
        Button5_pos_x,
        Button5_pos_y,
        Button5_pos_x + Button_Width,
        Button5_pos_y + Button_Height,
        3,                                             
        GFX_GOL_BUTTON_DRAW_STATE,
        NULL, NULL,                                    
        Button5_Str,                                   
        GFX_ALIGN_LEFT | GFX_ALIGN_VCENTER,
        &scheme2);
}
Пример #3
0
/////////////////////////////////////////////////////////////////////////////
// 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;
    
}