Example #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));
     }
 }
Example #2
0
        private void UpdateTooltip(NSEvent e)
        {
            (CGPoint native, SKPoint flipped) = ConvertToCanvasPoint(e);
            flipped = Swipe.Inverse(flipped, KChartHandler.GetManualPinchPan()); // adjust for current pinchPan
            string tip = (showTooltip) ? KChartHandler.HitListTooltip(flipped, 10) : "";

            if (tip == "")
            {
                MacGui.macGui.SetChartTooltip("", new CGPoint(0, 0), new CGRect(0, 0, 0, 0));
            }
            else
            {
                MacGui.macGui.SetChartTooltip(tip, native, Frame);
            }
        }