protected void SetBehavior(System.Windows.Forms.Design.Behavior.Behavior behavior)
 {
     this.behavior = behavior;
 }
Exemplo n.º 2
0
 public ComponentGlyph(IComponent relatedComponent, System.Windows.Forms.Design.Behavior.Behavior behavior) : base(behavior)
 {
     this.relatedComponent = relatedComponent;
 }
 protected Glyph(System.Windows.Forms.Design.Behavior.Behavior behavior)
 {
     this.behavior = behavior;
 }
        internal GrabHandleGlyph(Rectangle controlBounds, GrabHandleGlyphType type, System.Windows.Forms.Design.Behavior.Behavior behavior, bool primarySelection) : base(behavior)
        {
            this.isPrimary     = primarySelection;
            base.hitTestCursor = Cursors.Default;
            base.rules         = SelectionRules.None;
            switch (type)
            {
            case GrabHandleGlyphType.UpperLeft:
                base.bounds        = new Rectangle((controlBounds.X + DesignerUtils.HANDLEOVERLAP) - DesignerUtils.HANDLESIZE, (controlBounds.Y + DesignerUtils.HANDLEOVERLAP) - DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE);
                base.hitTestCursor = Cursors.SizeNWSE;
                base.rules         = SelectionRules.LeftSizeable | SelectionRules.TopSizeable;
                break;

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

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

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

            case GrabHandleGlyphType.MiddleTop:
                if (controlBounds.Width >= ((2 * DesignerUtils.HANDLEOVERLAP) + (2 * DesignerUtils.HANDLESIZE)))
                {
                    base.bounds        = new Rectangle((controlBounds.X + (controlBounds.Width / 2)) - (DesignerUtils.HANDLESIZE / 2), (controlBounds.Y + DesignerUtils.HANDLEOVERLAP) - DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE);
                    base.hitTestCursor = Cursors.SizeNS;
                    base.rules         = SelectionRules.TopSizeable;
                }
                break;

            case GrabHandleGlyphType.MiddleBottom:
                if (controlBounds.Width >= ((2 * DesignerUtils.HANDLEOVERLAP) + (2 * DesignerUtils.HANDLESIZE)))
                {
                    base.bounds        = new Rectangle((controlBounds.X + (controlBounds.Width / 2)) - (DesignerUtils.HANDLESIZE / 2), controlBounds.Bottom - DesignerUtils.HANDLEOVERLAP, DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE);
                    base.hitTestCursor = Cursors.SizeNS;
                    base.rules         = SelectionRules.BottomSizeable;
                }
                break;

            case GrabHandleGlyphType.MiddleLeft:
                if (controlBounds.Height >= ((2 * DesignerUtils.HANDLEOVERLAP) + (2 * DesignerUtils.HANDLESIZE)))
                {
                    base.bounds        = new Rectangle((controlBounds.X + DesignerUtils.HANDLEOVERLAP) - DesignerUtils.HANDLESIZE, (controlBounds.Y + (controlBounds.Height / 2)) - (DesignerUtils.HANDLESIZE / 2), DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE);
                    base.hitTestCursor = Cursors.SizeWE;
                    base.rules         = SelectionRules.LeftSizeable;
                }
                break;

            case GrabHandleGlyphType.MiddleRight:
                if (controlBounds.Height >= ((2 * DesignerUtils.HANDLEOVERLAP) + (2 * DesignerUtils.HANDLESIZE)))
                {
                    base.bounds        = new Rectangle(controlBounds.Right - DesignerUtils.HANDLEOVERLAP, (controlBounds.Y + (controlBounds.Height / 2)) - (DesignerUtils.HANDLESIZE / 2), DesignerUtils.HANDLESIZE, DesignerUtils.HANDLESIZE);
                    base.hitTestCursor = Cursors.SizeWE;
                    base.rules         = SelectionRules.RightSizeable;
                }
                break;
            }
            base.hitBounds = base.bounds;
        }
 internal NoResizeSelectionBorderGlyph(Rectangle controlBounds, SelectionRules rules, SelectionBorderGlyphType type, System.Windows.Forms.Design.Behavior.Behavior behavior) : base(behavior)
 {
     this.InitializeGlyph(controlBounds, rules, type);
 }
Exemplo n.º 6
0
 protected Glyph(System.Windows.Forms.Design.Behavior.Behavior behavior)
 {
     this.behavior = behavior;
 }
Exemplo n.º 7
0
 protected void SetBehavior(System.Windows.Forms.Design.Behavior.Behavior behavior)
 {
     this.behavior = behavior;
 }
Exemplo n.º 8
0
 internal TableLayoutPanelResizeGlyph(Rectangle controlBounds, TableLayoutStyle style, Cursor hitTestCursor, System.Windows.Forms.Design.Behavior.Behavior behavior) : base(behavior)
 {
     this.bounds        = controlBounds;
     this.hitTestCursor = hitTestCursor;
     this.style         = style;
     if (style is ColumnStyle)
     {
         this.type = TableLayoutResizeType.Column;
     }
     else
     {
         this.type = TableLayoutResizeType.Row;
     }
 }
Exemplo n.º 9
0
 internal SelectionGlyphBase(System.Windows.Forms.Design.Behavior.Behavior behavior) : base(behavior)
 {
 }
 internal MiniLockedBorderGlyph(Rectangle controlBounds, SelectionBorderGlyphType type, System.Windows.Forms.Design.Behavior.Behavior behavior, bool primarySelection) : base(behavior)
 {
     this.InitializeGlyph(controlBounds, type, primarySelection);
 }
 public void PushCaptureBehavior(System.Windows.Forms.Design.Behavior.Behavior behavior)
 {
     this.PushBehavior(behavior);
     this.captureBehavior = behavior;
     this.adornerWindow.Capture = true;
     IUIService service = (IUIService) this.serviceProvider.GetService(typeof(IUIService));
     if (service != null)
     {
         IWin32Window dialogOwnerWindow = service.GetDialogOwnerWindow();
         if (((dialogOwnerWindow != null) && (dialogOwnerWindow.Handle != IntPtr.Zero)) && (dialogOwnerWindow.Handle != System.Design.UnsafeNativeMethods.GetActiveWindow()))
         {
             System.Design.UnsafeNativeMethods.SetActiveWindow(new HandleRef(this, dialogOwnerWindow.Handle));
         }
     }
 }
 internal void OnLoseCapture()
 {
     if (this.captureBehavior != null)
     {
         System.Windows.Forms.Design.Behavior.Behavior captureBehavior = this.captureBehavior;
         this.captureBehavior = null;
         try
         {
             captureBehavior.OnLoseCapture(this.hitTestedGlyph, EventArgs.Empty);
         }
         catch
         {
         }
     }
 }
 public ControlBodyGlyph(Rectangle bounds, Cursor cursor, IComponent relatedComponent, System.Windows.Forms.Design.Behavior.Behavior behavior) : base(relatedComponent, behavior)
 {
     this.bounds        = bounds;
     this.hitTestCursor = cursor;
     this.component     = relatedComponent;
 }
 internal NoResizeHandleGlyph(Rectangle controlBounds, SelectionRules selRules, bool primarySelection, System.Windows.Forms.Design.Behavior.Behavior behavior) : base(behavior)
 {
     this.isPrimary     = primarySelection;
     base.hitTestCursor = Cursors.Default;
     base.rules         = SelectionRules.None;
     if ((selRules & SelectionRules.Moveable) != SelectionRules.None)
     {
         base.rules         = SelectionRules.Moveable;
         base.hitTestCursor = Cursors.SizeAll;
     }
     base.bounds    = new Rectangle(controlBounds.X - DesignerUtils.NORESIZEHANDLESIZE, controlBounds.Y - DesignerUtils.NORESIZEHANDLESIZE, DesignerUtils.NORESIZEHANDLESIZE, DesignerUtils.NORESIZEHANDLESIZE);
     base.hitBounds = base.bounds;
 }