Exemplo n.º 1
0
        public override void MouseDown(MouseEvent ev)
        {
            IDrawingView view = ev.View;

            base.MouseDown(ev);
            view.Drawing.Add(Prototype);
            Prototype.MoveTo(ev.X, ev.Y);
            view.ClearSelection();
            view.AddToSelection(Prototype);
            CreateUndoActivity();
        }
 public override void InvokeStart(double x, double y, IDrawingView view) 
 {
     m_connection = CreateConnection();
     m_connection.EndPoint = new PointD (x, y);
     m_connection.StartPoint = new PointD (x, y);
     m_connection.ConnectStart (Owner.ConnectorAt(x, y));
     m_connection.UpdateConnection();
     view.Drawing.Add(m_connection);
     view.ClearSelection();
     view.AddToSelection(m_connection);
     m_handle = view.FindHandle(x, y);
 }
Exemplo n.º 3
0
 public override void InvokeStart(double x, double y, IDrawingView view)
 {
     m_connection            = CreateConnection();
     m_connection.EndPoint   = new PointD(x, y);
     m_connection.StartPoint = new PointD(x, y);
     m_connection.ConnectStart(Owner.ConnectorAt(x, y));
     m_connection.UpdateConnection();
     view.Drawing.Add(m_connection);
     view.ClearSelection();
     view.AddToSelection(m_connection);
     m_handle = view.FindHandle(x, y);
 }
		public void SelectFiguresOnRect (IDrawingView view, bool shift_pressed) 	{
			foreach (IFigure figure in view.Drawing.FiguresEnumeratorReverse) {
				RectangleD rect = figure.DisplayBox;
				if (_selectionRect.Contains (rect.X, rect.Y)
					&& _selectionRect.Contains (rect.X2, rect.Y2)) {
						if (shift_pressed) {
							view.ToggleSelection (figure);
						}
						else {
							view.AddToSelection (figure);
						}
				}
			}
		}
Exemplo n.º 5
0
 public void SelectFiguresOnRect(IDrawingView view, bool shift_pressed)
 {
     foreach (IFigure figure in view.Drawing.FiguresEnumeratorReverse)
     {
         RectangleD rect = figure.DisplayBox;
         if (_selectionRect.Contains(rect.X, rect.Y) &&
             _selectionRect.Contains(rect.X2, rect.Y2))
         {
             if (shift_pressed)
             {
                 view.ToggleSelection(figure);
             }
             else
             {
                 view.AddToSelection(figure);
             }
         }
     }
 }
Exemplo n.º 6
0
        public override void MouseDown(MouseEvent ev)
        {
            IDrawingView view   = ev.View;
            IFigure      figure = view.Drawing.FindFigure(ev.X, ev.Y);

            if (figure != null)
            {
                _connection.EndPoint   = new PointD(ev.X, ev.Y);
                _connection.StartPoint = new PointD(ev.X, ev.Y);
                _connection.ConnectStart(figure.ConnectorAt(ev.X, ev.Y));
                _connection.UpdateConnection();
                view.Drawing.Add(_connection);
                view.ClearSelection();
                view.AddToSelection(_connection);
                _handle = _connection.EndHandle;
                CreateUndoActivity();
            }
            else
            {
                Editor.Tool = new SelectionTool(Editor);
            }
        }
Exemplo n.º 7
0
        public override void MouseDown(MouseEvent ev)
        {
            base.MouseDown(ev);
            IDrawingView view = ev.View;

            SetLastCoords(ev.X, ev.Y);

            Gdk.ModifierType state = (ev.GdkEvent as EventButton).State;

            bool shift_pressed = (state & ModifierType.ShiftMask) != 0;

            if (shift_pressed)
            {
                view.ToggleSelection(AnchorFigure);
            }

            else if (!view.IsFigureSelected(AnchorFigure))
            {
                view.ClearSelection();
                view.AddToSelection(AnchorFigure);
            }
            CreateUndoActivity();
        }
Exemplo n.º 8
0
        public override void MouseDown(MouseEvent ev)
        {
            SetAnchorCoords(ev.X, ev.Y);
            IDrawingView view = ev.View;

            View = view;

            Gdk.EventType type = ev.GdkEvent.Type;
            if (type == EventType.TwoButtonPress)
            {
                PolyLineFigure connection = (PolyLineFigure)Figure;
                connection.SplitSegment(ev.X, ev.Y);
                view.ClearSelection();
                view.AddToSelection(Figure);
                _handle = view.FindHandle(ev.X, ev.Y) as PolyLineHandle;
                ((Gtk.Widget)view).GdkWindow.Cursor = _handle.CreateCursor();
                _handle.InvokeStart(ev.X, ev.Y, ev.View);
                CreateUndoActivity();
            }
            else
            {
                DefaultTool.MouseDown(ev);
            }
        }
        private void SelectFiguresOnRect(IDrawingView view, bool shift_pressed)
        {
            foreach (Figure figure in view.Drawing.Children) {
                RectangleD rect = figure.DisplayBox;

                if (selectionRectangle.Contains (rect.X, rect.Y) &&
                    selectionRectangle.Contains (rect.X2, rect.Y2)) {
                        if (shift_pressed)
                            view.ToggleSelection (figure);
                        else
                            view.AddToSelection (figure);
                }
            }
        }
Exemplo n.º 10
0
        public override void InvokeEnd(double x, double y, IDrawingView view)
        {
            if (_handle != null) {
                _handle.InvokeEnd(x, y, view);
            }

            if (_connection.EndConnector == null) {
                IFigure new_figure = CreateEndFigure();
                new_figure.MoveTo(x, y);
                view.Drawing.Add(new_figure);
                _connection.ConnectEnd(new_figure.ConnectorAt(0.0, 0.0));
                _connection.UpdateConnection();
                view.ClearSelection();
                view.AddToSelection(new_figure);
            }
        }