cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX menu multilevel variables store.

MM..1
Chief II

I now try create multilevel menu system over two animated screens. My trouble is how and where store cursor and selection on any level. I create test variable int menulevel in Model , but how to access , change it in two screens? Exist any direct way or only for me chaotic usage of set get in presenters and model ?

Second is actual cursor , can be used for this any global array or better is model class properties?

Now i use this but on every entry to menu is reset to zero.

class Screen3View : public Screen3ViewBase
{
public:
    Screen3View();
    virtual ~Screen3View() {}
    virtual void setupScreen();
    virtual void tearDownScreen();
 
    virtual void scrollList1UpdateItem(MenuItem& item, int16_t itemIndex);
    virtual void curdown();
    virtual void curup();
protected:
    int cursorpos;
};
Screen3View::Screen3View() :	cursorpos(0)
{
 
}

1 REPLY 1
MM..1
Chief II

Nobody? I extend my question. Exist way to make screens classes persistent? This will solve this problem , where showed screen is allways reset.

When not , one way is use Model - Presenter - View or better Model - ModelListener - Presenter - View.

Second simpler is based on state , that Model class is only one primary instance and can here define global variables and share it directly to view.