protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); if (e.Button == MouseButtons.Left) { SysBtnManager.ProcessMouseOperate(e.Location, NuiMouseOperate.LeftUp); } }
protected override void Dispose(bool disposing) { if (disposing) { if (m_sysBtnManager != null) { m_sysBtnManager.Dispose(); m_sysBtnManager = null; m_formFringe.Dispose(); m_formFringe = null; m_textFont.Dispose(); m_textFont = null; if (m_formBkg != null) { m_formBkg.Dispose(); m_formBkg = null; } } } base.Dispose(disposing); }
private SysBtnManager m_sysBtnManager; // 系统按钮管理器 public NuiForm() { InitializeComponent(); NuiFormIni(); m_sysBtnManager = new SysBtnManager(this); }
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( m_formBkg, ClientRectangle, new Rectangle(0, 0, m_formBkg.Width, m_formBkg.Height), GraphicsUnit.Pixel); break; case ImageLayout.Center: case ImageLayout.None: case ImageLayout.Tile: e.Graphics.DrawImage( m_formBkg, ClientRectangle, ClientRectangle, GraphicsUnit.Pixel); break; } } //draw system buttons SysBtnManager.DrawSystemButtons(e.Graphics); //draw fringe Render.DrawFormFringe(this, e.Graphics, m_formFringe, Radius); //draw icon if (Icon != null && ShowIcon) { e.Graphics.DrawIcon(Icon, IconRect); } //draw text if (Text.Length != 0) { if (TextWithShadow) { using (Image textImg = Render.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); } } }
protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); SysBtnManager.ProcessMouseOperate(Point.Empty, NuiMouseOperate.Leave); }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); SysBtnManager.ProcessMouseOperate(e.Location, NuiMouseOperate.Move); }