Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Using touch controller

Each widget instantiates its touch controller when it receives an EnableTouch event.

To enable touch support for all widgets, the application calls IWidget_EnableTouch() on the IWidget interface object for the root container, as shown in this example:

nErr = ISHELL_CreateInstance(piShell, AEECLSID_CRootContainer, 
             (void**)&me->picRoot);
if (AEE_SUCCESS == nErr) {
   nErr = IRootContainer_QueryInterface(me->picRoot, AEEIID_IWidget, 
             (void**)&me->piwRoot);
}
if (AEE_SUCCESS == nErr) {
   nErr = IWidget_EnableTouch(me->piwRoot);
}

When the root container receives an EnableTouch event, it propagates the event to all current child widgets and to any widgets inserted after touch has been enabled.

An application can also disable touch support, by calling IWidget_DisableTouch() on the root container.

An application can customize some of the default touch controller behavior by setting properties. For example, to configure the minimum distance that a pointer should travel before the list starts flicking, an application should retrieve the list touch controller from the list widget by calling IWidget_GetTouchController(), and then call IController_SetMinLiveScrollDist() to set the value.