예제 #1
0
        public void DrawSkinFormCaption(SkinFormCaptionRenderEventArgs e)
        {
            this.OnRenderSkinFormCaption(e);
            SkinFormCaptionRenderEventHandler handler = this.Events[EventRenderSkinFormCaption] as SkinFormCaptionRenderEventHandler;

            if (handler != null)
            {
                handler(this, e);
            }
        }
예제 #2
0
        protected override void OnRenderSkinFormCaption(SkinFormCaptionRenderEventArgs e)
        {
            Graphics  graphics      = e.Graphics;
            Rectangle clipRectangle = e.ClipRectangle;
            FormBase  skinForm      = e.SkinForm;
            Rectangle iconRect      = skinForm.IconRect;
            Rectangle empty         = Rectangle.Empty;
            bool      controlBox    = skinForm.ControlBox;
            bool      flag2         = skinForm.ControlBox && skinForm.MinimizeBox;
            bool      flag3         = skinForm.ControlBox && skinForm.MaximizeBox;
            //bool flag4 = skinForm.ControlBox && skinForm.SysBottomVisibale;
            int num = 0;

            if (controlBox)
            {
                num += skinForm.CloseBoxSize.Width + skinForm.ControlBoxOffset.X;
            }
            if (flag3)
            {
                num += skinForm.MaxSize.Width + skinForm.ControlBoxSpace;
            }
            if (flag2)
            {
                num += skinForm.MiniSize.Width + skinForm.ControlBoxSpace;
            }
            foreach (CmSysButton button in (IEnumerable)skinForm.ControlBoxManager.SysButtonItems)
            {
                if (skinForm.ControlBox && button.Visibale)
                {
                    num += button.Size.Width + skinForm.ControlBoxSpace;
                }
            }
            empty = new Rectangle(iconRect.Right + 3, skinForm.BorderPadding.Left, ((clipRectangle.Width - iconRect.Right) - num) - 6, clipRectangle.Height - skinForm.BorderPadding.Left);
            using (new AntiAliasGraphics(graphics))
            {
                this.DrawCaptionBackground(graphics, clipRectangle, e.Active);
                if (skinForm.ShowIcon && (skinForm.Icon != null))
                {
                    this.DrawIcon(graphics, iconRect, skinForm.Icon);
                }
                if (!string.IsNullOrEmpty(skinForm.Text))
                {
                    Color effectBack = skinForm.EffectBack;
                    Color titleColor = skinForm.TitleColor;
                    if (skinForm.TitleSuitColor)
                    {
                        if (SkinTools.ColorSlantsDarkOrBright(skinForm.BackColor))
                        {
                            titleColor = Color.White;
                            effectBack = Color.Black;
                        }
                        else
                        {
                            titleColor = Color.Black;
                            effectBack = Color.White;
                        }
                    }
                    this.DrawCaptionText(graphics, empty, skinForm.Text, skinForm.CaptionFont, skinForm.EffectCaption, effectBack, skinForm.EffectWidth, titleColor, skinForm.TitleOffset);
                }
            }
        }
예제 #3
0
 protected abstract void OnRenderSkinFormCaption(SkinFormCaptionRenderEventArgs e);