/// <summary> /// Initializes a new instance of the CaptionGlyph class. /// </summary> /// <param name="behaviorService"></param> /// <param name="PanderPanelW"></param> public PanderPanelWCaptionGlyph(System.Windows.Forms.Design.Behavior.BehaviorService behaviorService, PanderPanelW PanderPanelW) : base(new PanderPanelWCaptionClickBehavior(PanderPanelW)) { this.m_behaviorService = behaviorService; this.m_PanderPanelW = PanderPanelW; }
/// <summary> /// Initializes the designer with the specified component. /// </summary> /// <param name="component">The IComponent to associate with the designer.</param> public override void Initialize(IComponent component) { base.Initialize(component); PanderPanelW PanderPanelW = Control as PanderPanelW; if (PanderPanelW != null) { this.m_adorner = new System.Windows.Forms.Design.Behavior.Adorner(); BehaviorService.Adorners.Add(this.m_adorner); this.m_adorner.Glyphs.Add(new PanderPanelWCaptionGlyph(BehaviorService, PanderPanelW)); } }
private static void DrawInnerBorders(Graphics graphics, PanderPanelW PanderPanelW) { if (PanderPanelW.ShowBorder == true) { using (GraphicsPath graphicsPath = new GraphicsPath()) { Rectangle captionRectangle = PanderPanelW.CaptionRectangle; PanderPanelListW PanderPanelListW = PanderPanelW.Parent as PanderPanelListW; if ((PanderPanelListW != null) && (PanderPanelListW.Dock == DockStyle.Fill)) { XiaoCai.WinformUI.Panels.PanelW panel = PanderPanelListW.Parent as XiaoCai.WinformUI.Panels.PanelW; PanderPanelW parentPanderPanelW = PanderPanelListW.Parent as PanderPanelW; if (((panel != null) && (panel.Padding == new Padding(0))) || ((parentPanderPanelW != null) && (parentPanderPanelW.Padding == new Padding(0)))) { //Left vertical borderline graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y + captionRectangle.Height, captionRectangle.X, captionRectangle.Y + Constants.BorderThickness); if (PanderPanelW.Top == 0) { //Upper horizontal borderline graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y, captionRectangle.X + captionRectangle.Width, captionRectangle.Y); } else { //Upper horizontal borderline graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y + Constants.BorderThickness, captionRectangle.X + captionRectangle.Width, captionRectangle.Y + Constants.BorderThickness); } } } else { //Left vertical borderline graphicsPath.AddLine(captionRectangle.X + Constants.BorderThickness, captionRectangle.Y + captionRectangle.Height, captionRectangle.X + Constants.BorderThickness, captionRectangle.Y); if (PanderPanelW.Top == 0) { //Upper horizontal borderline graphicsPath.AddLine(captionRectangle.X + Constants.BorderThickness, captionRectangle.Y + Constants.BorderThickness, captionRectangle.X + captionRectangle.Width - Constants.BorderThickness, captionRectangle.Y + Constants.BorderThickness); } else { //Upper horizontal borderline graphicsPath.AddLine(captionRectangle.X + Constants.BorderThickness, captionRectangle.Y, captionRectangle.X + captionRectangle.Width - Constants.BorderThickness, captionRectangle.Y); } } using (Pen borderPen = new Pen(PanderPanelW.PanelColors.InnerBorderColor)) { graphics.DrawPath(borderPen, graphicsPath); } } } }
private void InitCustomColors(Dictionary <KnownColors, Color> rgbTable) { PanelW panel = this.m_basePanel as PanelW; if (panel != null) { rgbTable[KnownColors.BorderColor] = panel.CustomColors.BorderColor; rgbTable[KnownColors.InnerBorderColor] = panel.CustomColors.InnerBorderColor; rgbTable[KnownColors.PanelCaptionCloseIcon] = panel.CustomColors.CaptionCloseIcon; rgbTable[KnownColors.PanelCaptionExpandIcon] = panel.CustomColors.CaptionExpandIcon; rgbTable[KnownColors.PanelCaptionGradientBegin] = panel.CustomColors.CaptionGradientBegin; rgbTable[KnownColors.PanelCaptionGradientEnd] = panel.CustomColors.CaptionGradientEnd; rgbTable[KnownColors.PanelCaptionGradientMiddle] = panel.CustomColors.CaptionGradientMiddle; rgbTable[KnownColors.PanelCaptionSelectedGradientBegin] = panel.CustomColors.CaptionSelectedGradientBegin; rgbTable[KnownColors.PanelCaptionSelectedGradientEnd] = panel.CustomColors.CaptionSelectedGradientEnd; rgbTable[KnownColors.PanelContentGradientBegin] = panel.CustomColors.ContentGradientBegin; rgbTable[KnownColors.PanelContentGradientEnd] = panel.CustomColors.ContentGradientEnd; rgbTable[KnownColors.PanelCaptionText] = panel.CustomColors.CaptionText; rgbTable[KnownColors.PanelCollapsedCaptionText] = panel.CustomColors.CollapsedCaptionText; } PanderPanelW PanderPanelW = this.m_basePanel as PanderPanelW; if (PanderPanelW != null) { rgbTable[KnownColors.BorderColor] = PanderPanelW.CustomColors.BorderColor; rgbTable[KnownColors.InnerBorderColor] = PanderPanelW.CustomColors.InnerBorderColor; rgbTable[KnownColors.PanderPanelWBackColor] = PanderPanelW.CustomColors.BackColor; rgbTable[KnownColors.PanderPanelWCaptionCloseIcon] = PanderPanelW.CustomColors.CaptionCloseIcon; rgbTable[KnownColors.PanderPanelWCaptionExpandIcon] = PanderPanelW.CustomColors.CaptionExpandIcon; rgbTable[KnownColors.PanderPanelWCaptionText] = PanderPanelW.CustomColors.CaptionText; rgbTable[KnownColors.PanderPanelWCaptionGradientBegin] = PanderPanelW.CustomColors.CaptionGradientBegin; rgbTable[KnownColors.PanderPanelWCaptionGradientEnd] = PanderPanelW.CustomColors.CaptionGradientEnd; rgbTable[KnownColors.PanderPanelWCaptionGradientMiddle] = PanderPanelW.CustomColors.CaptionGradientMiddle; rgbTable[KnownColors.PanderPanelWFlatCaptionGradientBegin] = PanderPanelW.CustomColors.FlatCaptionGradientBegin; rgbTable[KnownColors.PanderPanelWFlatCaptionGradientEnd] = PanderPanelW.CustomColors.FlatCaptionGradientEnd; rgbTable[KnownColors.PanderPanelWPressedCaptionBegin] = PanderPanelW.CustomColors.CaptionPressedGradientBegin; rgbTable[KnownColors.PanderPanelWPressedCaptionEnd] = PanderPanelW.CustomColors.CaptionPressedGradientEnd; rgbTable[KnownColors.PanderPanelWPressedCaptionMiddle] = PanderPanelW.CustomColors.CaptionPressedGradientMiddle; rgbTable[KnownColors.PanderPanelWCheckedCaptionBegin] = PanderPanelW.CustomColors.CaptionCheckedGradientBegin; rgbTable[KnownColors.PanderPanelWCheckedCaptionEnd] = PanderPanelW.CustomColors.CaptionCheckedGradientEnd; rgbTable[KnownColors.PanderPanelWCheckedCaptionMiddle] = PanderPanelW.CustomColors.CaptionCheckedGradientMiddle; rgbTable[KnownColors.PanderPanelWSelectedCaptionBegin] = PanderPanelW.CustomColors.CaptionSelectedGradientBegin; rgbTable[KnownColors.PanderPanelWSelectedCaptionEnd] = PanderPanelW.CustomColors.CaptionSelectedGradientEnd; rgbTable[KnownColors.PanderPanelWSelectedCaptionMiddle] = PanderPanelW.CustomColors.CaptionSelectedGradientMiddle; rgbTable[KnownColors.PanderPanelWSelectedCaptionText] = PanderPanelW.CustomColors.CaptionSelectedText; } }
/// <summary> /// Initializes a new instance of the Behavior class. /// </summary> /// <param name="PanderPanelW">PanderPanelW for this behaviour</param> public PanderPanelWCaptionClickBehavior(PanderPanelW PanderPanelW) { this.m_PanderPanelW = PanderPanelW; }
private static void DrawBorders(Graphics graphics, PanderPanelW PanderPanelW) { if (PanderPanelW.ShowBorder == true) { using (GraphicsPath graphicsPath = new GraphicsPath()) { using (Pen borderPen = new Pen(PanderPanelW.PanelColors.BorderColor, Constants.BorderThickness)) { Rectangle captionRectangle = PanderPanelW.CaptionRectangle; Rectangle borderRectangle = captionRectangle; if (PanderPanelW.Expand == true) { borderRectangle = PanderPanelW.ClientRectangle; graphics.DrawLine( borderPen, captionRectangle.Left, captionRectangle.Top + captionRectangle.Height - Constants.BorderThickness, captionRectangle.Left + captionRectangle.Width, captionRectangle.Top + captionRectangle.Height - Constants.BorderThickness); } PanderPanelListW PanderPanelListW = PanderPanelW.Parent as PanderPanelListW; if ((PanderPanelListW != null) && (PanderPanelListW.Dock == DockStyle.Fill)) { XiaoCai.WinformUI.Panels.PanelW panel = PanderPanelListW.Parent as XiaoCai.WinformUI.Panels.PanelW; PanderPanelW parentPanderPanelW = PanderPanelListW.Parent as PanderPanelW; if (((panel != null) && (panel.Padding == new Padding(0))) || ((parentPanderPanelW != null) && (parentPanderPanelW.Padding == new Padding(0)))) { if (PanderPanelW.Top != 0) { graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left + captionRectangle.Width, borderRectangle.Top); } // Left vertical borderline graphics.DrawLine(borderPen, borderRectangle.Left, borderRectangle.Top, borderRectangle.Left, borderRectangle.Top + borderRectangle.Height); // Right vertical borderline graphics.DrawLine(borderPen, borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top + borderRectangle.Height); } else { // Upper horizontal borderline only at the top PanderPanelW if (PanderPanelW.Top == 0) { graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width, borderRectangle.Top); } // Left vertical borderline graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left, borderRectangle.Top + borderRectangle.Height); //Lower horizontal borderline graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top + borderRectangle.Height - Constants.BorderThickness, borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top + borderRectangle.Height - Constants.BorderThickness); // Right vertical borderline graphicsPath.AddLine( borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top + borderRectangle.Height); } } else { // Upper horizontal borderline only at the top PanderPanelW if (PanderPanelW.Top == 0) { graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width, borderRectangle.Top); } // Left vertical borderline graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left, borderRectangle.Top + borderRectangle.Height); //Lower horizontal borderline graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top + borderRectangle.Height - Constants.BorderThickness, borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top + borderRectangle.Height - Constants.BorderThickness); // Right vertical borderline graphicsPath.AddLine( borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top + borderRectangle.Height); } } using (Pen borderPen = new Pen(PanderPanelW.PanelColors.BorderColor, Constants.BorderThickness)) { graphics.DrawPath(borderPen, graphicsPath); } } } }
/// <summary> /// Copies the elements of the collection to an Array, starting at a particular Array index. /// </summary> /// <param name="PanderPanelWs">The one-dimensional Array that is the destination of the elements copied from ICollection. /// The Array must have zero-based indexing. ///</param> /// <param name="index">The zero-based index in array at which copying begins.</param> public void CopyTo(PanderPanelW[] PanderPanelWs, int index) { this.m_controlCollection.CopyTo(PanderPanelWs, index); }
/// <summary> /// Inserts an PanderPanelW to the collection at the specified index. /// </summary> /// <param name="index">The zero-based index at which value should be inserted. </param> /// <param name="PanderPanelW">The PanderPanelW to insert into the Collection.</param> public void Insert(int index, PanderPanelW PanderPanelW) { ((IList)this).Insert(index, (object)PanderPanelW); }
/// <summary> /// Returns the index of the specified PanderPanelW in the collection. /// </summary> /// <param name="PanderPanelW">The PanderPanelW to find the index of.</param> /// <returns>The index of the PanderPanelW, or -1 if the PanderPanelW is not in the <see ref="ControlCollection">ControlCollection</see> instance.</returns> public int IndexOf(PanderPanelW PanderPanelW) { return this.m_controlCollection.IndexOf(PanderPanelW); }
/// <summary> /// Removes the first occurrence of a specific PanderPanelW from the PanderPanelWCollection /// </summary> /// <param name="PanderPanelW">The PanderPanelW to remove from the PanderPanelWCollection</param> public void Remove(PanderPanelW PanderPanelW) { this.m_controlCollection.Remove(PanderPanelW); }
/// <summary> /// Adds a PanderPanelW to the collection. /// </summary> /// <param name="PanderPanelW">The PanderPanelW to add.</param> public void Add(PanderPanelW PanderPanelW) { this.m_controlCollection.Add(PanderPanelW); this.m_PanderPanelListW.Invalidate(); }
/// <summary> /// Determines whether the PanderPanelWCollection contains a specific PanderPanelW /// </summary> /// <param name="PanderPanelW">The PanderPanelW to locate in the PanderPanelWCollection</param> /// <returns>true if the PanderPanelWCollection contains the specified value; otherwise, false.</returns> public bool Contains(PanderPanelW PanderPanelW) { return this.m_controlCollection.Contains(PanderPanelW); }