Exemple #1
0
        public KChartSKControl() : base()
        {
            chartControl          = this;
            chartControl.Location = new Point(0, 0);
            Label toolTip = WinGui.winGui.label_Tooltip;

            toolTip.Visible     = false;
            toolTip.BackColor   = WinControls.cPanelButtonDeselected;
            toolTip.Font        = WinGui.winGui.GetFont(8, true);
            toolTip.MouseEnter +=
                (object sender, EventArgs e) => { UpdateTooltip(new Point(0, 0), ""); };

            /* Initialize Interface KTouchClient with a locally-sourced KTouchClientData closure */
            touch = new KTouchClientData(
                invalidateSurface: () => { InvalidateAndUpdate(); },
                setManualPinchPan: (Swipe pinchPan) => { KChartHandler.SetManualPinchPan(pinchPan); }
                );
            touch.onTouchSwipeOrMouseDrag      = OnMouseDrag;
            touch.onTouchSwipeOrMouseDragEnd   = OnMouseDragEnd;
            touch.onTouchDoubletapOrMouseClick = OnMouseClick;
            touch.onTouchPinchOrMouseZoom      = OnMouseZoom;
            touch.lastPinchPan           = Swipe.Id();
            touch.incrementalScaling     = Swipe.Id();
            touch.incrementalTranslation = Swipe.Id();
            KChartHandler.RegisterKTouchClientData(touch);
        }
Exemple #2
0
 private void OnMouseClick(SKPoint p)
 {
     touch.lastPinchPan           = Swipe.Id();
     touch.incrementalScaling     = Swipe.Id();
     touch.incrementalTranslation = Swipe.Id();
     touch.setManualPinchPan?.Invoke(touch.lastPinchPan);
     touch.invalidateSurface();
 }
Exemple #3
0
 private void OnMouseDragEnd(SKPoint from, SKPoint to)
 {
     if (touch.swiping)
     {
         touch.swiping                = false;
         touch.lastPinchPan           = touch.lastPinchPan * touch.incrementalScaling * touch.incrementalTranslation;
         touch.incrementalScaling     = Swipe.Id();
         touch.incrementalTranslation = Swipe.Id();
         touch.setManualPinchPan?.Invoke(touch.lastPinchPan);
         touch.invalidateSurface();
     }
 }
Exemple #4
0
        private KTouchClientData touch = null;           // data for pan&zoom by mouse drag and scroll

        private void OnLoad()
        {
            this.WantsLayer = true;
            this.LayerContentsRedrawPolicy = NSViewLayerContentsRedrawPolicy.OnSetNeedsDisplay;
            chartControl = this;

            /* Initialize Interface KTouchClient with a locally-sourced KTouchClientData closure */
            touch = new KTouchClientData(
                invalidateSurface: () => { Invalidate(); },
                setManualPinchPan: (Swipe pinchPan) => { KChartHandler.SetManualPinchPan(pinchPan); }
                );
            touch.onTouchSwipeOrMouseDrag      = OnMouseDrag;
            touch.onTouchSwipeOrMouseDragEnd   = OnMouseDragEnd;
            touch.onTouchDoubletapOrMouseClick = OnMouseClick;
            touch.onTouchPinchOrMouseZoom      = OnMouseZoom;
            touch.lastPinchPan           = Swipe.Id();
            touch.incrementalScaling     = Swipe.Id();
            touch.incrementalTranslation = Swipe.Id();
            KChartHandler.RegisterKTouchClientData(touch);
            Tracking();
        }