public void DrawSkinFormCaption(SkinFormCaptionRenderEventArgs e) { this.OnRenderSkinFormCaption(e); SkinFormCaptionRenderEventHandler skinFormCaptionRenderEventHandler = this.Events[SkinFormRenderer.EventRenderSkinFormCaption] as SkinFormCaptionRenderEventHandler; if (skinFormCaptionRenderEventHandler != null) { skinFormCaptionRenderEventHandler(this, e); } }
public void DrawSkinFormCaption(SkinFormCaptionRenderEventArgs e) { OnRenderSkinFormCaption(e); var handler = Events[EventRenderSkinFormCaption] as SkinFormCaptionRenderEventHandler; if (handler != null) { handler(this, e); } }
protected override void OnRenderSkinFormCaption(SkinFormCaptionRenderEventArgs e) { Graphics graphics = e.Graphics; Rectangle clipRectangle = e.ClipRectangle; SkinForm skinForm = e.SkinForm; Rectangle iconRect = skinForm.IconRect; Rectangle empty = Rectangle.Empty; bool controlBox = skinForm.ControlBox; bool flag = skinForm.ControlBox && skinForm.MinimizeBox; bool flag2 = skinForm.ControlBox && skinForm.MaximizeBox; int num = 0; checked { if (controlBox) { num += skinForm.CloseBoxSize.Width + skinForm.ControlBoxOffset.X; } if (flag2) { num += skinForm.MaximizeBoxSize.Width + skinForm.ControlBoxSpace; } if (flag) { num += skinForm.MinimizeBoxSize.Width + skinForm.ControlBoxSpace; } empty = new Rectangle(iconRect.Right + 3, skinForm.BorderWidth, clipRectangle.Width - iconRect.Right - num - 6, clipRectangle.Height - skinForm.BorderWidth); 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)) { this.DrawCaptionText(graphics, empty, skinForm.Text, skinForm.CaptionFont); } } } }
protected override void OnRenderSkinFormCaption(SkinFormCaptionRenderEventArgs e) { var graphics = e.Graphics; var clipRectangle = e.ClipRectangle; var skinForm = e.SkinForm; var iconRect = skinForm.IconRect; var empty = Rectangle.Empty; var controlBox = skinForm.ControlBox; var flag2 = skinForm.ControlBox && skinForm.MinimizeBox; var flag3 = skinForm.ControlBox && skinForm.MaximizeBox; var flag4 = skinForm.ControlBox && skinForm.btnCustomImage != null;//skinForm.SysBottomVisibale; var 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; } if (flag4) { num += skinForm.CustomSize.Width + skinForm.ControlBoxSpace; } // empty = new Rectangle(iconRect.Right + 3, skinForm.BorderPadding.Left + 3, ((clipRectangle.Width - iconRect.Right) - num) - 6, clipRectangle.Height - skinForm.BorderPadding.Left);//old empty = new Rectangle(iconRect.Right + 3, iconRect.Top, ((clipRectangle.Width - iconRect.Right) - num) - 6, clipRectangle.Height - skinForm.BorderPadding.Left); using (new AntiAliasGraphics(graphics)) { DrawCaptionBackground(graphics, clipRectangle, e.Active); if (skinForm.ShowIcon && (skinForm.Icon != null)) { DrawIcon(graphics, iconRect, skinForm.Icon); } if (!string.IsNullOrEmpty(skinForm.Text)) { var effectBack = skinForm.EffectBack; var titleColor = skinForm.TitleColor; if (skinForm.TitleSuitColor) { if (SkinTools.ColorSlantsDarkOrBright(skinForm.BackColor)) { titleColor = Color.White; effectBack = Color.Black; } else { titleColor = Color.Black; effectBack = Color.White; } } DrawCaptionText(graphics, empty, skinForm.Text, skinForm.CaptionFont, skinForm.EffectCaption, effectBack, skinForm.EffectWidth, titleColor); } } }
protected abstract void OnRenderSkinFormCaption(SkinFormCaptionRenderEventArgs e);