📄 formex.cs
字号:
}
base.Dispose(disposing);
}
private void doClose()
{
if (!base.IsDisposed)
{
if (this._formStyle == XFormStyle.Mainform)
{
InnerWin32.SendMessage(base.Handle, 0x112, 0xf060, 0);
}
else
{
base.Close();
}
}
}
private void doMax()
{
if (base.MaximizeBox)
{
base.WindowState = FormWindowState.Maximized;
}
}
private void doMin()
{
if (base.MinimizeBox)
{
base.WindowState = FormWindowState.Minimized;
}
}
private void doRestore()
{
base.WindowState = FormWindowState.Normal;
}
private bool ExistWindowsState(XFormWindowState state)
{
if (state == XFormWindowState.Maximized)
{
return (base.MaximizeBox && (base.WindowState != FormWindowState.Maximized));
}
if (state == XFormWindowState.Normal)
{
return (base.MaximizeBox && (base.WindowState != FormWindowState.Normal));
}
if (state == XFormWindowState.Minimized)
{
return (base.MinimizeBox && (base.WindowState != FormWindowState.Minimized));
}
return (state == XFormWindowState.Close);
}
private void FormEx_Click(object sender, EventArgs e)
{
this._wndlessCtrlMgr.MouseClick(e);
}
private void FormEx_Disposed(object sender, EventArgs e)
{
BossKey.HiddenEvent -= new EventHandler(this.BossKey_HiddenEvent);
style.StyleChanged -= new EventHandler(this.style_StyleChanged);
if (this.Region != null)
{
this.Region.Dispose();
}
this._wndlessCtrlMgr.Dispose();
if (this._iconImage != null)
{
this._iconImage.Dispose();
}
this._isdisposed = true;
}
private void FormEx_DoubleClick(object sender, EventArgs e)
{
System.Drawing.Point pt = System.Drawing.Point.Empty;
ChatEditCtrlManager.GetCursorPos(ref pt);
System.Drawing.Point point2 = base.PointToClient(pt);
if ((!this._wndlessCtrlMgr.MouseDblClick(e) && this._wndlessCtrlMgr.PointInRect(point2, this._titlebar_rgn)) && (base.WindowState == FormWindowState.Normal))
{
MouseEventArgs args = e as MouseEventArgs;
if ((args != null) && (args.Button == MouseButtons.Left))
{
this.doMax();
}
}
}
private void FormEx_Load(object sender, EventArgs e)
{
if (!this._bRegionCreated)
{
this.initComponentRegion();
}
base.Visible = !BossKey.Hidden;
}
private void FormEx_MouseDown(object sender, MouseEventArgs e)
{
if (this._wndlessCtrlMgr.MouseDown(e))
{
this._mouseDownLocation = System.Drawing.Point.Empty;
}
}
private void FormEx_MouseLeave(object sender, EventArgs e)
{
this._wndlessCtrlMgr.MouseLeave(e);
}
private void FormEx_MouseMove(object sender, MouseEventArgs e)
{
if (!this._wndlessCtrlMgr.MouseMove(e))
{
this.Cursor = Cursors.Default;
}
}
private void FormEx_MouseUp(object sender, MouseEventArgs e)
{
base.ResumeLayout();
base.Invalidate();
if (this._wndlessCtrlMgr.MouseUp(e))
{
}
}
private void FormEx_SizeChanged(object sender, EventArgs e)
{
if (base.WindowState == FormWindowState.Maximized)
{
this.Region = this.CreateMaximized();
}
else if (base.WindowState == FormWindowState.Normal)
{
this.Region = this.CreateRegion(base.Width, base.Height, true);
base.Invalidate();
}
this.ChangeSizeParemeter();
}
private void FormEx_SystemColorsChanged(object sender, EventArgs e)
{
this._firstAdjusted = true;
this._diagnosedHeight = (SystemInformation.CaptionHeight - 0x1a) / 2;
this._captionHeight = SystemInformation.CaptionHeight * 2;
this._deltaX = this._deltaY = 0;
this._x = this._y = 0;
this.initComponentRegion();
}
protected ImageList FromImage(Image image)
{
return ThemeManager.GetImageList(image, 3, 1, false);
}
private FormDirection GetNcPoint(System.Drawing.Point pt)
{
pt.X += this._deltaX;
pt.Y += this._deltaY;
if (((pt.X <= this._leftBorderRegion.Right) && (pt.Y >= this._left_topfadeRegion.Top)) && (pt.Y <= this._left_bottomfadeRegion.Bottom))
{
return FormDirection.Left;
}
if (((pt.X >= this._top_leftfadeRegion.X) && (pt.X <= this._top_rightfadeRegion.Right)) && (pt.Y <= this._topBorderRegion.Bottom))
{
return FormDirection.Top;
}
if (((pt.X <= this._leftBorderRegion.Right) && (pt.Y < this._left_topfadeRegion.Top)) || ((pt.X < this._top_leftfadeRegion.Right) && (pt.Y <= this._topBorderRegion.Bottom)))
{
return FormDirection.TopLeft;
}
if (((pt.X > this._top_rightfadeRegion.Right) && (pt.Y <= this._topBorderRegion.Bottom)) || ((pt.X >= this._rightBorderRegion.Left) && (pt.Y < this._right_topfadeRegion.Top)))
{
return FormDirection.TopRight;
}
if (((pt.X >= this._rightBorderRegion.Left) && (pt.Y <= this._right_bottomfadeRegion.Bottom)) && (pt.Y >= this._right_topfadeRegion.Top))
{
if (((this._resizer != null) && this._resizer.Visible) && ((pt.Y >= (this._resizer.Top + this._deltaY)) && (pt.Y <= (this._resizer.Bottom + this._deltaY))))
{
return FormDirection.Resizer;
}
return FormDirection.Right;
}
if (((pt.X >= this._rightBorderRegion.Left) && (pt.Y > this._right_topfadeRegion.Bottom)) || ((pt.Y >= this._bottomBorderRegion.Top) && (pt.X >= this._bottom_rightfadeRegion.Right)))
{
return FormDirection.BottomRight;
}
if (((pt.Y >= this._bottomBorderRegion.Top) && (pt.X <= this._bottom_rightfadeRegion.Right)) && (pt.X >= this._bottom_leftfadeRegion.Left))
{
if (((this._resizer != null) && this._resizer.Visible) && ((pt.X >= (this._resizer.Left + this._deltaX)) && (pt.X <= (this._resizer.Right + this._deltaX))))
{
return FormDirection.Resizer;
}
return FormDirection.Bottom;
}
if (((pt.Y >= this._bottomBorderRegion.Top) && (pt.X < this._bottom_leftfadeRegion.Left)) || ((pt.X < this._leftBorderRegion.Right) && (pt.Y > this._left_bottomfadeRegion.Bottom)))
{
return FormDirection.BottomLeft;
}
if ((this._iconImage == null) || !this._wndlessCtrlMgr.PointInRect(new System.Drawing.Point(pt.X - this._deltaX, pt.Y - this._deltaY), this._iconImage.Rectangle, false))
{
if (this._wndlessCtrlMgr.PointInRect(new System.Drawing.Point(pt.X - this._deltaX, pt.Y - this._deltaY), this._titlebar_rgn, false))
{
pt.X -= this._deltaX;
pt.Y -= this._deltaY;
FormDirection normal = FormDirection.Normal;
normal = this._wndlessCtrlMgr.GetPoint(pt, false);
if (normal != FormDirection.None)
{
return normal;
}
return FormDirection.TitleBar;
}
if (this._wndlessCtrlMgr.PointInRect(new System.Drawing.Point(pt.X - this._deltaX, pt.Y - this._deltaY), this._title_left_rgn, false) || this._wndlessCtrlMgr.PointInRect(new System.Drawing.Point(pt.X - this._deltaX, pt.Y - this._deltaY), this._title_right_rgn, false))
{
pt.X -= this._deltaX;
pt.Y -= this._deltaY;
FormDirection point = FormDirection.Normal;
point = this._wndlessCtrlMgr.GetPoint(pt, false);
if (point != FormDirection.None)
{
return point;
}
return FormDirection.TitleBar;
}
if (this._wndlessCtrlMgr.PointInRect(new System.Drawing.Point(pt.X - this._deltaX, pt.Y - this._deltaY), this._titlebar_rgn_2, false))
{
pt.X -= this._deltaX;
pt.Y -= this._deltaY;
FormDirection direction3 = this._wndlessCtrlMgr.GetPoint(pt, false);
if (direction3 != FormDirection.None)
{
return direction3;
}
return FormDirection.TitleBar;
}
if ((this._resizer != null) && this._wndlessCtrlMgr.PointInRect(new System.Drawing.Point(pt.X - this._deltaX, pt.Y - this._deltaY), this._resizer.Rectangle, false))
{
return FormDirection.Resizer;
}
}
return FormDirection.Normal;
}
private FormDirection GetPoint(System.Drawing.Point pt, bool nonClient)
{
pt.X += this._deltaX;
pt.Y += this._deltaY;
if (((pt.X <= this._leftBorderRegion.Right) && (pt.Y >= this._left_topfadeRegion.Top)) && (pt.Y <= this._left_bottomfadeRegion.Bottom))
{
return FormDirection.Left;
}
if (((pt.X <= this._leftBorderRegion.Right) && (pt.Y < this._left_topfadeRegion.Top)) || ((pt.X < this._top_leftfadeRegion.Right) && (pt.Y <= this._topBorderRegion.Bottom)))
{
return FormDirection.TopLeft;
}
if (((pt.X >= this._top_leftfadeRegion.X) && (pt.X <= this._top_rightfadeRegion.Right)) && (pt.Y <= this._topBorderRegion.Bottom))
{
return FormDirection.Top;
}
if (((pt.X > this._top_rightfadeRegion.Right) && (pt.Y <= this._topBorderRegion.Bottom)) || ((pt.X >= this._rightBorderRegion.Left) && (pt.Y < this._right_topfadeRegion.Top)))
{
return FormDirection.TopRight;
}
if (((pt.X >= this._rightBorderRegion.Left) && (pt.Y <= this._right_bottomfadeRegion.Bottom)) && (pt.Y >= this._right_topfadeRegion.Top))
{
return FormDirection.Right;
}
if (((pt.X >= this._rightBorderRegion.Left) && (pt.Y > this._right_topfadeRegion.Bottom)) || ((pt.Y >= this._bottomBorderRegion.Top) && (pt.X >= this._bottom_rightfadeRegion.Right)))
{
return FormDirection.BottomRight;
}
if (((pt.Y >= this._bottomBorderRegion.Top) && (pt.X <= this._bottom_rightfadeRegion.Right)) && (pt.X >= this._bottom_leftfadeRegion.Left))
{
return FormDirection.Bottom;
}
if (((pt.Y >= this._bottomBorderRegion.Top) && (pt.X < this._bottom_leftfadeRegion.Left)) || ((pt.X < this._leftBorderRegion.Right) && (pt.Y > this._left_bottomfadeRegion.Bottom)))
{
return FormDirection.BottomLeft;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -