Initial commit
This commit is contained in:
@ -0,0 +1,43 @@
|
||||
/*********************************************************************************/
|
||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
|
||||
/*********************************************************************************/
|
||||
#include <new>
|
||||
#include <gui_generated/common/FrontendApplicationBase.hpp>
|
||||
#include <gui/common/FrontendHeap.hpp>
|
||||
#include <touchgfx/transitions/NoTransition.hpp>
|
||||
#include <texts/TextKeysAndLanguages.hpp>
|
||||
#include <touchgfx/Texts.hpp>
|
||||
#include <touchgfx/hal/HAL.hpp>
|
||||
#include <platform/driver/lcd/LCD16bpp.hpp>
|
||||
#include <gui/terminal_screen/TerminalView.hpp>
|
||||
#include <gui/terminal_screen/TerminalPresenter.hpp>
|
||||
|
||||
using namespace touchgfx;
|
||||
|
||||
FrontendApplicationBase::FrontendApplicationBase(Model& m, FrontendHeap& heap)
|
||||
: touchgfx::MVPApplication(),
|
||||
transitionCallback(),
|
||||
frontendHeap(heap),
|
||||
model(m)
|
||||
{
|
||||
touchgfx::HAL::getInstance()->setDisplayOrientation(touchgfx::ORIENTATION_LANDSCAPE);
|
||||
touchgfx::Texts::setLanguage(GB);
|
||||
reinterpret_cast<touchgfx::LCD16bpp&>(touchgfx::HAL::lcd()).enableTextureMapperAll();
|
||||
}
|
||||
|
||||
/*
|
||||
* Screen Transition Declarations
|
||||
*/
|
||||
|
||||
// Terminal
|
||||
|
||||
void FrontendApplicationBase::gotoTerminalScreenNoTransition()
|
||||
{
|
||||
transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoTerminalScreenNoTransitionImpl);
|
||||
pendingScreenTransitionCallback = &transitionCallback;
|
||||
}
|
||||
|
||||
void FrontendApplicationBase::gotoTerminalScreenNoTransitionImpl()
|
||||
{
|
||||
touchgfx::makeTransition<TerminalView, TerminalPresenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
/*********************************************************************************/
|
||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
|
||||
/*********************************************************************************/
|
||||
#include <gui_generated/terminal_screen/TerminalViewBase.hpp>
|
||||
#include <touchgfx/Color.hpp>
|
||||
#include "BitmapDatabase.hpp"
|
||||
#include <texts/TextKeysAndLanguages.hpp>
|
||||
|
||||
TerminalViewBase::TerminalViewBase() :
|
||||
buttonCallback(this, &TerminalViewBase::buttonCallbackHandler)
|
||||
{
|
||||
|
||||
__background.setPosition(0, 0, 480, 272);
|
||||
__background.setColor(touchgfx::Color::getColorFrom24BitRGB(0, 0, 0));
|
||||
|
||||
buttonClearLogText_.setXY(1, 6);
|
||||
buttonClearLogText_.setBitmaps(touchgfx::Bitmap(BITMAP_DARK_BUTTONS_ROUND_EDGE_ICON_BUTTON_ID), touchgfx::Bitmap(BITMAP_DARK_BUTTONS_ROUND_EDGE_ICON_BUTTON_PRESSED_ID), touchgfx::Bitmap(BITMAP_DARK_ICONS_TRASH_32_ROTATED_ID), touchgfx::Bitmap(BITMAP_DARK_ICONS_TRASH_32_ROTATED_ID));
|
||||
buttonClearLogText_.setIconXY(17, 14);
|
||||
buttonClearLogText_.setAction(buttonCallback);
|
||||
|
||||
scrollableTextArea_.setPosition(61, 6, 414, 260);
|
||||
scrollableTextArea_.setScrollbarsColor(touchgfx::Color::getColorFrom24BitRGB(0, 0, 0));
|
||||
|
||||
logText_.setPosition(0, 129, 414, 130);
|
||||
logText_.setColor(touchgfx::Color::getColorFrom24BitRGB(171, 171, 171));
|
||||
logText_.setLinespacing(0);
|
||||
logText_.setRotation(touchgfx::TEXT_ROTATE_180);
|
||||
Unicode::snprintf(logText_Buffer, LOGTEXT__SIZE, "%s", touchgfx::TypedText(T_SINGLEUSEID2).getText());
|
||||
logText_.setWildcard(logText_Buffer);
|
||||
logText_.setTypedText(touchgfx::TypedText(T_SINGLEUSEID1));
|
||||
scrollableTextArea_.add(logText_);
|
||||
|
||||
add(__background);
|
||||
add(buttonClearLogText_);
|
||||
add(scrollableTextArea_);
|
||||
}
|
||||
|
||||
void TerminalViewBase::setupScreen()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//Handles when a key is pressed
|
||||
void TerminalViewBase::handleKeyEvent(uint8_t key)
|
||||
{
|
||||
if(0 == key)
|
||||
{
|
||||
//Interaction1
|
||||
//When hardware button 0 clicked move logText_
|
||||
//Set position x:0 and y:0 on logText_
|
||||
logText_.moveTo(0,0);
|
||||
}
|
||||
}
|
||||
|
||||
void TerminalViewBase::buttonCallbackHandler(const touchgfx::AbstractButton& src)
|
||||
{
|
||||
if (&src == &buttonClearLogText_)
|
||||
{
|
||||
//ButtonClearLogTextClicked
|
||||
//When buttonClearLogText_ clicked call virtual function
|
||||
//Call onButtonClearLogTextClicked
|
||||
onButtonClearLogTextClicked();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user