Esempio n. 1
0
 protected override void detachSubject(IReactiveShape subject)
 {
     Subject.MouseDown -= Subject_MouseDown;
     Subject.MouseUp -= Subject_MouseUp;
     Subject.MouseMove -= Subject_MouseMove;
     Subject.DragCancel -= Subject_DragCancel;
 }
 protected override void attachSubject(IReactiveShape subject)
 {
     Subject.MouseDown += Subject_MouseDown;
     Subject.MouseUp += Subject_MouseUp;
     Subject.MouseEnter += Subject_MouseEnter;
     Subject.MouseLeave += Subject_MouseLeave;
 }
Esempio n. 3
0
 protected override void attachSubject(IReactiveShape subject)
 {
     Subject.MouseDown += Subject_MouseDown;
     Subject.MouseUp += Subject_MouseUp;
     Subject.MouseMove += Subject_MouseMove;
     Subject.DragCancel += Subject_DragCancel;
 }
Esempio n. 4
0
 protected override void attachSubject(IReactiveShape subject)
 {
     Subject.MouseEnter += Subject_MouseEnter;
     Subject.MouseLeave += Subject_MouseLeave;
     Subject.MouseMove += Subject_MouseMove;
     Subject.Render.ShapeDrawed += SubjectShapeDrawed;
 }
 protected override void detachSubject(IReactiveShape subject)
 {
     Subject.MouseDown -= Subject_MouseDown;
     Subject.MouseUp -= Subject_MouseUp;
     Subject.MouseEnter -= Subject_MouseEnter;
     Subject.MouseLeave -= Subject_MouseLeave;
 }
Esempio n. 6
0
 protected override void attachSubject(IReactiveShape subject)
 {
     Subject.ChangedForm += Subject_ChangedForm;
     Subject.CommandHandlers["BeginDrag"].ExecuteHnd += Shape_BeginDrag;
     Subject.CommandHandlers["EndDrag"].ExecuteHnd += Shape_EndDrag;
     Subject.Render.ShapeDrawed += Subject_ShapeDrawed;
 }
Esempio n. 7
0
 protected override void detachSubject(IReactiveShape subject)
 {
     Subject.MouseEnter -= Subject_MouseEnter;
     Subject.MouseLeave -= Subject_MouseLeave;
     Subject.Render.ShapeDrawed -= SubjectShapeDrawed;
     Subject.MouseMove -= Subject_MouseMove;
 }
Esempio n. 8
0
            protected override void detachSubject(IReactiveShape subject)
            {
                Subject.ChangedForm -= Subject_ChangedForm;
// ReSharper disable DelegateSubtraction
                Subject.CommandHandlers["BeginDrag"].ExecuteHnd -= Shape_BeginDrag;
                Subject.CommandHandlers["EndDrag"].ExecuteHnd -= Shape_EndDrag;
// ReSharper restore DelegateSubtraction
                Subject.Render.ShapeDrawed -= Subject_ShapeDrawed;
            }
Esempio n. 9
0
 public void RemoveShape(IShape shape, IReactiveShape reactive)
 {
     reactive.ChangedForm -= reactive_ChangedForm;
     reactive.Disposing -= reactive_Disposing;
     shapes.Remove(reactive);
     reactives.Remove(reactive);
     if (shape.Render.IsSee)
         IsChanged = true;
 }
Esempio n. 10
0
 private void Shape_BeginDrag(IReactiveShape shape, string mnemoCode, params object[] args)
 {
     dragged = shape;
 }
Esempio n. 11
0
 private void Shape_EndDrag(IReactiveShape shape, string mnemoCode, params object[] args)
 {
     dragged = null;
 }
Esempio n. 12
0
 protected override void detachSubject(IReactiveShape subject)
 {
     guides.Remove(subject);
 }
Esempio n. 13
0
 private void capturer_Disposing(object obj)
 {
     Capturer = null;
 }
Esempio n. 14
0
 private void removeShape(IShape shape, IReactiveShape reactive)
 {
     if (reactive != null)
         reactive.Disposing -= reactive_Disposing;
     getLayer(chiToLay[shape]).RemoveShape(shape, reactive);
     chiToLay.Remove(shape);
     if (RemovedShape != null)
         RemovedShape(this, shape, reactive);
 }
Esempio n. 15
0
 private void addShape(int layer, IShape shape, IReactiveShape reactive)
 {
     getLayer(layer).AddShape(shape, reactive);
     chiToLay.Add(shape, layer);
     if (reactive != null)
         reactive.Disposing += reactive_Disposing;
     if (AddedShape != null)
         AddedShape(this, shape, reactive);
 }
Esempio n. 16
0
        public void MouseUp(MouseEventArgs e)
        {
            LastMouseEventArgs = e;
            if (Capturer != null)
            {
                var sdea = new SimpleDragEventArgs(Capturer, e.X, e.Y);
                foreach (var item in UnderCursor
                    .Where(s => s.AllowDrop)
                    .Where(s => s != Capturer))
                {
                    item.OnDragDrop(sdea);
                    if (sdea.Handled) break;
                }

                if (clickTimer.ElapsedMilliseconds <= SystemInformation.DoubleClickTime)
                    ++countClicks;
                else
                    countClicks = 1;
                var sizeClicks = new Size(Math.Abs(firstMouseDown.X - e.Location.X),
                                          Math.Abs(firstMouseDown.Y - e.Location.Y));
                if (countClicks > 1 && (SystemInformation.DoubleClickSize.Width < sizeClicks.Width
                                        || SystemInformation.DoubleClickSize.Height < sizeClicks.Height))
                    countClicks = 1;
                Capturer.OnMouseUp(e);
                if (Capturer.Contains(e.Location))
                    if (countClicks == 2)
                    {
                        Capturer.OnMouseDoubleClick(e);
                        countClicks = 0;
                        clickTimer.Stop();
                    }
                    else
                        Capturer.OnMouseClick(e);
                Capturer = null;
            }
        }
Esempio n. 17
0
 public void MouseDown(MouseEventArgs e)
 {
     LastMouseEventArgs = e;
     if (!clickTimer.IsRunning || clickTimer.ElapsedMilliseconds > SystemInformation.DoubleClickTime)
     {
         countClicks = 0;
         clickTimer.Restart();
         firstMouseDown = e.Location;
     }
     Capturer = Reactives.FirstOrDefault(s => s.Contains(e.Location));
     if (Capturer != null)
         Capturer.OnMouseDown(e);
 }
Esempio n. 18
0
 public void KeyUp(KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape && Capturer != null)
     {
         if (Capturer.IsDrag)
             Capturer.OnDragCancel(new SimpleDragEventArgs(Capturer, int.MinValue, int.MinValue));
         Capturer.IsDrag = false;
         Capturer = null;
     }
 }
Esempio n. 19
0
 private void capturer_ChangedForm(IShape obj, ChangeFormState state = ChangeFormState.All)
 {
     if (state.HasFlag(ChangeFormState.Visibility) && !obj.Render.IsSee)
         Capturer = null;
 }
Esempio n. 20
0
 public void AddMenuToShape(IReactiveShape shape)
 {
     if (shapes.Add(shape))
     {
         shape.MouseSenseEnter += shape_MouseSenseEnter;
         shape.MouseSenseLeave += shape_MouseSenseLeave;
         shape.ChangedForm += shape_ChangedForm;
         shape.Disposing += shape_Disposing;
     }
 }
Esempio n. 21
0
 protected override void attachSubject(IReactiveShape subject)
 {
     guides.Add(subject);
 }
Esempio n. 22
0
        private void ActionOnDragOnDistanceAddingMarker(IReactiveShape reactiveShape, PointF pnt)
        {
            int ind;
            Filler.Shape.GetNormalPoint(pnt, out ind);
            ind = (ind + 1) % Filler.Shape.Count;
            if (Filler.Shape.Insert(ind, pnt))
                ViewLayer.Capturer = Markers[ind]; // перетаскивается вместо маркера добавленная точка 

            addingPointMaker.IsVisible = false;
        }
Esempio n. 23
0
 public void AddShape(IShape shape, IReactiveShape reactive)
 {
     shapes.Add(shape);
     if (reactive != null)
     {
         reactives.Add(reactive);
         reactive.ChangedForm += reactive_ChangedForm;
         reactive.Disposing += reactive_Disposing;
     }
     if (shape.Render.IsSee)
         IsChanged = true;
 }