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); }
/// <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; }
/// <summary> /// Glyph's default constructor takes a Behavior. /// </summary> protected Glyph(Behavior behavior) { _behavior = behavior; }
public void PushCaptureBehavior(Behavior behavior) { throw new NotImplementedException(); }
public RichGlyph(D designer, Behavior.Behavior behavior) : base(behavior) { Designer = designer; }
public Behavior GetNextBehavior (Behavior behavior) { throw new NotImplementedException (); }
public Behavior PopBehavior (Behavior behavior) { throw new NotImplementedException (); }
public ComponentGlyph(IComponent relatedComponent, Behavior behavior) : base(behavior) { throw null; }
/// <summary> /// Standard constructor. /// </summary> public ComponentGlyph(IComponent relatedComponent, Behavior behavior) : base(behavior) { throw new NotImplementedException(SR.NotImplementedByDesign); }
public ControlBodyGlyph(Rectangle bounds, Cursor cursor, IComponent relatedComponent, Behavior behavior) : base(relatedComponent, behavior) { this.bounds = bounds; throw new NotImplementedException(); }
/// <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; }
public ComponentGlyph (IComponent relatedComponent, Behavior behavior) : base (behavior) { this.component = relatedComponent; }
public Behavior GetNextBehavior(Behavior behavior) { throw new NotImplementedException(); }
protected Glyph (Behavior behavior) { SetBehavior (behavior); }
protected SelectionRules rules; // the selection rules - defining how the control can change /// <summary> /// Standard constructor. /// </summary> internal SelectionGlyphBase(Behavior behavior) : base(behavior) { }
protected void SetBehavior (Behavior behavior) { throw new NotImplementedException (); }
/// <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); }
public void PushCaptureBehavior (Behavior behavior) { throw new NotImplementedException (); }
public ControlBodyGlyph (Rectangle bounds, Cursor cursor, IComponent relatedComponent, Behavior behavior) : base (relatedComponent, behavior) { this.bounds = bounds; throw new NotImplementedException (); }
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; }
/// <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; }
protected RichGlyph(TDesigner designer, Behavior.Behavior behavior) : base(behavior) { Designer = designer; }
public Behavior PopBehavior(Behavior behavior) { throw new NotImplementedException(); }