Ejemplo n.º 1
0
        protected override void OnRenderGroundFormCaption(FormCaptionRenderEventArgs e)
        {
            Graphics  g        = e.Graphics;
            Rectangle rect     = e.ClipRectangle;
            SkinForm  form     = e.Form;
            Rectangle iconRect = form.IconRect;
            Rectangle textRect;

            bool closeBox         = form.ControlBox;
            bool ifHasMinimizeBox = form.ControlBox && form.MinimizeBox;
            bool ifHasMaximizeBox = form.ControlBox && form.MaximizeBox;

            int iconAreaWidth = 0;

            if (closeBox)
            {
                iconAreaWidth += form.CloseBoxSize.Width + form.ControlBoxOffset.X;
            }

            if (ifHasMaximizeBox)
            {
                iconAreaWidth += form.MaximizeBoxSize.Width + form.ControlBoxSpace;
            }

            if (ifHasMinimizeBox)
            {
                iconAreaWidth += form.MinimizeBoxSize.Width + form.ControlBoxSpace;
            }

            textRect = new Rectangle(
                iconRect.Right + 3,
                form.BorderWidth,
                rect.Width - iconRect.Right - iconAreaWidth - 6,
                rect.Height - form.BorderWidth);

            using (var antiGraphics = new SmoothingModeGraphics(g))
            {
                if (form.DrawCationBackground)
                {
                    DrawCaptionBackground(g, rect, e.IsActive);
                }

                if (form.DrawIcon && form.Icon != null)
                {
                    DrawIcon(g, iconRect, form.Icon);
                }

                if (!string.IsNullOrEmpty(form.Text))
                {
                    DrawCaptionText(
                        g,
                        textRect,
                        form.Text,
                        form.CaptionFont);
                }
            }
        }
Ejemplo n.º 2
0
        public void DrawGroundFormCaption(FormCaptionRenderEventArgs e)
        {
            OnRenderGroundFormCaption(e);
            var handle = Events[EventRenderGroundFormCaption] as FormCaptionRenderEventHandler;

            if (handle != null)
            {
                handle(this, e);
            }
        }
Ejemplo n.º 3
0
 protected abstract void OnRenderGroundFormCaption(FormCaptionRenderEventArgs e);