示例#1
0
        public override bool OnMouseUp(Glyph g, System.Windows.Forms.MouseButtons button)
        {
            MESGlyph mesGlyph = g as MESGlyph;

            if (null != mesGlyph)
            {
                if (null != _ctrl)
                {
                    IDesignEdit de = _ctrl as IDesignEdit;
                    if (null != de)
                    {
                        if (de.IsEdit)
                        {
                            de.EndEdit();
                        }
                    }
                }

                if (_mouseLocation != Point.Empty)
                {
                    if (mesGlyph.AdornerMouseUp(button, _mouseLocation))
                    {
                        _mouseLocation = Point.Empty;
                        return(true);
                    }
                }
            }
            return(base.OnMouseUp(g, button));
        }
示例#2
0
        public override bool OnMouseMove(Glyph g, System.Windows.Forms.MouseButtons button, System.Drawing.Point mouseLoc)
        {
            MESGlyph mesGlyph = g as MESGlyph;

            if (null != mesGlyph)
            {
                if (mesGlyph.AdornerMouseMove(button, mouseLoc))
                {
                    return(true);
                }
            }
            return(base.OnMouseMove(g, button, mouseLoc));
        }
示例#3
0
        //protected override bool GetHitTest(System.Drawing.Point point)
        //{
        //    point = Control.PointToClient(point);
        //    if (object.ReferenceEquals(_selectionService.PrimarySelection, Control))
        //    {
        //        if (Control.ClientRectangle.Contains(point))
        //        {
        //            if (!(point.X <= 5 && point.Y <= 5 && point.X >= 0 && point.Y >= 0))
        //            {
        //                return true;
        //            }
        //        }
        //    }
        //    return base.GetHitTest(point);
        //}

        private void InitialService()
        {
            _behaviorSvc =
                GetService(typeof(BehaviorService))
                as BehaviorService;
            _selectionService =
                GetService(typeof(ISelectionService))
                as ISelectionService;
            if (null != _behaviorSvc)
            {
                _mesAdorner = new Adorner();
                _glyph      = new MESGlyph(_mesAdorner, _selectionService, Control, _behaviorSvc, new MESBehavior(Control, true, _behaviorSvc));
                _mesAdorner.Glyphs.Add(_glyph);
                _behaviorSvc.Adorners.Add(_mesAdorner);
            }
        }
示例#4
0
        public override bool OnMouseLeave(Glyph g)
        {
            if (null == _ctrl.Site)
            {
                return(false);
            }
            MESGlyph mesGlyph = g as MESGlyph;

            if (null != mesGlyph)
            {
                if (mesGlyph.AdornerMouseLeave())
                {
                    return(true);
                }
            }
            return(base.OnMouseLeave(g));
        }