示例#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);
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the CaptionGlyph class.
 /// </summary>
 /// <param name="behaviorService"></param>
 /// <param name="xpanderPanel"></param>
 public XPanderPanelCaptionGlyph(System.Windows.Forms.Design.Behavior.BehaviorService behaviorService, XPanderPanel xpanderPanel)
     :
     base(new XPanderPanelCaptionClickBehavior(xpanderPanel))
 {
     this.m_behaviorService = behaviorService;
     this.m_xpanderPanel    = xpanderPanel;
 }
示例#3
0
        /// <summary>
        /// expands the specified panel
        /// </summary>
        /// <param name="panel">panel to expand</param>
        public void Expand(BasePanel panel)
        {
            if (panel == null)
            {
                throw new ArgumentNullException("panel",
                                                string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                              BaseControls.Properties.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);
                }
            }
        }
示例#4
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 System.Windows.Forms.Design.Behavior.Adorner();
                BehaviorService.Adorners.Add(this.m_adorner);
                this.m_adorner.Glyphs.Add(new XPanderPanelCaptionGlyph(BehaviorService, xpanderPanel));
            }
        }
示例#5
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(System.Globalization.CultureInfo.CurrentUICulture,
                                                          Resources.IDS_ArgumentException,
                                                          typeof(XPanderPanel).Name));
            }
            this.Add(xpanderPanel);
            return(this.IndexOf(xpanderPanel));
        }
示例#6
0
        private void InitCustomColors(ref Dictionary <KnownColors, Color> rgbTable)
        {
            rgbTable[KnownColors.BorderColor]      = this.m_basePanel.BorderColor;
            rgbTable[KnownColors.InnerBorderColor] = this.m_basePanel.InnerBorderColor;
            Panel panel = this.m_basePanel as Panel;

            if (panel != null)
            {
                rgbTable[KnownColors.PanelCaptionCloseIcon]      = this.m_basePanel.CloseIconForeColor;
                rgbTable[KnownColors.PanelCaptionExpandIcon]     = this.m_basePanel.CaptionForeColor;
                rgbTable[KnownColors.PanelCaptionGradientBegin]  = this.m_basePanel.ColorCaptionGradientBegin;
                rgbTable[KnownColors.PanelCaptionGradientEnd]    = this.m_basePanel.ColorCaptionGradientEnd;
                rgbTable[KnownColors.PanelCaptionGradientMiddle] = this.m_basePanel.ColorCaptionGradientMiddle;
                rgbTable[KnownColors.PanelContentGradientBegin]  = panel.ColorContentPanelGradientBegin;
                rgbTable[KnownColors.PanelContentGradientEnd]    = panel.ColorContentPanelGradientEnd;
                rgbTable[KnownColors.PanelCaptionText]           = panel.CaptionForeColor;
                rgbTable[KnownColors.PanelCollapsedCaptionText]  = panel.CollapsedCaptionForeColor;
            }

            XPanderPanel xpanderPanel = this.m_basePanel as XPanderPanel;

            if (xpanderPanel != null)
            {
                rgbTable[KnownColors.XPanderPanelBackColor]                = xpanderPanel.BackColor;
                rgbTable[KnownColors.XPanderPanelCaptionCloseIcon]         = this.m_basePanel.CloseIconForeColor;
                rgbTable[KnownColors.XPanderPanelCaptionExpandIcon]        = this.m_basePanel.CaptionForeColor;
                rgbTable[KnownColors.XPanderPanelCaptionText]              = xpanderPanel.CaptionForeColor;
                rgbTable[KnownColors.XPanderPanelCaptionGradientBegin]     = xpanderPanel.ColorCaptionGradientBegin;
                rgbTable[KnownColors.XPanderPanelCaptionGradientEnd]       = xpanderPanel.ColorCaptionGradientEnd;
                rgbTable[KnownColors.XPanderPanelCaptionGradientMiddle]    = xpanderPanel.ColorCaptionGradientMiddle;
                rgbTable[KnownColors.XPanderPanelFlatCaptionGradientBegin] = xpanderPanel.ColorFlatCaptionGradientBegin;
                rgbTable[KnownColors.XPanderPanelFlatCaptionGradientEnd]   = xpanderPanel.ColorFlatCaptionGradientEnd;
                rgbTable[KnownColors.XPanderPanelPressedCaptionBegin]      = this.m_professionalColorTable.ButtonPressedGradientBegin;
                rgbTable[KnownColors.XPanderPanelPressedCaptionEnd]        = this.m_professionalColorTable.ButtonPressedGradientEnd;
                rgbTable[KnownColors.XPanderPanelPressedCaptionMiddle]     = this.m_professionalColorTable.ButtonPressedGradientMiddle;
                rgbTable[KnownColors.XPanderPanelSelectedCaptionBegin]     = this.m_professionalColorTable.ButtonCheckedGradientBegin;
                rgbTable[KnownColors.XPanderPanelSelectedCaptionEnd]       = this.m_professionalColorTable.ButtonCheckedGradientEnd;
                rgbTable[KnownColors.XPanderPanelSelectedCaptionMiddle]    = this.m_professionalColorTable.ButtonCheckedGradientMiddle;
                rgbTable[KnownColors.XPanderPanelSelectedCaptionText]      = SystemColors.ControlText;
            }
        }
示例#7
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);
 }
示例#8
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));
 }
示例#9
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);
 }
示例#10
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();
 }
示例#11
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));
 }
示例#12
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;
 }