コード例 #1
0
ファイル: TabDialog.cs プロジェクト: piwi1263/Tinkr
        protected override void TouchGestureMessage(object sender, TouchType type, float force, ref bool handled)
        {
            if (Children == null)
            {
                return;
            }

            if (type == TouchType.GestureRight)
            {
                int newSel = _selIndex - 1;
                if (newSel < 0)
                {
                    newSel = Children.Length - 1;
                }
                SelectedIndex = newSel;
            }
            else if (type == TouchType.GestureLeft)
            {
                int newSel = _selIndex + 1;
                if (newSel > Children.Length - 1)
                {
                    newSel = 0;
                }
                SelectedIndex = newSel;
            }

            if (ActiveChild != null)
            {
                handled = true;
                ActiveChild.SendTouchGesture(sender, type, force);
            }
        }
コード例 #2
0
ファイル: Tab.cs プロジェクト: piwi1263/Tinkr
 protected override void TouchGestureMessage(object sender, TouchType type, float force, ref bool handled)
 {
     if (ActiveChild != null)
     {
         handled = true;
         ActiveChild.SendTouchGesture(sender, type, force);
     }
 }
コード例 #3
0
ファイル: Panel.cs プロジェクト: valoni/Tinkr
 /// <summary>
 /// Override this message to handle touch events internally.
 /// </summary>
 /// <param name="sender">Object sending the event</param>
 /// <param name="type">Type of touch gesture</param>
 /// <param name="force">Force associated with gesture (0.0 to 1.0)</param>
 /// <param name="handled">true if the event is handled. Set to true if handled.</param>
 /// <remarks>
 /// Forwards the message to <see cref="Container.ActiveChild"/>
 /// </remarks>
 protected override void TouchGestureMessage(object sender, TouchType type, float force, ref bool handled)
 {
     //TODO: check if this code shouldn't go to Container
     if (ActiveChild != null)
     {
         handled = true;
         ActiveChild.SendTouchGesture(sender, type, force);
     }
 }