Beispiel #1
0
 protected override void OnMouseUp(MouseEventArgs e)
 {
     base.OnMouseUp(e);
     if (e.Button == MouseButtons.Left)
     {
         SystemButtonManager.ProcessMouseOperate(e.Location, MouseOperate.Up);
     }
 }
Beispiel #2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_systemButtonManager != null)
                {
                    _systemButtonManager.Dispose();
                    _systemButtonManager = null;

                    _formFringe.Dispose();
                    _formFringe = null;

                    _textFont.Dispose();
                    _textFont = null;

                    if (_formBkg != null)
                    {
                        _formBkg.Dispose();
                        _formBkg = null;
                    }
                }
            }
            base.Dispose(disposing);
        }
Beispiel #3
0
 public SYDFormEx()
 {
     InitializeComponent();
     FormExIni();
     _systemButtonManager = new SystemButtonManager(this);
 }
Beispiel #4
0
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.SmoothingMode     = SmoothingMode.AntiAlias;
            e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;

            //draw BackgroundImage
            if (BackgroundImage != null)
            {
                switch (BackgroundImageLayout)
                {
                case ImageLayout.Stretch:
                case ImageLayout.Zoom:
                    e.Graphics.DrawImage(
                        _formBkg,
                        ClientRectangle,
                        new Rectangle(0, 0, _formBkg.Width, _formBkg.Height),
                        GraphicsUnit.Pixel);
                    break;

                case ImageLayout.Center:
                case ImageLayout.None:
                case ImageLayout.Tile:
                    e.Graphics.DrawImage(
                        _formBkg,
                        ClientRectangle,
                        ClientRectangle,
                        GraphicsUnit.Pixel);
                    break;
                }
            }

            //draw system buttons
            SystemButtonManager.DrawSystemButtons(e.Graphics);



            //draw icon
            if (Icon != null && ShowIcon)
            {
                e.Graphics.DrawIcon(Icon, IconRect);
            }

            //draw text
            if (Text.Length != 0)
            {
                if (TextWithShadow)
                {
                    using (Image textImg = RenderHelper.GetStringImgWithShadowEffect(Text, TextFont, TextForeColor, TextShadowColor, TextShadowWidth))
                    {
                        e.Graphics.DrawImage(textImg, TextRect.Location);
                    }
                }
                else
                {
                    TextRenderer.DrawText(
                        e.Graphics,
                        Text, TextFont,
                        TextRect,
                        TextForeColor,
                        TextFormatFlags.SingleLine | TextFormatFlags.EndEllipsis);
                }
            }

            //绘制窗体边框
            this.DrawFrameBorder(e.Graphics);

            //draw fringe
            // RenderHelper.DrawFormFringe(this, e.Graphics, _formFringe, Radius);
        }
Beispiel #5
0
 protected override void OnMouseLeave(EventArgs e)
 {
     base.OnMouseLeave(e);
     SystemButtonManager.ProcessMouseOperate(Point.Empty, MouseOperate.Leave);
 }
Beispiel #6
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     base.OnMouseMove(e);
     SystemButtonManager.ProcessMouseOperate(e.Location, MouseOperate.Move);
 }