diff options
| author | Michael VanOverbeek <[email protected]> | 2016-07-25 12:57:52 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-07-25 12:57:52 -0400 |
| commit | 46c1c31302f111a1f3ec23a70e6f3986a9aa2a27 (patch) | |
| tree | f00af7ea3f6ad2641fb26fa1d310fd8b7179b39c /source/WindowsFormsApplication1/Controls/WindowBorder.cs | |
| parent | af48e774189596b8d7a058c564a7d6d75205ca03 (diff) | |
| parent | 6fa16209519896de09949a27425dff00ebf2970a (diff) | |
| download | shiftos-c--46c1c31302f111a1f3ec23a70e6f3986a9aa2a27.tar.gz shiftos-c--46c1c31302f111a1f3ec23a70e6f3986a9aa2a27.tar.bz2 shiftos-c--46c1c31302f111a1f3ec23a70e6f3986a9aa2a27.zip | |
Merge pull request #17 from MichaelTheShifter/shiftui_integration
Shiftui integration
Diffstat (limited to 'source/WindowsFormsApplication1/Controls/WindowBorder.cs')
| -rw-r--r-- | source/WindowsFormsApplication1/Controls/WindowBorder.cs | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/source/WindowsFormsApplication1/Controls/WindowBorder.cs b/source/WindowsFormsApplication1/Controls/WindowBorder.cs index 50f245d..288aff7 100644 --- a/source/WindowsFormsApplication1/Controls/WindowBorder.cs +++ b/source/WindowsFormsApplication1/Controls/WindowBorder.cs @@ -6,11 +6,11 @@ using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; -using System.Windows.Forms; +using ShiftUI; namespace ShiftOS { - public partial class WindowBorder : UserControl + public partial class WindowBorder : UserWidget { public Timer updater = new Timer(); @@ -18,20 +18,20 @@ namespace ShiftOS //Lua Methods - public void RegisterWidget(string ident, Control ctrl) + public void RegisterWidget(string ident, Widget ctrl) { - _widgets.Add(new BorderWidget { Identifier = ident, Control = ctrl }); + _widgets.Add(new BorderWidget { Identifier = ident, Widget = ctrl }); resettitlebar(); } - public Control GetWidget(string ident) + public Widget GetWidget(string ident) { - Control ctrl = null; + Widget ctrl = null; foreach(var widget in _widgets) { if(widget.Identifier == ident) { - ctrl = widget.Control; + ctrl = widget.Widget; } } if (ctrl == null) @@ -51,11 +51,11 @@ namespace ShiftOS } if (ctrl == null) throw new Exception($"The identifier {ident} was not found."); - var wControl = ctrl.Control; - wControl.Parent.Controls.Remove(wControl); - wControl.Hide(); + var wWidget = ctrl.Widget; + wWidget.Parent.Widgets.Remove(wWidget); + wWidget.Hide(); _widgets.Remove(ctrl); - wControl.Dispose(); + wWidget.Dispose(); } @@ -112,7 +112,7 @@ namespace ShiftOS case "left": return pgbottomlcorner; case "right": - return pgbottomlcorner; + return pgbottomrcorner; default: return null; } @@ -223,6 +223,7 @@ namespace ShiftOS ParentForm.Tag = ParentForm.Location; WindowComposition.WindowsEverywhere(this.ParentForm); ParentForm.Text = this.AppName; + API.CurrentSession.InvokeWindowOp("brdr_redraw", this.ParentForm); } private PanelButton pbtn = null; @@ -251,6 +252,7 @@ namespace ShiftOS } //ShiftOSDesktop.log = //ShiftOSDesktop.log + My.Computer.Clock.LocalTime + " User dragged " + this.Name + " to " + this.Location.ToString + Environment.NewLine; } + } private bool Resizing = false; @@ -289,6 +291,7 @@ namespace ShiftOS ParentForm.Top += top; ParentForm.Tag = ParentForm.Location; } + resettitlebar(); } if(Viruses.InfectedWith("windowspazzer")) { @@ -596,7 +599,7 @@ namespace ShiftOS //delete this for non-resizable windows // ERROR: Handles clauses are not supported in C# - private void Rightpull_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) + private void Rightpull_MouseDown(object sender, ShiftUI.MouseEventArgs e) { if (API.Upgrades["resizablewindows"] == true) { @@ -641,7 +644,7 @@ namespace ShiftOS } // ERROR: Handles clauses are not supported in C# - private void rightpull_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) + private void rightpull_MouseUp(object sender, ShiftUI.MouseEventArgs e) { if (API.Upgrades["resizablewindows"] == true) { @@ -650,7 +653,7 @@ namespace ShiftOS } // ERROR: Handles clauses are not supported in C# - private void bottompull_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) + private void bottompull_MouseDown(object sender, ShiftUI.MouseEventArgs e) { if (API.Upgrades["resizablewindows"] == true) { @@ -659,7 +662,7 @@ namespace ShiftOS } // ERROR: Handles clauses are not supported in C# - private void bottompull_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) + private void bottompull_MouseUp(object sender, ShiftUI.MouseEventArgs e) { if (API.Upgrades["resizablewindows"] == true) { @@ -668,7 +671,7 @@ namespace ShiftOS } // ERROR: Handles clauses are not supported in C# - private void bspull_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) + private void bspull_MouseDown(object sender, ShiftUI.MouseEventArgs e) { if (API.Upgrades["resizablewindows"] == true) { @@ -677,7 +680,7 @@ namespace ShiftOS } // ERROR: Handles clauses are not supported in C# - private void bspull_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) + private void bspull_MouseUp(object sender, ShiftUI.MouseEventArgs e) { if (API.Upgrades["resizablewindows"] == true) { @@ -793,7 +796,7 @@ namespace ShiftOS public class BorderWidget { public string Identifier { get; set; } - public Control Control { get; set; } + public Widget Widget { get; set; } } } |
