Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi,

 

I have created a popup window and inserted a GridListContainer into that.Using a list container model factory I have inserted 4 static widgets into the GridListContainer.

 

Now I want to catch the event when any static widget gets selected, so I have written code under EVT_POINTER_DOWN of static widget's event handler.

 

But the problem is I am getting EVT_POINTER_DOWN event only inside popup window and GridlIstContainer?

Why am I not receiving EVT_POINTER_DOWN event on static widgets which are present inside GridListContainer?

When I called API IWIDEGT_GetFocusIndex on GridListContainer I get the correct index of the static widget getting selected.

 

Is this the only way to know that select has been done on static widget?

 

Waiting for your response

-Pradnya

Did you register for static widget's model listener? You should get events like EVT_MDL_WIDGETELEM_CLICK and not pointer up/pointer down.

Did you register for static widget's model listener? You should get events like EVT_MDL_WIDGETELEM_CLICK and not pointer up/pointer down.

Hi,
I registered the ViewModel Listner for the gridlist as well as for all static widgets getting inserted into it.
but only gridlist's ModelListner function gets called with EVT_MDL_WIDGETELEM_CLICK & EVT_MDL_SCROLL_CHANGE & EVT_MDL_FOCUS_CHANGE.
In case of EVT_MDL_FOCUS_CHANGE I get correct values of numItems and focusIndex,which reflect the staticwidget I clicked.
 
But none of my StaticWidget's ViewModel Lister functions gets called? Is this a correct behavior?
So do I need to retrieve the IWidget* for the staticwidget from focusIndex and call IWidget_HandleEvent with that IWidget* every time so that the individual staticwidget's event handler will get called.
your Clarification on these concepts is highly appreciated.
Thank You
-Pradnya

Hi,
I registered the ViewModel Listner for the gridlist as well as for all static widgets getting inserted into it.
but only gridlist's ModelListner function gets called with EVT_MDL_WIDGETELEM_CLICK & EVT_MDL_SCROLL_CHANGE & EVT_MDL_FOCUS_CHANGE.
In case of EVT_MDL_FOCUS_CHANGE I get correct values of numItems and focusIndex,which reflect the staticwidget I clicked.
 
But none of my StaticWidget's ViewModel Lister functions gets called? Is this a correct behavior?
So do I need to retrieve the IWidget* for the staticwidget from focusIndex and call IWidget_HandleEvent with that IWidget* every time so that the individual staticwidget's event handler will get called.
your Clarification on these concepts is highly appreciated.
Thank You
-Pradnya

Static widget doesn't have attached view model; it has only value model. So the behavior you have seen is correct. I am not clear on the need to send events to individual static widgets using _HandleEvent method. Whenever you send events to root container using IWidget_HandleEvent(), root container passes on those events to itss childs, so static widgets automatially receives all the events and processes supported events.

Static widget doesn't have attached view model; it has only value model. So the behavior you have seen is correct. I am not clear on the need to send events to individual static widgets using _HandleEvent method. Whenever you send events to root container using IWidget_HandleEvent(), root container passes on those events to itss childs, so static widgets automatially receives all the events and processes supported events.

The static widget does not have a touch controller, so it will never issue a click event.  You could create a Button touch controller and set the touch controller of the static widget to be this newly created TC.  You would do something like the following:
ISHELL_CreateInstance(piShell, AEECLSID_ButtonTC, (void **)&piTC);
IWidget_SetTouchController(piWidget, piTC);
 
- J.Ford

The static widget does not have a touch controller, so it will never issue a click event.  You could create a Button touch controller and set the touch controller of the static widget to be this newly created TC.  You would do something like the following:
ISHELL_CreateInstance(piShell, AEECLSID_ButtonTC, (void **)&piTC);
IWidget_SetTouchController(piWidget, piTC);
 
- J.Ford