/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#include <gui_generated/screen1_screen/Screen1ViewBase.hpp>
#include <touchgfx/Color.hpp>
#include <images/BitmapDatabase.hpp>
#include <texts/TextKeysAndLanguages.hpp>

Screen1ViewBase::Screen1ViewBase() :
    updateItemCallback(this, &Screen1ViewBase::updateItemCallbackHandler)
{
    __background.setPosition(0, 0, 800, 480);
    __background.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
    add(__background);

    image1.setXY(0, 0);
    image1.setBitmap(touchgfx::Bitmap(BITMAP_SOLID_NAVY_BLUE_ID));
    add(image1);

    scrollWheel1.setPosition(62, 139, 348, 202);
    scrollWheel1.setHorizontal(false);
    scrollWheel1.setCircular(false);
    scrollWheel1.setEasingEquation(touchgfx::EasingEquations::linearEaseOut);
    scrollWheel1.setSwipeAcceleration(1);
    scrollWheel1.setDragAcceleration(50);
    scrollWheel1.setNumberOfItems(5);
    scrollWheel1.setSelectedItemOffset(0);
    scrollWheel1.setOvershootPercentage(0);
    scrollWheel1.setDrawableSize(331, 0);
    scrollWheel1.setDrawables(scrollWheel1ListItems, updateItemCallback);
    scrollWheel1.animateToItem(0, 0);
    add(scrollWheel1);

    digitalClock1.setPosition(0, -8, 473, 119);
    digitalClock1.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
    digitalClock1.setTypedText(touchgfx::TypedText(T_T_DATE));
    digitalClock1.displayLeadingZeroForHourIndicator(true);
    digitalClock1.setDisplayMode(touchgfx::DigitalClock::DISPLAY_12_HOUR_NO_SECONDS);
    digitalClock1.setTime12Hour(10, 10, 0, true);
    add(digitalClock1);

    textArea23.setXY(0, 419);
    textArea23.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
    textArea23.setLinespacing(0);
    textArea23.setTypedText(touchgfx::TypedText(T___SINGLEUSE_YYZC));
    add(textArea23);

    textArea24.setXY(533, 6);
    textArea24.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
    textArea24.setLinespacing(0);
    textArea24.setTypedText(touchgfx::TypedText(T___SINGLEUSE_DJFB));
    add(textArea24);
}

Screen1ViewBase::~Screen1ViewBase()
{

}

void Screen1ViewBase::setupScreen()
{
    scrollWheel1.initialize();
    for (int i = 0; i < scrollWheel1ListItems.getNumberOfDrawables(); i++)
    {
        scrollWheel1ListItems[i].initialize();
    }
}

void Screen1ViewBase::updateItemCallbackHandler(touchgfx::DrawableListItemsInterface* items, int16_t containerIndex, int16_t itemIndex)
{
    if (items == &scrollWheel1ListItems)
    {
        touchgfx::Drawable* d = items->getDrawable(containerIndex);
        Scroll_container* cc = (Scroll_container*)d;
        scrollWheel1UpdateItem(*cc, itemIndex);
    }
}
