Esempio n. 1
0
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);
            if (!ready)
            {
                return;
            }

            if (dragging)
            {
                Capture  = false;
                stopDrag = Vector.V(e.X, e.Y);
                dragging = false;

                double f1 = gridF.getAbsolutePos(startDrag.x);
                double f2 = gridF.getAbsolutePos(stopDrag.x);
                if (f1 > f2)
                {
                    flip(ref f1, ref f2);
                }
                double y1 = gridY.getAbsolutePos(startDrag.y);
                double y2 = gridY.getAbsolutePos(stopDrag.y);
                if (y1 > y2)
                {
                    flip(ref y1, ref y2);
                }
                gridF.newRange(f1, f2);
                // gridY.newRange(y1, y2);

                root.updateRanges();

                Invalidate();
            }
        }
Esempio n. 2
0
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);
            if (dragging)
            {
                Capture  = false;
                stopDrag = Vector.V(e.X, e.Y);
                dragging = false;

                if (Math.Abs(startDrag.x - stopDrag.x) < 5)
                {
                    return;
                }
                if (Math.Abs(startDrag.y - stopDrag.y) < 5)
                {
                    return;
                }

                double x1 = x.getAbsolutePos(startDrag.x);
                double x2 = x.getAbsolutePos(stopDrag.x);
                if (x1 > x2)
                {
                    flip(ref x1, ref x2);
                }
                x.newRange(x1, x2);

                if (selectedScreen == 0)
                {
                    double u1 = y1.getAbsolutePos(startDrag.y);
                    double u2 = y1.getAbsolutePos(stopDrag.y);
                    if (u1 > u2)
                    {
                        flip(ref u1, ref u2);
                    }
                    y1.newRange(u1, u2);
                }
                else
                {
                    double u1 = y2.getAbsolutePos(startDrag.y);
                    double u2 = y2.getAbsolutePos(stopDrag.y);
                    if (u1 > u2)
                    {
                        flip(ref u1, ref u2);
                    }
                    y2.newRange(u1, u2);
                }
                root.updateRanges();

                Invalidate();
            }
        }
Esempio n. 3
0
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);
            if (dragging)
            {
                Capture  = false;
                stopDrag = Vector.V(e.X, e.Y);
                dragging = false;


                double x1 = gridX.getAbsolutePos(startDrag.x);
                double x2 = gridX.getAbsolutePos(stopDrag.x);
                if (x1 > x2)
                {
                    flip(ref x1, ref x2);
                }
                gridX.newRange(x1, x2);

                // root.updateRanges();
                Invalidate();
            }
        }
Esempio n. 4
0
 public void drawToMap(ColorTable colorTable, GridCalculator gridF, GridCalculator gridCol, int[] mapdata, int ofs, int width)
 {
     for (int i = 0; i < width; i++)
     {
         double f   = gridF.getAbsolutePos(i + gridF.low);
         int    idx = (int)Math.Floor(f / fmax * size + 0.5);
         if (idx < 0)
         {
             idx = 0;
         }
         if (idx >= size)
         {
             idx = size - 1;
         }
         double cv  = gridCol.getRelativePos(data[idx]);
         int    col = colorTable.col(cv).ToArgb();
         mapdata[ofs + i] = col;
     }
 }