예제 #1
0
 public override void OnMouseDown(MouseButtonEventArgs e)
 {
     if (CheckArrows(LastMouseDownMousePosition.X, LastMouseDownMousePosition.Y))
     {
         Timer.Delay = 500;
         if (prevArrowHover)
         {
             tmrMonthDelta = -1;
             TimerAction();
             Invalidate();
             Timer.Start();
         }
         else if (nextArrowHover)
         {
             tmrMonthDelta = 1;
             TimerAction();
             Invalidate();
             Timer.Start();
         }
         else
         {
             tmrMonthDelta = 0;
         }
     }
     else
     {
         tmrMonthDelta = 0;
         base.OnMouseDown(e);
     }
 }
예제 #2
0
        protected void StartOutOfBoundsSelection(int direction)
        {
            if (VScrollBar == null || !VScrollBar.Visible)
            {
                return;
            }

            OutOfBondsDirection = direction;
            if (OutOfBoundsSelectionTimer == null)
            {
                OutOfBoundsSelectionTimer = new TaskTimer(50, () => {
                    if (OutOfBondsDirection < 0)
                    {
                        RowManager.SetCursorPosition(0, 0 - ScrollOffsetY - Padding.Top - RowManager.LineHeight);
                        SetSelection();
                    }
                    else if (OutOfBondsDirection > 0)
                    {
                        RowManager.SetCursorPosition(0, Height - ScrollOffsetY + Padding.Height + RowManager.LineHeight + RowManager.LineHeight);
                        SetSelection();
                    }

                    EnsureCurrentRowVisible();
                    VScrollBar.Value += OutOfBondsDirection * VScrollBar.SmallChange;
                }, 500);
                OutOfBoundsSelectionTimer.Start();
            }
            else if (!OutOfBoundsSelectionTimer.Enabled)
            {
                OutOfBoundsSelectionTimer.Start();
            }
        }
예제 #3
0
 public override void OnMouseDown(OpenTK.Input.MouseButtonEventArgs e)
 {
     IsMouseDown = true;
     base.OnMouseDown(e);
     Invalidate();
     if (IsAutofire)
     {
         if (Enabled && WidgetState == WidgetStates.Pressed)
         {
             try {
                 OnFire();
                 Timer.Start();
             } catch (Exception ex) {
                 ex.LogWarning();
             }
         }
     }
 }
예제 #4
0
        public RootContainer(IGUIContext ctx, string name)
            : base(name, Docking.Fill, new EmptyWidgetStyle())
        {
            CTX      = ctx;
            Overlays = new BinarySortedList <Widget> ();
            if (ctx != null)
            {
                this.SetSize(ctx.Width, ctx.Height);
            }

            m_Tooltip         = new TooltipWidget("root");
            m_Tooltip.MaxSize = new SizeF(320, 600);
            m_Tooltip.ZIndex  = this.ZIndex + 10000;
            AddChild(m_Tooltip);
            CanFocus           = false;
            TabIndex           = -1;
            TooltipDelayAction = new DelayedAction(500, TooltipAction);
            HeartbeatTimer     = new TaskTimer(500, Heartbeat);
            HeartbeatTimer.Start();
            HeartbeatSubscriptions = new HashSet <Widget> ();
            Tooltip  = null;
            Messages = new MessageQueue <EventMessage> (true);
        }