예제 #1
0
 public void GetGlyphs(ref GlyphCollection glyphs, System.Windows.Forms.Design.Behavior.Behavior standardBehavior)
 {
     if (this.ImmediateParent != null)
     {
         Rectangle glyphBounds = this.GetGlyphBounds();
         ToolStripDesignerUtils.GetAdjustedBounds(this.ToolStripItem, ref glyphBounds);
         BehaviorService service = (BehaviorService)this.GetService(typeof(BehaviorService));
         if (service.ControlRectInAdornerWindow((Control)this.ImmediateParent).Contains(glyphBounds.Left, glyphBounds.Top))
         {
             if (this.ToolStripItem.IsOnDropDown)
             {
                 ToolStrip currentParent = this.ToolStripItem.GetCurrentParent();
                 if (currentParent == null)
                 {
                     currentParent = this.ToolStripItem.Owner;
                 }
                 if ((currentParent != null) && currentParent.Visible)
                 {
                     glyphs.Add(new MiniLockedBorderGlyph(glyphBounds, SelectionBorderGlyphType.Top, standardBehavior, true));
                     glyphs.Add(new MiniLockedBorderGlyph(glyphBounds, SelectionBorderGlyphType.Bottom, standardBehavior, true));
                     glyphs.Add(new MiniLockedBorderGlyph(glyphBounds, SelectionBorderGlyphType.Left, standardBehavior, true));
                     glyphs.Add(new MiniLockedBorderGlyph(glyphBounds, SelectionBorderGlyphType.Right, standardBehavior, true));
                 }
             }
             else
             {
                 glyphs.Add(new MiniLockedBorderGlyph(glyphBounds, SelectionBorderGlyphType.Top, standardBehavior, true));
                 glyphs.Add(new MiniLockedBorderGlyph(glyphBounds, SelectionBorderGlyphType.Bottom, standardBehavior, true));
                 glyphs.Add(new MiniLockedBorderGlyph(glyphBounds, SelectionBorderGlyphType.Left, standardBehavior, true));
                 glyphs.Add(new MiniLockedBorderGlyph(glyphBounds, SelectionBorderGlyphType.Right, standardBehavior, true));
             }
         }
     }
 }
        internal GlyphCollection GetGlyphs(ToolStrip parent, GlyphCollection glyphs, System.Windows.Forms.Design.Behavior.Behavior standardBehavior)
        {
            if (this.b == null)
            {
                this.b = (BehaviorService)parent.Site.GetService(typeof(BehaviorService));
            }
            Point     pos    = this.b.ControlToAdornerWindow(base.Parent);
            Rectangle bounds = this.Bounds;

            bounds.Offset(pos);
            bounds.Inflate(-2, -2);
            glyphs.Add(new MiniLockedBorderGlyph(bounds, SelectionBorderGlyphType.Top, standardBehavior, true));
            glyphs.Add(new MiniLockedBorderGlyph(bounds, SelectionBorderGlyphType.Bottom, standardBehavior, true));
            glyphs.Add(new MiniLockedBorderGlyph(bounds, SelectionBorderGlyphType.Left, standardBehavior, true));
            glyphs.Add(new MiniLockedBorderGlyph(bounds, SelectionBorderGlyphType.Right, standardBehavior, true));
            return(glyphs);
        }
예제 #3
0
 /// <summary>
 ///  This method is called by inheriting classes to change the
 ///  Behavior object associated with the Glyph.
 /// </summary>
 protected void SetBehavior(Behavior behavior)
 {
     _behavior = behavior;
 }
예제 #4
0
 /// <summary>
 ///  Glyph's default constructor takes a Behavior.
 /// </summary>
 protected Glyph(Behavior behavior)
 {
     _behavior = behavior;
 }
예제 #5
0
 public void PushCaptureBehavior(Behavior behavior)
 {
     throw new NotImplementedException();
 }
 public RichGlyph(D designer, Behavior.Behavior behavior)
     : base(behavior)
 {
     Designer = designer;
 }
예제 #7
0
		public Behavior GetNextBehavior (Behavior behavior)
		{
			throw new NotImplementedException ();
		}
예제 #8
0
		public Behavior PopBehavior (Behavior behavior)
		{
			throw new NotImplementedException ();
		}
예제 #9
0
 public ComponentGlyph(IComponent relatedComponent, Behavior behavior)
     : base(behavior)
 {
     throw null;
 }
예제 #10
0
 /// <summary>
 ///     Standard constructor.
 /// </summary>
 public ComponentGlyph(IComponent relatedComponent, Behavior behavior) : base(behavior)
 {
     throw new NotImplementedException(SR.NotImplementedByDesign);
 }
예제 #11
0
 public ControlBodyGlyph(Rectangle bounds, Cursor cursor, IComponent relatedComponent, Behavior behavior)
     : base(relatedComponent, behavior)
 {
     this.bounds = bounds;
     throw new NotImplementedException();
 }
예제 #12
0
        /// <summary>
        ///  GrabHandleGlyph's constructor takes additional parameters: 'type' and 'primary selection'. Also, we create/cache our pen & brush here to avoid this action with every paint message.
        /// </summary>
        internal GrabHandleGlyph(Rectangle controlBounds, GrabHandleGlyphType type, Behavior behavior, bool primarySelection) : base(behavior)
        {
            _isPrimary    = primarySelection;
            hitTestCursor = Cursors.Default;
            rules         = SelectionRules.None;

            // We +/- DesignerUtils.HANDLEOVERLAP because we want each GrabHandle to overlap the control by DesignerUtils.HANDLEOVERLAP pixels
            switch (type)
            {
            case GrabHandleGlyphType.UpperLeft:
                bounds        = new Rectangle((controlBounds.X + DesignerUtils.HANDLEOVERLAP) - DesignerUtils.HANDLESIZE, (controlBounds.Y + DesignerUtils.HANDLEOVERLAP) - DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE);
                hitTestCursor = Cursors.SizeNWSE;
                rules         = SelectionRules.TopSizeable | SelectionRules.LeftSizeable;
                break;

            case GrabHandleGlyphType.UpperRight:
                bounds        = new Rectangle(controlBounds.Right - DesignerUtils.HANDLEOVERLAP, (controlBounds.Y + DesignerUtils.HANDLEOVERLAP) - DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE);
                hitTestCursor = Cursors.SizeNESW;
                rules         = SelectionRules.TopSizeable | SelectionRules.RightSizeable;
                break;

            case GrabHandleGlyphType.LowerRight:
                bounds        = new Rectangle(controlBounds.Right - DesignerUtils.HANDLEOVERLAP, controlBounds.Bottom - DesignerUtils.HANDLEOVERLAP, DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE);
                hitTestCursor = Cursors.SizeNWSE;
                rules         = SelectionRules.BottomSizeable | SelectionRules.RightSizeable;
                break;

            case GrabHandleGlyphType.LowerLeft:
                bounds        = new Rectangle((controlBounds.X + DesignerUtils.HANDLEOVERLAP) - DesignerUtils.HANDLESIZE, controlBounds.Bottom - DesignerUtils.HANDLEOVERLAP, DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE);
                hitTestCursor = Cursors.SizeNESW;
                rules         = SelectionRules.BottomSizeable | SelectionRules.LeftSizeable;
                break;

            case GrabHandleGlyphType.MiddleTop:
                // Only add this one if there's room enough. Room is enough is as follows: 2*HANDLEOVERLAP for UpperLeft and UpperRight handles, 1 HANDLESIZE for the MiddleTop handle, 1 HANDLESIZE for padding
                if (controlBounds.Width >= (2 * DesignerUtils.HANDLEOVERLAP) + (2 * DesignerUtils.HANDLESIZE))
                {
                    bounds        = new Rectangle(controlBounds.X + (controlBounds.Width / 2) - (DesignerUtils.HANDLESIZE / 2), (controlBounds.Y + DesignerUtils.HANDLEOVERLAP) - DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE);
                    hitTestCursor = Cursors.SizeNS;
                    rules         = SelectionRules.TopSizeable;
                }
                break;

            case GrabHandleGlyphType.MiddleBottom:
                // Only add this one if there's room enough. Room is enough is as follows: 2*HANDLEOVERLAP for LowerLeft and LowerRight handles, 1 HANDLESIZE for the MiddleBottom handle, 1 HANDLESIZE for padding
                if (controlBounds.Width >= (2 * DesignerUtils.HANDLEOVERLAP) + (2 * DesignerUtils.HANDLESIZE))
                {
                    bounds        = new Rectangle(controlBounds.X + (controlBounds.Width / 2) - (DesignerUtils.HANDLESIZE / 2), controlBounds.Bottom - DesignerUtils.HANDLEOVERLAP, DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE);
                    hitTestCursor = Cursors.SizeNS;
                    rules         = SelectionRules.BottomSizeable;
                }
                break;

            case GrabHandleGlyphType.MiddleLeft:
                // Only add this one if there's room enough. Room is enough is as follows: 2*HANDLEOVERLAP for UpperLeft and LowerLeft handles, 1 HANDLESIZE for the MiddleLeft handle, 1 HANDLESIZE for padding
                if (controlBounds.Height >= (2 * DesignerUtils.HANDLEOVERLAP) + (2 * DesignerUtils.HANDLESIZE))
                {
                    bounds        = new Rectangle((controlBounds.X + DesignerUtils.HANDLEOVERLAP) - DesignerUtils.HANDLESIZE, controlBounds.Y + (controlBounds.Height / 2) - (DesignerUtils.HANDLESIZE / 2), DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE);
                    hitTestCursor = Cursors.SizeWE;
                    rules         = SelectionRules.LeftSizeable;
                }
                break;

            case GrabHandleGlyphType.MiddleRight:
                // Only add this one if there's room enough. Room is enough is as follows: 2*HANDLEOVERLAP for UpperRight and LowerRight handles, 1 HANDLESIZE for the MiddleRight handle, 1 HANDLESIZE for padding
                if (controlBounds.Height >= (2 * DesignerUtils.HANDLEOVERLAP) + (2 * DesignerUtils.HANDLESIZE))
                {
                    bounds        = new Rectangle(controlBounds.Right - DesignerUtils.HANDLEOVERLAP, controlBounds.Y + (controlBounds.Height / 2) - (DesignerUtils.HANDLESIZE / 2), DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE);
                    hitTestCursor = Cursors.SizeWE;
                    rules         = SelectionRules.RightSizeable;
                }
                break;

            default:
                Debug.Assert(false, "GrabHandleGlyph was called with a bad GrapHandleGlyphType.");
                break;
            }

            hitBounds = bounds;
        }
예제 #13
0
		public ComponentGlyph (IComponent relatedComponent, Behavior behavior)
			: base (behavior)
		{
			this.component = relatedComponent;
		}
예제 #14
0
 public Behavior GetNextBehavior(Behavior behavior)
 {
     throw new NotImplementedException();
 }
예제 #15
0
파일: Glyph.cs 프로젝트: nlhepler/mono
		protected Glyph (Behavior behavior)
		{
			SetBehavior (behavior);
		}
예제 #16
0
        protected SelectionRules rules; // the selection rules - defining how the control can change

        /// <summary>
        ///  Standard constructor.
        /// </summary>
        internal SelectionGlyphBase(Behavior behavior) : base(behavior)
        {
        }
예제 #17
0
파일: Glyph.cs 프로젝트: nlhepler/mono
		protected void SetBehavior (Behavior behavior)
		{
			throw new NotImplementedException ();
		}
예제 #18
0
 /// <summary>
 ///  This constructor extends from the standard SelectionGlyphBase constructor.
 /// </summary>
 internal SelectionBorderGlyph(Rectangle controlBounds, SelectionRules rules, SelectionBorderGlyphType type, Behavior behavior) : base(behavior)
 {
     InitializeGlyph(controlBounds, rules, type);
 }
예제 #19
0
		public void PushCaptureBehavior (Behavior behavior)
		{
			throw new NotImplementedException ();
		}
예제 #20
0
		public ControlBodyGlyph (Rectangle bounds, Cursor cursor, IComponent relatedComponent, Behavior behavior)
			: base (relatedComponent, behavior)
		{
			this.bounds = bounds;
			throw new NotImplementedException ();
		}
예제 #21
0
 public ToolStripItemGlyph(ToolStripItem item, ToolStripItemDesigner itemDesigner, Rectangle bounds, System.Windows.Forms.Design.Behavior.Behavior b) : base(bounds, Cursors.Default, item, b)
 {
     _item         = item;
     _bounds       = bounds;
     _itemDesigner = itemDesigner;
 }
예제 #22
0
 /// <summary>
 ///  NoResizeHandleGlyph's constructor takes additional parameters: 'type' and 'primary selection'.
 ///  Also, we create/cache our pen and brush here to avoid this action with every paint message.
 /// </summary>
 internal NoResizeHandleGlyph(Rectangle controlBounds, SelectionRules selRules, bool primarySelection, Behavior behavior) : base(behavior)
 {
     _isPrimary    = primarySelection;
     hitTestCursor = Cursors.Default;
     rules         = SelectionRules.None;
     if ((selRules & SelectionRules.Moveable) != 0)
     {
         rules         = SelectionRules.Moveable;
         hitTestCursor = Cursors.SizeAll;
     }
     // The handle is always upperleft
     bounds    = new Rectangle(controlBounds.X - DesignerUtils.NORESIZEHANDLESIZE, controlBounds.Y - DesignerUtils.NORESIZEHANDLESIZE, DesignerUtils.NORESIZEHANDLESIZE, DesignerUtils.NORESIZEHANDLESIZE);
     hitBounds = bounds;
 }
예제 #23
0
 protected RichGlyph(TDesigner designer, Behavior.Behavior behavior)
     : base(behavior)
 {
     Designer = designer;
 }
예제 #24
0
 public Behavior PopBehavior(Behavior behavior)
 {
     throw new NotImplementedException();
 }