Hi,
regarding your first question. The problem is that when touch handler overlap, only the handler lying in front of the screen reacts to the touch events. Solution for such application cases is the 'deflection'. For this purpose the Core::Root class implements the methods DeflectCursor() and RetargetCursor(). In your application case you use the DeflectCursor() method. The following would be the approach:
1. First ensure that the 'Slide Touch Handler' is arranged behind all ItemSelectMenu components. The simplest would be to reorder it behind the 'Outline Box' itself.
2. In the implementation of the ItemSelectMenu component, adapt the onDrag slot method:
if (( delta > 8 ) || ( delta < -8 ))
{
// The owner of the item is the menu itself where the 'Outline Box' and the
// 'Slide Touch Handler' are enclosed. Cast the generic 'Owner' to the specific
// class of the menu component
var TheClassOfYourMenuComponent menu = (TheClassOfYourMenuComponent)Owner;
// Knowing the superior menu component, deflect the cursor events to the
// 'Slide Touch Handler' embedded inside it.
GetRoot().DeflectCursor( menu.SlideTouchHandler, <0,0>);
}
The effect of this implementation is: when the user taps a menu item, the 'Simple Touch Handler' gets the events first. When the user drags the finger more than 8 pixel up/down, the event handling is passed over to the 'Slide Touch Handler' in the superior menu component. From the menu item's point of view, the user interaction has finished. Therefore, if you implement some onRelease code in the menu item, evaluate the variable 'AutoDeflected' of the 'Simple Touch Handler' in order to distinguish whether the user has taped the menu item or the interaction has been deflected to the menu. In the second case, the menu item should ignore the release event:
if ( SimpleTouchHandler.AutoDeflected )
return;
With the next version 8.10 we will provide an improvement of all touch handler. With it, it is no more necessary to deflect the cursors 'manually'. Instead, you can specify for every touch handler so-called 'retarget condition'. This can e.g. be a vertical movement. As soon as the specified gesture is detected, the touch handler takes care of the correct deflection to other handle. We plan to release 8.10 in few weeks.
Regarding your second question. You can override the inherited method Init() and implement there the desired startup code for the component.
Best regard