Ejemplo n.º 1
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     base.OnMouseMove(e);
     if (DateTime.Now.Subtract(lastTooltipUpdate).TotalSeconds > 0.01)
     {
         KChartHandler.ShowEndNames(!shiftKeyDown);
         if (mouseDown)
         {
             UpdateTooltip(new Point(0, 0), "");
         }
         else if (!shiftKeyDown)
         {
             UpdateTooltip(new Point(e.X, e.Y), KChartHandler.HitListTooltip(Swipe.Inverse(new SKPoint(e.X, e.Y), KChartHandler.GetManualPinchPan()), 10));
         }
         lastTooltipUpdate = DateTime.Now;
         if (!KControls.IsSimulating())
         {
             Invalidate();                            // because of ShowEndNames
         }
     }
     if (mouseDown)
     {
         touch.onTouchSwipeOrMouseDrag?.Invoke(mouseDownPoint, new SKPoint(e.Location.X, e.Location.Y));
     }
 }
Ejemplo n.º 2
0
 public bool MyModifiersChanged(NSEvent e)
 {
     if (e.ModifierFlags.HasFlag(NSEventModifierMask.ShiftKeyMask))   //0x38 kVK_Shift
     {
         shiftKeyDown = true;
         if (mouseInsideChartControl)
         {
             KChartHandler.ShowEndNames(false);
             showTooltip = false; UpdateTooltip(e);
             if (!KControls.IsSimulating())
             {
                 Invalidate();
             }
         }
         return(true);
     }
     else
     {
         shiftKeyDown = false;
         if (mouseInsideChartControl)
         {
             KChartHandler.ShowEndNames(true);
             showTooltip = true; UpdateTooltip(e);
             if (!KControls.IsSimulating())
             {
                 Invalidate();
             }
         }
         return(false);
     }
 }
Ejemplo n.º 3
0
        public void SetSelection(string name)
        {
            if (!this.namedControls.ContainsKey(name))
            {
                return;
            }
            KButton control = this.namedControls[name];

            KControls.ItemSelected(this, control);
        }
Ejemplo n.º 4
0
 protected override void OnMouseEnter(EventArgs e)
 {
     base.OnMouseEnter(e);
     mouseInsideChartControl = true;
     KChartHandler.ShowEndNames(true);
     if (!KControls.IsSimulating())
     {
         Invalidate();
     }
 }
Ejemplo n.º 5
0
 protected override void OnMouseLeave(EventArgs e)
 {
     base.OnMouseLeave(e);
     mouseInsideChartControl = false;
     UpdateTooltip(new Point(0, 0), "");
     KChartHandler.ShowEndNames(false);
     if (!KControls.IsSimulating())
     {
         Invalidate();
     }
 }
Ejemplo n.º 6
0
 public override void MouseExited(NSEvent e)
 {
     base.MouseExited(e);
     mouseInsideChartControl = false;
     showTooltip             = false; UpdateTooltip(e);
     KChartHandler.ShowEndNames(false);
     if (!KControls.IsSimulating())
     {
         Invalidate();
     }
 }
Ejemplo n.º 7
0
 public override void MouseEntered(NSEvent e)
 {
     base.MouseEntered(e);
     mouseInsideChartControl = true;
     showTooltip             = !shiftKeyDown;
     KChartHandler.ShowEndNames(!shiftKeyDown);
     if (!KControls.IsSimulating())
     {
         Invalidate();
     }
 }
Ejemplo n.º 8
0
 public static void OnShiftKeyUp()    // called from GuiToWin.GuiToWin_KeyUp form callback
 {
     shiftKeyDown = false;
     if (mouseInsideChartControl)
     {
         KChartHandler.ShowEndNames(true);
         if (!KControls.IsSimulating())
         {
             chartControl.Invalidate();
         }
     }
 }
Ejemplo n.º 9
0
        public static bool shiftKeyDown = false; // See also WinGui_KeyDown, WinGui_KeyUp

        public static void OnShiftKeyDown()      // called from GuiToWin.GuiToWin_KeyDown form callback
        {
            shiftKeyDown = true;
            if (mouseInsideChartControl)
            {
                KChartHandler.ShowEndNames(false);
                chartControl.UpdateTooltip(new Point(0, 0), "");
                if (!KControls.IsSimulating())
                {
                    chartControl.Invalidate();
                }
            }
        }
Ejemplo n.º 10
0
 public override void MouseMoved(NSEvent e)
 {
     base.MouseMoved(e);
     if (!mouseInsideChartControl)
     {
         return;
     }
     (CGPoint native, SKPoint location) = ConvertToCanvasPoint(e);
     lastLocationForZoom = location;
     if (DateTime.Now.Subtract(lastTooltipUpdate).TotalSeconds > 0.01)
     {
         KChartHandler.ShowEndNames(!shiftKeyDown);
         showTooltip       = !shiftKeyDown; UpdateTooltip(e);
         lastTooltipUpdate = DateTime.Now;
         if (!KControls.IsSimulating())
         {
             Invalidate();                            // because of ShowEndNames
         }
     }
 }