protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType)
        {
            ControlBodyGlyph glyph   = null;
            SelectionManager service = (SelectionManager)this.GetService(typeof(SelectionManager));

            if (service != null)
            {
                Rectangle             bounds   = base.BehaviorService.ControlRectInAdornerWindow(this.splitterPanel1);
                SplitterPanelDesigner designer = this.designerHost.GetDesigner(this.splitterPanel1) as SplitterPanelDesigner;
                this.OnSetCursor();
                if (designer != null)
                {
                    glyph = new ControlBodyGlyph(bounds, Cursor.Current, this.splitterPanel1, designer);
                    service.BodyGlyphAdorner.Glyphs.Add(glyph);
                }
                bounds   = base.BehaviorService.ControlRectInAdornerWindow(this.splitterPanel2);
                designer = this.designerHost.GetDesigner(this.splitterPanel2) as SplitterPanelDesigner;
                if (designer != null)
                {
                    glyph = new ControlBodyGlyph(bounds, Cursor.Current, this.splitterPanel2, designer);
                    service.BodyGlyphAdorner.Glyphs.Add(glyph);
                }
            }
            return(base.GetControlGlyph(selectionType));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// get glyhs of the designer
        /// </summary>
        /// <param name="selectionType"></param>
        /// <returns></returns>
        public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
        {
            GlyphCollection glyphs = new GlyphCollection();

            // when the split container is not readonly, add the glyphs
            if (!this.spc.IsReadOnly)
            {
                Point     location            = base.BehaviorService.MapAdornerWindowPoint(this.spc.Handle, this.spc.DisplayRectangle.Location);
                Rectangle clientAreaRectangle = new Rectangle(location, this.spc.DisplayRectangle.Size);
                for (int i = 0; i < spc.Panels.Count - 1; i++)
                {
                    Control            item       = spc.GetChildByIndex(i);
                    PropertyDescriptor descriptor = TypeDescriptor.GetProperties(item.Controls[0])["Locked"];
                    bool isLocked = (descriptor != null) ? ((bool)descriptor.GetValue(item.Controls[0])) : false;
                    if (!isLocked && item.Visible) // show glyphs when form inside panel is not locked
                    {
                        Behavior b = new SplitterResizeBehavior(spc, base.Component.Site, item);

                        if (spc.Orientation == Orientation.Horizontal)
                        {
                            glyphs.Add(GetVerticalResizeGlyph(clientAreaRectangle, item.Bounds.Bottom, b));
                        }
                        else
                        {
                            glyphs.Add(GetHorizontalResizeGlyph(clientAreaRectangle, item.Bounds.Right, b));
                        }
                    }
                }
            }
            return(glyphs);
        }
Ejemplo n.º 3
0
        public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
        {
            var coll = base.GetGlyphs(selectionType);

            if (selectionType != GlyphSelectionType.NotSelected)
            {
                coll.Add(new VerticalDividerGlyph(BehaviorService, Adorner, (PickCoordinateControl)Control));
            }
            return(coll);
        }
 protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selType)
 {
     Cursor sizeAll = Cursors.Default;
     if ((selType != GlyphSelectionType.NotSelected) && ((this.SelectionRules & SelectionRules.Moveable) != SelectionRules.None))
     {
         sizeAll = Cursors.SizeAll;
     }
     Point location = base.BehaviorService.ControlToAdornerWindow((Control) base.Component);
     return new ControlBodyGlyph(new Rectangle(location, ((Control) base.Component).Size), sizeAll, this.Control, this);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// get glyphs of form
 /// </summary>
 /// <param name="selectionType"></param>
 /// <returns></returns>
 public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
 {
     if (this.Control.Visible)
     {
         return(base.GetGlyphs(selectionType));
     }
     else
     {
         return(new GlyphCollection()); // when form is not visible , don't show glyphs
     }
 }
Ejemplo n.º 6
0
        protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selType)
        {
            Cursor sizeAll = Cursors.Default;

            if ((selType != GlyphSelectionType.NotSelected) && ((this.SelectionRules & SelectionRules.Moveable) != SelectionRules.None))
            {
                sizeAll = Cursors.SizeAll;
            }
            Point location = base.BehaviorService.ControlToAdornerWindow((Control)base.Component);

            return(new ControlBodyGlyph(new Rectangle(location, ((Control)base.Component).Size), sizeAll, this.Control, this));
        }
Ejemplo n.º 7
0
        //protected override bool GetHitTest(Point pt)
        //{
        //    TreeView tree = this.Control as TreeView;
        //    if(tree.ClientRectangle.Contains(tree.PointToClient(pt)))
        //    {
        //        return true;
        //    }
        //    return false;
        //}
        //protected override void WndProc(ref Message m)
        //{
        //    if (m.Msg == (int)WinApi.Messages.WM_VSCROLL)
        //    {
        //        JwDialog.AlertInfo($"MESSAGe;{m.Msg} {m.WParam} {m.LParam}");
        //    }
        //    base.WndProc(ref m);
        //}
        public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
        {
            GlyphCollection glyphs = base.GetGlyphs(selectionType);

            if (SelectionService != null)
            {
                if (SelectionService.PrimarySelection == this.Control)
                {
                    glyphs.Add(new EventGlyph(this.BehaviorService, this.Control));
                }
            }
            return(glyphs);
        }
Ejemplo n.º 8
0
        //<summary>
        //get glyhs of the designer
        //</summary>
        //<param name="selectionType"></param>
        //<returns></returns>
        public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
        {
            GlyphCollection    glyphs     = base.GetGlyphs(selectionType);
            PropertyDescriptor descriptor = TypeDescriptor.GetProperties(base.Component)["Locked"];
            bool isLocked = (descriptor != null) ? ((bool)descriptor.GetValue(base.Component)) : false;

            if (selectionType != GlyphSelectionType.NotSelected && !isLocked && !tableControl.IsDragging) //selectionType == GlyphSelectionType.SelectedPrimary
            {
                Point     location            = base.BehaviorService.MapAdornerWindowPoint(this.tableControl.Handle, this.tableControl.DisplayRectangle.Location);
                Rectangle clientAreaRectangle = new Rectangle(location, this.tableControl.DisplayRectangle.Size);
                glyphs.Add(GetVerticalResizeGlyph(clientAreaRectangle, tableControl.TitleHeight + tableControl.RowHeight, RowHeightResizeBehavior));
                glyphs.Add(GetVerticalResizeGlyph(clientAreaRectangle, tableControl.TitleHeight, TitleHeightResizeBehavior));
            }
            return(glyphs);
        }
Ejemplo n.º 9
0
        protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType)
        {
            SelectionManager service = (SelectionManager)this.GetService(typeof(SelectionManager));

            if (service != null)
            {
                for (int i = 0; i <= 4; i++)
                {
                    Control         c        = this.panels[i];
                    Rectangle       bounds   = base.BehaviorService.ControlRectInAdornerWindow(c);
                    ControlDesigner designer = this.InternalControlDesigner(i);
                    this.OnSetCursor();
                    if (designer != null)
                    {
                        ControlBodyGlyph glyph = new ControlBodyGlyph(bounds, Cursor.Current, c, designer);
                        service.BodyGlyphAdorner.Glyphs.Add(glyph);
                        bool        flag = true;
                        ICollection selectedComponents = this.selectionSvc.GetSelectedComponents();
                        if (!this.selectionSvc.GetComponentSelected(this.toolStripContainer))
                        {
                            foreach (object obj2 in selectedComponents)
                            {
                                if (this.ContainerParent(obj2 as Control) == this.toolStripContainer)
                                {
                                    flag = true;
                                }
                                else
                                {
                                    flag = false;
                                }
                            }
                        }
                        if (flag)
                        {
                            ToolStripPanelDesigner designer2 = designer as ToolStripPanelDesigner;
                            if (designer2 != null)
                            {
                                this.AddPanelSelectionGlyph(designer2, service);
                            }
                        }
                    }
                }
            }
            return(base.GetControlGlyph(selectionType));
        }
        private void AddAllControlGlyphs(Control parent, ArrayList selComps, object primarySelection)
        {
            foreach (Control control in parent.Controls)
            {
                this.AddAllControlGlyphs(control, selComps, primarySelection);
            }
            GlyphSelectionType notSelected = GlyphSelectionType.NotSelected;

            if (selComps.Contains(parent))
            {
                if (parent.Equals(primarySelection))
                {
                    notSelected = GlyphSelectionType.SelectedPrimary;
                }
                else
                {
                    notSelected = GlyphSelectionType.Selected;
                }
            }
            this.AddControlGlyphs(parent, notSelected);
        }
        private void AddControlGlyphs(Control c, GlyphSelectionType selType)
        {
            ControlDesigner designer = (ControlDesigner)this.componentToDesigner[c];

            if (designer != null)
            {
                ControlBodyGlyph controlGlyphInternal = designer.GetControlGlyphInternal(selType);
                if (controlGlyphInternal != null)
                {
                    this.bodyAdorner.Glyphs.Add(controlGlyphInternal);
                    if ((selType == GlyphSelectionType.SelectedPrimary) || (selType == GlyphSelectionType.Selected))
                    {
                        if (this.curSelectionBounds[this.curCompIndex] == Rectangle.Empty)
                        {
                            this.curSelectionBounds[this.curCompIndex] = controlGlyphInternal.Bounds;
                        }
                        else
                        {
                            this.curSelectionBounds[this.curCompIndex] = Rectangle.Union(this.curSelectionBounds[this.curCompIndex], controlGlyphInternal.Bounds);
                        }
                    }
                }
                GlyphCollection glyphs = designer.GetGlyphs(selType);
                if (glyphs != null)
                {
                    this.selectionAdorner.Glyphs.AddRange(glyphs);
                    if ((selType == GlyphSelectionType.SelectedPrimary) || (selType == GlyphSelectionType.Selected))
                    {
                        foreach (Glyph glyph2 in glyphs)
                        {
                            this.curSelectionBounds[this.curCompIndex] = Rectangle.Union(this.curSelectionBounds[this.curCompIndex], glyph2.Bounds);
                        }
                    }
                }
            }
            if ((selType == GlyphSelectionType.SelectedPrimary) || (selType == GlyphSelectionType.Selected))
            {
                this.curCompIndex++;
            }
        }
Ejemplo n.º 12
0
        public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
        {
            GlyphCollection glyphs = base.GetGlyphs(selectionType);

            if (spc.Orientation == Orientation.Horizontal)
            {
                Point                location             = base.BehaviorService.MapAdornerWindowPoint(this.spc.Handle, this.spc.DisplayRectangle.Location);
                Rectangle            clientAreaRectangle  = new Rectangle(location, this.spc.DisplayRectangle.Size);
                int                  thinkness            = 2;
                IOFormSplitContainer iOFormSplitContainer = spc as IOFormSplitContainer;

                if (!iOFormSplitContainer.IsReadOnly) // Show glyphs only when control is not readonly
                {
                    // add glyph to change width of the container
                    Behavior    widthResizeBehavior = new IOFormWidthResizeBehavior(spc as IOFormSplitContainer, base.Component.Site);
                    Rectangle   WEGlyphRect         = new Rectangle(clientAreaRectangle.Left + clientAreaRectangle.Width - thinkness / 2, clientAreaRectangle.Top, thinkness, clientAreaRectangle.Height);
                    ResizeGlyph WEGlyph             = new ResizeGlyph(WEGlyphRect, Cursors.SizeWE, widthResizeBehavior);
                    glyphs.Add(WEGlyph);
                }

                // Add the glyph to change the height of last form when it is visible
                if (spc.Panels.Count > 0 && spc.Panels.Last().Visible)
                {
                    PropertyDescriptor descriptor = TypeDescriptor.GetProperties(spc.Panels.Last().Controls[0])["Locked"];
                    bool isLocked = descriptor != null? (bool)descriptor.GetValue(spc.Panels.Last().Controls[0]) : false;

                    if (!isLocked) // Show glyphs when panel is not locked
                    {
                        SplitterResizeBehavior heightResizeBehavior = new SplitterResizeBehavior(iOFormSplitContainer, base.Component.Site, spc.Panels.Last());
                        Rectangle   NSGlyphRect = new Rectangle(clientAreaRectangle.Left, clientAreaRectangle.Bottom - thinkness, clientAreaRectangle.Width, thinkness);
                        ResizeGlyph NSGlyph     = new ResizeGlyph(NSGlyphRect, Cursors.SizeNS, heightResizeBehavior);
                        glyphs.Add(NSGlyph);
                    }
                }
            }

            return(glyphs);
        }
 protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType)
 {
     ControlBodyGlyph glyph = null;
     SelectionManager service = (SelectionManager) this.GetService(typeof(SelectionManager));
     if (service != null)
     {
         Rectangle bounds = base.BehaviorService.ControlRectInAdornerWindow(this.splitterPanel1);
         SplitterPanelDesigner designer = this.designerHost.GetDesigner(this.splitterPanel1) as SplitterPanelDesigner;
         this.OnSetCursor();
         if (designer != null)
         {
             glyph = new ControlBodyGlyph(bounds, Cursor.Current, this.splitterPanel1, designer);
             service.BodyGlyphAdorner.Glyphs.Add(glyph);
         }
         bounds = base.BehaviorService.ControlRectInAdornerWindow(this.splitterPanel2);
         designer = this.designerHost.GetDesigner(this.splitterPanel2) as SplitterPanelDesigner;
         if (designer != null)
         {
             glyph = new ControlBodyGlyph(bounds, Cursor.Current, this.splitterPanel2, designer);
             service.BodyGlyphAdorner.Glyphs.Add(glyph);
         }
     }
     return base.GetControlGlyph(selectionType);
 }
Ejemplo n.º 14
0
		protected override ControlBodyGlyph GetControlGlyph (GlyphSelectionType selectionType)
		{
			return base.GetControlGlyph (selectionType);
		}
Ejemplo n.º 15
0
 public virtual GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
 {
     throw new NotImplementedException();
 }
 private void AddControlGlyphs(Control c, GlyphSelectionType selType)
 {
     ControlDesigner designer = (ControlDesigner) this.componentToDesigner[c];
     if (designer != null)
     {
         ControlBodyGlyph controlGlyphInternal = designer.GetControlGlyphInternal(selType);
         if (controlGlyphInternal != null)
         {
             this.bodyAdorner.Glyphs.Add(controlGlyphInternal);
             if ((selType == GlyphSelectionType.SelectedPrimary) || (selType == GlyphSelectionType.Selected))
             {
                 if (this.curSelectionBounds[this.curCompIndex] == Rectangle.Empty)
                 {
                     this.curSelectionBounds[this.curCompIndex] = controlGlyphInternal.Bounds;
                 }
                 else
                 {
                     this.curSelectionBounds[this.curCompIndex] = Rectangle.Union(this.curSelectionBounds[this.curCompIndex], controlGlyphInternal.Bounds);
                 }
             }
         }
         GlyphCollection glyphs = designer.GetGlyphs(selType);
         if (glyphs != null)
         {
             this.selectionAdorner.Glyphs.AddRange(glyphs);
             if ((selType == GlyphSelectionType.SelectedPrimary) || (selType == GlyphSelectionType.Selected))
             {
                 foreach (Glyph glyph2 in glyphs)
                 {
                     this.curSelectionBounds[this.curCompIndex] = Rectangle.Union(this.curSelectionBounds[this.curCompIndex], glyph2.Bounds);
                 }
             }
         }
     }
     if ((selType == GlyphSelectionType.SelectedPrimary) || (selType == GlyphSelectionType.Selected))
     {
         this.curCompIndex++;
     }
 }
 internal ControlBodyGlyph GetControlGlyphInternal(GlyphSelectionType selectionType)
 {
     return this.GetControlGlyph(selectionType);
 }
 public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
 {
     GlyphCollection glyphs = new GlyphCollection();
     if (selectionType != GlyphSelectionType.NotSelected)
     {
         Point location = base.BehaviorService.ControlToAdornerWindow((Control) base.Component);
         Rectangle controlBounds = new Rectangle(location, ((Control) base.Component).Size);
         bool primarySelection = selectionType == GlyphSelectionType.SelectedPrimary;
         bool flag2 = false;
         PropertyDescriptor descriptor = TypeDescriptor.GetProperties(base.Component)["Locked"];
         if (descriptor != null)
         {
             flag2 = (bool) descriptor.GetValue(base.Component);
         }
         bool flag3 = false;
         descriptor = TypeDescriptor.GetProperties(base.Component)["AutoSize"];
         if (descriptor != null)
         {
             flag3 = (bool) descriptor.GetValue(base.Component);
         }
         AutoSizeMode growOnly = AutoSizeMode.GrowOnly;
         descriptor = TypeDescriptor.GetProperties(base.Component)["AutoSizeMode"];
         if (descriptor != null)
         {
             growOnly = (AutoSizeMode) descriptor.GetValue(base.Component);
         }
         System.Windows.Forms.Design.SelectionRules selectionRules = this.SelectionRules;
         if (flag2)
         {
             glyphs.Add(new LockedHandleGlyph(controlBounds, primarySelection));
             glyphs.Add(new LockedBorderGlyph(controlBounds, SelectionBorderGlyphType.Top));
             glyphs.Add(new LockedBorderGlyph(controlBounds, SelectionBorderGlyphType.Bottom));
             glyphs.Add(new LockedBorderGlyph(controlBounds, SelectionBorderGlyphType.Left));
             glyphs.Add(new LockedBorderGlyph(controlBounds, SelectionBorderGlyphType.Right));
             return glyphs;
         }
         if ((flag3 && (growOnly == AutoSizeMode.GrowAndShrink)) && !(this.Control is Form))
         {
             glyphs.Add(new NoResizeHandleGlyph(controlBounds, selectionRules, primarySelection, null));
             glyphs.Add(new NoResizeSelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Top, null));
             glyphs.Add(new NoResizeSelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Bottom, null));
             glyphs.Add(new NoResizeSelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Left, null));
             glyphs.Add(new NoResizeSelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Right, null));
             return glyphs;
         }
         glyphs.Add(new GrabHandleGlyph(controlBounds, GrabHandleGlyphType.MiddleRight, this.StandardBehavior, primarySelection));
         glyphs.Add(new GrabHandleGlyph(controlBounds, GrabHandleGlyphType.LowerRight, this.StandardBehavior, primarySelection));
         glyphs.Add(new GrabHandleGlyph(controlBounds, GrabHandleGlyphType.MiddleBottom, this.StandardBehavior, primarySelection));
         glyphs.Add(new SelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Top, null));
         glyphs.Add(new SelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Bottom, this.StandardBehavior));
         glyphs.Add(new SelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Left, null));
         glyphs.Add(new SelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Right, this.StandardBehavior));
     }
     return glyphs;
 }
Ejemplo n.º 19
0
 public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
 {
     return(base.GetGlyphs(selectionType));
 }
 protected virtual ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType)
 {
     this.OnSetCursor();
     Cursor current = Cursor.Current;
     Rectangle bounds = this.BehaviorService.ControlRectInAdornerWindow(this.Control);
     ControlBodyGlyph glyph = null;
     System.Windows.Forms.Control parent = this.Control.Parent;
     if (((parent != null) && (this.host != null)) && (this.host.RootComponent != base.Component))
     {
         Rectangle rectangle2 = parent.RectangleToScreen(parent.ClientRectangle);
         Rectangle rect = this.Control.RectangleToScreen(this.Control.ClientRectangle);
         if (!rectangle2.Contains(rect) && !rectangle2.IntersectsWith(rect))
         {
             ISelectionService service = (ISelectionService) this.GetService(typeof(ISelectionService));
             if ((service != null) && service.GetComponentSelected(this.Control))
             {
                 glyph = new ControlBodyGlyph(bounds, current, this.Control, this.MoveBehavior);
             }
             else if (current == Cursors.SizeAll)
             {
                 current = Cursors.Default;
             }
         }
     }
     if (glyph == null)
     {
         glyph = new ControlBodyGlyph(bounds, current, this.Control, this);
     }
     return glyph;
 }
 public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
 {
     GlyphCollection glyphs = base.GetGlyphs(selectionType);
     PropertyDescriptor descriptor = TypeDescriptor.GetProperties(base.Component)["Locked"];
     bool flag = (descriptor != null) ? ((bool) descriptor.GetValue(base.Component)) : false;
     bool flag2 = this.EnsureAvailableStyles();
     if (((selectionType != GlyphSelectionType.NotSelected) && !flag) && (this.InheritanceAttribute != System.ComponentModel.InheritanceAttribute.InheritedReadOnly))
     {
         Point location = base.BehaviorService.MapAdornerWindowPoint(this.Table.Handle, this.Table.DisplayRectangle.Location);
         Rectangle rectangle = new Rectangle(location, this.Table.DisplayRectangle.Size);
         Point point2 = base.BehaviorService.ControlToAdornerWindow(this.Control);
         Rectangle rectangle2 = new Rectangle(point2, this.Control.ClientSize);
         int[] columnWidths = this.Table.GetColumnWidths();
         int[] rowHeights = this.Table.GetRowHeights();
         int num = DesignerUtils.RESIZEGLYPHSIZE / 2;
         bool flag3 = this.Table.RightToLeft == RightToLeft.Yes;
         int y = flag3 ? rectangle.Right : rectangle.X;
         if (!flag2)
         {
             return glyphs;
         }
         for (int i = 0; i < (columnWidths.Length - 1); i++)
         {
             if (columnWidths[i] != 0)
             {
                 if (flag3)
                 {
                     y -= columnWidths[i];
                 }
                 else
                 {
                     y += columnWidths[i];
                 }
                 Rectangle rect = new Rectangle(y - num, rectangle2.Top, DesignerUtils.RESIZEGLYPHSIZE, rectangle2.Height);
                 if (rectangle2.Contains(rect) && (this.Table.ColumnStyles[i] != null))
                 {
                     TableLayoutPanelResizeGlyph glyph = new TableLayoutPanelResizeGlyph(rect, this.Table.ColumnStyles[i], Cursors.VSplit, this.Behavior);
                     glyphs.Add(glyph);
                 }
             }
         }
         y = rectangle.Y;
         for (int j = 0; j < (rowHeights.Length - 1); j++)
         {
             if (rowHeights[j] != 0)
             {
                 y += rowHeights[j];
                 Rectangle rectangle4 = new Rectangle(rectangle2.Left, y - num, rectangle2.Width, DesignerUtils.RESIZEGLYPHSIZE);
                 if (rectangle2.Contains(rectangle4) && (this.Table.RowStyles[j] != null))
                 {
                     TableLayoutPanelResizeGlyph glyph2 = new TableLayoutPanelResizeGlyph(rectangle4, this.Table.RowStyles[j], Cursors.HSplit, this.Behavior);
                     glyphs.Add(glyph2);
                 }
             }
         }
     }
     return glyphs;
 }
Ejemplo n.º 22
0
 public virtual GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
 {
     throw null;
 }
 protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType)
 {
     this.OnSetCursor();
     Rectangle b = base.BehaviorService.ControlRectInAdornerWindow(this.Control);
     Control parent = this.Control.Parent;
     IDesignerHost service = (IDesignerHost) this.GetService(typeof(IDesignerHost));
     if (((parent != null) && (service != null)) && (service.RootComponent != base.Component))
     {
         Rectangle a = base.BehaviorService.ControlRectInAdornerWindow(parent);
         Rectangle bounds = Rectangle.Intersect(a, b);
         if (selectionType == GlyphSelectionType.NotSelected)
         {
             if (!bounds.IsEmpty && !a.Contains(b))
             {
                 return new ControlBodyGlyph(bounds, Cursor.Current, this.Control, this);
             }
             if (bounds.IsEmpty)
             {
                 return null;
             }
         }
     }
     return new ControlBodyGlyph(b, Cursor.Current, this.Control, this);
 }
 public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
 {
     GlyphCollection glyphs = base.GetGlyphs(selectionType);
     if ((((this.SelectionRules & SelectionRules.Moveable) != SelectionRules.None) && (this.InheritanceAttribute != InheritanceAttribute.InheritedReadOnly)) && (selectionType != GlyphSelectionType.NotSelected))
     {
         Point location = base.BehaviorService.ControlToAdornerWindow((Control) base.Component);
         Rectangle containerBounds = new Rectangle(location, ((Control) base.Component).Size);
         int glyphOffset = (int) (DesignerUtils.CONTAINERGRABHANDLESIZE * 0.5);
         if (containerBounds.Width < (2 * DesignerUtils.CONTAINERGRABHANDLESIZE))
         {
             glyphOffset = -1 * glyphOffset;
         }
         ContainerSelectorBehavior behavior = new ContainerSelectorBehavior((Control) base.Component, base.Component.Site, true);
         ContainerSelectorGlyph glyph = new ContainerSelectorGlyph(containerBounds, DesignerUtils.CONTAINERGRABHANDLESIZE, glyphOffset, behavior);
         glyphs.Insert(0, glyph);
     }
     return glyphs;
 }
Ejemplo n.º 25
0
		/*
		 * GetControlGlyph
		 */

		/// <summary>
		/// </summary>
		/// <param name="selectionType"></param>
		/// <returns></returns>
		protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType)
		{
			this.OnSetCursor();
			return new ControlBodyGlyph(Rectangle.Empty, Cursor.Current, this.Control, this);
		}
Ejemplo n.º 26
0
 protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType)
 {
     throw null;
 }
Ejemplo n.º 27
0
 public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
 {
     return(new GlyphCollection());
 }
Ejemplo n.º 28
0
 /// <summary>
 ///     Returns an array of Glyph objects representing the selection
 ///     borders and grab handles for the related Component.  Note that
 ///     based on 'selType' the Glyphs returned will either: represent
 ///     a fully resizeable selection border with grab handles, a locked
 ///     selection border, or a single 'hidden' selection Glyph.
 /// </summary>
 public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
 {
     throw new NotImplementedException(SR.NotImplementedByDesign);
 }
Ejemplo n.º 29
0
 protected virtual ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType)
 {
     throw null;
 }
Ejemplo n.º 30
0
 protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType)
 {
     return(base.GetControlGlyph(selectionType));
 }
Ejemplo n.º 31
0
 protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType)
 {
     this.OnSetCursor();
     return(new ControlBodyGlyph(Rectangle.Empty, Cursor.Current, this.Control, this));
 }
Ejemplo n.º 32
0
		public override GlyphCollection GetGlyphs (GlyphSelectionType selectionType)
		{
			return base.GetGlyphs (selectionType);
		}
Ejemplo n.º 33
0
		protected virtual ControlBodyGlyph GetControlGlyph (GlyphSelectionType selectionType)
		{
			throw new NotImplementedException ();
		}
 public virtual GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
 {
     GlyphCollection glyphs = new GlyphCollection();
     if (selectionType != GlyphSelectionType.NotSelected)
     {
         Rectangle controlBounds = this.BehaviorService.ControlRectInAdornerWindow(this.Control);
         bool primarySelection = selectionType == GlyphSelectionType.SelectedPrimary;
         System.Windows.Forms.Design.SelectionRules selectionRules = this.SelectionRules;
         if (this.Locked || (this.InheritanceAttribute == System.ComponentModel.InheritanceAttribute.InheritedReadOnly))
         {
             glyphs.Add(new LockedHandleGlyph(controlBounds, primarySelection));
             glyphs.Add(new LockedBorderGlyph(controlBounds, SelectionBorderGlyphType.Top));
             glyphs.Add(new LockedBorderGlyph(controlBounds, SelectionBorderGlyphType.Bottom));
             glyphs.Add(new LockedBorderGlyph(controlBounds, SelectionBorderGlyphType.Left));
             glyphs.Add(new LockedBorderGlyph(controlBounds, SelectionBorderGlyphType.Right));
             return glyphs;
         }
         if ((selectionRules & System.Windows.Forms.Design.SelectionRules.AllSizeable) == System.Windows.Forms.Design.SelectionRules.None)
         {
             glyphs.Add(new NoResizeHandleGlyph(controlBounds, selectionRules, primarySelection, this.MoveBehavior));
             glyphs.Add(new NoResizeSelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Top, this.MoveBehavior));
             glyphs.Add(new NoResizeSelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Bottom, this.MoveBehavior));
             glyphs.Add(new NoResizeSelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Left, this.MoveBehavior));
             glyphs.Add(new NoResizeSelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Right, this.MoveBehavior));
             if (TypeDescriptor.GetAttributes(base.Component).Contains(DesignTimeVisibleAttribute.Yes) && (this.behaviorService.DesignerActionUI != null))
             {
                 Glyph designerActionGlyph = this.behaviorService.DesignerActionUI.GetDesignerActionGlyph(base.Component);
                 if (designerActionGlyph != null)
                 {
                     glyphs.Insert(0, designerActionGlyph);
                 }
             }
             return glyphs;
         }
         if ((selectionRules & System.Windows.Forms.Design.SelectionRules.TopSizeable) != System.Windows.Forms.Design.SelectionRules.None)
         {
             glyphs.Add(new GrabHandleGlyph(controlBounds, GrabHandleGlyphType.MiddleTop, this.StandardBehavior, primarySelection));
             if ((selectionRules & System.Windows.Forms.Design.SelectionRules.LeftSizeable) != System.Windows.Forms.Design.SelectionRules.None)
             {
                 glyphs.Add(new GrabHandleGlyph(controlBounds, GrabHandleGlyphType.UpperLeft, this.StandardBehavior, primarySelection));
             }
             if ((selectionRules & System.Windows.Forms.Design.SelectionRules.RightSizeable) != System.Windows.Forms.Design.SelectionRules.None)
             {
                 glyphs.Add(new GrabHandleGlyph(controlBounds, GrabHandleGlyphType.UpperRight, this.StandardBehavior, primarySelection));
             }
         }
         if ((selectionRules & System.Windows.Forms.Design.SelectionRules.BottomSizeable) != System.Windows.Forms.Design.SelectionRules.None)
         {
             glyphs.Add(new GrabHandleGlyph(controlBounds, GrabHandleGlyphType.MiddleBottom, this.StandardBehavior, primarySelection));
             if ((selectionRules & System.Windows.Forms.Design.SelectionRules.LeftSizeable) != System.Windows.Forms.Design.SelectionRules.None)
             {
                 glyphs.Add(new GrabHandleGlyph(controlBounds, GrabHandleGlyphType.LowerLeft, this.StandardBehavior, primarySelection));
             }
             if ((selectionRules & System.Windows.Forms.Design.SelectionRules.RightSizeable) != System.Windows.Forms.Design.SelectionRules.None)
             {
                 glyphs.Add(new GrabHandleGlyph(controlBounds, GrabHandleGlyphType.LowerRight, this.StandardBehavior, primarySelection));
             }
         }
         if ((selectionRules & System.Windows.Forms.Design.SelectionRules.LeftSizeable) != System.Windows.Forms.Design.SelectionRules.None)
         {
             glyphs.Add(new GrabHandleGlyph(controlBounds, GrabHandleGlyphType.MiddleLeft, this.StandardBehavior, primarySelection));
         }
         if ((selectionRules & System.Windows.Forms.Design.SelectionRules.RightSizeable) != System.Windows.Forms.Design.SelectionRules.None)
         {
             glyphs.Add(new GrabHandleGlyph(controlBounds, GrabHandleGlyphType.MiddleRight, this.StandardBehavior, primarySelection));
         }
         glyphs.Add(new SelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Top, this.StandardBehavior));
         glyphs.Add(new SelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Bottom, this.StandardBehavior));
         glyphs.Add(new SelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Left, this.StandardBehavior));
         glyphs.Add(new SelectionBorderGlyph(controlBounds, selectionRules, SelectionBorderGlyphType.Right, this.StandardBehavior));
         if (TypeDescriptor.GetAttributes(base.Component).Contains(DesignTimeVisibleAttribute.Yes) && (this.behaviorService.DesignerActionUI != null))
         {
             Glyph glyph2 = this.behaviorService.DesignerActionUI.GetDesignerActionGlyph(base.Component);
             if (glyph2 != null)
             {
                 glyphs.Insert(0, glyph2);
             }
         }
     }
     return glyphs;
 }
Ejemplo n.º 35
0
		public virtual GlyphCollection GetGlyphs (GlyphSelectionType selectionType)
		{
			throw new NotImplementedException ();
		}
Ejemplo n.º 36
0
 public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
 {
     throw null;
 }
 protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType)
 {
     if (!this.ToolStrip.IsHandleCreated)
     {
         return null;
     }
     SelectionManager manager = (SelectionManager) this.GetService(typeof(SelectionManager));
     if (((manager != null) && (this.ToolStrip != null)) && (this.CanAddItems && this.ToolStrip.Visible))
     {
         object primarySelection = this.SelectionService.PrimarySelection;
         System.Windows.Forms.Design.Behavior.Behavior b = new ToolStripItemBehavior();
         if (this.ToolStrip.Items.Count > 0)
         {
             ToolStripItem[] array = new ToolStripItem[this.ToolStrip.Items.Count];
             this.ToolStrip.Items.CopyTo(array, 0);
             foreach (ToolStripItem item in array)
             {
                 if (item != null)
                 {
                     ToolStripItemDesigner designer = (ToolStripItemDesigner) this.host.GetDesigner(item);
                     if (((item != primarySelection) && (designer != null)) && designer.IsEditorActive)
                     {
                         designer.Editor.Commit(false, false);
                     }
                 }
             }
         }
         IMenuEditorService service = (IMenuEditorService) this.GetService(typeof(IMenuEditorService));
         if ((service == null) || ((service != null) && !service.IsActive()))
         {
             foreach (ToolStripItem item2 in this.ToolStrip.Items)
             {
                 if (!(item2 is DesignerToolStripControlHost) && (item2.Placement == ToolStripItemPlacement.Main))
                 {
                     ToolStripItemDesigner itemDesigner = (ToolStripItemDesigner) this.host.GetDesigner(item2);
                     if (itemDesigner != null)
                     {
                         bool flag2 = item2 == primarySelection;
                         if (flag2)
                         {
                             ((ToolStripItemBehavior) b).dragBoxFromMouseDown = this.dragBoxFromMouseDown;
                         }
                         if (!flag2)
                         {
                             item2.AutoSize = (itemDesigner != null) ? itemDesigner.AutoSize : true;
                         }
                         Rectangle glyphBounds = itemDesigner.GetGlyphBounds();
                         Control parent = this.ToolStrip.Parent;
                         Rectangle parentBounds = base.BehaviorService.ControlRectInAdornerWindow(parent);
                         if (IsGlyphTotallyVisible(glyphBounds, parentBounds) && item2.Visible)
                         {
                             ToolStripItemGlyph glyph = new ToolStripItemGlyph(item2, itemDesigner, glyphBounds, b);
                             itemDesigner.bodyGlyph = glyph;
                             manager.BodyGlyphAdorner.Glyphs.Add(glyph);
                         }
                     }
                 }
             }
         }
     }
     return base.GetControlGlyph(selectionType);
 }
Ejemplo n.º 38
0
 protected virtual ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType)
 {
     throw new NotImplementedException();
 }
 public override GlyphCollection GetGlyphs(GlyphSelectionType selType)
 {
     GlyphCollection glyphs = new GlyphCollection();
     foreach (object obj2 in this.SelectionService.GetSelectedComponents())
     {
         if (obj2 is System.Windows.Forms.ToolStrip)
         {
             GlyphCollection glyphs2 = base.GetGlyphs(selType);
             glyphs.AddRange(glyphs2);
         }
         else
         {
             ToolStripItem component = obj2 as ToolStripItem;
             if ((component != null) && component.Visible)
             {
                 ToolStripItemDesigner designer = (ToolStripItemDesigner) this.host.GetDesigner(component);
                 if (designer != null)
                 {
                     designer.GetGlyphs(ref glyphs, this.StandardBehavior);
                 }
             }
         }
     }
     if ((((this.SelectionRules & SelectionRules.Moveable) != SelectionRules.None) && (this.InheritanceAttribute != System.ComponentModel.InheritanceAttribute.InheritedReadOnly)) && (selType != GlyphSelectionType.NotSelected))
     {
         Point location = base.BehaviorService.ControlToAdornerWindow((Control) base.Component);
         Rectangle containerBounds = new Rectangle(location, ((Control) base.Component).Size);
         int glyphOffset = (int) (DesignerUtils.CONTAINERGRABHANDLESIZE * 0.5);
         if (containerBounds.Width < (2 * DesignerUtils.CONTAINERGRABHANDLESIZE))
         {
             glyphOffset = -1 * glyphOffset;
         }
         ContainerSelectorBehavior behavior = new ContainerSelectorBehavior(this.ToolStrip, base.Component.Site, true);
         ContainerSelectorGlyph glyph = new ContainerSelectorGlyph(containerBounds, DesignerUtils.CONTAINERGRABHANDLESIZE, glyphOffset, behavior);
         glyphs.Insert(0, glyph);
     }
     return glyphs;
 }
Ejemplo n.º 40
0
 internal ControlBodyGlyph GetControlGlyphMethod(GlyphSelectionType selectionType)
 {
     return(GetControlGlyph(selectionType));
 }
 protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType)
 {
     SelectionManager service = (SelectionManager) this.GetService(typeof(SelectionManager));
     if (service != null)
     {
         for (int i = 0; i <= 4; i++)
         {
             Control c = this.panels[i];
             Rectangle bounds = base.BehaviorService.ControlRectInAdornerWindow(c);
             ControlDesigner designer = this.InternalControlDesigner(i);
             this.OnSetCursor();
             if (designer != null)
             {
                 ControlBodyGlyph glyph = new ControlBodyGlyph(bounds, Cursor.Current, c, designer);
                 service.BodyGlyphAdorner.Glyphs.Add(glyph);
                 bool flag = true;
                 ICollection selectedComponents = this.selectionSvc.GetSelectedComponents();
                 if (!this.selectionSvc.GetComponentSelected(this.toolStripContainer))
                 {
                     foreach (object obj2 in selectedComponents)
                     {
                         if (this.ContainerParent(obj2 as Control) == this.toolStripContainer)
                         {
                             flag = true;
                         }
                         else
                         {
                             flag = false;
                         }
                     }
                 }
                 if (flag)
                 {
                     ToolStripPanelDesigner designer2 = designer as ToolStripPanelDesigner;
                     if (designer2 != null)
                     {
                         this.AddPanelSelectionGlyph(designer2, service);
                     }
                 }
             }
         }
     }
     return base.GetControlGlyph(selectionType);
 }