Exemplo n.º 1
0
 private static void DrawStyleDefault(Graphics graphics, Rectangle captionRectangle, Color colorGradientBegin, Color colorGradientEnd, Color colorGradientMiddle)
 {
     BasePanel.RenderDoubleBackgroundGradient(graphics, captionRectangle, colorGradientBegin, colorGradientMiddle, colorGradientEnd, LinearGradientMode.Vertical, flipHorizontal: true);
 }
Exemplo n.º 2
0
        private void DrawCaptionbar(Graphics graphics, bool bExpand, bool bShowBorder, PanelStyle panelStyle)
        {
            Rectangle captionRectangle    = base.CaptionRectangle;
            Color     color               = base.PanelColors.XPanderPanelCaptionGradientBegin;
            Color     color2              = base.PanelColors.XPanderPanelCaptionGradientEnd;
            Color     color3              = base.PanelColors.XPanderPanelCaptionGradientMiddle;
            Color     color4              = base.PanelColors.XPanderPanelCaptionText;
            Color     foreColorCloseIcon  = base.PanelColors.XPanderPanelCaptionCloseIcon;
            Color     foreColorExpandIcon = base.PanelColors.XPanderPanelCaptionExpandIcon;
            bool      flag = (base.HoverStateCaptionBar == HoverState.Hover) ? true : false;

            if (m_imageClosePanel == null)
            {
                m_imageClosePanel = Resources.closePanel;
            }
            if (m_imageChevronUp == null)
            {
                m_imageChevronUp = Resources.ChevronUp;
            }
            if (m_imageChevronDown == null)
            {
                m_imageChevronDown = Resources.ChevronDown;
            }
            m_imageChevron = m_imageChevronDown;
            if (bExpand)
            {
                m_imageChevron = m_imageChevronUp;
            }
            if (m_captionStyle == CaptionStyle.Normal)
            {
                if (flag)
                {
                    color  = base.PanelColors.XPanderPanelSelectedCaptionBegin;
                    color2 = base.PanelColors.XPanderPanelSelectedCaptionEnd;
                    color3 = base.PanelColors.XPanderPanelSelectedCaptionMiddle;
                    if (bExpand)
                    {
                        color  = base.PanelColors.XPanderPanelPressedCaptionBegin;
                        color2 = base.PanelColors.XPanderPanelPressedCaptionEnd;
                        color3 = base.PanelColors.XPanderPanelPressedCaptionMiddle;
                    }
                    color4              = base.PanelColors.XPanderPanelSelectedCaptionText;
                    foreColorCloseIcon  = color4;
                    foreColorExpandIcon = color4;
                }
                else if (bExpand)
                {
                    color               = base.PanelColors.XPanderPanelCheckedCaptionBegin;
                    color2              = base.PanelColors.XPanderPanelCheckedCaptionEnd;
                    color3              = base.PanelColors.XPanderPanelCheckedCaptionMiddle;
                    color4              = base.PanelColors.XPanderPanelSelectedCaptionText;
                    foreColorCloseIcon  = color4;
                    foreColorExpandIcon = color4;
                }
                if (panelStyle != PanelStyle.Office2007)
                {
                    BasePanel.RenderDoubleBackgroundGradient(graphics, captionRectangle, color, color3, color2, LinearGradientMode.Vertical, flipHorizontal: false);
                }
                else
                {
                    BasePanel.RenderButtonBackground(graphics, captionRectangle, color, color3, color2);
                }
            }
            else
            {
                Color xPanderPanelFlatCaptionGradientBegin = base.PanelColors.XPanderPanelFlatCaptionGradientBegin;
                Color xPanderPanelFlatCaptionGradientEnd   = base.PanelColors.XPanderPanelFlatCaptionGradientEnd;
                Color innerBorderColor = base.PanelColors.InnerBorderColor;
                color4 = base.PanelColors.XPanderPanelCaptionText;
                foreColorExpandIcon = color4;
                BasePanel.RenderFlatButtonBackground(graphics, captionRectangle, xPanderPanelFlatCaptionGradientBegin, xPanderPanelFlatCaptionGradientEnd, flag);
                DrawInnerBorders(graphics, this);
            }
            BasePanel.DrawImagesAndText(graphics, captionRectangle, 3, base.ImageRectangle, base.Image, RightToLeft, m_bIsClosable, ShowCloseIcon, m_imageClosePanel, foreColorCloseIcon, ref RectangleCloseIcon, ShowExpandIcon, m_imageChevron, foreColorExpandIcon, ref RectangleExpandIcon, base.CaptionFont, color4, Text);
        }