Example #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;
 }
Example #3
0
 protected override void attachSubject(IReactiveShape subject)
 {
     Subject.MouseDown += Subject_MouseDown;
     Subject.MouseUp += Subject_MouseUp;
     Subject.MouseMove += Subject_MouseMove;
     Subject.DragCancel += Subject_DragCancel;
 }
Example #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;
 }
Example #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;
 }
Example #7
0
 protected override void detachSubject(IReactiveShape subject)
 {
     Subject.MouseEnter -= Subject_MouseEnter;
     Subject.MouseLeave -= Subject_MouseLeave;
     Subject.Render.ShapeDrawed -= SubjectShapeDrawed;
     Subject.MouseMove -= Subject_MouseMove;
 }
Example #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;
            }
Example #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;
 }
Example #10
0
 private void Shape_BeginDrag(IReactiveShape shape, string mnemoCode, params object[] args)
 {
     dragged = shape;
 }
Example #11
0
 private void Shape_EndDrag(IReactiveShape shape, string mnemoCode, params object[] args)
 {
     dragged = null;
 }
Example #12
0
 protected override void detachSubject(IReactiveShape subject)
 {
     guides.Remove(subject);
 }
Example #13
0
 private void capturer_Disposing(object obj)
 {
     Capturer = null;
 }
Example #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);
 }
Example #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);
 }
Example #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;
            }
        }
Example #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);
 }
Example #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;
     }
 }
Example #19
0
 private void capturer_ChangedForm(IShape obj, ChangeFormState state = ChangeFormState.All)
 {
     if (state.HasFlag(ChangeFormState.Visibility) && !obj.Render.IsSee)
         Capturer = null;
 }
Example #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;
     }
 }
Example #21
0
 protected override void attachSubject(IReactiveShape subject)
 {
     guides.Add(subject);
 }
Example #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;
        }
Example #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;
 }