From c23e42cc396d4fc55799d659bae2149cc183dbf6 Mon Sep 17 00:00:00 2001 From: FloppyDiskDrive Date: Sun, 1 Oct 2017 09:49:14 -0500 Subject: Added a fuckton of changes New infobox icons, new WIP port of Snakey, we are getting closer to a pre-alpha! --- .vs/ShiftOS/v15/sqlite3/storage.ide | Bin 659456 -> 819200 bytes ShiftOS.Engine/Properties/Resources.Designer.cs | 34 ++++- ShiftOS.Engine/Properties/Resources.resx | 15 +- ShiftOS.Engine/Resources/Symbolinfo - Copy.png | Bin 56780 -> 0 bytes ShiftOS.Engine/Resources/symbolError.png | Bin 0 -> 3297 bytes ShiftOS.Engine/Resources/symbolQuestion.png | Bin 0 -> 3078 bytes ShiftOS.Engine/Resources/symbolWarning.png | Bin 3463 -> 2929 bytes ShiftOS.Engine/ShiftOS.Engine.csproj | 9 ++ .../Templates/InfoboxTemplate.Designer.cs | 110 -------------- ShiftOS.Engine/Templates/InfoboxTemplate.cs | 35 ----- ShiftOS.Engine/Templates/InfoboxTemplate.resx | 120 --------------- .../WindowManager/InfoboxTemplate.Designer.cs | 3 +- ShiftOS.Engine/WindowManager/InfoboxTemplate.cs | 29 +++- ShiftOS.Main/HijackScreen.Designer.cs | 7 +- ShiftOS.Main/ShiftOS.Main.csproj | 9 ++ .../ShiftOS/Apps/ShifterStuff/SelectColor.cs | 10 +- ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs | 93 ++++++++++++ ShiftOS.Main/ShiftOS/Apps/Snakey.cs | 123 +++++++++++++++ ShiftOS.Main/ShiftOS/Apps/Snakey.resx | 120 +++++++++++++++ ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs | 168 +++++++++++---------- ShiftOS.Main/ShiftOS/Apps/TestForm.cs | 24 ++- ShiftOS.Main/ShiftOS/Desktop.Designer.cs | 137 +++++++++-------- ShiftOS.Main/ShiftOS/Desktop.cs | 10 +- 23 files changed, 616 insertions(+), 440 deletions(-) delete mode 100644 ShiftOS.Engine/Resources/Symbolinfo - Copy.png create mode 100644 ShiftOS.Engine/Resources/symbolError.png create mode 100644 ShiftOS.Engine/Resources/symbolQuestion.png delete mode 100644 ShiftOS.Engine/Templates/InfoboxTemplate.Designer.cs delete mode 100644 ShiftOS.Engine/Templates/InfoboxTemplate.cs delete mode 100644 ShiftOS.Engine/Templates/InfoboxTemplate.resx create mode 100644 ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs create mode 100644 ShiftOS.Main/ShiftOS/Apps/Snakey.cs create mode 100644 ShiftOS.Main/ShiftOS/Apps/Snakey.resx diff --git a/.vs/ShiftOS/v15/sqlite3/storage.ide b/.vs/ShiftOS/v15/sqlite3/storage.ide index 3be5453..d58d29e 100644 Binary files a/.vs/ShiftOS/v15/sqlite3/storage.ide and b/.vs/ShiftOS/v15/sqlite3/storage.ide differ diff --git a/ShiftOS.Engine/Properties/Resources.Designer.cs b/ShiftOS.Engine/Properties/Resources.Designer.cs index db83dd9..470100c 100644 --- a/ShiftOS.Engine/Properties/Resources.Designer.cs +++ b/ShiftOS.Engine/Properties/Resources.Designer.cs @@ -92,9 +92,39 @@ namespace ShiftOS.Engine.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap Symbolinfo { + internal static System.Drawing.Bitmap symbolError { get { - object obj = ResourceManager.GetObject("Symbolinfo", resourceCulture); + object obj = ResourceManager.GetObject("symbolError", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap symbolInfo { + get { + object obj = ResourceManager.GetObject("symbolInfo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap symbolQuestion { + get { + object obj = ResourceManager.GetObject("symbolQuestion", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap symbolWarning { + get { + object obj = ResourceManager.GetObject("symbolWarning", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } diff --git a/ShiftOS.Engine/Properties/Resources.resx b/ShiftOS.Engine/Properties/Resources.resx index db3d27b..7c6edde 100644 --- a/ShiftOS.Engine/Properties/Resources.resx +++ b/ShiftOS.Engine/Properties/Resources.resx @@ -121,13 +121,22 @@ ..\Resources\nullIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Symbolinfo1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\iconInfoBox.fw.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\infobox.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\symbolError.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Symbolinfo1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\symbolQuestion.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\symbolWarning.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/ShiftOS.Engine/Resources/Symbolinfo - Copy.png b/ShiftOS.Engine/Resources/Symbolinfo - Copy.png deleted file mode 100644 index 659d9b3..0000000 Binary files a/ShiftOS.Engine/Resources/Symbolinfo - Copy.png and /dev/null differ diff --git a/ShiftOS.Engine/Resources/symbolError.png b/ShiftOS.Engine/Resources/symbolError.png new file mode 100644 index 0000000..83c210d Binary files /dev/null and b/ShiftOS.Engine/Resources/symbolError.png differ diff --git a/ShiftOS.Engine/Resources/symbolQuestion.png b/ShiftOS.Engine/Resources/symbolQuestion.png new file mode 100644 index 0000000..f6f9325 Binary files /dev/null and b/ShiftOS.Engine/Resources/symbolQuestion.png differ diff --git a/ShiftOS.Engine/Resources/symbolWarning.png b/ShiftOS.Engine/Resources/symbolWarning.png index f8805f6..1ea4287 100644 Binary files a/ShiftOS.Engine/Resources/symbolWarning.png and b/ShiftOS.Engine/Resources/symbolWarning.png differ diff --git a/ShiftOS.Engine/ShiftOS.Engine.csproj b/ShiftOS.Engine/ShiftOS.Engine.csproj index 2b436c1..6da50d0 100644 --- a/ShiftOS.Engine/ShiftOS.Engine.csproj +++ b/ShiftOS.Engine/ShiftOS.Engine.csproj @@ -92,5 +92,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/ShiftOS.Engine/Templates/InfoboxTemplate.Designer.cs b/ShiftOS.Engine/Templates/InfoboxTemplate.Designer.cs deleted file mode 100644 index ca37891..0000000 --- a/ShiftOS.Engine/Templates/InfoboxTemplate.Designer.cs +++ /dev/null @@ -1,110 +0,0 @@ -namespace ShiftOS.Engine.Templates -{ - partial class InfoboxTemplate - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.label1 = new System.Windows.Forms.Label(); - this.button2 = new System.Windows.Forms.Button(); - this.button1 = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.SuspendLayout(); - // - // pictureBox1 - // - this.pictureBox1.Image = global::ShiftOS.Engine.Properties.Resources.Symbolinfo; - this.pictureBox1.Location = new System.Drawing.Point(15, 17); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(80, 70); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; - // - // 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", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(114, 40); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(115, 15); - this.label1.TabIndex = 1; - this.label1.Text = "Generic Body"; - // - // button2 - // - this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button2.Font = new System.Drawing.Font("Lucida Console", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button2.Location = new System.Drawing.Point(194, 122); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(116, 27); - this.button2.TabIndex = 3; - this.button2.Text = "No"; - this.button2.UseVisualStyleBackColor = true; - // - // button1 - // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button1.Font = new System.Drawing.Font("Lucida Console", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button1.Location = new System.Drawing.Point(51, 122); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(116, 27); - this.button1.TabIndex = 4; - this.button1.Text = "Yes"; - this.button1.UseVisualStyleBackColor = true; - // - // InfoboxTemplate - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.button1); - this.Controls.Add(this.button2); - this.Controls.Add(this.label1); - this.Controls.Add(this.pictureBox1); - this.Name = "InfoboxTemplate"; - this.Size = new System.Drawing.Size(367, 177); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.Button button1; - } -} diff --git a/ShiftOS.Engine/Templates/InfoboxTemplate.cs b/ShiftOS.Engine/Templates/InfoboxTemplate.cs deleted file mode 100644 index bfc91a6..0000000 --- a/ShiftOS.Engine/Templates/InfoboxTemplate.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace ShiftOS.Engine.Templates -{ - public partial class InfoboxTemplate : UserControl - { - public int buttonResult; - public InfoboxTemplate(buttonType type) - { - InitializeComponent(); - switch (type) - { - case buttonType.OK: - button1.Text = "OK"; - button2.Visible = false; - button1.Location = new Point(117, 122); - - } - } - public enum buttonType - { - YesNo, - OK, - OKCancel, - } - } -} diff --git a/ShiftOS.Engine/Templates/InfoboxTemplate.resx b/ShiftOS.Engine/Templates/InfoboxTemplate.resx deleted file mode 100644 index 1af7de1..0000000 --- a/ShiftOS.Engine/Templates/InfoboxTemplate.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs index a076c2a..2675935 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs @@ -69,7 +69,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.Image = global::ShiftOS.Engine.Properties.Resources.symbolInfo; this.pictureBox1.Location = new System.Drawing.Point(3, 35); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(80, 70); @@ -80,7 +80,6 @@ // changeSize // this.changeSize.Interval = 1; - this.changeSize.Tick += new System.EventHandler(this.changeSize_Tick); // // label1 // diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs index a5be129..c5e49de 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs @@ -11,7 +11,7 @@ namespace ShiftOS.Engine.WindowManager Stream _str; private int _buttonChoice; private int _buttonSelected; - public InfoboxTemplate(ButtonType type) + public InfoboxTemplate(ButtonType type, ErrorIcon icon) { InitializeComponent(); @@ -34,6 +34,21 @@ namespace ShiftOS.Engine.WindowManager _buttonChoice = 3; break; } + switch (icon) + { + case ErrorIcon.Critical: + SetImage(Properties.Resources.symbolError); + break; + case ErrorIcon.Error: + SetImage(Properties.Resources.symbolWarning); + break; + case ErrorIcon.Info: + SetImage(Properties.Resources.symbolInfo); + break; + case ErrorIcon.Question: + SetImage(Properties.Resources.symbolQuestion); + break; + } } public enum ButtonType @@ -43,6 +58,13 @@ namespace ShiftOS.Engine.WindowManager Ok } + public enum ErrorIcon + { + Info, + Critical, + Error, + Question + } private void btnOpt1_Click(object sender, EventArgs e) { switch (btnOpt1.Text) @@ -82,10 +104,9 @@ namespace ShiftOS.Engine.WindowManager private void InfoboxTemplate_Load(object sender, EventArgs e) => Play(); - private void changeSize_Tick(object sender, EventArgs e) + private void SetImage(Image imageType) { - this.Height += label1.Height; - this.Width += label1.Width; + pictureBox1.Image = imageType; } } } diff --git a/ShiftOS.Main/HijackScreen.Designer.cs b/ShiftOS.Main/HijackScreen.Designer.cs index fab31dc..c0e5de9 100644 --- a/ShiftOS.Main/HijackScreen.Designer.cs +++ b/ShiftOS.Main/HijackScreen.Designer.cs @@ -28,12 +28,11 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); - this.conversationtimer = new System.Windows.Forms.Timer(this.components); - this.hackeffecttimer = new System.Windows.Forms.Timer(this.components); + this.conversationtimer = new System.Windows.Forms.Timer(); + this.hackeffecttimer = new System.Windows.Forms.Timer(); this.lblHijack = new System.Windows.Forms.Label(); - this.textgen = new System.Windows.Forms.Timer(this.components); + this.textgen = new System.Windows.Forms.Timer(); this.lblhackwords = new System.Windows.Forms.Label(); this.SuspendLayout(); // diff --git a/ShiftOS.Main/ShiftOS.Main.csproj b/ShiftOS.Main/ShiftOS.Main.csproj index c814c14..84d64ab 100644 --- a/ShiftOS.Main/ShiftOS.Main.csproj +++ b/ShiftOS.Main/ShiftOS.Main.csproj @@ -70,6 +70,12 @@ Shifter.cs + + UserControl + + + Snakey.cs + Form @@ -104,6 +110,9 @@ Shifter.cs + + Snakey.cs + TestForm.cs diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs index 697e22e..5eb5faa 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs @@ -27,12 +27,12 @@ namespace ShiftOS.Main.ShiftOS.Apps } catch(FormatException ex) { - ShiftWM.StartInfoboxSession("Error!", "Failed to parse integer. Error:\n" + ex, InfoboxTemplate.ButtonType.Ok); + ShiftWM.StartInfoboxSession("Error!", "Failed to parse integer. Error:\n" + ex, InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Critical); } if (_colorType1 > 255 || _colorType2 > 255 || _colorType3 > 255) { - ShiftWM.StartInfoboxSession("Error!", "A value cannot be greater than 255!", InfoboxTemplate.ButtonType.Ok); + ShiftWM.StartInfoboxSession("Error!", "A value cannot be greater than 255!", InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Critical); } else { @@ -40,12 +40,12 @@ namespace ShiftOS.Main.ShiftOS.Apps { ShiftWindow sw = new ShiftWindow(); _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3); - BackColor = _finalColor; - ShiftWM.StartInfoboxSession("Success!", "Changed color to:\n" + _colorType1.ToString() + ", " + _colorType2.ToString() + ", " + _colorType3.ToString() + ".", InfoboxTemplate.ButtonType.Ok); + ShiftWM.SetTitleBarColor(_finalColor); + ShiftWM.StartInfoboxSession("Success!", "Changed color to:\n" + _colorType1.ToString() + ", " + _colorType2.ToString() + ", " + _colorType3.ToString() + ".", InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Info); } catch (Exception) { - ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok); + ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Critical); } } } diff --git a/ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs new file mode 100644 index 0000000..bef7a6b --- /dev/null +++ b/ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs @@ -0,0 +1,93 @@ +namespace ShiftOS.Main.ShiftOS.Apps +{ + partial class Snakey + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.length = new System.Windows.Forms.Label(); + this.speed = new System.Windows.Forms.Label(); + this.score = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // length + // + this.length.AutoSize = true; + this.length.BackColor = System.Drawing.Color.Transparent; + this.length.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.length.ForeColor = System.Drawing.Color.White; + this.length.Location = new System.Drawing.Point(573, 18); + this.length.Name = "length"; + this.length.Size = new System.Drawing.Size(76, 20); + this.length.TabIndex = 16; + this.length.Text = "Length: 5"; + // + // speed + // + this.speed.AutoSize = true; + this.speed.BackColor = System.Drawing.Color.Transparent; + this.speed.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.speed.ForeColor = System.Drawing.Color.White; + this.speed.Location = new System.Drawing.Point(287, 18); + this.speed.Name = "speed"; + this.speed.Size = new System.Drawing.Size(73, 20); + this.speed.TabIndex = 15; + this.speed.Text = "Speed: 1"; + // + // score + // + this.score.AutoSize = true; + this.score.BackColor = System.Drawing.Color.Transparent; + this.score.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.score.ForeColor = System.Drawing.Color.White; + this.score.Location = new System.Drawing.Point(24, 18); + this.score.Name = "score"; + this.score.Size = new System.Drawing.Size(100, 20); + this.score.TabIndex = 14; + this.score.Text = "Total Points: "; + // + // Snakey + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Black; + this.Controls.Add(this.length); + this.Controls.Add(this.speed); + this.Controls.Add(this.score); + this.Name = "Snakey"; + this.Size = new System.Drawing.Size(673, 447); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + internal System.Windows.Forms.Label length; + internal System.Windows.Forms.Label speed; + internal System.Windows.Forms.Label score; + } +} diff --git a/ShiftOS.Main/ShiftOS/Apps/Snakey.cs b/ShiftOS.Main/ShiftOS/Apps/Snakey.cs new file mode 100644 index 0000000..d8d4a98 --- /dev/null +++ b/ShiftOS.Main/ShiftOS/Apps/Snakey.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Drawing.Drawing2D; +using ShiftOS.Engine; +using ShiftOS.Main.Properties; + +namespace ShiftOS.Main.ShiftOS.Apps +{ + public partial class Snakey : UserControl + { + public Snakey() + { + InitializeComponent(); + } + private struct structSnake + { + public Rectangle rect; + public int x; + public int y; + } + private enum directions + { + Rightward, + Downward, + Leftward, + Upward + } + #region Various-Objects + private const int INTIAL_SNAKE_RECT_COUNT = 5; + private const int COLUMN_COUNT = 65; + private const int ROW_COUNT = 47; + private int curRecCount; + private Rectangle[,] Rects; + + + private bool [,] isSnakePart; + private List snake; + private Brush snakeBrush = new SolidBrush(Color.FromArgb(255, 255, 255)); + private Brush backBrush = new SolidBrush(Color.FromArgb(1, 1, 1)); + private Brush tokenBrush = new SolidBrush(Color.FromArgb(255, 255, 255)); + private directions curDirection; + private Bitmap buffer; + private int columnCount; + private int rowCount; + private int snakePoints; + private double snakeSpeed; + private int snakeLength; + private Rectangle token; + #endregion + private int xyIndexToRect(int X, int Y) + { + return (Y * (columnCount)) + X; + } + private void rectToIndexXY(double index, double X, double Y) + { + X = index % (columnCount); + Y = Math.Round(index / columnCount); + } + private void initSnake() + { + int x; + int y; + int index; + snake = new List(); + structSnake sSnake = new structSnake(); + x = ((columnCount) - 10 / 2); + y = ((rowCount) - 6) / 2; + Point snakePosition = new Point(x, y); + index = xyIndexToRect(x, y); + for (int i = 0; i < INTIAL_SNAKE_RECT_COUNT; i++) + { + rectToIndexXY(index + (i - 1), x, y); + sSnake.rect = Rects[x, y]; + sSnake.x = x; + sSnake.y = y; + snake.Add(sSnake); + } + snakeLength = INTIAL_SNAKE_RECT_COUNT; + snakeSpeed = 1; + length.Text = "Length: " + snakeLength.ToString(); + speed.Text = "Speed: " + snakeSpeed.ToString(); + } + private void selectRectangles() + { + Graphics g = Graphics.FromImage(Resources.snakeyback); + int i; + structSnake sSnake = new structSnake(); + for (i = 0; i < INTIAL_SNAKE_RECT_COUNT; i++) + { + sSnake = snake[i]; + g.FillRectangle(snakeBrush, sSnake.rect); + isSnakePart[sSnake.x, sSnake.y] = true; + } + buffer = new Bitmap(Resources.snakeyback); + g.Dispose(); + Refresh(); + } + private void initRectangles() + { + int i; + int j; + columnCount = COLUMN_COUNT; + rowCount = ROW_COUNT; + Rects = new Rectangle[columnCount, rowCount]; + isSnakePart = new bool[columnCount, rowCount]; + for (j = 0; j < rowCount; j++) + { + for (i = 0; i < columnCount; i++) + { + //TO-DO: I can't really port this over right now. Commiting soon. -FDD + } + } + } + } +} + diff --git a/ShiftOS.Main/ShiftOS/Apps/Snakey.resx b/ShiftOS.Main/ShiftOS/Apps/Snakey.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.Main/ShiftOS/Apps/Snakey.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs index 50bcb58..53765bd 100644 --- a/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs @@ -28,60 +28,57 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.systemIconsBindingSource = new System.Windows.Forms.BindingSource(this.components); - ((System.ComponentModel.ISupportInitialize)(this.systemIconsBindingSource)).BeginInit(); - this.SuspendLayout(); - // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(18, 20); - this.textBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(388, 26); - this.textBox1.TabIndex = 0; - this.textBox1.Text = "Title"; - // - // textBox2 - // - this.textBox2.Location = new System.Drawing.Point(18, 60); - this.textBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(388, 26); - this.textBox2.TabIndex = 1; - this.textBox2.Text = "Contents"; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(13, 149); - this.button1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(192, 35); - this.button1.TabIndex = 2; - this.button1.Text = "Create Window"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.Button1_Click); - // - // button2 - // - this.button2.Location = new System.Drawing.Point(217, 149); - this.button2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(189, 35); - this.button2.TabIndex = 4; - this.button2.Text = "Test Shifter"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // comboBox1 - // - this.comboBox1.FormattingEnabled = true; - this.comboBox1.Items.AddRange(new object[] { + this.components = new System.ComponentModel.Container(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.systemIconsBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.panel1 = new System.Windows.Forms.Panel(); + ((System.ComponentModel.ISupportInitialize)(this.systemIconsBindingSource)).BeginInit(); + this.SuspendLayout(); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(12, 13); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(260, 20); + this.textBox1.TabIndex = 0; + this.textBox1.Text = "Title"; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(12, 39); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(260, 20); + this.textBox2.TabIndex = 1; + this.textBox2.Text = "Contents"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(9, 97); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(128, 23); + this.button1.TabIndex = 2; + this.button1.Text = "Create Window"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.Button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(145, 97); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(126, 23); + this.button2.TabIndex = 4; + this.button2.Text = "Test Shifter"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // comboBox1 + // + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Items.AddRange(new object[] { "Application", "Asterisk", "Error", @@ -92,31 +89,41 @@ "Shield", "Warning", "WinLogo"}); - this.comboBox1.Location = new System.Drawing.Point(18, 104); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(388, 28); - this.comboBox1.TabIndex = 5; - // - // systemIconsBindingSource - // - this.systemIconsBindingSource.DataSource = typeof(System.Drawing.SystemIcons); - // - // TestForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(426, 198); - this.Controls.Add(this.comboBox1); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); - this.Controls.Add(this.textBox2); - this.Controls.Add(this.textBox1); - this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.Name = "TestForm"; - this.Text = "TestForm"; - ((System.ComponentModel.ISupportInitialize)(this.systemIconsBindingSource)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + this.comboBox1.Location = new System.Drawing.Point(12, 68); + this.comboBox1.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(260, 21); + this.comboBox1.TabIndex = 5; + // + // systemIconsBindingSource + // + this.systemIconsBindingSource.DataSource = typeof(System.Drawing.SystemIcons); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.SystemColors.ControlDarkDark; + this.panel1.Location = new System.Drawing.Point(71, 138); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(200, 37); + this.panel1.TabIndex = 6; + this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove); + // + // TestForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 175); + this.Controls.Add(this.panel1); + this.Controls.Add(this.comboBox1); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.textBox1); + this.Name = "TestForm"; + this.Text = "TestForm"; + ((System.ComponentModel.ISupportInitialize)(this.systemIconsBindingSource)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -128,5 +135,6 @@ private System.Windows.Forms.Button button2; private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.BindingSource systemIconsBindingSource; - } + private System.Windows.Forms.Panel panel1; + } } \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/TestForm.cs b/ShiftOS.Main/ShiftOS/Apps/TestForm.cs index 1fd3b18..e8360e0 100644 --- a/ShiftOS.Main/ShiftOS/Apps/TestForm.cs +++ b/ShiftOS.Main/ShiftOS/Apps/TestForm.cs @@ -10,6 +10,7 @@ namespace ShiftOS.Main { public partial class TestForm : Form { + Point loc; public TestForm() { InitializeComponent(); @@ -17,16 +18,25 @@ namespace ShiftOS.Main private void Button1_Click(object sender, EventArgs e) { - ShiftDemo demo = new ShiftDemo {label1 = {Text = textBox2.Text}}; + ShiftDemo demo = new ShiftDemo { label1 = { Text = textBox2.Text } }; - var item = typeof(SystemIcons).GetProperties() - .First(p => p.Name == comboBox1.SelectedItem as string); + var item = typeof(SystemIcons).GetProperties() + .First(p => p.Name == comboBox1.SelectedItem as string); - ShiftWM.Init(demo, textBox1.Text, (item.GetMethod.Invoke(null, new object[0]) as Icon)); - ShiftWM.StartInfoboxSession(textBox1.Text, textBox2.Text, InfoboxTemplate.ButtonType.Ok); + ShiftWM.Init(demo, textBox1.Text, (item.GetMethod.Invoke(null, new object[0]) as Icon)); + ShiftWM.StartInfoboxSession(textBox1.Text, textBox2.Text, InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Critical); } - private void button2_Click(object sender, EventArgs e) - => ShiftWM.Init(new Shifter(), "Shifter", Properties.Resources.iconShifter.ToIcon()); + private void button2_Click(object sender, EventArgs e) + => ShiftWM.Init(new Shifter(), "Shifter", Properties.Resources.iconShifter.ToIcon()); + + private void panel1_MouseMove(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + loc = new Point(Cursor.Position.X, Cursor.Position.Y); + this.Location = loc; + } + } } } diff --git a/ShiftOS.Main/ShiftOS/Desktop.Designer.cs b/ShiftOS.Main/ShiftOS/Desktop.Designer.cs index dac30c6..35cf33e 100644 --- a/ShiftOS.Main/ShiftOS/Desktop.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Desktop.Designer.cs @@ -28,75 +28,78 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.listView1 = new System.Windows.Forms.ListView(); - this.taskbar = new System.Windows.Forms.ToolStrip(); - this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); - this.taskbarClock = new System.Windows.Forms.ToolStripLabel(); - this.timer1 = new System.Windows.Forms.Timer(this.components); - this.taskbar.SuspendLayout(); - this.SuspendLayout(); - // - // listView1 - // - this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.listView1.Location = new System.Drawing.Point(0, 0); - this.listView1.Name = "listView1"; - this.listView1.Size = new System.Drawing.Size(1962, 1236); - this.listView1.TabIndex = 0; - this.listView1.UseCompatibleStateImageBehavior = false; - // - // taskbar - // - this.taskbar.Dock = System.Windows.Forms.DockStyle.Bottom; - this.taskbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; - this.taskbar.ImageScalingSize = new System.Drawing.Size(24, 24); - this.taskbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.components = new System.ComponentModel.Container(); + this.listView1 = new System.Windows.Forms.ListView(); + this.taskbar = new System.Windows.Forms.ToolStrip(); + this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); + this.taskbarClock = new System.Windows.Forms.ToolStripLabel(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.taskbar.SuspendLayout(); + this.SuspendLayout(); + // + // listView1 + // + this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.Location = new System.Drawing.Point(0, 0); + this.listView1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(913, 489); + this.listView1.TabIndex = 0; + this.listView1.UseCompatibleStateImageBehavior = false; + // + // taskbar + // + this.taskbar.Dock = System.Windows.Forms.DockStyle.Bottom; + this.taskbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this.taskbar.ImageScalingSize = new System.Drawing.Size(24, 24); + this.taskbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripDropDownButton1, this.taskbarClock}); - this.taskbar.Location = new System.Drawing.Point(0, 1204); - this.taskbar.Name = "taskbar"; - this.taskbar.Size = new System.Drawing.Size(1962, 32); - this.taskbar.TabIndex = 1; - this.taskbar.Text = "toolStrip1"; - // - // toolStripDropDownButton1 - // - this.toolStripDropDownButton1.Image = global::ShiftOS.Main.Properties.Resources.iconWebBrowser; - this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; - this.toolStripDropDownButton1.Size = new System.Drawing.Size(131, 29); - this.toolStripDropDownButton1.Tag = ((uint)(0u)); - this.toolStripDropDownButton1.Text = "Programs"; - // - // taskbarClock - // - this.taskbarClock.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.taskbarClock.Image = global::ShiftOS.Main.Properties.Resources.iconClock; - this.taskbarClock.Name = "taskbarClock"; - this.taskbarClock.Size = new System.Drawing.Size(70, 29); - this.taskbarClock.Tag = ((uint)(0u)); - this.taskbarClock.Text = "0:00"; - // - // timer1 - // - this.timer1.Interval = 1000; - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // - // Desktop - // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1962, 1236); - this.Controls.Add(this.taskbar); - this.Controls.Add(this.listView1); - this.Name = "Desktop"; - this.Text = "Desktop"; - this.taskbar.ResumeLayout(false); - this.taskbar.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + this.taskbar.Location = new System.Drawing.Point(0, 458); + this.taskbar.Name = "taskbar"; + this.taskbar.Size = new System.Drawing.Size(913, 31); + this.taskbar.TabIndex = 1; + this.taskbar.Text = "toolStrip1"; + // + // toolStripDropDownButton1 + // + this.toolStripDropDownButton1.Image = global::ShiftOS.Main.Properties.Resources.iconWebBrowser; + this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; + this.toolStripDropDownButton1.Size = new System.Drawing.Size(95, 28); + this.toolStripDropDownButton1.Tag = ((uint)(0u)); + this.toolStripDropDownButton1.Text = "Programs"; + this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); + // + // taskbarClock + // + this.taskbarClock.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.taskbarClock.Image = global::ShiftOS.Main.Properties.Resources.iconClock; + this.taskbarClock.Name = "taskbarClock"; + this.taskbarClock.Size = new System.Drawing.Size(52, 28); + this.taskbarClock.Tag = ((uint)(0u)); + this.taskbarClock.Text = "0:00"; + // + // timer1 + // + this.timer1.Interval = 1000; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // Desktop + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(913, 489); + this.Controls.Add(this.taskbar); + this.Controls.Add(this.listView1); + this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.Name = "Desktop"; + this.Text = "Desktop"; + this.taskbar.ResumeLayout(false); + this.taskbar.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/ShiftOS.Main/ShiftOS/Desktop.cs b/ShiftOS.Main/ShiftOS/Desktop.cs index 494222a..1ea4183 100644 --- a/ShiftOS.Main/ShiftOS/Desktop.cs +++ b/ShiftOS.Main/ShiftOS/Desktop.cs @@ -8,6 +8,9 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using ShiftOS.Engine.WindowManager; +using ShiftOS.Main.ShiftOS.Apps; +using ShiftOS.Main.Properties; +using ShiftOS.Engine; namespace ShiftOS.Main.ShiftOS { @@ -57,5 +60,10 @@ namespace ShiftOS.Main.ShiftOS private void timer1_Tick(object sender, EventArgs e) => taskbarClock.Text = $"{DateTime.Now:t}"; - } + + private void toolStripDropDownButton1_Click(object sender, EventArgs e) + { + ShiftWM.Init(new Snakey(), "Snakey - WIP", Resources.iconSnakey.ToIcon(), false, true); + } + } } -- cgit v1.2.3 From aa44f27eab230f464e9778a4256c330a056a7b3c Mon Sep 17 00:00:00 2001 From: FloppyDiskDrive Date: Sun, 1 Oct 2017 09:52:26 -0500 Subject: Revert "Added a fuckton of changes" This reverts commit c23e42cc396d4fc55799d659bae2149cc183dbf6. --- .vs/ShiftOS/v15/sqlite3/storage.ide | Bin 819200 -> 659456 bytes ShiftOS.Engine/Properties/Resources.Designer.cs | 34 +---- ShiftOS.Engine/Properties/Resources.resx | 15 +- ShiftOS.Engine/Resources/Symbolinfo - Copy.png | Bin 0 -> 56780 bytes ShiftOS.Engine/Resources/symbolError.png | Bin 3297 -> 0 bytes ShiftOS.Engine/Resources/symbolQuestion.png | Bin 3078 -> 0 bytes ShiftOS.Engine/Resources/symbolWarning.png | Bin 2929 -> 3463 bytes ShiftOS.Engine/ShiftOS.Engine.csproj | 9 -- .../Templates/InfoboxTemplate.Designer.cs | 110 ++++++++++++++ ShiftOS.Engine/Templates/InfoboxTemplate.cs | 35 +++++ ShiftOS.Engine/Templates/InfoboxTemplate.resx | 120 +++++++++++++++ .../WindowManager/InfoboxTemplate.Designer.cs | 3 +- ShiftOS.Engine/WindowManager/InfoboxTemplate.cs | 29 +--- ShiftOS.Main/HijackScreen.Designer.cs | 7 +- ShiftOS.Main/ShiftOS.Main.csproj | 9 -- .../ShiftOS/Apps/ShifterStuff/SelectColor.cs | 10 +- ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs | 93 ------------ ShiftOS.Main/ShiftOS/Apps/Snakey.cs | 123 --------------- ShiftOS.Main/ShiftOS/Apps/Snakey.resx | 120 --------------- ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs | 168 ++++++++++----------- ShiftOS.Main/ShiftOS/Apps/TestForm.cs | 24 +-- ShiftOS.Main/ShiftOS/Desktop.Designer.cs | 137 ++++++++--------- ShiftOS.Main/ShiftOS/Desktop.cs | 10 +- 23 files changed, 440 insertions(+), 616 deletions(-) create mode 100644 ShiftOS.Engine/Resources/Symbolinfo - Copy.png delete mode 100644 ShiftOS.Engine/Resources/symbolError.png delete mode 100644 ShiftOS.Engine/Resources/symbolQuestion.png create mode 100644 ShiftOS.Engine/Templates/InfoboxTemplate.Designer.cs create mode 100644 ShiftOS.Engine/Templates/InfoboxTemplate.cs create mode 100644 ShiftOS.Engine/Templates/InfoboxTemplate.resx delete mode 100644 ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/Snakey.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/Snakey.resx diff --git a/.vs/ShiftOS/v15/sqlite3/storage.ide b/.vs/ShiftOS/v15/sqlite3/storage.ide index d58d29e..3be5453 100644 Binary files a/.vs/ShiftOS/v15/sqlite3/storage.ide and b/.vs/ShiftOS/v15/sqlite3/storage.ide differ diff --git a/ShiftOS.Engine/Properties/Resources.Designer.cs b/ShiftOS.Engine/Properties/Resources.Designer.cs index 470100c..db83dd9 100644 --- a/ShiftOS.Engine/Properties/Resources.Designer.cs +++ b/ShiftOS.Engine/Properties/Resources.Designer.cs @@ -92,39 +92,9 @@ namespace ShiftOS.Engine.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap symbolError { + internal static System.Drawing.Bitmap Symbolinfo { get { - object obj = ResourceManager.GetObject("symbolError", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap symbolInfo { - get { - object obj = ResourceManager.GetObject("symbolInfo", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap symbolQuestion { - get { - object obj = ResourceManager.GetObject("symbolQuestion", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap symbolWarning { - get { - object obj = ResourceManager.GetObject("symbolWarning", resourceCulture); + object obj = ResourceManager.GetObject("Symbolinfo", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } diff --git a/ShiftOS.Engine/Properties/Resources.resx b/ShiftOS.Engine/Properties/Resources.resx index 7c6edde..db3d27b 100644 --- a/ShiftOS.Engine/Properties/Resources.resx +++ b/ShiftOS.Engine/Properties/Resources.resx @@ -121,22 +121,13 @@ ..\Resources\nullIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Symbolinfo1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\iconInfoBox.fw.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\infobox.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\symbolError.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Symbolinfo1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\symbolQuestion.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\symbolWarning.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - \ No newline at end of file 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/symbolError.png b/ShiftOS.Engine/Resources/symbolError.png deleted file mode 100644 index 83c210d..0000000 Binary files a/ShiftOS.Engine/Resources/symbolError.png and /dev/null differ diff --git a/ShiftOS.Engine/Resources/symbolQuestion.png b/ShiftOS.Engine/Resources/symbolQuestion.png deleted file mode 100644 index f6f9325..0000000 Binary files a/ShiftOS.Engine/Resources/symbolQuestion.png and /dev/null differ diff --git a/ShiftOS.Engine/Resources/symbolWarning.png b/ShiftOS.Engine/Resources/symbolWarning.png index 1ea4287..f8805f6 100644 Binary files a/ShiftOS.Engine/Resources/symbolWarning.png and b/ShiftOS.Engine/Resources/symbolWarning.png differ diff --git a/ShiftOS.Engine/ShiftOS.Engine.csproj b/ShiftOS.Engine/ShiftOS.Engine.csproj index 6da50d0..2b436c1 100644 --- a/ShiftOS.Engine/ShiftOS.Engine.csproj +++ b/ShiftOS.Engine/ShiftOS.Engine.csproj @@ -92,14 +92,5 @@ - - - - - - - - - \ No newline at end of file diff --git a/ShiftOS.Engine/Templates/InfoboxTemplate.Designer.cs b/ShiftOS.Engine/Templates/InfoboxTemplate.Designer.cs new file mode 100644 index 0000000..ca37891 --- /dev/null +++ b/ShiftOS.Engine/Templates/InfoboxTemplate.Designer.cs @@ -0,0 +1,110 @@ +namespace ShiftOS.Engine.Templates +{ + partial class InfoboxTemplate + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.label1 = new System.Windows.Forms.Label(); + this.button2 = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // pictureBox1 + // + this.pictureBox1.Image = global::ShiftOS.Engine.Properties.Resources.Symbolinfo; + this.pictureBox1.Location = new System.Drawing.Point(15, 17); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(80, 70); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + // + // 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", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(114, 40); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(115, 15); + this.label1.TabIndex = 1; + this.label1.Text = "Generic Body"; + // + // button2 + // + this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button2.Font = new System.Drawing.Font("Lucida Console", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.button2.Location = new System.Drawing.Point(194, 122); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(116, 27); + this.button2.TabIndex = 3; + this.button2.Text = "No"; + this.button2.UseVisualStyleBackColor = true; + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button1.Font = new System.Drawing.Font("Lucida Console", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.button1.Location = new System.Drawing.Point(51, 122); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(116, 27); + this.button1.TabIndex = 4; + this.button1.Text = "Yes"; + this.button1.UseVisualStyleBackColor = true; + // + // InfoboxTemplate + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.button1); + this.Controls.Add(this.button2); + this.Controls.Add(this.label1); + this.Controls.Add(this.pictureBox1); + this.Name = "InfoboxTemplate"; + this.Size = new System.Drawing.Size(367, 177); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button1; + } +} diff --git a/ShiftOS.Engine/Templates/InfoboxTemplate.cs b/ShiftOS.Engine/Templates/InfoboxTemplate.cs new file mode 100644 index 0000000..bfc91a6 --- /dev/null +++ b/ShiftOS.Engine/Templates/InfoboxTemplate.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ShiftOS.Engine.Templates +{ + public partial class InfoboxTemplate : UserControl + { + public int buttonResult; + public InfoboxTemplate(buttonType type) + { + InitializeComponent(); + switch (type) + { + case buttonType.OK: + button1.Text = "OK"; + button2.Visible = false; + button1.Location = new Point(117, 122); + + } + } + public enum buttonType + { + YesNo, + OK, + OKCancel, + } + } +} diff --git a/ShiftOS.Engine/Templates/InfoboxTemplate.resx b/ShiftOS.Engine/Templates/InfoboxTemplate.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.Engine/Templates/InfoboxTemplate.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs index 2675935..a076c2a 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs @@ -69,7 +69,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.Image = global::ShiftOS.Engine.Properties.Resources.Symbolinfo; this.pictureBox1.Location = new System.Drawing.Point(3, 35); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(80, 70); @@ -80,6 +80,7 @@ // changeSize // this.changeSize.Interval = 1; + this.changeSize.Tick += new System.EventHandler(this.changeSize_Tick); // // label1 // diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs index c5e49de..a5be129 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs @@ -11,7 +11,7 @@ namespace ShiftOS.Engine.WindowManager Stream _str; private int _buttonChoice; private int _buttonSelected; - public InfoboxTemplate(ButtonType type, ErrorIcon icon) + public InfoboxTemplate(ButtonType type) { InitializeComponent(); @@ -34,21 +34,6 @@ namespace ShiftOS.Engine.WindowManager _buttonChoice = 3; break; } - switch (icon) - { - case ErrorIcon.Critical: - SetImage(Properties.Resources.symbolError); - break; - case ErrorIcon.Error: - SetImage(Properties.Resources.symbolWarning); - break; - case ErrorIcon.Info: - SetImage(Properties.Resources.symbolInfo); - break; - case ErrorIcon.Question: - SetImage(Properties.Resources.symbolQuestion); - break; - } } public enum ButtonType @@ -58,13 +43,6 @@ namespace ShiftOS.Engine.WindowManager Ok } - public enum ErrorIcon - { - Info, - Critical, - Error, - Question - } private void btnOpt1_Click(object sender, EventArgs e) { switch (btnOpt1.Text) @@ -104,9 +82,10 @@ namespace ShiftOS.Engine.WindowManager private void InfoboxTemplate_Load(object sender, EventArgs e) => Play(); - private void SetImage(Image imageType) + private void changeSize_Tick(object sender, EventArgs e) { - pictureBox1.Image = imageType; + this.Height += label1.Height; + this.Width += label1.Width; } } } diff --git a/ShiftOS.Main/HijackScreen.Designer.cs b/ShiftOS.Main/HijackScreen.Designer.cs index c0e5de9..fab31dc 100644 --- a/ShiftOS.Main/HijackScreen.Designer.cs +++ b/ShiftOS.Main/HijackScreen.Designer.cs @@ -28,11 +28,12 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); - this.conversationtimer = new System.Windows.Forms.Timer(); - this.hackeffecttimer = new System.Windows.Forms.Timer(); + this.conversationtimer = new System.Windows.Forms.Timer(this.components); + this.hackeffecttimer = new System.Windows.Forms.Timer(this.components); this.lblHijack = new System.Windows.Forms.Label(); - this.textgen = new System.Windows.Forms.Timer(); + this.textgen = new System.Windows.Forms.Timer(this.components); this.lblhackwords = new System.Windows.Forms.Label(); this.SuspendLayout(); // diff --git a/ShiftOS.Main/ShiftOS.Main.csproj b/ShiftOS.Main/ShiftOS.Main.csproj index 84d64ab..c814c14 100644 --- a/ShiftOS.Main/ShiftOS.Main.csproj +++ b/ShiftOS.Main/ShiftOS.Main.csproj @@ -70,12 +70,6 @@ Shifter.cs - - UserControl - - - Snakey.cs - Form @@ -110,9 +104,6 @@ Shifter.cs - - Snakey.cs - TestForm.cs diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs index 5eb5faa..697e22e 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs @@ -27,12 +27,12 @@ namespace ShiftOS.Main.ShiftOS.Apps } catch(FormatException ex) { - ShiftWM.StartInfoboxSession("Error!", "Failed to parse integer. Error:\n" + ex, InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Critical); + ShiftWM.StartInfoboxSession("Error!", "Failed to parse integer. Error:\n" + ex, InfoboxTemplate.ButtonType.Ok); } if (_colorType1 > 255 || _colorType2 > 255 || _colorType3 > 255) { - ShiftWM.StartInfoboxSession("Error!", "A value cannot be greater than 255!", InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Critical); + ShiftWM.StartInfoboxSession("Error!", "A value cannot be greater than 255!", InfoboxTemplate.ButtonType.Ok); } else { @@ -40,12 +40,12 @@ namespace ShiftOS.Main.ShiftOS.Apps { ShiftWindow sw = new ShiftWindow(); _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3); - ShiftWM.SetTitleBarColor(_finalColor); - ShiftWM.StartInfoboxSession("Success!", "Changed color to:\n" + _colorType1.ToString() + ", " + _colorType2.ToString() + ", " + _colorType3.ToString() + ".", InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Info); + BackColor = _finalColor; + ShiftWM.StartInfoboxSession("Success!", "Changed color to:\n" + _colorType1.ToString() + ", " + _colorType2.ToString() + ", " + _colorType3.ToString() + ".", InfoboxTemplate.ButtonType.Ok); } catch (Exception) { - ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Critical); + ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok); } } } diff --git a/ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs deleted file mode 100644 index bef7a6b..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs +++ /dev/null @@ -1,93 +0,0 @@ -namespace ShiftOS.Main.ShiftOS.Apps -{ - partial class Snakey - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.length = new System.Windows.Forms.Label(); - this.speed = new System.Windows.Forms.Label(); - this.score = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // length - // - this.length.AutoSize = true; - this.length.BackColor = System.Drawing.Color.Transparent; - this.length.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.length.ForeColor = System.Drawing.Color.White; - this.length.Location = new System.Drawing.Point(573, 18); - this.length.Name = "length"; - this.length.Size = new System.Drawing.Size(76, 20); - this.length.TabIndex = 16; - this.length.Text = "Length: 5"; - // - // speed - // - this.speed.AutoSize = true; - this.speed.BackColor = System.Drawing.Color.Transparent; - this.speed.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.speed.ForeColor = System.Drawing.Color.White; - this.speed.Location = new System.Drawing.Point(287, 18); - this.speed.Name = "speed"; - this.speed.Size = new System.Drawing.Size(73, 20); - this.speed.TabIndex = 15; - this.speed.Text = "Speed: 1"; - // - // score - // - this.score.AutoSize = true; - this.score.BackColor = System.Drawing.Color.Transparent; - this.score.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.score.ForeColor = System.Drawing.Color.White; - this.score.Location = new System.Drawing.Point(24, 18); - this.score.Name = "score"; - this.score.Size = new System.Drawing.Size(100, 20); - this.score.TabIndex = 14; - this.score.Text = "Total Points: "; - // - // Snakey - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Black; - this.Controls.Add(this.length); - this.Controls.Add(this.speed); - this.Controls.Add(this.score); - this.Name = "Snakey"; - this.Size = new System.Drawing.Size(673, 447); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - internal System.Windows.Forms.Label length; - internal System.Windows.Forms.Label speed; - internal System.Windows.Forms.Label score; - } -} diff --git a/ShiftOS.Main/ShiftOS/Apps/Snakey.cs b/ShiftOS.Main/ShiftOS/Apps/Snakey.cs deleted file mode 100644 index d8d4a98..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/Snakey.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.Drawing.Drawing2D; -using ShiftOS.Engine; -using ShiftOS.Main.Properties; - -namespace ShiftOS.Main.ShiftOS.Apps -{ - public partial class Snakey : UserControl - { - public Snakey() - { - InitializeComponent(); - } - private struct structSnake - { - public Rectangle rect; - public int x; - public int y; - } - private enum directions - { - Rightward, - Downward, - Leftward, - Upward - } - #region Various-Objects - private const int INTIAL_SNAKE_RECT_COUNT = 5; - private const int COLUMN_COUNT = 65; - private const int ROW_COUNT = 47; - private int curRecCount; - private Rectangle[,] Rects; - - - private bool [,] isSnakePart; - private List snake; - private Brush snakeBrush = new SolidBrush(Color.FromArgb(255, 255, 255)); - private Brush backBrush = new SolidBrush(Color.FromArgb(1, 1, 1)); - private Brush tokenBrush = new SolidBrush(Color.FromArgb(255, 255, 255)); - private directions curDirection; - private Bitmap buffer; - private int columnCount; - private int rowCount; - private int snakePoints; - private double snakeSpeed; - private int snakeLength; - private Rectangle token; - #endregion - private int xyIndexToRect(int X, int Y) - { - return (Y * (columnCount)) + X; - } - private void rectToIndexXY(double index, double X, double Y) - { - X = index % (columnCount); - Y = Math.Round(index / columnCount); - } - private void initSnake() - { - int x; - int y; - int index; - snake = new List(); - structSnake sSnake = new structSnake(); - x = ((columnCount) - 10 / 2); - y = ((rowCount) - 6) / 2; - Point snakePosition = new Point(x, y); - index = xyIndexToRect(x, y); - for (int i = 0; i < INTIAL_SNAKE_RECT_COUNT; i++) - { - rectToIndexXY(index + (i - 1), x, y); - sSnake.rect = Rects[x, y]; - sSnake.x = x; - sSnake.y = y; - snake.Add(sSnake); - } - snakeLength = INTIAL_SNAKE_RECT_COUNT; - snakeSpeed = 1; - length.Text = "Length: " + snakeLength.ToString(); - speed.Text = "Speed: " + snakeSpeed.ToString(); - } - private void selectRectangles() - { - Graphics g = Graphics.FromImage(Resources.snakeyback); - int i; - structSnake sSnake = new structSnake(); - for (i = 0; i < INTIAL_SNAKE_RECT_COUNT; i++) - { - sSnake = snake[i]; - g.FillRectangle(snakeBrush, sSnake.rect); - isSnakePart[sSnake.x, sSnake.y] = true; - } - buffer = new Bitmap(Resources.snakeyback); - g.Dispose(); - Refresh(); - } - private void initRectangles() - { - int i; - int j; - columnCount = COLUMN_COUNT; - rowCount = ROW_COUNT; - Rects = new Rectangle[columnCount, rowCount]; - isSnakePart = new bool[columnCount, rowCount]; - for (j = 0; j < rowCount; j++) - { - for (i = 0; i < columnCount; i++) - { - //TO-DO: I can't really port this over right now. Commiting soon. -FDD - } - } - } - } -} - diff --git a/ShiftOS.Main/ShiftOS/Apps/Snakey.resx b/ShiftOS.Main/ShiftOS/Apps/Snakey.resx deleted file mode 100644 index 1af7de1..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/Snakey.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs index 53765bd..50bcb58 100644 --- a/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs @@ -28,57 +28,60 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.systemIconsBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.panel1 = new System.Windows.Forms.Panel(); - ((System.ComponentModel.ISupportInitialize)(this.systemIconsBindingSource)).BeginInit(); - this.SuspendLayout(); - // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(12, 13); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(260, 20); - this.textBox1.TabIndex = 0; - this.textBox1.Text = "Title"; - // - // textBox2 - // - this.textBox2.Location = new System.Drawing.Point(12, 39); - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(260, 20); - this.textBox2.TabIndex = 1; - this.textBox2.Text = "Contents"; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(9, 97); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(128, 23); - this.button1.TabIndex = 2; - this.button1.Text = "Create Window"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.Button1_Click); - // - // button2 - // - this.button2.Location = new System.Drawing.Point(145, 97); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(126, 23); - this.button2.TabIndex = 4; - this.button2.Text = "Test Shifter"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // comboBox1 - // - this.comboBox1.FormattingEnabled = true; - this.comboBox1.Items.AddRange(new object[] { + this.components = new System.ComponentModel.Container(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.systemIconsBindingSource = new System.Windows.Forms.BindingSource(this.components); + ((System.ComponentModel.ISupportInitialize)(this.systemIconsBindingSource)).BeginInit(); + this.SuspendLayout(); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(18, 20); + this.textBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(388, 26); + this.textBox1.TabIndex = 0; + this.textBox1.Text = "Title"; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(18, 60); + this.textBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(388, 26); + this.textBox2.TabIndex = 1; + this.textBox2.Text = "Contents"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(13, 149); + this.button1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(192, 35); + this.button1.TabIndex = 2; + this.button1.Text = "Create Window"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.Button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(217, 149); + this.button2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(189, 35); + this.button2.TabIndex = 4; + this.button2.Text = "Test Shifter"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // comboBox1 + // + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Items.AddRange(new object[] { "Application", "Asterisk", "Error", @@ -89,41 +92,31 @@ "Shield", "Warning", "WinLogo"}); - this.comboBox1.Location = new System.Drawing.Point(12, 68); - this.comboBox1.Margin = new System.Windows.Forms.Padding(2); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(260, 21); - this.comboBox1.TabIndex = 5; - // - // systemIconsBindingSource - // - this.systemIconsBindingSource.DataSource = typeof(System.Drawing.SystemIcons); - // - // panel1 - // - this.panel1.BackColor = System.Drawing.SystemColors.ControlDarkDark; - this.panel1.Location = new System.Drawing.Point(71, 138); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(200, 37); - this.panel1.TabIndex = 6; - this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove); - // - // TestForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(284, 175); - this.Controls.Add(this.panel1); - this.Controls.Add(this.comboBox1); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); - this.Controls.Add(this.textBox2); - this.Controls.Add(this.textBox1); - this.Name = "TestForm"; - this.Text = "TestForm"; - ((System.ComponentModel.ISupportInitialize)(this.systemIconsBindingSource)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + this.comboBox1.Location = new System.Drawing.Point(18, 104); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(388, 28); + this.comboBox1.TabIndex = 5; + // + // systemIconsBindingSource + // + this.systemIconsBindingSource.DataSource = typeof(System.Drawing.SystemIcons); + // + // TestForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(426, 198); + this.Controls.Add(this.comboBox1); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.textBox1); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.Name = "TestForm"; + this.Text = "TestForm"; + ((System.ComponentModel.ISupportInitialize)(this.systemIconsBindingSource)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -135,6 +128,5 @@ private System.Windows.Forms.Button button2; private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.BindingSource systemIconsBindingSource; - private System.Windows.Forms.Panel panel1; - } + } } \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/TestForm.cs b/ShiftOS.Main/ShiftOS/Apps/TestForm.cs index e8360e0..1fd3b18 100644 --- a/ShiftOS.Main/ShiftOS/Apps/TestForm.cs +++ b/ShiftOS.Main/ShiftOS/Apps/TestForm.cs @@ -10,7 +10,6 @@ namespace ShiftOS.Main { public partial class TestForm : Form { - Point loc; public TestForm() { InitializeComponent(); @@ -18,25 +17,16 @@ namespace ShiftOS.Main private void Button1_Click(object sender, EventArgs e) { - ShiftDemo demo = new ShiftDemo { label1 = { Text = textBox2.Text } }; + ShiftDemo demo = new ShiftDemo {label1 = {Text = textBox2.Text}}; - var item = typeof(SystemIcons).GetProperties() - .First(p => p.Name == comboBox1.SelectedItem as string); + var item = typeof(SystemIcons).GetProperties() + .First(p => p.Name == comboBox1.SelectedItem as string); - ShiftWM.Init(demo, textBox1.Text, (item.GetMethod.Invoke(null, new object[0]) as Icon)); - ShiftWM.StartInfoboxSession(textBox1.Text, textBox2.Text, InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Critical); + ShiftWM.Init(demo, textBox1.Text, (item.GetMethod.Invoke(null, new object[0]) as Icon)); + ShiftWM.StartInfoboxSession(textBox1.Text, textBox2.Text, InfoboxTemplate.ButtonType.Ok); } - private void button2_Click(object sender, EventArgs e) - => ShiftWM.Init(new Shifter(), "Shifter", Properties.Resources.iconShifter.ToIcon()); - - private void panel1_MouseMove(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Left) - { - loc = new Point(Cursor.Position.X, Cursor.Position.Y); - this.Location = loc; - } - } + private void button2_Click(object sender, EventArgs e) + => ShiftWM.Init(new Shifter(), "Shifter", Properties.Resources.iconShifter.ToIcon()); } } diff --git a/ShiftOS.Main/ShiftOS/Desktop.Designer.cs b/ShiftOS.Main/ShiftOS/Desktop.Designer.cs index 35cf33e..dac30c6 100644 --- a/ShiftOS.Main/ShiftOS/Desktop.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Desktop.Designer.cs @@ -28,78 +28,75 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.listView1 = new System.Windows.Forms.ListView(); - this.taskbar = new System.Windows.Forms.ToolStrip(); - this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); - this.taskbarClock = new System.Windows.Forms.ToolStripLabel(); - this.timer1 = new System.Windows.Forms.Timer(this.components); - this.taskbar.SuspendLayout(); - this.SuspendLayout(); - // - // listView1 - // - this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.listView1.Location = new System.Drawing.Point(0, 0); - this.listView1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.listView1.Name = "listView1"; - this.listView1.Size = new System.Drawing.Size(913, 489); - this.listView1.TabIndex = 0; - this.listView1.UseCompatibleStateImageBehavior = false; - // - // taskbar - // - this.taskbar.Dock = System.Windows.Forms.DockStyle.Bottom; - this.taskbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; - this.taskbar.ImageScalingSize = new System.Drawing.Size(24, 24); - this.taskbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.components = new System.ComponentModel.Container(); + this.listView1 = new System.Windows.Forms.ListView(); + this.taskbar = new System.Windows.Forms.ToolStrip(); + this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); + this.taskbarClock = new System.Windows.Forms.ToolStripLabel(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.taskbar.SuspendLayout(); + this.SuspendLayout(); + // + // listView1 + // + this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.Location = new System.Drawing.Point(0, 0); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(1962, 1236); + this.listView1.TabIndex = 0; + this.listView1.UseCompatibleStateImageBehavior = false; + // + // taskbar + // + this.taskbar.Dock = System.Windows.Forms.DockStyle.Bottom; + this.taskbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this.taskbar.ImageScalingSize = new System.Drawing.Size(24, 24); + this.taskbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripDropDownButton1, this.taskbarClock}); - this.taskbar.Location = new System.Drawing.Point(0, 458); - this.taskbar.Name = "taskbar"; - this.taskbar.Size = new System.Drawing.Size(913, 31); - this.taskbar.TabIndex = 1; - this.taskbar.Text = "toolStrip1"; - // - // toolStripDropDownButton1 - // - this.toolStripDropDownButton1.Image = global::ShiftOS.Main.Properties.Resources.iconWebBrowser; - this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; - this.toolStripDropDownButton1.Size = new System.Drawing.Size(95, 28); - this.toolStripDropDownButton1.Tag = ((uint)(0u)); - this.toolStripDropDownButton1.Text = "Programs"; - this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); - // - // taskbarClock - // - this.taskbarClock.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.taskbarClock.Image = global::ShiftOS.Main.Properties.Resources.iconClock; - this.taskbarClock.Name = "taskbarClock"; - this.taskbarClock.Size = new System.Drawing.Size(52, 28); - this.taskbarClock.Tag = ((uint)(0u)); - this.taskbarClock.Text = "0:00"; - // - // timer1 - // - this.timer1.Interval = 1000; - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // - // Desktop - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(913, 489); - this.Controls.Add(this.taskbar); - this.Controls.Add(this.listView1); - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.Name = "Desktop"; - this.Text = "Desktop"; - this.taskbar.ResumeLayout(false); - this.taskbar.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + this.taskbar.Location = new System.Drawing.Point(0, 1204); + this.taskbar.Name = "taskbar"; + this.taskbar.Size = new System.Drawing.Size(1962, 32); + this.taskbar.TabIndex = 1; + this.taskbar.Text = "toolStrip1"; + // + // toolStripDropDownButton1 + // + this.toolStripDropDownButton1.Image = global::ShiftOS.Main.Properties.Resources.iconWebBrowser; + this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; + this.toolStripDropDownButton1.Size = new System.Drawing.Size(131, 29); + this.toolStripDropDownButton1.Tag = ((uint)(0u)); + this.toolStripDropDownButton1.Text = "Programs"; + // + // taskbarClock + // + this.taskbarClock.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.taskbarClock.Image = global::ShiftOS.Main.Properties.Resources.iconClock; + this.taskbarClock.Name = "taskbarClock"; + this.taskbarClock.Size = new System.Drawing.Size(70, 29); + this.taskbarClock.Tag = ((uint)(0u)); + this.taskbarClock.Text = "0:00"; + // + // timer1 + // + this.timer1.Interval = 1000; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // Desktop + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1962, 1236); + this.Controls.Add(this.taskbar); + this.Controls.Add(this.listView1); + this.Name = "Desktop"; + this.Text = "Desktop"; + this.taskbar.ResumeLayout(false); + this.taskbar.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/ShiftOS.Main/ShiftOS/Desktop.cs b/ShiftOS.Main/ShiftOS/Desktop.cs index 1ea4183..494222a 100644 --- a/ShiftOS.Main/ShiftOS/Desktop.cs +++ b/ShiftOS.Main/ShiftOS/Desktop.cs @@ -8,9 +8,6 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using ShiftOS.Engine.WindowManager; -using ShiftOS.Main.ShiftOS.Apps; -using ShiftOS.Main.Properties; -using ShiftOS.Engine; namespace ShiftOS.Main.ShiftOS { @@ -60,10 +57,5 @@ namespace ShiftOS.Main.ShiftOS private void timer1_Tick(object sender, EventArgs e) => taskbarClock.Text = $"{DateTime.Now:t}"; - - private void toolStripDropDownButton1_Click(object sender, EventArgs e) - { - ShiftWM.Init(new Snakey(), "Snakey - WIP", Resources.iconSnakey.ToIcon(), false, true); - } - } + } } -- cgit v1.2.3 From b45df71168d5fa3f817c45194e4019d15b3a2aa0 Mon Sep 17 00:00:00 2001 From: AShifter Date: Sun, 1 Oct 2017 09:52:36 -0600 Subject: Shifting is working owow --- .vs/ShiftOS/v15/sqlite3/storage.ide | Bin 659456 -> 835584 bytes ShiftOS.Engine/ShiftOS.Engine.csproj | 1 + ShiftOS.Engine/WindowManager/ShiftArray.cs | 12 +++ ShiftOS.Engine/WindowManager/ShiftWM.cs | 2 +- .../Apps/ShifterStuff/SelectColor.Designer.cs | 81 +++++++++++++-------- .../ShiftOS/Apps/ShifterStuff/SelectColor.cs | 43 +++++------ .../ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs | 30 ++++++++ ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs | 10 +++ ShiftOS.Main/ShiftOS/Apps/TestForm.cs | 8 +- 9 files changed, 124 insertions(+), 63 deletions(-) create mode 100644 ShiftOS.Engine/WindowManager/ShiftArray.cs diff --git a/.vs/ShiftOS/v15/sqlite3/storage.ide b/.vs/ShiftOS/v15/sqlite3/storage.ide index 3be5453..8466a5c 100644 Binary files a/.vs/ShiftOS/v15/sqlite3/storage.ide and b/.vs/ShiftOS/v15/sqlite3/storage.ide differ diff --git a/ShiftOS.Engine/ShiftOS.Engine.csproj b/ShiftOS.Engine/ShiftOS.Engine.csproj index 2b436c1..be91d50 100644 --- a/ShiftOS.Engine/ShiftOS.Engine.csproj +++ b/ShiftOS.Engine/ShiftOS.Engine.csproj @@ -59,6 +59,7 @@ InfoboxTemplate.cs + Form diff --git a/ShiftOS.Engine/WindowManager/ShiftArray.cs b/ShiftOS.Engine/WindowManager/ShiftArray.cs new file mode 100644 index 0000000..bfb3cde --- /dev/null +++ b/ShiftOS.Engine/WindowManager/ShiftArray.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShiftOS.Engine.WindowManager +{ + class ShiftArray + { + } +} diff --git a/ShiftOS.Engine/WindowManager/ShiftWM.cs b/ShiftOS.Engine/WindowManager/ShiftWM.cs index 0c69fb7..594848a 100644 --- a/ShiftOS.Engine/WindowManager/ShiftWM.cs +++ b/ShiftOS.Engine/WindowManager/ShiftWM.cs @@ -18,7 +18,7 @@ namespace ShiftOS.Engine.WindowManager } /// - /// Shows a new Window based on a UserControl. + /// Shows a new ShiftWindow based on a UserControl. /// /// The UserControl to use /// The program's title diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.Designer.cs index e305651..a7473a0 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.Designer.cs @@ -31,10 +31,13 @@ this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.textBox3 = new System.Windows.Forms.TextBox(); this.btnSetColor = new System.Windows.Forms.Button(); + this.redUpDown = new System.Windows.Forms.NumericUpDown(); + this.greenUpDown = new System.Windows.Forms.NumericUpDown(); + this.blueUpDown = new System.Windows.Forms.NumericUpDown(); + ((System.ComponentModel.ISupportInitialize)(this.redUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.greenUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.blueUpDown)).BeginInit(); this.SuspendLayout(); // // label1 @@ -64,27 +67,6 @@ this.label3.TabIndex = 2; this.label3.Text = "Blue:"; // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(75, 27); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(206, 20); - this.textBox1.TabIndex = 3; - // - // textBox2 - // - this.textBox2.Location = new System.Drawing.Point(75, 58); - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(206, 20); - this.textBox2.TabIndex = 4; - // - // textBox3 - // - this.textBox3.Location = new System.Drawing.Point(75, 88); - this.textBox3.Name = "textBox3"; - this.textBox3.Size = new System.Drawing.Size(206, 20); - this.textBox3.TabIndex = 5; - // // btnSetColor // this.btnSetColor.FlatStyle = System.Windows.Forms.FlatStyle.Flat; @@ -96,20 +78,59 @@ this.btnSetColor.UseVisualStyleBackColor = true; this.btnSetColor.Click += new System.EventHandler(this.btnSetColor_Click); // + // redUpDown + // + this.redUpDown.Location = new System.Drawing.Point(82, 32); + this.redUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.redUpDown.Name = "redUpDown"; + this.redUpDown.Size = new System.Drawing.Size(120, 20); + this.redUpDown.TabIndex = 7; + // + // greenUpDown + // + this.greenUpDown.Location = new System.Drawing.Point(82, 60); + this.greenUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.greenUpDown.Name = "greenUpDown"; + this.greenUpDown.Size = new System.Drawing.Size(120, 20); + this.greenUpDown.TabIndex = 8; + // + // blueUpDown + // + this.blueUpDown.Location = new System.Drawing.Point(82, 90); + this.blueUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.blueUpDown.Name = "blueUpDown"; + this.blueUpDown.Size = new System.Drawing.Size(120, 20); + this.blueUpDown.TabIndex = 9; + // // SelectColor // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.blueUpDown); + this.Controls.Add(this.greenUpDown); + this.Controls.Add(this.redUpDown); this.Controls.Add(this.btnSetColor); - this.Controls.Add(this.textBox3); - this.Controls.Add(this.textBox2); - this.Controls.Add(this.textBox1); this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Font = new System.Drawing.Font("Lucida Console", 9.25F); this.Name = "SelectColor"; this.Size = new System.Drawing.Size(317, 158); + ((System.ComponentModel.ISupportInitialize)(this.redUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.greenUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.blueUpDown)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -120,9 +141,9 @@ private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.TextBox textBox2; - private System.Windows.Forms.TextBox textBox3; private System.Windows.Forms.Button btnSetColor; + private System.Windows.Forms.NumericUpDown redUpDown; + private System.Windows.Forms.NumericUpDown greenUpDown; + private System.Windows.Forms.NumericUpDown blueUpDown; } } diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs index 697e22e..f9f8f72 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs @@ -14,40 +14,31 @@ namespace ShiftOS.Main.ShiftOS.Apps public SelectColor() { InitializeComponent(); - + } private void btnSetColor_Click(object sender, EventArgs e) { + _colorType1 = Int32.Parse(redUpDown.Value.ToString()); + _colorType2 = Int32.Parse(greenUpDown.Value.ToString()); + _colorType3 = Int32.Parse(blueUpDown.Value.ToString()); try { - _colorType1 = Convert.ToInt32(textBox1.Text); - _colorType2 = Convert.ToInt32(textBox2.Text); - _colorType3 = Convert.ToInt32(textBox3.Text); - } - catch(FormatException ex) - { - ShiftWM.StartInfoboxSession("Error!", "Failed to parse integer. Error:\n" + ex, InfoboxTemplate.ButtonType.Ok); - } - - if (_colorType1 > 255 || _colorType2 > 255 || _colorType3 > 255) - { - ShiftWM.StartInfoboxSession("Error!", "A value cannot be greater than 255!", InfoboxTemplate.ButtonType.Ok); + _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3); + //BackColor = _finalColor; + + foreach (var window in ShiftWM.Windows) +{ + window.Invoke(new Action(() => window.top.BackColor = _finalColor)); + } + + ShiftWM.StartInfoboxSession("Success!", $"Changed color to:\r\n{_colorType1}, {_colorType2}, {_colorType3}.", InfoboxTemplate.ButtonType.Ok); } - else + catch (Exception) { - try - { - ShiftWindow sw = new ShiftWindow(); - _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3); - BackColor = _finalColor; - ShiftWM.StartInfoboxSession("Success!", "Changed color to:\n" + _colorType1.ToString() + ", " + _colorType2.ToString() + ", " + _colorType3.ToString() + ".", InfoboxTemplate.ButtonType.Ok); - } - catch (Exception) - { - ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok); - } + ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok); } + //return _finalColor; } } -} + } diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs index a89dca4..51bce9c 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs @@ -33,6 +33,8 @@ this.groupBox1 = new System.Windows.Forms.GroupBox(); this.button1 = new System.Windows.Forms.Button(); this.tabPage2 = new System.Windows.Forms.TabPage(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -53,6 +55,8 @@ // // tabPage1 // + this.tabPage1.Controls.Add(this.button3); + this.tabPage1.Controls.Add(this.button2); this.tabPage1.Controls.Add(this.groupBox1); this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Name = "tabPage1"; @@ -94,6 +98,30 @@ this.tabPage2.Text = "tabPage2"; this.tabPage2.UseVisualStyleBackColor = true; // + // button2 + // + this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button2.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.button2.Location = new System.Drawing.Point(171, 267); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(149, 23); + this.button2.TabIndex = 2; + this.button2.Text = "Set Colorful Skin"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button3 + // + this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button3.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.button3.Location = new System.Drawing.Point(6, 267); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(149, 23); + this.button3.TabIndex = 3; + this.button3.Text = "Set Default Skin"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // // Shifter // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -115,5 +143,7 @@ private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Button button1; private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button2; } } diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs index 098920f..5d5ad7d 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs @@ -18,5 +18,15 @@ namespace ShiftOS.Main.ShiftOS.Apps colorType = 1; ShiftWM.Init(new SelectColor(), "Select a color", Properties.Resources.iconColourPicker_fw.ToIcon()); } + + private void button3_Click(object sender, EventArgs e) + { + + } + + private void button2_Click(object sender, EventArgs e) + { + + } } } diff --git a/ShiftOS.Main/ShiftOS/Apps/TestForm.cs b/ShiftOS.Main/ShiftOS/Apps/TestForm.cs index 1fd3b18..389f8d1 100644 --- a/ShiftOS.Main/ShiftOS/Apps/TestForm.cs +++ b/ShiftOS.Main/ShiftOS/Apps/TestForm.cs @@ -17,12 +17,8 @@ namespace ShiftOS.Main private void Button1_Click(object sender, EventArgs e) { - ShiftDemo demo = new ShiftDemo {label1 = {Text = textBox2.Text}}; - - var item = typeof(SystemIcons).GetProperties() - .First(p => p.Name == comboBox1.SelectedItem as string); - - ShiftWM.Init(demo, textBox1.Text, (item.GetMethod.Invoke(null, new object[0]) as Icon)); + ShiftDemo demo = new ShiftDemo(); + ShiftWM.Init(demo, textBox1.Text, null); ShiftWM.StartInfoboxSession(textBox1.Text, textBox2.Text, InfoboxTemplate.ButtonType.Ok); } -- cgit v1.2.3 From b52e50320961ae5997b6b6de2f83cb15b21ba73d Mon Sep 17 00:00:00 2001 From: AShifter Date: Sun, 1 Oct 2017 10:00:17 -0600 Subject: whomst've --- .vs/ShiftOS/v15/sqlite3/storage.ide | Bin 835584 -> 835584 bytes .../ShiftOS/Apps/ShifterStuff/SelectColor.cs | 7 ++++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.vs/ShiftOS/v15/sqlite3/storage.ide b/.vs/ShiftOS/v15/sqlite3/storage.ide index 8466a5c..610893e 100644 Binary files a/.vs/ShiftOS/v15/sqlite3/storage.ide and b/.vs/ShiftOS/v15/sqlite3/storage.ide differ diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs index f9f8f72..1534f36 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs @@ -17,7 +17,7 @@ namespace ShiftOS.Main.ShiftOS.Apps } - private void btnSetColor_Click(object sender, EventArgs e) + private Color btnSetColor_Click(object sender, EventArgs e) { _colorType1 = Int32.Parse(redUpDown.Value.ToString()); _colorType2 = Int32.Parse(greenUpDown.Value.ToString()); @@ -25,12 +25,13 @@ namespace ShiftOS.Main.ShiftOS.Apps try { _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3); - //BackColor = _finalColor; + /* foreach (var window in ShiftWM.Windows) { window.Invoke(new Action(() => window.top.BackColor = _finalColor)); } + */ ShiftWM.StartInfoboxSession("Success!", $"Changed color to:\r\n{_colorType1}, {_colorType2}, {_colorType3}.", InfoboxTemplate.ButtonType.Ok); } @@ -38,7 +39,7 @@ namespace ShiftOS.Main.ShiftOS.Apps { ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok); } - //return _finalColor; + return _finalColor; } } } -- cgit v1.2.3 From 385d800066822cdf7467a90f6168026b6603573e Mon Sep 17 00:00:00 2001 From: AShifter Date: Tue, 3 Oct 2017 20:44:54 -0600 Subject: Adding basic skinning Open up the shifter, choose a skin and hit Apply. I ll work on it more later. --- .vs/ShiftOS/v15/sqlite3/storage.ide | Bin 835584 -> 843776 bytes ShiftOS.Engine/ShiftOS.Engine.csproj | 2 +- ShiftOS.Engine/WindowManager/ShiftArray.cs | 12 --- ShiftOS.Engine/WindowManager/ShiftSkinData.cs | 34 +++++++++ .../ShiftOS/Apps/ShifterStuff/SelectColor.cs | 9 ++- .../ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs | 82 ++++++++++++++------- ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs | 40 +++++++++- 7 files changed, 136 insertions(+), 43 deletions(-) delete mode 100644 ShiftOS.Engine/WindowManager/ShiftArray.cs create mode 100644 ShiftOS.Engine/WindowManager/ShiftSkinData.cs diff --git a/.vs/ShiftOS/v15/sqlite3/storage.ide b/.vs/ShiftOS/v15/sqlite3/storage.ide index 610893e..590cc4d 100644 Binary files a/.vs/ShiftOS/v15/sqlite3/storage.ide and b/.vs/ShiftOS/v15/sqlite3/storage.ide differ diff --git a/ShiftOS.Engine/ShiftOS.Engine.csproj b/ShiftOS.Engine/ShiftOS.Engine.csproj index be91d50..71721bc 100644 --- a/ShiftOS.Engine/ShiftOS.Engine.csproj +++ b/ShiftOS.Engine/ShiftOS.Engine.csproj @@ -59,7 +59,7 @@ InfoboxTemplate.cs - + Form diff --git a/ShiftOS.Engine/WindowManager/ShiftArray.cs b/ShiftOS.Engine/WindowManager/ShiftArray.cs deleted file mode 100644 index bfb3cde..0000000 --- a/ShiftOS.Engine/WindowManager/ShiftArray.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ShiftOS.Engine.WindowManager -{ - class ShiftArray - { - } -} diff --git a/ShiftOS.Engine/WindowManager/ShiftSkinData.cs b/ShiftOS.Engine/WindowManager/ShiftSkinData.cs new file mode 100644 index 0000000..653e814 --- /dev/null +++ b/ShiftOS.Engine/WindowManager/ShiftSkinData.cs @@ -0,0 +1,34 @@ +using System.Drawing; + +namespace ShiftOS.Engine.WindowManager +{ + public class ShiftSkinData + { + // ColorData + public Color leftTopCornerColor { get; set; } + public Color titleBarColor { get; set; } + public Color rightTopCornerColor { get; set; } + public Color btnCloseColor { get; set; } + public Color btnMaxColor { get; set; } + public Color btnMinColor { get; set; } + public Color leftSideColor { get; set; } + public Color rightSideColor { get; set; } + public Color leftBottomCornerColor { get; set; } + public Color bottomSideColor { get; set; } + public Color rightBottomCornerColor { get; set; } + public Color borderColorColor { get; set; } + + // SetBorderColor + public void setBorderColor(Color borderColor) + { + leftTopCornerColor = borderColor; + titleBarColor = borderColor; + rightTopCornerColor = borderColor; + leftSideColor = borderColor; + rightSideColor = borderColor; + leftBottomCornerColor = borderColor; + bottomSideColor = borderColor; + rightBottomCornerColor = borderColor; + } + } +} diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs index 1534f36..7a97915 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs @@ -17,7 +17,7 @@ namespace ShiftOS.Main.ShiftOS.Apps } - private Color btnSetColor_Click(object sender, EventArgs e) + private Color setColor() { _colorType1 = Int32.Parse(redUpDown.Value.ToString()); _colorType2 = Int32.Parse(greenUpDown.Value.ToString()); @@ -41,5 +41,10 @@ namespace ShiftOS.Main.ShiftOS.Apps } return _finalColor; } + + private void btnSetColor_Click(object sender, EventArgs e) + { + setColor(); + } } - } +} diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs index 51bce9c..47bc115 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs @@ -30,11 +30,13 @@ { this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); + this.button5 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.button1 = new System.Windows.Forms.Button(); this.tabPage2 = new System.Windows.Forms.TabPage(); - this.button2 = new System.Windows.Forms.Button(); - this.button3 = new System.Windows.Forms.Button(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -55,6 +57,8 @@ // // tabPage1 // + this.tabPage1.Controls.Add(this.button5); + this.tabPage1.Controls.Add(this.button4); this.tabPage1.Controls.Add(this.button3); this.tabPage1.Controls.Add(this.button2); this.tabPage1.Controls.Add(this.groupBox1); @@ -66,6 +70,54 @@ this.tabPage1.Text = "Titlebar"; this.tabPage1.UseVisualStyleBackColor = true; // + // button5 + // + this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button5.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.button5.Location = new System.Drawing.Point(6, 267); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(314, 23); + this.button5.TabIndex = 5; + this.button5.Text = "Apply"; + this.button5.UseVisualStyleBackColor = true; + this.button5.Click += new System.EventHandler(this.button5_Click); + // + // button4 + // + this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button4.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.button4.Location = new System.Drawing.Point(6, 209); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(314, 23); + this.button4.TabIndex = 4; + this.button4.Text = "Set Random Skin"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.setRandomSkin); + // + // button3 + // + this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button3.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.button3.Location = new System.Drawing.Point(6, 238); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(155, 23); + this.button3.TabIndex = 3; + this.button3.Text = "Set Default Skin"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.setDefaultSkin); + // + // button2 + // + this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button2.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.button2.Location = new System.Drawing.Point(171, 238); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(149, 23); + this.button2.TabIndex = 2; + this.button2.Text = "Set Colorful Skin"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.setColorSkin); + // // groupBox1 // this.groupBox1.Controls.Add(this.button1); @@ -98,30 +150,6 @@ this.tabPage2.Text = "tabPage2"; this.tabPage2.UseVisualStyleBackColor = true; // - // button2 - // - this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button2.Font = new System.Drawing.Font("Lucida Console", 8.25F); - this.button2.Location = new System.Drawing.Point(171, 267); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(149, 23); - this.button2.TabIndex = 2; - this.button2.Text = "Set Colorful Skin"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // button3 - // - this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button3.Font = new System.Drawing.Font("Lucida Console", 8.25F); - this.button3.Location = new System.Drawing.Point(6, 267); - this.button3.Name = "button3"; - this.button3.Size = new System.Drawing.Size(149, 23); - this.button3.TabIndex = 3; - this.button3.Text = "Set Default Skin"; - this.button3.UseVisualStyleBackColor = true; - this.button3.Click += new System.EventHandler(this.button3_Click); - // // Shifter // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -145,5 +173,7 @@ private System.Windows.Forms.TabPage tabPage2; private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.Button button5; } } diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs index 5d5ad7d..7659601 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs @@ -2,12 +2,14 @@ using System.Windows.Forms; using ShiftOS.Engine; using ShiftOS.Engine.WindowManager; +using System.Drawing; namespace ShiftOS.Main.ShiftOS.Apps { public partial class Shifter : UserControl { public int colorType; //This is a check to see what option was chosen. + ShiftSkinData skinConfig = new ShiftSkinData(); public Shifter() { InitializeComponent(); @@ -19,14 +21,48 @@ namespace ShiftOS.Main.ShiftOS.Apps ShiftWM.Init(new SelectColor(), "Select a color", Properties.Resources.iconColourPicker_fw.ToIcon()); } - private void button3_Click(object sender, EventArgs e) + private void setDefaultSkin(object sender, EventArgs e) { + skinConfig.setBorderColor(Color.FromArgb(64, 64, 64)); + skinConfig.btnCloseColor = Color.Black; + skinConfig.btnMaxColor = Color.Black; + skinConfig.btnMinColor = Color.Black; + } + private void setColorSkin(object sender, EventArgs e) + { + skinConfig.setBorderColor(Color.Blue); + skinConfig.btnCloseColor = Color.Red; + skinConfig.btnMaxColor = Color.Yellow; + skinConfig.btnMinColor = Color.Green; + } + + private void setRandomSkin(object sender, EventArgs e) + { + Random rnd = new Random(); + skinConfig.setBorderColor(Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255))); + skinConfig.btnCloseColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + skinConfig.btnMaxColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + skinConfig.btnMinColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); } - private void button2_Click(object sender, EventArgs e) + private void button5_Click(object sender, EventArgs e) { + foreach (var window in ShiftWM.Windows) + { + window.Invoke(new Action(() => window.top.BackColor = skinConfig.titleBarColor)); + window.Invoke(new Action(() => window.topleftcorner.BackColor = skinConfig.leftTopCornerColor)); + window.Invoke(new Action(() => window.toprightcorner.BackColor = skinConfig.rightTopCornerColor)); + window.Invoke(new Action(() => window.left.BackColor = skinConfig.leftSideColor)); + window.Invoke(new Action(() => window.right.BackColor = skinConfig.rightSideColor)); + window.Invoke(new Action(() => window.bottomleftcorner.BackColor = skinConfig.leftBottomCornerColor)); + window.Invoke(new Action(() => window.bottom.BackColor = skinConfig.bottomSideColor)); + window.Invoke(new Action(() => window.bottomrightcorner.BackColor = skinConfig.rightBottomCornerColor)); + window.Invoke(new Action(() => window.closebutton.BackColor = skinConfig.btnCloseColor)); + window.Invoke(new Action(() => window.maximizebutton.BackColor = skinConfig.btnMaxColor)); + window.Invoke(new Action(() => window.minimizebutton.BackColor = skinConfig.btnMinColor)); + } } } } -- cgit v1.2.3 From e9a8a6df70337a061384b46816f7e4b552145946 Mon Sep 17 00:00:00 2001 From: AShifter Date: Sat, 14 Oct 2017 09:27:27 -0600 Subject: More Skinning You can now set a skin and it will persist throughout all windows - though there is a bug where hovering over a context button will change it's color and leaving it will change it back to black. Will fix soon:tm:. --- .vs/ShiftOS/v15/sqlite3/storage.ide | Bin 843776 -> 843776 bytes ShiftOS.Engine/WindowManager/ShiftSkinData.cs | 38 +- ShiftOS.Engine/WindowManager/ShiftWM.cs | 37 +- .../WindowManager/ShiftWindow.Designer.cs | 470 ++++++++++----------- ShiftOS.Engine/WindowManager/ShiftWindow.cs | 24 +- ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs | 64 +-- 6 files changed, 324 insertions(+), 309 deletions(-) diff --git a/.vs/ShiftOS/v15/sqlite3/storage.ide b/.vs/ShiftOS/v15/sqlite3/storage.ide index 590cc4d..4a94421 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/ShiftSkinData.cs b/ShiftOS.Engine/WindowManager/ShiftSkinData.cs index 653e814..2c03123 100644 --- a/ShiftOS.Engine/WindowManager/ShiftSkinData.cs +++ b/ShiftOS.Engine/WindowManager/ShiftSkinData.cs @@ -2,33 +2,19 @@ namespace ShiftOS.Engine.WindowManager { - public class ShiftSkinData + public abstract class ShiftSkinData { // ColorData - public Color leftTopCornerColor { get; set; } - public Color titleBarColor { get; set; } - public Color rightTopCornerColor { get; set; } - public Color btnCloseColor { get; set; } - public Color btnMaxColor { get; set; } - public Color btnMinColor { get; set; } - public Color leftSideColor { get; set; } - public Color rightSideColor { get; set; } - public Color leftBottomCornerColor { get; set; } - public Color bottomSideColor { get; set; } - public Color rightBottomCornerColor { get; set; } - public Color borderColorColor { get; set; } - - // SetBorderColor - public void setBorderColor(Color borderColor) - { - leftTopCornerColor = borderColor; - titleBarColor = borderColor; - rightTopCornerColor = borderColor; - leftSideColor = borderColor; - rightSideColor = borderColor; - leftBottomCornerColor = borderColor; - bottomSideColor = borderColor; - rightBottomCornerColor = borderColor; - } + public static Color leftTopCornerColor = Color.Empty; + public static Color titleBarColor = Color.Empty; + public static Color rightTopCornerColor = Color.Empty; + public static Color btnCloseColor = Color.Empty; + public static Color btnMaxColor = Color.Empty; + public static Color btnMinColor = Color.Empty; + public static Color leftSideColor = Color.Empty; + public static Color rightSideColor = Color.Empty; + public static Color leftBottomCornerColor = Color.Empty; + public static Color bottomSideColor = Color.Empty; + public static Color rightBottomCornerColor = Color.Empty; } } diff --git a/ShiftOS.Engine/WindowManager/ShiftWM.cs b/ShiftOS.Engine/WindowManager/ShiftWM.cs index 594848a..64b84f9 100644 --- a/ShiftOS.Engine/WindowManager/ShiftWM.cs +++ b/ShiftOS.Engine/WindowManager/ShiftWM.cs @@ -33,13 +33,42 @@ namespace ShiftOS.Engine.WindowManager { Text = title, Title = {Text = title} - }; + }; + + app.Width = content.Width + app.leftSide.Width + app.rightSide.Width; + app.Height = content.Height + app.bottomSide.Height + app.titleBar.Height; + + if (ShiftSkinData.titleBarColor == Color.Empty) + { + Color borderColor = Color.FromArgb(64, 64, 64); + ShiftSkinData.btnCloseColor = Color.Black; + ShiftSkinData.btnMaxColor = Color.Black; + ShiftSkinData.btnMinColor = Color.Black; + ShiftSkinData.leftTopCornerColor = borderColor; + ShiftSkinData.titleBarColor = borderColor; + ShiftSkinData.rightTopCornerColor = borderColor; + ShiftSkinData.leftSideColor = borderColor; + ShiftSkinData.rightSideColor = borderColor; + ShiftSkinData.leftBottomCornerColor = borderColor; + ShiftSkinData.bottomSideColor = borderColor; + ShiftSkinData.rightBottomCornerColor = borderColor; + } - app.Width = content.Width + app.left.Width + app.right.Width; - app.Height = content.Height + app.bottom.Height + app.top.Height; + app.btnClose.BackColor = ShiftSkinData.btnCloseColor; + app.btnMax.BackColor = ShiftSkinData.btnMaxColor; + app.btnMin.BackColor = ShiftSkinData.btnMinColor; + app.leftTopCorner.BackColor = ShiftSkinData.leftTopCornerColor; + app.titleBar.BackColor = ShiftSkinData.titleBarColor; + app.rightTopCorner.BackColor = ShiftSkinData.rightTopCornerColor; + app.leftSide.BackColor = ShiftSkinData.leftSideColor; + app.rightSide.BackColor = ShiftSkinData.rightSideColor; + app.leftBottomCorner.BackColor = ShiftSkinData.leftBottomCornerColor; + app.bottomSide.BackColor = ShiftSkinData.bottomSideColor; + app.rightBottomCorner.BackColor = ShiftSkinData.rightBottomCornerColor; + // Icon Setup - if (icon == null) + if (icon == null) { app.programIcon.Hide(); app.programIcon.Image = Properties.Resources.nullIcon; diff --git a/ShiftOS.Engine/WindowManager/ShiftWindow.Designer.cs b/ShiftOS.Engine/WindowManager/ShiftWindow.Designer.cs index 1e0f105..211324c 100644 --- a/ShiftOS.Engine/WindowManager/ShiftWindow.Designer.cs +++ b/ShiftOS.Engine/WindowManager/ShiftWindow.Designer.cs @@ -28,238 +28,222 @@ /// private void InitializeComponent() { - this.program = new System.Windows.Forms.Panel(); - this.programContent = new System.Windows.Forms.Panel(); - this.bottomleftcorner = new System.Windows.Forms.Panel(); - this.toprightcorner = new System.Windows.Forms.Panel(); - this.bottomrightcorner = new System.Windows.Forms.Panel(); - this.topleftcorner = new System.Windows.Forms.Panel(); - this.bottom = new System.Windows.Forms.Panel(); - this.top = new System.Windows.Forms.Panel(); - this.programIcon = new System.Windows.Forms.PictureBox(); - this.maximizebutton = new System.Windows.Forms.PictureBox(); - this.minimizebutton = new System.Windows.Forms.PictureBox(); - this.Title = new System.Windows.Forms.Label(); - this.closebutton = new System.Windows.Forms.PictureBox(); - this.right = new System.Windows.Forms.Panel(); - this.left = new System.Windows.Forms.Panel(); - this.program.SuspendLayout(); - this.top.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.programIcon)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.maximizebutton)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.minimizebutton)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.closebutton)).BeginInit(); - this.SuspendLayout(); - // - // program - // - this.program.BackColor = System.Drawing.Color.White; - this.program.Controls.Add(this.programContent); - this.program.Controls.Add(this.bottomleftcorner); - this.program.Controls.Add(this.toprightcorner); - this.program.Controls.Add(this.bottomrightcorner); - this.program.Controls.Add(this.topleftcorner); - this.program.Controls.Add(this.bottom); - this.program.Controls.Add(this.top); - this.program.Controls.Add(this.right); - this.program.Controls.Add(this.left); - this.program.Dock = System.Windows.Forms.DockStyle.Fill; - this.program.Location = new System.Drawing.Point(0, 0); - this.program.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.program.Name = "program"; - this.program.Size = new System.Drawing.Size(426, 402); - this.program.TabIndex = 11; - // - // programContent - // - this.programContent.Dock = System.Windows.Forms.DockStyle.Fill; - this.programContent.Location = new System.Drawing.Point(6, 46); - this.programContent.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.programContent.Name = "programContent"; - this.programContent.Size = new System.Drawing.Size(414, 350); - this.programContent.TabIndex = 11; - // - // bottomleftcorner - // - this.bottomleftcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.bottomleftcorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.bottomleftcorner.Location = new System.Drawing.Point(0, 395); - this.bottomleftcorner.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.bottomleftcorner.Name = "bottomleftcorner"; - this.bottomleftcorner.Size = new System.Drawing.Size(8, 6); - this.bottomleftcorner.TabIndex = 10; - // - // toprightcorner - // - this.toprightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.toprightcorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.toprightcorner.Location = new System.Drawing.Point(417, 0); - this.toprightcorner.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.toprightcorner.Name = "toprightcorner"; - this.toprightcorner.Size = new System.Drawing.Size(9, 46); - this.toprightcorner.TabIndex = 9; - // - // bottomrightcorner - // - this.bottomrightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.bottomrightcorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.bottomrightcorner.Cursor = System.Windows.Forms.Cursors.SizeNWSE; - this.bottomrightcorner.Location = new System.Drawing.Point(420, 395); - this.bottomrightcorner.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.bottomrightcorner.Name = "bottomrightcorner"; - this.bottomrightcorner.Size = new System.Drawing.Size(6, 6); - this.bottomrightcorner.TabIndex = 4; - // - // topleftcorner - // - this.topleftcorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.topleftcorner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.topleftcorner.Location = new System.Drawing.Point(0, 0); - this.topleftcorner.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.topleftcorner.Name = "topleftcorner"; - this.topleftcorner.Size = new System.Drawing.Size(10, 46); - this.topleftcorner.TabIndex = 8; - // - // bottom - // - this.bottom.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.bottom.Cursor = System.Windows.Forms.Cursors.SizeNS; - this.bottom.Dock = System.Windows.Forms.DockStyle.Bottom; - this.bottom.Location = new System.Drawing.Point(6, 396); - this.bottom.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.bottom.Name = "bottom"; - this.bottom.Size = new System.Drawing.Size(414, 6); - this.bottom.TabIndex = 3; - // - // top - // - this.top.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.top.Controls.Add(this.programIcon); - this.top.Controls.Add(this.maximizebutton); - this.top.Controls.Add(this.minimizebutton); - this.top.Controls.Add(this.Title); - this.top.Controls.Add(this.closebutton); - this.top.Dock = System.Windows.Forms.DockStyle.Top; - this.top.ForeColor = System.Drawing.SystemColors.ControlText; - this.top.Location = new System.Drawing.Point(6, 0); - this.top.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.top.Name = "top"; - this.top.Size = new System.Drawing.Size(414, 46); - this.top.TabIndex = 0; - this.top.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Programtopbar_drag); - // - // programIcon - // - this.programIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.programIcon.ErrorImage = null; - this.programIcon.InitialImage = null; - this.programIcon.Location = new System.Drawing.Point(9, 11); - this.programIcon.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.programIcon.Name = "programIcon"; - this.programIcon.Size = new System.Drawing.Size(24, 25); - this.programIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.programIcon.TabIndex = 7; - this.programIcon.TabStop = false; - // - // maximizebutton - // - this.maximizebutton.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.maximizebutton.BackColor = System.Drawing.Color.Black; - this.maximizebutton.Location = new System.Drawing.Point(345, 6); - this.maximizebutton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.maximizebutton.Name = "maximizebutton"; - this.maximizebutton.Size = new System.Drawing.Size(32, 32); - this.maximizebutton.TabIndex = 6; - this.maximizebutton.TabStop = false; - this.maximizebutton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.maximizebutton_MouseDown); - this.maximizebutton.MouseEnter += new System.EventHandler(this.maximizebutton_MouseEnter); - this.maximizebutton.MouseLeave += new System.EventHandler(this.maximizebutton_MouseLeave); - this.maximizebutton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.maximizebutton_MouseUp); - // - // minimizebutton - // - this.minimizebutton.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.minimizebutton.BackColor = System.Drawing.Color.Black; - this.minimizebutton.Location = new System.Drawing.Point(310, 6); - this.minimizebutton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.minimizebutton.Name = "minimizebutton"; - this.minimizebutton.Size = new System.Drawing.Size(32, 32); - this.minimizebutton.TabIndex = 5; - this.minimizebutton.TabStop = false; - this.minimizebutton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.minimizebutton_MouseDown); - this.minimizebutton.MouseEnter += new System.EventHandler(this.minimizebutton_MouseEnter); - this.minimizebutton.MouseLeave += new System.EventHandler(this.minimizebutton_MouseLeave); - this.minimizebutton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.minimizebutton_MouseUp); - // - // Title - // - this.Title.AutoSize = true; - this.Title.BackColor = System.Drawing.Color.Transparent; - this.Title.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Title.ForeColor = System.Drawing.Color.White; - this.Title.Location = new System.Drawing.Point(38, 12); - this.Title.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.Title.Name = "Title"; - this.Title.Size = new System.Drawing.Size(149, 21); - this.Title.TabIndex = 3; - this.Title.Text = "Application Title"; - this.Title.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Programtopbar_drag); - // - // closebutton - // - this.closebutton.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.closebutton.BackColor = System.Drawing.Color.Black; - this.closebutton.Location = new System.Drawing.Point(380, 6); - this.closebutton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.closebutton.Name = "closebutton"; - this.closebutton.Size = new System.Drawing.Size(32, 32); - this.closebutton.TabIndex = 4; - this.closebutton.TabStop = false; - this.closebutton.Click += new System.EventHandler(this.closebutton_Click); - this.closebutton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.closebutton_MouseDown); - this.closebutton.MouseEnter += new System.EventHandler(this.closebutton_MouseEnter); - this.closebutton.MouseLeave += new System.EventHandler(this.closebutton_MouseLeave); - this.closebutton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.closebutton_MouseUp); - // - // right - // - this.right.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.right.Cursor = System.Windows.Forms.Cursors.SizeWE; - this.right.Dock = System.Windows.Forms.DockStyle.Right; - this.right.Location = new System.Drawing.Point(420, 0); - this.right.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.right.Name = "right"; - this.right.Size = new System.Drawing.Size(6, 402); - this.right.TabIndex = 2; - // - // left - // - this.left.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.left.Dock = System.Windows.Forms.DockStyle.Left; - this.left.Location = new System.Drawing.Point(0, 0); - this.left.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.left.Name = "left"; - this.left.Size = new System.Drawing.Size(6, 402); - this.left.TabIndex = 1; - // - // ShiftWindow - // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(426, 402); - this.Controls.Add(this.program); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.Name = "ShiftWindow"; - this.Text = "c"; - this.program.ResumeLayout(false); - this.top.ResumeLayout(false); - this.top.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.programIcon)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.maximizebutton)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.minimizebutton)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.closebutton)).EndInit(); - this.ResumeLayout(false); + this.program = new System.Windows.Forms.Panel(); + this.programContent = new System.Windows.Forms.Panel(); + this.leftBottomCorner = new System.Windows.Forms.Panel(); + this.rightTopCorner = new System.Windows.Forms.Panel(); + this.rightBottomCorner = new System.Windows.Forms.Panel(); + this.leftTopCorner = new System.Windows.Forms.Panel(); + this.bottomSide = new System.Windows.Forms.Panel(); + this.titleBar = new System.Windows.Forms.Panel(); + this.programIcon = new System.Windows.Forms.PictureBox(); + this.btnMax = new System.Windows.Forms.PictureBox(); + this.btnMin = new System.Windows.Forms.PictureBox(); + this.Title = new System.Windows.Forms.Label(); + this.btnClose = new System.Windows.Forms.PictureBox(); + this.rightSide = new System.Windows.Forms.Panel(); + this.leftSide = new System.Windows.Forms.Panel(); + this.program.SuspendLayout(); + this.titleBar.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.programIcon)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.btnMax)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.btnMin)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.btnClose)).BeginInit(); + this.SuspendLayout(); + // + // program + // + this.program.BackColor = System.Drawing.Color.White; + this.program.Controls.Add(this.programContent); + this.program.Controls.Add(this.leftBottomCorner); + this.program.Controls.Add(this.rightTopCorner); + this.program.Controls.Add(this.rightBottomCorner); + this.program.Controls.Add(this.leftTopCorner); + this.program.Controls.Add(this.bottomSide); + this.program.Controls.Add(this.titleBar); + this.program.Controls.Add(this.rightSide); + this.program.Controls.Add(this.leftSide); + this.program.Dock = System.Windows.Forms.DockStyle.Fill; + this.program.Location = new System.Drawing.Point(0, 0); + this.program.Name = "program"; + this.program.Size = new System.Drawing.Size(284, 261); + this.program.TabIndex = 11; + // + // programContent + // + this.programContent.Dock = System.Windows.Forms.DockStyle.Fill; + this.programContent.Location = new System.Drawing.Point(4, 30); + this.programContent.Name = "programContent"; + this.programContent.Size = new System.Drawing.Size(276, 227); + this.programContent.TabIndex = 11; + // + // leftBottomCorner + // + this.leftBottomCorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.leftBottomCorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.leftBottomCorner.Location = new System.Drawing.Point(0, 257); + this.leftBottomCorner.Name = "leftBottomCorner"; + this.leftBottomCorner.Size = new System.Drawing.Size(5, 4); + this.leftBottomCorner.TabIndex = 10; + // + // rightTopCorner + // + this.rightTopCorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.rightTopCorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.rightTopCorner.Location = new System.Drawing.Point(278, 0); + this.rightTopCorner.Name = "rightTopCorner"; + this.rightTopCorner.Size = new System.Drawing.Size(6, 30); + this.rightTopCorner.TabIndex = 9; + // + // rightBottomCorner + // + this.rightBottomCorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.rightBottomCorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.rightBottomCorner.Cursor = System.Windows.Forms.Cursors.SizeNWSE; + this.rightBottomCorner.Location = new System.Drawing.Point(280, 257); + this.rightBottomCorner.Name = "rightBottomCorner"; + this.rightBottomCorner.Size = new System.Drawing.Size(4, 4); + this.rightBottomCorner.TabIndex = 4; + // + // leftTopCorner + // + this.leftTopCorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.leftTopCorner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.leftTopCorner.Location = new System.Drawing.Point(0, 0); + this.leftTopCorner.Name = "leftTopCorner"; + this.leftTopCorner.Size = new System.Drawing.Size(7, 30); + this.leftTopCorner.TabIndex = 8; + // + // bottomSide + // + this.bottomSide.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.bottomSide.Cursor = System.Windows.Forms.Cursors.SizeNS; + this.bottomSide.Dock = System.Windows.Forms.DockStyle.Bottom; + this.bottomSide.Location = new System.Drawing.Point(4, 257); + this.bottomSide.Name = "bottomSide"; + this.bottomSide.Size = new System.Drawing.Size(276, 4); + this.bottomSide.TabIndex = 3; + // + // titleBar + // + this.titleBar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.titleBar.Controls.Add(this.programIcon); + this.titleBar.Controls.Add(this.btnMax); + this.titleBar.Controls.Add(this.btnMin); + this.titleBar.Controls.Add(this.Title); + this.titleBar.Controls.Add(this.btnClose); + this.titleBar.Dock = System.Windows.Forms.DockStyle.Top; + this.titleBar.ForeColor = System.Drawing.SystemColors.ControlText; + this.titleBar.Location = new System.Drawing.Point(4, 0); + this.titleBar.Name = "titleBar"; + this.titleBar.Size = new System.Drawing.Size(276, 30); + this.titleBar.TabIndex = 0; + this.titleBar.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Programtopbar_drag); + // + // programIcon + // + this.programIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.programIcon.ErrorImage = null; + this.programIcon.InitialImage = null; + this.programIcon.Location = new System.Drawing.Point(6, 7); + this.programIcon.Name = "programIcon"; + this.programIcon.Size = new System.Drawing.Size(16, 16); + this.programIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.programIcon.TabIndex = 7; + this.programIcon.TabStop = false; + // + // btnMax + // + this.btnMax.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.btnMax.BackColor = System.Drawing.Color.Black; + this.btnMax.Location = new System.Drawing.Point(230, 4); + this.btnMax.Name = "btnMax"; + this.btnMax.Size = new System.Drawing.Size(21, 21); + this.btnMax.TabIndex = 6; + this.btnMax.TabStop = false; + this.btnMax.MouseDown += new System.Windows.Forms.MouseEventHandler(this.maximizebutton_MouseDown); + this.btnMax.MouseEnter += new System.EventHandler(this.maximizebutton_MouseEnter); + this.btnMax.MouseLeave += new System.EventHandler(this.maximizebutton_MouseLeave); + this.btnMax.MouseUp += new System.Windows.Forms.MouseEventHandler(this.maximizebutton_MouseUp); + // + // btnMin + // + this.btnMin.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.btnMin.BackColor = System.Drawing.Color.Black; + this.btnMin.Location = new System.Drawing.Point(207, 4); + this.btnMin.Name = "btnMin"; + this.btnMin.Size = new System.Drawing.Size(21, 21); + this.btnMin.TabIndex = 5; + this.btnMin.TabStop = false; + this.btnMin.MouseDown += new System.Windows.Forms.MouseEventHandler(this.minimizebutton_MouseDown); + this.btnMin.MouseEnter += new System.EventHandler(this.minimizebutton_MouseEnter); + this.btnMin.MouseLeave += new System.EventHandler(this.minimizebutton_MouseLeave); + this.btnMin.MouseUp += new System.Windows.Forms.MouseEventHandler(this.minimizebutton_MouseUp); + // + // Title + // + this.Title.AutoSize = true; + this.Title.BackColor = System.Drawing.Color.Transparent; + this.Title.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Title.ForeColor = System.Drawing.Color.White; + this.Title.Location = new System.Drawing.Point(25, 8); + this.Title.Name = "Title"; + this.Title.Size = new System.Drawing.Size(98, 13); + this.Title.TabIndex = 3; + this.Title.Text = "Application Title"; + this.Title.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Programtopbar_drag); + // + // btnClose + // + this.btnClose.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.btnClose.BackColor = System.Drawing.Color.Black; + this.btnClose.Location = new System.Drawing.Point(253, 4); + this.btnClose.Name = "btnClose"; + this.btnClose.Size = new System.Drawing.Size(21, 21); + this.btnClose.TabIndex = 4; + this.btnClose.TabStop = false; + this.btnClose.Click += new System.EventHandler(this.closebutton_Click); + this.btnClose.MouseDown += new System.Windows.Forms.MouseEventHandler(this.closebutton_MouseDown); + this.btnClose.MouseEnter += new System.EventHandler(this.closebutton_MouseEnter); + this.btnClose.MouseLeave += new System.EventHandler(this.closebutton_MouseLeave); + this.btnClose.MouseUp += new System.Windows.Forms.MouseEventHandler(this.closebutton_MouseUp); + // + // rightSide + // + this.rightSide.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.rightSide.Cursor = System.Windows.Forms.Cursors.SizeWE; + this.rightSide.Dock = System.Windows.Forms.DockStyle.Right; + this.rightSide.Location = new System.Drawing.Point(280, 0); + this.rightSide.Name = "rightSide"; + this.rightSide.Size = new System.Drawing.Size(4, 261); + this.rightSide.TabIndex = 2; + // + // leftSide + // + this.leftSide.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.leftSide.Dock = System.Windows.Forms.DockStyle.Left; + this.leftSide.Location = new System.Drawing.Point(0, 0); + this.leftSide.Name = "leftSide"; + this.leftSide.Size = new System.Drawing.Size(4, 261); + this.leftSide.TabIndex = 1; + // + // ShiftWindow + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 261); + this.Controls.Add(this.program); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "ShiftWindow"; + this.Text = "c"; + this.program.ResumeLayout(false); + this.titleBar.ResumeLayout(false); + this.titleBar.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.programIcon)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.btnMax)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.btnMin)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.btnClose)).EndInit(); + this.ResumeLayout(false); } @@ -267,17 +251,17 @@ public System.Windows.Forms.PictureBox programIcon; public System.Windows.Forms.Panel programContent; public System.Windows.Forms.Panel program; - public System.Windows.Forms.Panel bottomleftcorner; - public System.Windows.Forms.Panel toprightcorner; - public System.Windows.Forms.Panel bottomrightcorner; - public System.Windows.Forms.Panel topleftcorner; - public System.Windows.Forms.Panel bottom; - public System.Windows.Forms.Panel top; - public System.Windows.Forms.PictureBox maximizebutton; - public System.Windows.Forms.PictureBox minimizebutton; + public System.Windows.Forms.Panel leftBottomCorner; + public System.Windows.Forms.Panel rightTopCorner; + public System.Windows.Forms.Panel rightBottomCorner; + public System.Windows.Forms.Panel leftTopCorner; + public System.Windows.Forms.Panel bottomSide; + public System.Windows.Forms.Panel titleBar; + public System.Windows.Forms.PictureBox btnMax; + public System.Windows.Forms.PictureBox btnMin; public System.Windows.Forms.Label Title; - public System.Windows.Forms.PictureBox closebutton; - public System.Windows.Forms.Panel right; - public System.Windows.Forms.Panel left; + public System.Windows.Forms.PictureBox btnClose; + public System.Windows.Forms.Panel rightSide; + public System.Windows.Forms.Panel leftSide; } } diff --git a/ShiftOS.Engine/WindowManager/ShiftWindow.cs b/ShiftOS.Engine/WindowManager/ShiftWindow.cs index a41786a..c091d40 100644 --- a/ShiftOS.Engine/WindowManager/ShiftWindow.cs +++ b/ShiftOS.Engine/WindowManager/ShiftWindow.cs @@ -50,40 +50,40 @@ namespace ShiftOS.Engine.WindowManager => this.Close(); private void closebutton_MouseEnter(object sender, EventArgs e) - => closebutton.BackColor = Color.Gray; + => btnClose.BackColor = Color.Gray; private void closebutton_MouseLeave(object sender, EventArgs e) - => closebutton.BackColor = Color.Black; + => btnClose.BackColor = Color.Black; private void maximizebutton_MouseEnter(object sender, EventArgs e) - => maximizebutton.BackColor = Color.Gray; + => btnMax.BackColor = Color.Gray; private void maximizebutton_MouseLeave(object sender, EventArgs e) - => maximizebutton.BackColor = Color.Black; + => btnMax.BackColor = Color.Black; private void minimizebutton_MouseEnter(object sender, EventArgs e) - => minimizebutton.BackColor = Color.Gray; + => btnMin.BackColor = Color.Gray; private void minimizebutton_MouseLeave(object sender, EventArgs e) - => minimizebutton.BackColor = Color.Black; + => btnMin.BackColor = Color.Black; private void closebutton_MouseDown(object sender, MouseEventArgs e) - => closebutton.BackColor = Color.Black; + => btnClose.BackColor = Color.Black; private void maximizebutton_MouseDown(object sender, MouseEventArgs e) - => maximizebutton.BackColor = Color.Black; + => btnMax.BackColor = Color.Black; private void minimizebutton_MouseDown(object sender, MouseEventArgs e) - => minimizebutton.BackColor = Color.Black; + => btnMin.BackColor = Color.Black; private void minimizebutton_MouseUp(object sender, MouseEventArgs e) - => minimizebutton.BackColor = Color.Gray; + => btnMin.BackColor = Color.Gray; private void maximizebutton_MouseUp(object sender, MouseEventArgs e) - => maximizebutton.BackColor = Color.Gray; + => btnMax.BackColor = Color.Gray; private void closebutton_MouseUp(object sender, MouseEventArgs e) - => closebutton.BackColor = Color.Gray; + => btnClose.BackColor = Color.Gray; } public interface IShiftWindowExtensions diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs index 7659601..177942d 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs @@ -9,7 +9,6 @@ namespace ShiftOS.Main.ShiftOS.Apps public partial class Shifter : UserControl { public int colorType; //This is a check to see what option was chosen. - ShiftSkinData skinConfig = new ShiftSkinData(); public Shifter() { InitializeComponent(); @@ -23,27 +22,43 @@ namespace ShiftOS.Main.ShiftOS.Apps private void setDefaultSkin(object sender, EventArgs e) { - skinConfig.setBorderColor(Color.FromArgb(64, 64, 64)); - skinConfig.btnCloseColor = Color.Black; - skinConfig.btnMaxColor = Color.Black; - skinConfig.btnMinColor = Color.Black; + setBorderColor(Color.FromArgb(64, 64, 64)); + ShiftSkinData.btnCloseColor = Color.Black; + ShiftSkinData.btnMaxColor = Color.Black; + ShiftSkinData.btnMinColor = Color.Black; + button5_Click(sender, e); } private void setColorSkin(object sender, EventArgs e) { - skinConfig.setBorderColor(Color.Blue); - skinConfig.btnCloseColor = Color.Red; - skinConfig.btnMaxColor = Color.Yellow; - skinConfig.btnMinColor = Color.Green; + setBorderColor(Color.Blue); + ShiftSkinData.btnCloseColor = Color.Red; + ShiftSkinData.btnMaxColor = Color.Yellow; + ShiftSkinData.btnMinColor = Color.Green; + button5_Click(sender, e); } private void setRandomSkin(object sender, EventArgs e) { Random rnd = new Random(); - skinConfig.setBorderColor(Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255))); - skinConfig.btnCloseColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); - skinConfig.btnMaxColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); - skinConfig.btnMinColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + setBorderColor(Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255))); + ShiftSkinData.btnCloseColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + ShiftSkinData.btnMaxColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + ShiftSkinData.btnMinColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + button5_Click(sender, e); + } + + // SetBorderColor + public void setBorderColor(Color borderColor) + { + ShiftSkinData.leftTopCornerColor = borderColor; + ShiftSkinData.titleBarColor = borderColor; + ShiftSkinData.rightTopCornerColor = borderColor; + ShiftSkinData.leftSideColor = borderColor; + ShiftSkinData.rightSideColor = borderColor; + ShiftSkinData.leftBottomCornerColor = borderColor; + ShiftSkinData.bottomSideColor = borderColor; + ShiftSkinData.rightBottomCornerColor = borderColor; } private void button5_Click(object sender, EventArgs e) @@ -51,17 +66,18 @@ namespace ShiftOS.Main.ShiftOS.Apps foreach (var window in ShiftWM.Windows) { - window.Invoke(new Action(() => window.top.BackColor = skinConfig.titleBarColor)); - window.Invoke(new Action(() => window.topleftcorner.BackColor = skinConfig.leftTopCornerColor)); - window.Invoke(new Action(() => window.toprightcorner.BackColor = skinConfig.rightTopCornerColor)); - window.Invoke(new Action(() => window.left.BackColor = skinConfig.leftSideColor)); - window.Invoke(new Action(() => window.right.BackColor = skinConfig.rightSideColor)); - window.Invoke(new Action(() => window.bottomleftcorner.BackColor = skinConfig.leftBottomCornerColor)); - window.Invoke(new Action(() => window.bottom.BackColor = skinConfig.bottomSideColor)); - window.Invoke(new Action(() => window.bottomrightcorner.BackColor = skinConfig.rightBottomCornerColor)); - window.Invoke(new Action(() => window.closebutton.BackColor = skinConfig.btnCloseColor)); - window.Invoke(new Action(() => window.maximizebutton.BackColor = skinConfig.btnMaxColor)); - window.Invoke(new Action(() => window.minimizebutton.BackColor = skinConfig.btnMinColor)); + window.Invoke(new Action(() => window.titleBar.BackColor = ShiftSkinData.titleBarColor)); + window.Invoke(new Action(() => window.leftTopCorner.BackColor = ShiftSkinData.leftTopCornerColor)); + window.Invoke(new Action(() => window.rightTopCorner.BackColor = ShiftSkinData.rightTopCornerColor)); + window.Invoke(new Action(() => window.leftSide.BackColor = ShiftSkinData.leftSideColor)); + window.Invoke(new Action(() => window.rightSide.BackColor = ShiftSkinData.rightSideColor)); + window.Invoke(new Action(() => window.leftBottomCorner.BackColor = ShiftSkinData.leftBottomCornerColor)); + window.Invoke(new Action(() => window.bottomSide.BackColor = ShiftSkinData.bottomSideColor)); + window.Invoke(new Action(() => window.rightBottomCorner.BackColor = ShiftSkinData.rightBottomCornerColor)); + window.Invoke(new Action(() => window.btnClose.BackColor = ShiftSkinData.btnCloseColor)); + window.Invoke(new Action(() => window.btnMax.BackColor = ShiftSkinData.btnMaxColor)); + window.Invoke(new Action(() => window.btnMin.BackColor = ShiftSkinData.btnMinColor)); + } } } -- cgit v1.2.3