Skip to main content
MPawl
Visitor II
March 10, 2020
Question

Is it possible to make a view with possibility to change a skin for it?

  • March 10, 2020
  • 1 reply
  • 619 views

I am looking for solution for selecting a skin for my application screen view. All components will have thesame position and size but I need to change coresponding bitmaps with this components. I need a solution which will work similar to selection of language.

I am not expert in TouhGfx but I wonder if it is possible to replace a bitmp data base and select between pointer for each containig differen list of bitmaps?​

This topic has been closed for replies.

1 reply

Alexandre RENOUX
Visitor II
March 11, 2020

It is possible to change bitmaps of different widgets according to a certain selection by calling the function setBitmap(). If you want to do the same as selection language where all the texts of all the screens are updated upon selection, this solution is not directly implemented in the TouchGFX framework, the programmer has to do it himself.

A simple solution would be: when you select a skin, you save the value in the Model, then in every setupScreen() function you start by reading the value stored in the model and initialize your view with the correct skin.

void Screen1View::setupScreen()
{
 Screen1ViewBase::setupScreen();
 
 switch(presenter->getCurrentSkin())
 {
 case SKIN1 :
 // Initialize the widgets with the correct bitmaps
 break:
 case SKIN2 :
 // same
 ...
 default : break;
 }
}

Hope this will help,

/Alexandre