Ejemplo n.º 1
0
Sheet* prepareStartBarSheet(Sheet *sheet)
{
    if (sheet != 0)
    {
        (*sheet).x = 112;
        (*sheet).y = 640;
        (*sheet).width = START_BAR_WIDTH;
        (*sheet).height = START_BAR_HEIGHT;
        (*sheet).buffer = (char *)allocMemoryInPage(START_BAR_WIDTH*START_BAR_HEIGHT*SCREEN_DENSITY);

        resetSheet(sheet);

        Image *appIcon1 = loadImageFromStorage(0x8808);
        (*appIcon1).x = 80;
        (*appIcon1).y = 10;

        addImage(sheet, appIcon1);

        Image *appIcon2 = loadImageFromStorage(0x882e);
        (*appIcon2).x = 180;
        (*appIcon2).y = 10;

        addImage(sheet, appIcon2);

        Image *appIcon3 = loadImageFromStorage(0x8854);
        (*appIcon3).x = 280;
        (*appIcon3).y = 10;

        addImage(sheet, appIcon3);

        Image *appIcon4 = loadImageFromStorage(0x887a);
        (*appIcon4).x = 380;
        (*appIcon4).y = 10;

        addImage(sheet, appIcon4);
    }
}
Ejemplo n.º 2
0
void prepareWindowSheetGraph(Sheet *sheet)
{
    if (sheet != null) {
        (*sheet).x = 60;
        (*sheet).y = 60;
        (*sheet).width = 800;
        (*sheet).height = 560;
        (*sheet).buffer = (char *)allocMemoryInPage((*sheet).width*(*sheet).height*SCREEN_DENSITY);
		View *mainView = createView(0, 0, 800, 560);

        resetSheet(sheet);

        Color startColor;
        startColor.red = 250;
        startColor.green = 250;
        startColor.blue = 250;

        Color endColor;
        endColor.red = 220;
        endColor.green = 220;
        endColor.blue = 220;

        Corner corner;
        corner.leftTop=2;
        corner.rightTop=2;
        corner.leftBtm=0;
        corner.rightBtm=0;

        Color mainBgColor;
        mainBgColor.red = 120;
        mainBgColor.green = 120;
        mainBgColor.blue = 120;

		Color mainColor;
        mainColor.red = 210;
        mainColor.green = 210;
        mainColor.blue = 210;

		Color textColor;
        textColor.red = 0x55;
        textColor.green = 0x55;
        textColor.blue = 0x55;

       	drawCornerRect(mainView, 0, 0, (*mainView).width, 21, mainBgColor, corner);
        drawGradualVerticalCornerRect(mainView, 1, 1, (*mainView).width-2, 20, startColor, endColor, corner, DIRECTION_UP);
        drawRect(mainView, 0, 21, (*mainView).width, 540, mainBgColor);
		drawRect(mainView, 1, 21, (*mainView).width-2, 538, mainColor);

		printString(mainView, "DataGraph", 9, 350, 4, textColor);

		graphPanel = createGraphPanel(5, 60, 790, 494);
		(*mainView).addSubView(mainView, (View *)graphPanel);
		(*mainView).addSubView(mainView, (*graphPanel).canvas);

		barGraphBtn = createButton(5, 24, 120, 32, &dataGraphFactory);
		(*barGraphBtn).initButton(barGraphBtn, "Bar Graph", 9, ButtonStyleLightGray);
		(*barGraphBtn).onMouseClick = onBarGraphBtnClick;
		(*mainView).addSubView(mainView, (View *)barGraphBtn);

		lineGraphBtn = createButton(130, 24, 120, 32, &dataGraphFactory);
		(*lineGraphBtn).initButton(lineGraphBtn, "Line Graph", 10, ButtonStyleLightGray);
		(*lineGraphBtn).onMouseClick = onLineGraphBtnClick;
		(*mainView).addSubView(mainView, (View *)lineGraphBtn);

		loadContentView(sheet, mainView);	
    }
}