Beispiel #1
0
        public AvaPlot()
        {
            InitializeComponent();

            Cursors = new Dictionary <ScottPlot.Cursor, Ava.Input.Cursor>()
            {
                [ScottPlot.Cursor.Arrow]     = new Ava.Input.Cursor(StandardCursorType.Arrow),
                [ScottPlot.Cursor.WE]        = new Ava.Input.Cursor(StandardCursorType.SizeWestEast),
                [ScottPlot.Cursor.NS]        = new Ava.Input.Cursor(StandardCursorType.SizeNorthSouth),
                [ScottPlot.Cursor.All]       = new Ava.Input.Cursor(StandardCursorType.SizeAll),
                [ScottPlot.Cursor.Crosshair] = new Ava.Input.Cursor(StandardCursorType.Cross),
                [ScottPlot.Cursor.Hand]      = new Ava.Input.Cursor(StandardCursorType.Hand),
                [ScottPlot.Cursor.Question]  = new Ava.Input.Cursor(StandardCursorType.Help),
            };

            Backend = new ScottPlot.Control.ControlBackEnd((float)Bounds.Width, (float)Bounds.Height, GetType().Name);
            Backend.BitmapChanged              += new EventHandler(OnBitmapChanged);
            Backend.BitmapUpdated              += new EventHandler(OnBitmapUpdated);
            Backend.CursorChanged              += new EventHandler(OnCursorChanged);
            Backend.RightClicked               += new EventHandler(OnRightClicked);
            Backend.AxesChanged                += new EventHandler(OnAxesChanged);
            Backend.PlottableDragged           += new EventHandler(OnPlottableDragged);
            Backend.PlottableDropped           += new EventHandler(OnPlottableDropped);
            Backend.Configuration.ScaleChanged += new EventHandler(OnScaleChanged);
            Configuration = Backend.Configuration;

            RightClicked += DefaultRightClickEvent;

            InitializeLayout();
            Backend.StartProcessingEvents();
        }
Beispiel #2
0
        public AvaPlot()
        {
            InitializeComponent();

            Cursors = new Dictionary <ScottPlot.Cursor, Ava.Input.Cursor>()
            {
                [ScottPlot.Cursor.Arrow]     = new Ava.Input.Cursor(StandardCursorType.Arrow),
                [ScottPlot.Cursor.WE]        = new Ava.Input.Cursor(StandardCursorType.SizeWestEast),
                [ScottPlot.Cursor.NS]        = new Ava.Input.Cursor(StandardCursorType.SizeNorthSouth),
                [ScottPlot.Cursor.All]       = new Ava.Input.Cursor(StandardCursorType.SizeAll),
                [ScottPlot.Cursor.Crosshair] = new Ava.Input.Cursor(StandardCursorType.Cross),
                [ScottPlot.Cursor.Hand]      = new Ava.Input.Cursor(StandardCursorType.Hand),
                [ScottPlot.Cursor.Question]  = new Ava.Input.Cursor(StandardCursorType.Help),
            };

            Backend = new ScottPlot.Control.ControlBackEnd((float)this.Bounds.Width, (float)this.Bounds.Height);
            Backend.BitmapChanged    += new EventHandler(OnBitmapChanged);
            Backend.BitmapUpdated    += new EventHandler(OnBitmapUpdated);
            Backend.CursorChanged    += new EventHandler(OnCursorChanged);
            Backend.RightClicked     += new EventHandler(OnRightClicked);
            Backend.AxesChanged      += new EventHandler(OnAxesChanged);
            Backend.PlottableDragged += new EventHandler(OnPlottableDragged);
            Backend.PlottableDropped += new EventHandler(OnPlottableDropped);

            RightClicked                += DefaultRightClickEvent;
            PlottableCountTimer.Tick    += PlottableCountTimer_Tick;
            PlottableCountTimer.Interval = new TimeSpan(0, 0, 0, 0, milliseconds: 10);
            PlottableCountTimer.Start();

            InitializeLayout();
            Backend.StartProcessingEvents();
        }
Beispiel #3
0
        public AvaPlot()
        {
            InitializeComponent();
            //SetContextMenu(backend.DefaultRightClickMenu());
            Backend = new ScottPlot.Control.ControlBackEnd((float)this.Bounds.Width, (float)this.Bounds.Height);
            Backend.BitmapChanged += new EventHandler(OnBitmapChanged);
            Backend.BitmapUpdated += new EventHandler(OnBitmapUpdated);
            //Backend.CursorChanged += new EventHandler(OnCursorChanged);
            Backend.RightClicked += new EventHandler(OnRightClicked);
            Backend.AxesChanged  += new EventHandler(OnAxesChanged);

            RightClicked                += DefaultRightClickEvent;
            PlottableCountTimer.Tick    += PlottableCountTimer_Tick;
            PlottableCountTimer.Interval = new TimeSpan(0, 0, 0, 0, milliseconds: 10);
            PlottableCountTimer.Start();

            InitializeLayout();
            Backend.StartProcessingEvents();
        }
Beispiel #4
0
        public PlotView()
        {
            Backend = new Control.ControlBackEnd(1, 1, GetType().Name);
            Backend.Resize(Width, Height, useDelayedRendering: false);
            Backend.BitmapChanged        += new EventHandler(OnBitmapChanged);
            Backend.BitmapUpdated        += new EventHandler(OnBitmapUpdated);
            Backend.CursorChanged        += new EventHandler(OnCursorChanged);
            Backend.RightClicked         += new EventHandler(OnRightClicked);
            Backend.LeftClicked          += new EventHandler(OnLeftClicked);
            Backend.LeftClickedPlottable += new EventHandler(OnLeftClickedPlottable);
            Backend.AxesChanged          += new EventHandler(OnAxesChanged);
            Backend.PlottableDragged     += new EventHandler(OnPlottableDragged);
            Backend.PlottableDropped     += new EventHandler(OnPlottableDropped);
            Configuration = Backend.Configuration;

            Cursors = new Dictionary <ScottPlot.Cursor, global::Eto.Forms.Cursor>()
            {
                [ScottPlot.Cursor.Arrow]     = global::Eto.Forms.Cursors.Default,
                [ScottPlot.Cursor.WE]        = global::Eto.Forms.Cursors.HorizontalSplit,
                [ScottPlot.Cursor.NS]        = global::Eto.Forms.Cursors.VerticalSplit,
                [ScottPlot.Cursor.All]       = global::Eto.Forms.Cursors.HorizontalSplit,
                [ScottPlot.Cursor.Crosshair] = global::Eto.Forms.Cursors.Crosshair,
                [ScottPlot.Cursor.Hand]      = global::Eto.Forms.Cursors.Pointer,
                [ScottPlot.Cursor.Question]  = global::Eto.Forms.Cursors.Default,
            };

            BackgroundColor = Colors.Transparent;
            Plot.Style(figureBackground: System.Drawing.Color.Transparent);

            SizeChanged      += OnSizeChanged;
            MouseDoubleClick += OnMouseDoubleClick;
            MouseWheel       += OnMouseWheel;
            MouseMove        += OnMouseMove;
            MouseDown        += OnMouseDown;
            MouseUp          += OnMouseUp;

            RightClicked += DefaultRightClickEvent;

            Backend.Configuration.UseRenderQueue = true;
            Backend.StartProcessingEvents();
        }