Esempio n. 1
0
        private int GetTopPosition()
        {
            int iTopPosition     = this.Padding.Top;
            int iNextTopPosition = 0;

            //The next top position is the highest top value + that controls height, with a
            //little vertical spacing thrown in for good measure
            IEnumerator enumerator = this.XPanderPanels.GetEnumerator();

            while (enumerator.MoveNext())
            {
                XPanderPanel xpanderPanel = (XPanderPanel)enumerator.Current;

                if (xpanderPanel.Visible == true)
                {
                    if (iNextTopPosition == this.Padding.Top)
                    {
                        iTopPosition = this.Padding.Top;
                    }
                    else
                    {
                        iTopPosition = iNextTopPosition;
                    }
                    iNextTopPosition = iTopPosition + xpanderPanel.Height;
                }
            }
            return(iTopPosition);
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the CaptionGlyph class.
 /// </summary>
 /// <param name="behaviorService"></param>
 /// <param name="xpanderPanel"></param>
 public XPanderPanelCaptionGlyph(BehaviorService behaviorService, XPanderPanel xpanderPanel)
     :
     base(new XPanderPanelCaptionClickBehavior(xpanderPanel))
 {
     this.m_behaviorService = behaviorService;
     this.m_xpanderPanel    = xpanderPanel;
 }
Esempio n. 3
0
        /// <summary>
        /// Expands the specified XPanderPanel
        /// </summary>
        /// <param name="panel">The XPanderPanel to expand</param>
        /// <example>
        /// <code>
        /// private void btnExpandXPander_Click(object sender, EventArgs e)
        /// {
        ///    // xPanderPanel10 is not null
        ///    if (xPanderPanel10 != null)
        ///    {
        ///        EgoDevil.Utilities.UI.EPanels.XPanderPanelList panelList = xPanderPanel10.Parent as EgoDevil.Utilities.UI.EPanels.XPanderPanelList;
        ///        // and it's parent panelList is not null
        ///        if (panelList != null)
        ///        {
        ///            // expands xPanderPanel10 in it's panelList.
        ///            panelList.Expand(xPanderPanel10);
        ///        }
        ///    }
        /// }
        /// </code>
        /// </example>
        public void Expand(BaseEPanel panel)
        {
            if (panel == null)
            {
                throw new ArgumentNullException("panel",
                                                string.Format(CultureInfo.InvariantCulture,
                                                              Resources.IDS_ArgumentException,
                                                              "panel"));
            }

            XPanderPanel xpanderPanel = panel as XPanderPanel;

            if (xpanderPanel != null)
            {
                foreach (XPanderPanel tmpXPanderPanel in this.m_xpanderPanels)
                {
                    if (tmpXPanderPanel.Equals(xpanderPanel) == false)
                    {
                        tmpXPanderPanel.Expand = false;
                    }
                }
                PropertyDescriptor propertyDescriptor = TypeDescriptor.GetProperties(xpanderPanel)["Expand"];
                if (propertyDescriptor != null)
                {
                    propertyDescriptor.SetValue(xpanderPanel, true);
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Raises the VisibleChanged event.
        /// </summary>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected override void OnVisibleChanged(EventArgs e)
        {
            base.OnVisibleChanged(e);

            if (this.DesignMode == true)
            {
                return;
            }
            if (this.Visible == false)
            {
                if (this.Expand == true)
                {
                    this.Expand = false;
                    foreach (Control control in this.Parent.Controls)
                    {
                        XPanderPanel xpanderPanel =
                            control as XPanderPanel;

                        if (xpanderPanel != null)
                        {
                            if (xpanderPanel.Visible == true)
                            {
                                xpanderPanel.Expand = true;
                                return;
                            }
                        }
                    }
                }
            }
#if DEBUG
            //System.Diagnostics.Trace.WriteLine("Visibility: " + this.Name + this.Visible);
#endif
            CalculatePanelHeights();
        }
Esempio n. 5
0
        private void XPanderPanelExpandClick(object sender, EventArgs e)
        {
            XPanderPanel xpanderPanel = sender as XPanderPanel;

            if (xpanderPanel != null)
            {
                this.Expand(xpanderPanel);
            }
        }
Esempio n. 6
0
        private void XPanderPanelCloseClick(object sender, EventArgs e)
        {
            XPanderPanel xpanderPanel = sender as XPanderPanel;

            if (xpanderPanel != null)
            {
                this.Controls.Remove(xpanderPanel);
            }
        }
Esempio n. 7
0
        private void CalculatePanelHeights()
        {
            if (this.Parent == null)
            {
                return;
            }

            int iPanelHeight = this.Parent.Padding.Top;

            foreach (Control control in this.Parent.Controls)
            {
                XPanderPanel xpanderPanel =
                    control as XPanderPanel;

                if ((xpanderPanel != null) && (xpanderPanel.Visible == true))
                {
                    iPanelHeight += xpanderPanel.CaptionHeight;
                }
            }

            iPanelHeight += this.Parent.Padding.Bottom;

            foreach (Control control in this.Parent.Controls)
            {
                XPanderPanel xpanderPanel =
                    control as XPanderPanel;

                if (xpanderPanel != null)
                {
                    if (xpanderPanel.Expand == true)
                    {
                        xpanderPanel.Height = this.Parent.Height
                                              + xpanderPanel.CaptionHeight
                                              - iPanelHeight;
                    }
                    else
                    {
                        xpanderPanel.Height = xpanderPanel.CaptionHeight;
                    }
                }
            }

            int iTop = this.Parent.Padding.Top;

            foreach (Control control in this.Parent.Controls)
            {
                XPanderPanel xpanderPanel =
                    control as XPanderPanel;

                if ((xpanderPanel != null) && (xpanderPanel.Visible == true))
                {
                    xpanderPanel.Top = iTop;
                    iTop            += xpanderPanel.Height;
                }
            }
        }
Esempio n. 8
0
        /// <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);
            XPanderPanel xpanderPanel = Control as XPanderPanel;

            if (xpanderPanel != null)
            {
                this.m_adorner = new Adorner();
                BehaviorService.Adorners.Add(this.m_adorner);
                this.m_adorner.Glyphs.Add(new XPanderPanelCaptionGlyph(BehaviorService, xpanderPanel));
            }
        }
Esempio n. 9
0
        private static void DrawInnerBorders(Graphics graphics, XPanderPanel xpanderPanel)
        {
            if (xpanderPanel.ShowBorder == true)
            {
                using (GraphicsPath graphicsPath = new GraphicsPath())
                {
                    Rectangle        captionRectangle = xpanderPanel.CaptionRectangle;
                    XPanderPanelList xpanderPanelList = xpanderPanel.Parent as XPanderPanelList;
                    if ((xpanderPanelList != null) && (xpanderPanelList.Dock == DockStyle.Fill))
                    {
                        EPanel       panel = xpanderPanelList.Parent as EPanel;
                        XPanderPanel parentXPanderPanel = xpanderPanelList.Parent as XPanderPanel;
                        if (((panel != null) && (panel.Padding == new Padding(0))) ||
                            ((parentXPanderPanel != null) && (parentXPanderPanel.Padding == new Padding(0))))
                        {
                            //Left vertical borderline
                            graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y + captionRectangle.Height, captionRectangle.X, captionRectangle.Y + Constants.BorderThickness);
                            if (xpanderPanel.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 (xpanderPanel.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(xpanderPanel.PanelColors.InnerBorderColor))
                    {
                        graphics.DrawPath(borderPen, graphicsPath);
                    }
                }
            }
        }
Esempio n. 10
0
        /// <summary>
        /// Adds an item to the IList.
        /// </summary>
        /// <param name="value">The Object to add to the IList.</param>
        /// <returns>The position into which the new element was inserted.</returns>
        int IList.Add(object value)
        {
            XPanderPanel xpanderPanel = value as XPanderPanel;

            if (xpanderPanel == null)
            {
                throw new ArgumentException(string.Format(CultureInfo.CurrentUICulture,
                                                          Resources.IDS_ArgumentException,
                                                          typeof(XPanderPanel).Name));
            }
            this.Add(xpanderPanel);
            return(this.IndexOf(xpanderPanel));
        }
Esempio n. 11
0
        /// <summary>
        /// Raises the ControlRemoved event.
        /// </summary>
        /// <param name="e">A ControlEventArgs that contains the event data.</param>
        protected override void OnControlRemoved(ControlEventArgs e)
        {
            base.OnControlRemoved(e);

            XPanderPanel xpanderPanel =
                e.Control as XPanderPanel;

            if (xpanderPanel != null)
            {
                xpanderPanel.PanelStyleChanged -= new EventHandler <PanelStyleChangeEventArgs>(XpanderPanelPanelStyleChanged);
                xpanderPanel.ExpandClick       -= new EventHandler <EventArgs>(this.XPanderPanelExpandClick);
                xpanderPanel.CloseClick        -= new EventHandler <EventArgs>(this.XPanderPanelCloseClick);
            }
        }
Esempio n. 12
0
        private void InitCustomColors(Dictionary <KnownColors, Color> rgbTable)
        {
            EPanel panel = this.m_basePanel as EPanel;

            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;
            }

            XPanderPanel xpanderPanel = this.m_basePanel as XPanderPanel;

            if (xpanderPanel != null)
            {
                rgbTable[KnownColors.BorderColor]                          = xpanderPanel.CustomColors.BorderColor;
                rgbTable[KnownColors.InnerBorderColor]                     = xpanderPanel.CustomColors.InnerBorderColor;
                rgbTable[KnownColors.XPanderPanelBackColor]                = xpanderPanel.CustomColors.BackColor;
                rgbTable[KnownColors.XPanderPanelCaptionCloseIcon]         = xpanderPanel.CustomColors.CaptionCloseIcon;
                rgbTable[KnownColors.XPanderPanelCaptionExpandIcon]        = xpanderPanel.CustomColors.CaptionExpandIcon;
                rgbTable[KnownColors.XPanderPanelCaptionText]              = xpanderPanel.CustomColors.CaptionText;
                rgbTable[KnownColors.XPanderPanelCaptionGradientBegin]     = xpanderPanel.CustomColors.CaptionGradientBegin;
                rgbTable[KnownColors.XPanderPanelCaptionGradientEnd]       = xpanderPanel.CustomColors.CaptionGradientEnd;
                rgbTable[KnownColors.XPanderPanelCaptionGradientMiddle]    = xpanderPanel.CustomColors.CaptionGradientMiddle;
                rgbTable[KnownColors.XPanderPanelFlatCaptionGradientBegin] = xpanderPanel.CustomColors.FlatCaptionGradientBegin;
                rgbTable[KnownColors.XPanderPanelFlatCaptionGradientEnd]   = xpanderPanel.CustomColors.FlatCaptionGradientEnd;
                rgbTable[KnownColors.XPanderPanelPressedCaptionBegin]      = xpanderPanel.CustomColors.CaptionPressedGradientBegin;
                rgbTable[KnownColors.XPanderPanelPressedCaptionEnd]        = xpanderPanel.CustomColors.CaptionPressedGradientEnd;
                rgbTable[KnownColors.XPanderPanelPressedCaptionMiddle]     = xpanderPanel.CustomColors.CaptionPressedGradientMiddle;
                rgbTable[KnownColors.XPanderPanelCheckedCaptionBegin]      = xpanderPanel.CustomColors.CaptionCheckedGradientBegin;
                rgbTable[KnownColors.XPanderPanelCheckedCaptionEnd]        = xpanderPanel.CustomColors.CaptionCheckedGradientEnd;
                rgbTable[KnownColors.XPanderPanelCheckedCaptionMiddle]     = xpanderPanel.CustomColors.CaptionCheckedGradientMiddle;
                rgbTable[KnownColors.XPanderPanelSelectedCaptionBegin]     = xpanderPanel.CustomColors.CaptionSelectedGradientBegin;
                rgbTable[KnownColors.XPanderPanelSelectedCaptionEnd]       = xpanderPanel.CustomColors.CaptionSelectedGradientEnd;
                rgbTable[KnownColors.XPanderPanelSelectedCaptionMiddle]    = xpanderPanel.CustomColors.CaptionSelectedGradientMiddle;
                rgbTable[KnownColors.XPanderPanelSelectedCaptionText]      = xpanderPanel.CustomColors.CaptionSelectedText;
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Creates a new instance of the specified collection item type.
        /// </summary>
        /// <param name="ItemType">The type of item to create.</param>
        /// <returns>A new instance of the specified object.</returns>
        protected override Object CreateInstance(Type ItemType)
        {
            /* you can create the new instance yourself
             * ComplexItem ci=new ComplexItem(2,"ComplexItem",null);
             * we know for sure that the itemType it will always be ComplexItem
             * but this time let it to do the job...
             */

            XPanderPanel xpanderPanel =
                (XPanderPanel)base.CreateInstance(ItemType);

            if (this.Context.Instance != null)
            {
                xpanderPanel.Expand = true;
            }
            return(xpanderPanel);
        }
Esempio n. 14
0
        /// <summary>
        /// Raises the ControlAdded event.
        /// </summary>
        /// <param name="e">A ControlEventArgs that contains the event data.</param>
        protected override void OnControlAdded(ControlEventArgs e)
        {
            base.OnControlAdded(e);
            XPanderPanel xpanderPanel = e.Control as XPanderPanel;

            if (xpanderPanel != null)
            {
                if (xpanderPanel.Expand == true)
                {
                    foreach (XPanderPanel tmpXPanderPanel in this.XPanderPanels)
                    {
                        if (tmpXPanderPanel != xpanderPanel)
                        {
                            tmpXPanderPanel.Expand = false;
                            tmpXPanderPanel.Height = xpanderPanel.CaptionHeight;
                        }
                    }
                }
                xpanderPanel.Parent = this;
                xpanderPanel.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left)
                                                       | AnchorStyles.Right)));
                xpanderPanel.Left  = this.Padding.Left;
                xpanderPanel.Width = this.ClientRectangle.Width
                                     - this.Padding.Left
                                     - this.Padding.Right;
                xpanderPanel.PanelStyle  = this.PanelStyle;
                xpanderPanel.ColorScheme = this.ColorScheme;
                if (this.PanelColors != null)
                {
                    xpanderPanel.SetPanelProperties(this.PanelColors);
                }
                xpanderPanel.ShowBorder         = this.ShowBorder;
                xpanderPanel.ShowCloseIcon      = this.m_bShowCloseIcon;
                xpanderPanel.ShowExpandIcon     = this.m_bShowExpandIcon;
                xpanderPanel.CaptionStyle       = this.m_captionStyle;
                xpanderPanel.Top                = this.GetTopPosition();
                xpanderPanel.PanelStyleChanged += new EventHandler <PanelStyleChangeEventArgs>(XpanderPanelPanelStyleChanged);
                xpanderPanel.ExpandClick       += new EventHandler <EventArgs>(this.XPanderPanelExpandClick);
                xpanderPanel.CloseClick        += new EventHandler <EventArgs>(this.XPanderPanelCloseClick);
            }
            else
            {
                throw new InvalidOperationException("Can only add EgoDevil.Utilities.UI.EPanels.XPanderPanel");
            }
        }
Esempio n. 15
0
 /// <summary>
 /// Initializes a new instance of the Behavior class.
 /// </summary>
 /// <param name="xpanderPanel">XPanderPanel for this behaviour</param>
 public XPanderPanelCaptionClickBehavior(XPanderPanel xpanderPanel)
 {
     this.m_xpanderPanel = xpanderPanel;
 }
Esempio n. 16
0
 /// <summary>
 /// Inserts an XPanderPanel to the collection at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which value should be inserted.</param>
 /// <param name="xpanderPanel">The XPanderPanel to insert into the Collection.</param>
 public void Insert(int index, XPanderPanel xpanderPanel)
 {
     ((IList)this).Insert(index, (object)xpanderPanel);
 }
Esempio n. 17
0
        private static void DrawBorders(Graphics graphics, XPanderPanel xpanderPanel)
        {
            if (xpanderPanel.ShowBorder == true)
            {
                using (GraphicsPath graphicsPath = new GraphicsPath())
                {
                    using (Pen borderPen = new Pen(xpanderPanel.PanelColors.BorderColor, Constants.BorderThickness))
                    {
                        Rectangle captionRectangle = xpanderPanel.CaptionRectangle;
                        Rectangle borderRectangle  = captionRectangle;

                        if (xpanderPanel.Expand == true)
                        {
                            borderRectangle = xpanderPanel.ClientRectangle;

                            graphics.DrawLine(
                                borderPen,
                                captionRectangle.Left,
                                captionRectangle.Top + captionRectangle.Height - Constants.BorderThickness,
                                captionRectangle.Left + captionRectangle.Width,
                                captionRectangle.Top + captionRectangle.Height - Constants.BorderThickness);
                        }

                        XPanderPanelList xpanderPanelList = xpanderPanel.Parent as XPanderPanelList;
                        if ((xpanderPanelList != null) && (xpanderPanelList.Dock == DockStyle.Fill))
                        {
                            EPanel       panel = xpanderPanelList.Parent as EPanel;
                            XPanderPanel parentXPanderPanel = xpanderPanelList.Parent as XPanderPanel;
                            if (((panel != null) && (panel.Padding == new Padding(0))) ||
                                ((parentXPanderPanel != null) && (parentXPanderPanel.Padding == new Padding(0))))
                            {
                                if (xpanderPanel.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 xpanderPanel
                                if (xpanderPanel.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 xpanderPanel
                            if (xpanderPanel.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(xpanderPanel.PanelColors.BorderColor, Constants.BorderThickness))
                    {
                        graphics.DrawPath(borderPen, graphicsPath);
                    }
                }
            }
        }
Esempio n. 18
0
 /// <summary>
 /// Removes the first occurrence of a specific XPanderPanel from the XPanderPanelCollection
 /// </summary>
 /// <param name="xpanderPanel">The XPanderPanel to remove from the XPanderPanelCollection</param>
 public void Remove(XPanderPanel xpanderPanel)
 {
     this.m_controlCollection.Remove(xpanderPanel);
 }
Esempio n. 19
0
 /// <summary>
 /// Inserts an XPanderPanel to the collection at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which value should be inserted.</param>
 /// <param name="xpanderPanel">The XPanderPanel to insert into the Collection.</param>
 public void Insert(int index, XPanderPanel xpanderPanel)
 {
     ((IList)this).Insert(index, (object)xpanderPanel);
 }
Esempio n. 20
0
 /// <summary>
 /// Returns the index of the specified XPanderPanel in the collection.
 /// </summary>
 /// <param name="xpanderPanel">The xpanderPanel to find the index of.</param>
 /// <returns>
 /// The index of the xpanderPanel, or -1 if the xpanderPanel is not in the <see
 /// ref="ControlCollection">ControlCollection</see> instance.
 /// </returns>
 public int IndexOf(XPanderPanel xpanderPanel)
 {
     return this.m_controlCollection.IndexOf(xpanderPanel);
 }
Esempio n. 21
0
 /// <summary>
 /// Adds a XPanderPanel to the collection.
 /// </summary>
 /// <param name="xpanderPanel">The XPanderPanel to add.</param>
 public void Add(XPanderPanel xpanderPanel)
 {
     this.m_controlCollection.Add(xpanderPanel);
     this.m_xpanderPanelList.Invalidate();
 }
Esempio n. 22
0
 /// <summary>
 /// Initializes a new instance of the CaptionGlyph class.
 /// </summary>
 /// <param name="behaviorService"></param>
 /// <param name="xpanderPanel"></param>
 public XPanderPanelCaptionGlyph(BehaviorService behaviorService, XPanderPanel xpanderPanel)
     : base(new XPanderPanelCaptionClickBehavior(xpanderPanel))
 {
     this.m_behaviorService = behaviorService;
     this.m_xpanderPanel = xpanderPanel;
 }
Esempio n. 23
0
 /// <summary>
 /// Returns the index of the specified XPanderPanel in the collection.
 /// </summary>
 /// <param name="xpanderPanel">The xpanderPanel to find the index of.</param>
 /// <returns>
 /// The index of the xpanderPanel, or -1 if the xpanderPanel is not in the <see
 /// ref="ControlCollection">ControlCollection</see> instance.
 /// </returns>
 public int IndexOf(XPanderPanel xpanderPanel)
 {
     return(this.m_controlCollection.IndexOf(xpanderPanel));
 }
Esempio n. 24
0
        private static void DrawInnerBorders(Graphics graphics, XPanderPanel xpanderPanel)
        {
            if (xpanderPanel.ShowBorder == true)
            {
                using (GraphicsPath graphicsPath = new GraphicsPath())
                {
                    Rectangle captionRectangle = xpanderPanel.CaptionRectangle;
                    XPanderPanelList xpanderPanelList = xpanderPanel.Parent as XPanderPanelList;
                    if ((xpanderPanelList != null) && (xpanderPanelList.Dock == DockStyle.Fill))
                    {
                        EPanel panel = xpanderPanelList.Parent as EPanel;
                        XPanderPanel parentXPanderPanel = xpanderPanelList.Parent as XPanderPanel;
                        if (((panel != null) && (panel.Padding == new Padding(0))) ||
                            ((parentXPanderPanel != null) && (parentXPanderPanel.Padding == new Padding(0))))
                        {
                            //Left vertical borderline
                            graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y + captionRectangle.Height, captionRectangle.X, captionRectangle.Y + Constants.BorderThickness);
                            if (xpanderPanel.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 (xpanderPanel.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(xpanderPanel.PanelColors.InnerBorderColor))
                    {
                        graphics.DrawPath(borderPen, graphicsPath);
                    }
                }
            }
        }
Esempio n. 25
0
 /// <summary>
 /// Removes the first occurrence of a specific XPanderPanel from the XPanderPanelCollection
 /// </summary>
 /// <param name="xpanderPanel">The XPanderPanel to remove from the XPanderPanelCollection</param>
 public void Remove(XPanderPanel xpanderPanel)
 {
     this.m_controlCollection.Remove(xpanderPanel);
 }
Esempio n. 26
0
        private static void DrawBorders(Graphics graphics, XPanderPanel xpanderPanel)
        {
            if (xpanderPanel.ShowBorder == true)
            {
                using (GraphicsPath graphicsPath = new GraphicsPath())
                {
                    using (Pen borderPen = new Pen(xpanderPanel.PanelColors.BorderColor, Constants.BorderThickness))
                    {
                        Rectangle captionRectangle = xpanderPanel.CaptionRectangle;
                        Rectangle borderRectangle = captionRectangle;

                        if (xpanderPanel.Expand == true)
                        {
                            borderRectangle = xpanderPanel.ClientRectangle;

                            graphics.DrawLine(
                                borderPen,
                                captionRectangle.Left,
                                captionRectangle.Top + captionRectangle.Height - Constants.BorderThickness,
                                captionRectangle.Left + captionRectangle.Width,
                                captionRectangle.Top + captionRectangle.Height - Constants.BorderThickness);
                        }

                        XPanderPanelList xpanderPanelList = xpanderPanel.Parent as XPanderPanelList;
                        if ((xpanderPanelList != null) && (xpanderPanelList.Dock == DockStyle.Fill))
                        {
                            EPanel panel = xpanderPanelList.Parent as EPanel;
                            XPanderPanel parentXPanderPanel = xpanderPanelList.Parent as XPanderPanel;
                            if (((panel != null) && (panel.Padding == new Padding(0))) ||
                                ((parentXPanderPanel != null) && (parentXPanderPanel.Padding == new Padding(0))))
                            {
                                if (xpanderPanel.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 xpanderPanel
                                if (xpanderPanel.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 xpanderPanel
                            if (xpanderPanel.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(xpanderPanel.PanelColors.BorderColor, Constants.BorderThickness))
                    {
                        graphics.DrawPath(borderPen, graphicsPath);
                    }
                }
            }
        }
Esempio n. 27
0
 /// <summary>
 /// Adds a XPanderPanel to the collection.
 /// </summary>
 /// <param name="xpanderPanel">The XPanderPanel to add.</param>
 public void Add(XPanderPanel xpanderPanel)
 {
     this.m_controlCollection.Add(xpanderPanel);
     this.m_xpanderPanelList.Invalidate();
 }
Esempio n. 28
0
 /// <summary>
 /// Initializes a new instance of the Behavior class.
 /// </summary>
 /// <param name="xpanderPanel">XPanderPanel for this behaviour</param>
 public XPanderPanelCaptionClickBehavior(XPanderPanel xpanderPanel)
 {
     this.m_xpanderPanel = xpanderPanel;
 }
Esempio n. 29
0
 /// <summary>
 /// Determines whether the XPanderPanelCollection contains a specific XPanderPanel
 /// </summary>
 /// <param name="xpanderPanel">The XPanderPanel to locate in the XPanderPanelCollection</param>
 /// <returns>
 /// true if the XPanderPanelCollection contains the specified value; otherwise, false.
 /// </returns>
 public bool Contains(XPanderPanel xpanderPanel)
 {
     return this.m_controlCollection.Contains(xpanderPanel);
 }
Esempio n. 30
0
 /// <summary>
 /// Copies the elements of the collection to an Array, starting at a particular Array index.
 /// </summary>
 /// <param name="xpanderPanels">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(XPanderPanel[] xpanderPanels, int index)
 {
     this.m_controlCollection.CopyTo(xpanderPanels, index);
 }
Esempio n. 31
0
 /// <summary>
 /// Determines whether the XPanderPanelCollection contains a specific XPanderPanel
 /// </summary>
 /// <param name="xpanderPanel">The XPanderPanel to locate in the XPanderPanelCollection</param>
 /// <returns>
 /// true if the XPanderPanelCollection contains the specified value; otherwise, false.
 /// </returns>
 public bool Contains(XPanderPanel xpanderPanel)
 {
     return(this.m_controlCollection.Contains(xpanderPanel));
 }