diff options
| author | MichaelTheShifter <[email protected]> | 2016-07-19 21:53:26 -0400 |
|---|---|---|
| committer | MichaelTheShifter <[email protected]> | 2016-07-19 21:53:26 -0400 |
| commit | 6b804f03ebcdd1c5aa145f29ae71b62bd61f8cb9 (patch) | |
| tree | d7bc4b46c45a552add946666151d44490f3b3caf /source/WindowsFormsApplication1/Controls/WindowBorder.cs | |
| parent | 9322701aa1eae9596a8586ef19a0fe1d1b3ab66b (diff) | |
| download | shiftos-c--6b804f03ebcdd1c5aa145f29ae71b62bd61f8cb9.tar.gz shiftos-c--6b804f03ebcdd1c5aa145f29ae71b62bd61f8cb9.tar.bz2 shiftos-c--6b804f03ebcdd1c5aa145f29ae71b62bd61f8cb9.zip | |
Full ShiftUI conversion
The only bugs are that windows don't show in the center of the screen,
and Gecko webbrowsers are not serializing properly to be converted to
ShiftUI widgets (you can use the ToWidget() extension method to convert
a WinForms control to a ShiftUI widget)
Also multiple desktop panels are removed due to some odd bug I can't
diagnose. Will add them back in the future. Promise. I loved creating
GNOME2 skins.
Diffstat (limited to 'source/WindowsFormsApplication1/Controls/WindowBorder.cs')
| -rw-r--r-- | source/WindowsFormsApplication1/Controls/WindowBorder.cs | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/source/WindowsFormsApplication1/Controls/WindowBorder.cs b/source/WindowsFormsApplication1/Controls/WindowBorder.cs index 50f245d..fec7eea 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(); } @@ -596,7 +596,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 +641,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 +650,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 +659,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 +668,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 +677,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 +793,7 @@ namespace ShiftOS public class BorderWidget { public string Identifier { get; set; } - public Control Control { get; set; } + public Widget Widget { get; set; } } } |
