cancel
Showing results for 
Search instead for 
Did you mean: 

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

MPawl
Associate

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?​

1 REPLY 1
Alexandre RENOUX
Principal

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