From 6b804f03ebcdd1c5aa145f29ae71b62bd61f8cb9 Mon Sep 17 00:00:00 2001 From: MichaelTheShifter Date: Tue, 19 Jul 2016 21:53:26 -0400 Subject: 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. --- .../Controls/WindowBorder.cs | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'source/WindowsFormsApplication1/Controls/WindowBorder.cs') 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; } } } -- cgit v1.2.3 From 024ec56765e91d896d25417ed09ebf2a6f131eee Mon Sep 17 00:00:00 2001 From: william341 Date: Sat, 23 Jul 2016 18:47:20 -0700 Subject: Less retarded terminal printing + Fix scrolling --- .../Apps/Terminal.Designer.cs | 4 ++-- source/WindowsFormsApplication1/Apps/Terminal.cs | 20 +++++++++----------- .../Controls/WindowBorder.Designer.cs | 2 +- .../Controls/WindowBorder.cs | 3 ++- 4 files changed, 14 insertions(+), 15 deletions(-) (limited to 'source/WindowsFormsApplication1/Controls/WindowBorder.cs') diff --git a/source/WindowsFormsApplication1/Apps/Terminal.Designer.cs b/source/WindowsFormsApplication1/Apps/Terminal.Designer.cs index de4e913..350bcfd 100644 --- a/source/WindowsFormsApplication1/Apps/Terminal.Designer.cs +++ b/source/WindowsFormsApplication1/Apps/Terminal.Designer.cs @@ -31,7 +31,7 @@ namespace ShiftOS private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.txtterm = new ShiftUI.TextBox(); + this.txtterm = new ShiftUI.RichTextBox(); this.tmrfirstrun = new ShiftUI.Timer(this.components); this.tmrshutdown = new ShiftUI.Timer(this.components); this.pullbs = new ShiftUI.Timer(this.components); @@ -111,7 +111,7 @@ namespace ShiftOS this.ResumeLayout(false); } - internal ShiftUI.TextBox txtterm; + internal ShiftUI.RichTextBox txtterm; internal ShiftUI.Timer tmrfirstrun; internal ShiftUI.Timer tmrshutdown; internal ShiftUI.Timer pullbs; diff --git a/source/WindowsFormsApplication1/Apps/Terminal.cs b/source/WindowsFormsApplication1/Apps/Terminal.cs index f34bdc6..3e156a4 100644 --- a/source/WindowsFormsApplication1/Apps/Terminal.cs +++ b/source/WindowsFormsApplication1/Apps/Terminal.cs @@ -70,18 +70,18 @@ namespace ShiftOS txtterm.Select(txtterm.TextLength, 0); if (API.Upgrades["terminalscrollbar"] == true) { - txtterm.ScrollBars = ScrollBars.Vertical; + txtterm.ScrollBars = RichTextBoxScrollBars.Vertical; } else { - txtterm.ScrollBars = ScrollBars.None; + txtterm.ScrollBars = RichTextBoxScrollBars.None; } txtterm.MouseWheel += (object s, MouseEventArgs a) => { if (Zooming == true) { - txtterm.ScrollBars = ScrollBars.None; + txtterm.ScrollBars = RichTextBoxScrollBars.None; if (ZoomMultiplier > 0) { if (a.Delta > 0) @@ -183,8 +183,7 @@ namespace ShiftOS // ERROR: Handles clauses are not supported in C# private void txtterm_Click(object sender, EventArgs e) { - txtterm.Select(txtterm.TextLength, 0); - txtterm.ScrollToCaret(); + //txtterm.AppendText(""); } public void SelectBottom() @@ -457,8 +456,7 @@ namespace ShiftOS if (SaveSystem.ShiftoriumRegistry.ShiftoriumUpgrades["autoscrollterminal"] == true) { - txtterm.Select(txtterm.TextLength, 0); - txtterm.ScrollToCaret(); + txtterm.AppendText(""); } } @@ -2135,14 +2133,14 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o { if (txtterm.Text.Length > 0) { - txtterm.Text += Environment.NewLine + text; + txtterm.AppendText(Environment.NewLine); + txtterm.AppendText(text); } else { txtterm.Text += text; } - txtterm.Select(txtterm.TextLength, 0); - txtterm.ScrollToCaret(); + txtterm.AppendText(""); })); } private bool Zooming = false; @@ -2194,7 +2192,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o { if (API.Upgrades["terminalscrollbar"] == true) { - txtterm.ScrollBars = ScrollBars.Vertical; + txtterm.ScrollBars = RichTextBoxScrollBars.Vertical; } } } diff --git a/source/WindowsFormsApplication1/Controls/WindowBorder.Designer.cs b/source/WindowsFormsApplication1/Controls/WindowBorder.Designer.cs index 01161eb..373210a 100644 --- a/source/WindowsFormsApplication1/Controls/WindowBorder.Designer.cs +++ b/source/WindowsFormsApplication1/Controls/WindowBorder.Designer.cs @@ -93,7 +93,7 @@ namespace ShiftOS // this.pgbottomrcorner.BackColor = System.Drawing.Color.Red; this.pgbottomrcorner.Dock = ShiftUI.DockStyle.Bottom; - this.pgbottomrcorner.Location = new System.Drawing.Point(0, 343); + this.pgbottomrcorner.Location = new System.Drawing.Point(363, 343); this.pgbottomrcorner.Name = "pgbottomrcorner"; this.pgbottomrcorner.Size = new System.Drawing.Size(2, 2); this.pgbottomrcorner.TabIndex = 15; diff --git a/source/WindowsFormsApplication1/Controls/WindowBorder.cs b/source/WindowsFormsApplication1/Controls/WindowBorder.cs index fec7eea..d6484aa 100644 --- a/source/WindowsFormsApplication1/Controls/WindowBorder.cs +++ b/source/WindowsFormsApplication1/Controls/WindowBorder.cs @@ -112,7 +112,7 @@ namespace ShiftOS case "left": return pgbottomlcorner; case "right": - return pgbottomlcorner; + return pgbottomrcorner; default: return null; } @@ -289,6 +289,7 @@ namespace ShiftOS ParentForm.Top += top; ParentForm.Tag = ParentForm.Location; } + resettitlebar(); } if(Viruses.InfectedWith("windowspazzer")) { -- cgit v1.2.3 From 0c5b360fcc7f8fd4de0ab91624e630543615d4dd Mon Sep 17 00:00:00 2001 From: william341 Date: Sat, 23 Jul 2016 19:12:08 -0700 Subject: It's all smooth scrolling from here! --- source/WindowsFormsApplication1/Controls/WindowBorder.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/WindowsFormsApplication1/Controls/WindowBorder.cs') diff --git a/source/WindowsFormsApplication1/Controls/WindowBorder.cs b/source/WindowsFormsApplication1/Controls/WindowBorder.cs index d6484aa..288aff7 100644 --- a/source/WindowsFormsApplication1/Controls/WindowBorder.cs +++ b/source/WindowsFormsApplication1/Controls/WindowBorder.cs @@ -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; -- cgit v1.2.3