cancel
Showing results for 
Search instead for 
Did you mean: 

How to change screen with touchgfx api functions with out interactions?

mchin.1
Associate II

I am working on touchgfx LCD. I need a a support to develop our custom application.

i have seen touchgfx API functions setup screen but i need example for better understanding.

17 REPLIES 17
mchin.1
Associate II

/*********************************************************************************/

/********** 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/screen1_screen/Screen1View.hpp>

#include <gui/screen1_screen/Screen1Presenter.hpp>

#include <gui/screen2_screen/Screen2View.hpp>

#include <gui/screen2_screen/Screen2Presenter.hpp>

#include <gui/screen3_screen/Screen3View.hpp>

#include <gui/screen3_screen/Screen3Presenter.hpp>

#include <gui/screen4_screen/Screen4View.hpp>

#include <gui/screen4_screen/Screen4Presenter.hpp>

#include <gui/screen5_screen/Screen5View.hpp>

#include <gui/screen5_screen/Screen5Presenter.hpp>

#include <gui/screen6_screen/Screen6View.hpp>

#include <gui/screen6_screen/Screen6Presenter.hpp>

#include <gui/screen7_screen/Screen7View.hpp>

#include <gui/screen7_screen/Screen7Presenter.hpp>

#include <gui/screen8_screen/Screen8View.hpp>

#include <gui/screen8_screen/Screen8Presenter.hpp>

#include <gui/screen9_screen/Screen9View.hpp>

#include <gui/screen9_screen/Screen9Presenter.hpp>

#include <gui/screen10_screen/Screen10View.hpp>

#include <gui/screen10_screen/Screen10Presenter.hpp>

using namespace touchgfx;

FrontendApplicationBase::FrontendApplicationBase(Model& m, FrontendHeap& heap)

  : touchgfx::MVPApplication(),

   transitionCallback(),

   frontendHeap(heap),

   model(m)

{

  touchgfx::HAL::getInstance()->setDisplayOrientation(touchgfx::ORIENTATION_PORTRAIT);

  reinterpret_cast<touchgfx::LCD16bpp&>(touchgfx::HAL::lcd()).enableTextureMapperAll();

}

/*

 * Screen Transition Declarations

 */

// Screen1

void FrontendApplicationBase::gotoScreen1ScreenNoTransition()

{

  transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoScreen1ScreenNoTransitionImpl);

  pendingScreenTransitionCallback = &transitionCallback;

}

void FrontendApplicationBase::gotoScreen1ScreenNoTransitionImpl()

{

  touchgfx::makeTransition<Screen1View, Screen1Presenter, touchgfx::NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model);

}

mchin.1
Associate II

1st screen is ok but for rest of the screens i did not get so how can i change my application from screen1 to screen 2 with out interaction. i need that give me support & concept.

OMG yes without interaction you need add this manualy to GUI files as everythink.

FrontendApplication.cpp

#include <gui/common/FrontendApplication.hpp>
 
FrontendApplication::FrontendApplication(Model& m, FrontendHeap& heap)
    : FrontendApplicationBase(m, heap)
{
 
}
 
add here screen 2 3 4 ...
void FrontendApplication::gotoScreen2ScreenNoTransition()
{
    transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoScreen2ScreenNoTransitionImpl);
    pendingScreenTransitionCallback = &transitionCallback;
}
 
void FrontendApplication::gotoScreen2ScreenNoTransitionImpl()
{
    touchgfx::makeTransition<Screen2View, Screen2Presenter, touchgfx::NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model);
}

and into hpp ...

mchin.1
Associate II

Thank you OK Is It works ? I will tell you after try manual addition.

Please tell about this stuff how to use beacause i am very new

Thank you but i have seen below information

switchScreen

virtual void switchScreen(Screen *newScreen)Switch to another Screen.Will call tearDownScreen on current Screen before switching, and subsequently call setupScreen and draw automatically for the new Screen.Parameters:newScreenA pointer to the new screen.

how can i use this to switch from one screen to other

virtual void switchScreen(Screen *newScreen)

maybe try

application().switchScreen( &Screen2View );

mchin.1
Associate II

Hi

screen changing is working fine.

i have a doubt about buttons.

If i add any button with out interaction how can i know is that button pressed or not?

Is button operation work without button interaction?

Mark answer , that help you as best and open new thread for this question out of topic

mchin.1
Associate II

ok can you please support for keypad widgets application.

i want to design keypad like mobile keypad

so how can i start to design keypad like custom smart mobile keypad.