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

Developer

Forums

Forums:

Platform: 1.0.2.410
Simulator: 7.6

According to headef file "AEEModelHelpers.h", line 526.

The 'dwParam' member of the ModelEvent
contains a pointer to a WidgetElemClickEvent struct containing information
about gesture.

While running the code on simulator, dwParam actually points to a NULL address.
We need to do static_cast to convert type 'ModelEvent*' to type 'WidgetElemClickEvent*'.

You can modify PVS code:

C:\Program Files\Qualcomm\Brew MP SDK\Platforms\1.0.2.365 Pro\pvs\platform\ui\widgets\src\utwidgets\

to know what actually dwParam points to.

I believe that is a documentation error.  You simply have to cast the ModelEvent to a WidgetElemClickEvent, so dwParam also pointing to the same struct wouldn't be all that helpful.  The following is enough to access the click event, but based on your comment you are already familiar...
static void myapp_ButtonViewModelChanged(myapp *pMe, ModelEvent* pEvt)
{
   if (EVT_MDL_WIDGETELEM_CLICK == pEvt->evCode)
   {
      WidgetElemClickEvent *clickEvt = (WidgetElemClickEvent *)pEvt;
                …
        }
        …
}
 
 
Regards,
Jason

I believe that is a documentation error.  You simply have to cast the ModelEvent to a WidgetElemClickEvent, so dwParam also pointing to the same struct wouldn't be all that helpful.  The following is enough to access the click event, but based on your comment you are already familiar...
static void myapp_ButtonViewModelChanged(myapp *pMe, ModelEvent* pEvt)
{
   if (EVT_MDL_WIDGETELEM_CLICK == pEvt->evCode)
   {
      WidgetElemClickEvent *clickEvt = (WidgetElemClickEvent *)pEvt;
                …
        }
        …
}
 
 
Regards,
Jason