From dc7533184a88271bfd2a3aae299532ec7632144d Mon Sep 17 00:00:00 2001 From: FloppyDiskDrive Date: Mon, 25 Sep 2017 17:49:40 -0500 Subject: Added titlebar button hughlighting / pushing --- .../WindowManager/InfoboxTemplate.Designer.cs | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs') diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs index 6b18e5f..a046516 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs @@ -28,10 +28,12 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.btnOpt1 = new System.Windows.Forms.Button(); this.btnOpt2 = new System.Windows.Forms.Button(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.label1 = new System.Windows.Forms.Label(); + this.changeSize = new System.Windows.Forms.Timer(this.components); + this.label1 = new System.Windows.Forms.TextBox(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // @@ -75,18 +77,21 @@ this.pictureBox1.TabIndex = 2; this.pictureBox1.TabStop = false; // + // changeSize + // + this.changeSize.Interval = 1; + this.changeSize.Tick += new System.EventHandler(this.changeSize_Tick); + // // label1 // - this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Lucida Console", 9.25F); - this.label1.Location = new System.Drawing.Point(106, 57); + this.label1.BackColor = System.Drawing.SystemColors.Window; + this.label1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.label1.Font = new System.Drawing.Font("Lucida Console", 9F); + this.label1.Location = new System.Drawing.Point(111, 61); + this.label1.Multiline = true; this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(103, 13); + this.label1.Size = new System.Drawing.Size(219, 57); this.label1.TabIndex = 3; - this.label1.Text = "Generic Body"; // // InfoboxTemplate // @@ -110,6 +115,7 @@ public System.Windows.Forms.Button btnOpt1; public System.Windows.Forms.Button btnOpt2; public System.Windows.Forms.PictureBox pictureBox1; - public System.Windows.Forms.Label label1; + private System.Windows.Forms.Timer changeSize; + public System.Windows.Forms.TextBox label1; } } -- cgit v1.2.3 From 1c2bf50041e376adc3e901fdc94326d2f9beec77 Mon Sep 17 00:00:00 2001 From: FloppyDiskDrive Date: Wed, 27 Sep 2017 19:36:09 -0500 Subject: Commented in the Engine project --- .vs/ShiftOS/v15/sqlite3/storage.ide | Bin 3678208 -> 3678208 bytes ShiftOS.Engine/Resources/Symbolinfo - Copy.png | Bin 0 -> 56780 bytes ShiftOS.Engine/Resources/symbolWarning.png | Bin 0 -> 3463 bytes ShiftOS.Engine/Tools.cs | 1 - .../WindowManager/InfoboxTemplate.Designer.cs | 15 ++++++------- ShiftOS.Engine/WindowManager/ShiftWM.cs | 25 ++++++++++++++++----- ShiftOS.Main/HijackScreen.cs | 18 +++++++-------- 7 files changed, 36 insertions(+), 23 deletions(-) create mode 100644 ShiftOS.Engine/Resources/Symbolinfo - Copy.png create mode 100644 ShiftOS.Engine/Resources/symbolWarning.png (limited to 'ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs') diff --git a/.vs/ShiftOS/v15/sqlite3/storage.ide b/.vs/ShiftOS/v15/sqlite3/storage.ide index a7bcbbb..a031093 100644 Binary files a/.vs/ShiftOS/v15/sqlite3/storage.ide and b/.vs/ShiftOS/v15/sqlite3/storage.ide differ diff --git a/ShiftOS.Engine/Resources/Symbolinfo - Copy.png b/ShiftOS.Engine/Resources/Symbolinfo - Copy.png new file mode 100644 index 0000000..659d9b3 Binary files /dev/null and b/ShiftOS.Engine/Resources/Symbolinfo - Copy.png differ diff --git a/ShiftOS.Engine/Resources/symbolWarning.png b/ShiftOS.Engine/Resources/symbolWarning.png new file mode 100644 index 0000000..f8805f6 Binary files /dev/null and b/ShiftOS.Engine/Resources/symbolWarning.png differ diff --git a/ShiftOS.Engine/Tools.cs b/ShiftOS.Engine/Tools.cs index eca7b59..792ccef 100644 --- a/ShiftOS.Engine/Tools.cs +++ b/ShiftOS.Engine/Tools.cs @@ -3,7 +3,6 @@ using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Runtime.InteropServices; -using ImageMagick; namespace ShiftOS.Engine { diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs index a046516..a076c2a 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs @@ -33,7 +33,7 @@ this.btnOpt2 = new System.Windows.Forms.Button(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.changeSize = new System.Windows.Forms.Timer(this.components); - this.label1 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // @@ -84,14 +84,13 @@ // // label1 // - this.label1.BackColor = System.Drawing.SystemColors.Window; - this.label1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.label1.Font = new System.Drawing.Font("Lucida Console", 9F); - this.label1.Location = new System.Drawing.Point(111, 61); - this.label1.Multiline = true; + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Lucida Console", 9.25F); + this.label1.Location = new System.Drawing.Point(105, 55); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(219, 57); + this.label1.Size = new System.Drawing.Size(55, 13); this.label1.TabIndex = 3; + this.label1.Text = "label1"; // // InfoboxTemplate // @@ -116,6 +115,6 @@ public System.Windows.Forms.Button btnOpt2; public System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Timer changeSize; - public System.Windows.Forms.TextBox label1; + public System.Windows.Forms.Label label1; } } diff --git a/ShiftOS.Engine/WindowManager/ShiftWM.cs b/ShiftOS.Engine/WindowManager/ShiftWM.cs index 539d469..0c69fb7 100644 --- a/ShiftOS.Engine/WindowManager/ShiftWM.cs +++ b/ShiftOS.Engine/WindowManager/ShiftWM.cs @@ -17,6 +17,15 @@ namespace ShiftOS.Engine.WindowManager return Windows.First(p => (uint) control.Tag == p.Id); } + /// + /// Shows a new Window based on a UserControl. + /// + /// The UserControl to use + /// The program's title + /// The icon to show + /// Checks if this is an infobox + /// Enables or disables resizing + /// public static ShiftWindow Init(UserControl content, string title, Icon icon, bool showAsInfobox = false, bool resize = true) { // Setup Window @@ -68,13 +77,19 @@ namespace ShiftOS.Engine.WindowManager return app; } + /// + /// Shows a new infobox. + /// + /// The title of the infobox. + /// The infobox's content. + /// The ButtonType used for the infobox. + /// public static InfoboxTemplate StartInfoboxSession(string title, string body, ButtonType type) { - InfoboxTemplate info = new InfoboxTemplate(type) - { - label1 = { Text = body } - }; - + InfoboxTemplate info = new InfoboxTemplate(type) + { + label1 = { Text = body } + }; Init(info, title, Properties.Resources.iconInfoBox_fw.ToIcon(), true, false); return info; } diff --git a/ShiftOS.Main/HijackScreen.cs b/ShiftOS.Main/HijackScreen.cs index ef1db92..721d49e 100644 --- a/ShiftOS.Main/HijackScreen.cs +++ b/ShiftOS.Main/HijackScreen.cs @@ -167,19 +167,19 @@ namespace ShiftOS.Main textgeninput = lblhackwords; textgen.Interval = 10; rtext = ""; - TextType("Congratulations, you have been involuntarily selected to be an Alpha Tester for ShiftOS." + Environment.NewLine + Environment.NewLine); + TextType("Congratulations, " + Environment.UserName + "you have been involuntarily selected to be an Alpha Tester for ShiftOS!" + Environment.NewLine + Environment.NewLine); break; case 4: - TextType("At this current point in time I do not wish to reveal my identity or future intentions." + Environment.NewLine + Environment.NewLine); + TextType("At this time, I do not wish to reveal any of my intentions and idenity." + Environment.NewLine + Environment.NewLine); break; case 5: TextType("I just need to use you and your computer as an external test bed to evolve my experimental operating system." + Environment.NewLine + Environment.NewLine); break; case 6: - TextType("Right now ShiftOS is practically non-existent but I’ll work on coding it remotely as you use it." + Environment.NewLine + Environment.NewLine); + TextType("I need to expand the name of ShiftOS, so I'll work on it, and you'll have the chance to use ShiftOS!" + Environment.NewLine + Environment.NewLine); break; case 7: - TextType("Your hard drive will now be formatted in preparation for the installation of ShiftOS" + Environment.NewLine + Environment.NewLine); + TextType("Your hard drive will now be formatted in preparation for the installation of ShiftOS." + Environment.NewLine + Environment.NewLine); break; case 8: TextType("Starting Format."); @@ -201,23 +201,23 @@ namespace ShiftOS.Main rtext = ""; break; case 20: - TextType("Scanning Drive C:/"); + TextType("Scanning Drive C:\\..."); break; case 21: TextType(Environment.NewLine + Environment.NewLine + "Drive Label: " + cdrive.VolumeLabel); break; case 22: - TextType(Environment.NewLine + "Total Drive Size: " + String.Format((cdrive.TotalSize / 1024 / 1024 / 1024).ToString(), "0.00") + " GigaBytes "); + TextType(Environment.NewLine + "Total Drive Size: " + String.Format((cdrive.TotalSize / 1024 / 1024 / 1024).ToString(), "0.00") + "GB. "); break; case 23: - TextType(Environment.NewLine + "Old File System: " + cdrive.DriveFormat + " "); + TextType(Environment.NewLine + "Old File System: " + cdrive.DriveFormat + ". "); break; case 24: - TextType(Environment.NewLine + "New File System: ShiftFS "); + TextType(Environment.NewLine + "New File System: ShiftFS. "); break; case 25: - TextType(Environment.NewLine + Environment.NewLine + "Formatting C:/ - "); + TextType(Environment.NewLine + Environment.NewLine + "Formatting C:\\... - "); conversationtimer.Interval = 100; break; case 26: // TODO: to 126 -- cgit v1.2.3 From 23791cf63b61a2a922e80e5077ec5a3ad0ce7c53 Mon Sep 17 00:00:00 2001 From: FloppyDiskDrive Date: Wed, 27 Sep 2017 20:00:17 -0500 Subject: Added a buggy dynamically changing infobox (this will most likely not work) --- .vs/ShiftOS/v15/sqlite3/storage.ide | Bin 3678208 -> 3678208 bytes .../WindowManager/InfoboxTemplate.Designer.cs | 2 +- ShiftOS.Engine/WindowManager/InfoboxTemplate.cs | 20 ++++++++++++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) (limited to 'ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs') diff --git a/.vs/ShiftOS/v15/sqlite3/storage.ide b/.vs/ShiftOS/v15/sqlite3/storage.ide index a031093..daba2e0 100644 Binary files a/.vs/ShiftOS/v15/sqlite3/storage.ide and b/.vs/ShiftOS/v15/sqlite3/storage.ide differ diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs index a076c2a..29d9299 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs @@ -70,7 +70,7 @@ this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.pictureBox1.Image = global::ShiftOS.Engine.Properties.Resources.Symbolinfo; - this.pictureBox1.Location = new System.Drawing.Point(3, 35); + this.pictureBox1.Location = new System.Drawing.Point(0, 34); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(80, 70); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs index a5be129..d8ad071 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs @@ -11,6 +11,12 @@ namespace ShiftOS.Engine.WindowManager Stream _str; private int _buttonChoice; private int _buttonSelected; + private int _leftDistance; + private int _rightDistance; + private int _textWidth; + private int _textHeight; + private int _topDistance; + private int _bottomDistance; public InfoboxTemplate(ButtonType type) { InitializeComponent(); @@ -84,8 +90,18 @@ namespace ShiftOS.Engine.WindowManager private void changeSize_Tick(object sender, EventArgs e) { - this.Height += label1.Height; - this.Width += label1.Width; + ChangeSize(); + } + private void ChangeSize() + { + _textHeight = label1.Height; + _textWidth = label1.Width; + _topDistance = 55; + _bottomDistance = 121; + _rightDistance = 101; + _leftDistance = 55; + this.Height = _textHeight + _topDistance + _bottomDistance; + this.Width = _textWidth + _leftDistance + _rightDistance; } } } -- cgit v1.2.3 From 753a880c0d5eb6fa6f466ef5e36713203409e13f Mon Sep 17 00:00:00 2001 From: FloppyDiskDrive Date: Wed, 27 Sep 2017 20:34:58 -0500 Subject: Revert "Added a buggy dynamically changing infobox (this will most likely not work)" This reverts commit 23791cf63b61a2a922e80e5077ec5a3ad0ce7c53. --- .vs/ShiftOS/v15/sqlite3/storage.ide | Bin 3678208 -> 3678208 bytes .../WindowManager/InfoboxTemplate.Designer.cs | 2 +- ShiftOS.Engine/WindowManager/InfoboxTemplate.cs | 20 ++------------------ 3 files changed, 3 insertions(+), 19 deletions(-) (limited to 'ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs') diff --git a/.vs/ShiftOS/v15/sqlite3/storage.ide b/.vs/ShiftOS/v15/sqlite3/storage.ide index daba2e0..a031093 100644 Binary files a/.vs/ShiftOS/v15/sqlite3/storage.ide and b/.vs/ShiftOS/v15/sqlite3/storage.ide differ diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs index 29d9299..a076c2a 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs @@ -70,7 +70,7 @@ this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.pictureBox1.Image = global::ShiftOS.Engine.Properties.Resources.Symbolinfo; - this.pictureBox1.Location = new System.Drawing.Point(0, 34); + this.pictureBox1.Location = new System.Drawing.Point(3, 35); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(80, 70); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs index d8ad071..a5be129 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs @@ -11,12 +11,6 @@ namespace ShiftOS.Engine.WindowManager Stream _str; private int _buttonChoice; private int _buttonSelected; - private int _leftDistance; - private int _rightDistance; - private int _textWidth; - private int _textHeight; - private int _topDistance; - private int _bottomDistance; public InfoboxTemplate(ButtonType type) { InitializeComponent(); @@ -90,18 +84,8 @@ namespace ShiftOS.Engine.WindowManager private void changeSize_Tick(object sender, EventArgs e) { - ChangeSize(); - } - private void ChangeSize() - { - _textHeight = label1.Height; - _textWidth = label1.Width; - _topDistance = 55; - _bottomDistance = 121; - _rightDistance = 101; - _leftDistance = 55; - this.Height = _textHeight + _topDistance + _bottomDistance; - this.Width = _textWidth + _leftDistance + _rightDistance; + this.Height += label1.Height; + this.Width += label1.Width; } } } -- cgit v1.2.3