Пример #1
0
        /// <summary>
        /// The overview rectangle should only appear selected if the <see cref="T:Northwoods.Go.GoOverview" />
        /// supports resizing (i.e. <see cref="P:Northwoods.Go.GoView.AllowSelect" /> and <see cref="P:Northwoods.Go.GoView.AllowResize" /> are true),
        /// and even then the handles will not be seen since their <see cref="T:Northwoods.Go.GoHandle" />.<see cref="T:Northwoods.Go.GoHandleStyle" />
        /// is <see cref="F:Northwoods.Go.GoHandleStyle.None" />.
        /// </summary>
        /// <param name="sel"></param>
        /// <param name="selectedObj"></param>
        public override void AddSelectionHandles(GoSelection sel, GoObject selectedObj)
        {
            GoView view = sel.View;

            if (view != null && view.CanSelectObjects() && view.CanResizeObjects())
            {
                view.ResizeHandleSize = new SizeF(4f / view.DocScale, 4f / view.DocScale);
                RemoveSelectionHandles(sel);
                RectangleF bounds   = Bounds;
                GoHandle   goHandle = sel.CreateResizeHandle(this, selectedObj, new PointF(bounds.Left, bounds.Top), 2, filled: true) as GoHandle;
                if (goHandle != null)
                {
                    goHandle.Style = GoHandleStyle.None;
                }
                goHandle = (sel.CreateResizeHandle(this, selectedObj, new PointF(bounds.Right, bounds.Top), 4, filled: true) as GoHandle);
                if (goHandle != null)
                {
                    goHandle.Style = GoHandleStyle.None;
                }
                goHandle = (sel.CreateResizeHandle(this, selectedObj, new PointF(bounds.Right, bounds.Bottom), 8, filled: true) as GoHandle);
                if (goHandle != null)
                {
                    goHandle.Style = GoHandleStyle.None;
                }
                goHandle = (sel.CreateResizeHandle(this, selectedObj, new PointF(bounds.Left, bounds.Bottom), 16, filled: true) as GoHandle);
                if (goHandle != null)
                {
                    goHandle.Style = GoHandleStyle.None;
                }
            }
        }