2021-06-02 02:25 PM
Version: Touch GFX Designer 4.16.1
Project is attached.
My question is similar to:
I looked at the ContainerCallback example that Martin posted and I think I understand what he is trying to show.
In that solution though, the View register itself to a known custom container name (i.e. customContainer11)
Screen1View::Screen1View()
{
customContainer11.setPtr(this);
}
If my custom container is an element inside a Scroll list, where is a good place
to call setPtr()? from inside ListUpdateItem()? or is there a better place?
essentially I am looking to have the onGroupLightLevelChange() in my example to notify the View -> Presenter -> Model of a value change.
Also, if the backend want to influence how many items are displayed in the scroll list (e.g. item 1,3,5,8 in sequence) is there a good example on how to do that?
I am able to use lightGroupListUpdateItem() in my example to dynamically generate the groupNames and set the slider value, but If i try to skip say group 3, by setting it notVisible/Touchable, The scroll list displays a gap between group2 and group4 and when I scroll the list, group3 becomes visible again.
Thanks for everyone's time.
2021-06-03 01:35 PM
Partially answering my own question on custom containers getting messages back via the correct View -> Presenter -> Model channels.
Following the example that Martin sets up for CustomCallback, here are the steps I end up doing (using my attached project as a reference):
Not quite sure on the finer points of passing a pointer to a view vs a presenter. I end up using presenter since it seems like a simpler approach than to call a method on the view only to have it call the presenter's method.