cancel
Showing results for 
Search instead for 
Did you mean: 

Mix and Merge screens outside TouchGFX

RiccardoD
Associate
 
In TouchGFX online docs there is a Tip that I think it would be very interesting going deeper into.

Are there examples? Someone tried this way?

 

"Code Structure

TIP
Of course you do not need to use any features of the code generated by TouchGFX Designer but it will potentially save a lot of time. It is possible to do TouchGFX applications the old-school way by just adding the necessary files by hand.

It is also possible to mix and match. For example, you can have screens that are not defined within the TouchGFX Designer project. You can add the gotoXYZ functions to the FrontendApplication class and add the views, presenters and transitions you need for your screen to the FrontendHeap. "

https://support.touchgfx.com/docs/development/ui-development/software-architecture/code-structure 

 

1 REPLY 1

Hello @RiccardoD ,
Unfortunately, there are no examples of that in TouchGFX because the screens are not implemented in TouchGFX. However, the easiest way it would be to define an empty screen in the designer, and then have a source file defining all the functionalities you want, and then instruct TouchGFX to use which functions for setup and teardown in the View.cpp.
An imaginary example would be:

 

//MyExternalScreenView.cpp created in TouchGFX
extern "C" {
   void setUpTheScreen();
   void exitTheScreen();
   ...
}

void MyExternalScreen::setupScreen()
{
   MyExternalScreenBase::setupScreen();
   
   setUpTheScreen();
}

void MyExternalScreen::tearDownScreen()
{
    exitTheScreen(); 

    MyExternalScreenBase::tearDownScreen();
}

 

 

 

//MyExternalScreenImplementaion.c  created outside of TouchGFX

void setUpTheScreen(){
   //Implementation
}

void exitTheScreen(){
  //Implementation
}

...

 

I hope this helps you, don't hesitate to ask more questions 

Mohammad MORADI
ST Software Developer | TouchGFX