From 5363daecef3c00ed97155b9e2e96d6192c86890f Mon Sep 17 00:00:00 2001 From: Carver Harrison Date: Sat, 14 Jan 2017 14:04:12 -0800 Subject: [PATCH] Update WindowBorder.cs --- ShiftOS.WinForms/WindowBorder.cs | 113 +++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) diff --git a/ShiftOS.WinForms/WindowBorder.cs b/ShiftOS.WinForms/WindowBorder.cs index 23fef57..be59c70 100644 --- a/ShiftOS.WinForms/WindowBorder.cs +++ b/ShiftOS.WinForms/WindowBorder.cs @@ -37,10 +37,20 @@ using System.Runtime.InteropServices; using ShiftOS.Engine; using ShiftOS.WinForms.Tools; +/// +/// Window border. +/// namespace ShiftOS.WinForms { + /// + /// Window border. + /// public partial class WindowBorder : Form, IWindowBorder { + /// + /// Raises the closing event. + /// + /// E. protected override void OnClosing(CancelEventArgs e) { if ((ParentWindow as IShiftOSWindow).OnUnload()) @@ -54,8 +64,16 @@ namespace ShiftOS.WinForms } base.OnClosing(e); } + + /// + /// The parent window. + /// private UserControl _parentWindow = null; + /// + /// Gets or sets the parent window. + /// + /// The parent window. public IShiftOSWindow ParentWindow { get @@ -68,6 +86,10 @@ namespace ShiftOS.WinForms } } + /// + /// Initializes a new instance of the class. + /// + /// Window. public WindowBorder(UserControl win) { InitializeComponent(); @@ -110,6 +132,12 @@ namespace ShiftOS.WinForms } + /// + /// Universals the key down. + /// + /// The key down. + /// O. + /// The alpha component. public static void Universal_KeyDown(object o, KeyEventArgs a) { if (a.Control && a.KeyCode == Keys.T) @@ -127,6 +155,12 @@ namespace ShiftOS.WinForms } } + /// + /// Windows the border load. + /// + /// The border load. + /// Sender. + /// E. public void WindowBorder_Load(object sender, EventArgs e) { this.DoubleBuffered = true; @@ -172,6 +206,9 @@ namespace ShiftOS.WinForms sWin.OnLoad(); } + /// + /// Setup this instance. + /// public void Setup() { this.lbtitletext.Text = Localization.Parse(this._parentWindow.Text); @@ -194,6 +231,10 @@ namespace ShiftOS.WinForms } } + /// + /// Gets or sets the text. + /// + /// The text. public override string Text { get @@ -207,6 +248,10 @@ namespace ShiftOS.WinForms } } + /// + /// Setups the skin. + /// + /// The skin. public void SetupSkin() { this.DoubleBuffered = true; @@ -285,43 +330,99 @@ namespace ShiftOS.WinForms } } + /// + /// Froms the right. + /// + /// The right. + /// Input. public Point FromRight(Point input) { return new Point(pnltitle.Width - input.X, input.Y); } + /// + /// Lbtitletexts the click. + /// + /// The click. + /// Sender. + /// E. private void lbtitletext_Click(object sender, EventArgs e) { } + /// + /// Pnlcloses the click. + /// + /// The click. + /// Sender. + /// E. private void pnlclose_Click(object sender, EventArgs e) { this.Close(); } + /// + /// Pnlmaximizes the click. + /// + /// The click. + /// Sender. + /// E. private void pnlmaximize_Click(object sender, EventArgs e) { TerminalBackend.InvokeCommand($"win.max{{id:{this.ParentForm.GetHashCode()}}}"); } + /// + /// Pnlminimizes the click. + /// + /// The click. + /// Sender. + /// E. private void pnlminimize_Click(object sender, EventArgs e) { TerminalBackend.InvokeCommand($"win.mini{{id:{this.ParentForm.GetHashCode()}}}"); } + /// + /// The W m NCLBUTTONDOW. + /// public const int WM_NCLBUTTONDOWN = 0xA1; + /// + /// The H t CAPTIO. + /// public const int HT_CAPTION = 0x2; + /// + /// The is dialog. + /// public bool IsDialog = false; [DllImportAttribute("user32.dll")] + /// + /// Sends the message. + /// + /// The message. + /// H window. + /// Message. + /// W parameter. + /// L parameter. public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); [DllImportAttribute("user32.dll")] + /// + /// Releases the capture. + /// + /// The capture. public static extern bool ReleaseCapture(); + /// + /// Pnltitles the mouse move. + /// + /// The mouse move. + /// Sender. + /// E. private void pnltitle_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left && Shiftorium.UpgradeInstalled("draggable_windows")) @@ -331,10 +432,22 @@ namespace ShiftOS.WinForms } } + /// + /// Pnltitles the paint. + /// + /// The paint. + /// Sender. + /// E. private void pnltitle_Paint(object sender, PaintEventArgs e) { } + /// + /// Lbtitletexts the mouse move. + /// + /// The mouse move. + /// Sender. + /// E. private void lbtitletext_MouseMove(object sender, MouseEventArgs e) { pnltitle_MouseMove(sender, e); }