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. --- .../Apps/Terminal.Designer.cs | 56 +++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'source/WindowsFormsApplication1/Apps/Terminal.Designer.cs') diff --git a/source/WindowsFormsApplication1/Apps/Terminal.Designer.cs b/source/WindowsFormsApplication1/Apps/Terminal.Designer.cs index 5f7ba27..de4e913 100644 --- a/source/WindowsFormsApplication1/Apps/Terminal.Designer.cs +++ b/source/WindowsFormsApplication1/Apps/Terminal.Designer.cs @@ -31,24 +31,24 @@ namespace ShiftOS private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.txtterm = new System.Windows.Forms.TextBox(); - this.tmrfirstrun = new System.Windows.Forms.Timer(this.components); - this.tmrshutdown = new System.Windows.Forms.Timer(this.components); - this.pullbs = new System.Windows.Forms.Timer(this.components); - this.pullbottom = new System.Windows.Forms.Timer(this.components); - this.pullside = new System.Windows.Forms.Timer(this.components); - this.tmrstorylineupdate = new System.Windows.Forms.Timer(this.components); - this.panel2 = new System.Windows.Forms.Panel(); - this.tmrsetfont = new System.Windows.Forms.Timer(this.components); + this.txtterm = new ShiftUI.TextBox(); + this.tmrfirstrun = new ShiftUI.Timer(this.components); + this.tmrshutdown = new ShiftUI.Timer(this.components); + this.pullbs = new ShiftUI.Timer(this.components); + this.pullbottom = new ShiftUI.Timer(this.components); + this.pullside = new ShiftUI.Timer(this.components); + this.tmrstorylineupdate = new ShiftUI.Timer(this.components); + this.panel2 = new ShiftUI.Panel(); + this.tmrsetfont = new ShiftUI.Timer(this.components); this.panel2.SuspendLayout(); this.SuspendLayout(); // // txtterm // this.txtterm.BackColor = System.Drawing.Color.Black; - this.txtterm.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.txtterm.Cursor = System.Windows.Forms.Cursors.IBeam; - this.txtterm.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtterm.BorderStyle = ShiftUI.BorderStyle.None; + this.txtterm.Cursor = ShiftUI.Cursors.IBeam; + this.txtterm.Dock = ShiftUI.DockStyle.Fill; this.txtterm.Font = new System.Drawing.Font("Lucida Console", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtterm.ForeColor = System.Drawing.Color.White; this.txtterm.Location = new System.Drawing.Point(0, 0); @@ -56,8 +56,8 @@ namespace ShiftOS this.txtterm.Name = "txtterm"; this.txtterm.Size = new System.Drawing.Size(650, 396); this.txtterm.TabIndex = 0; - this.txtterm.KeyUp += new System.Windows.Forms.KeyEventHandler(this.ScrollDeactivate); - this.txtterm.MouseMove += new System.Windows.Forms.MouseEventHandler(this.ScrollTerm); + this.txtterm.KeyUp += new ShiftUI.KeyEventHandler(this.ScrollDeactivate); + this.txtterm.MouseMove += new ShiftUI.MouseEventHandler(this.ScrollTerm); // // tmrfirstrun // @@ -81,8 +81,8 @@ namespace ShiftOS // // panel2 // - this.panel2.Controls.Add(this.txtterm); - this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel2.Widgets.Add(this.txtterm); + this.panel2.Dock = ShiftUI.DockStyle.Fill; this.panel2.Location = new System.Drawing.Point(0, 0); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(650, 396); @@ -95,11 +95,11 @@ namespace ShiftOS // Terminal // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleMode = ShiftUI.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Black; this.ClientSize = new System.Drawing.Size(650, 396); - this.Controls.Add(this.panel2); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Widgets.Add(this.panel2); + this.FormBorderStyle = ShiftUI.FormBorderStyle.None; this.KeyPreview = true; this.MinimumSize = new System.Drawing.Size(350, 200); this.Name = "Terminal"; @@ -111,16 +111,16 @@ namespace ShiftOS this.ResumeLayout(false); } - internal System.Windows.Forms.TextBox txtterm; - internal System.Windows.Forms.Timer tmrfirstrun; - internal System.Windows.Forms.Timer tmrshutdown; - internal System.Windows.Forms.Timer pullbs; - internal System.Windows.Forms.Timer pullbottom; - internal System.Windows.Forms.Timer pullside; - internal System.Windows.Forms.Timer tmrstorylineupdate; + internal ShiftUI.TextBox txtterm; + internal ShiftUI.Timer tmrfirstrun; + internal ShiftUI.Timer tmrshutdown; + internal ShiftUI.Timer pullbs; + internal ShiftUI.Timer pullbottom; + internal ShiftUI.Timer pullside; + internal ShiftUI.Timer tmrstorylineupdate; #endregion - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Timer tmrsetfont; + private ShiftUI.Panel panel2; + private ShiftUI.Timer tmrsetfont; } } \ No newline at end of file -- 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/Apps/Terminal.Designer.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