From c81573594f509177214bbc9b64427c8aabdc30a6 Mon Sep 17 00:00:00 2001 From: AShifter Date: Sat, 25 Nov 2017 08:59:48 -0700 Subject: Add SaveSystem, FullScreen Terminal and stuff Git had a horrible seizure and removed our repo but Alex-TIMEHACK helped us get it back. --- .../WindowManager/InfoboxTemplate.Designer.cs | 90 ++++++++++++---------- ShiftOS.Engine/WindowManager/InfoboxTemplate.cs | 39 ++++++---- ShiftOS.Engine/WindowManager/ShiftSkinData.cs | 47 +++++++---- ShiftOS.Engine/WindowManager/ShiftWM.cs | 54 ++++++------- ShiftOS.Engine/WindowManager/ShiftWindow.cs | 12 +-- 5 files changed, 135 insertions(+), 107 deletions(-) (limited to 'ShiftOS.Engine/WindowManager') diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs index 58c191e..3279179 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs @@ -29,42 +29,14 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.btnOpt1 = new System.Windows.Forms.Button(); - this.btnOpt2 = new System.Windows.Forms.Button(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.changeSize = new System.Windows.Forms.Timer(this.components); - this.label1 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.TextBox(); + this.btnOpt2 = new ShiftOS.Engine.UI.ShiftButton(); + this.btnOpt1 = new ShiftOS.Engine.UI.ShiftButton(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // - // btnOpt1 - // - this.btnOpt1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.btnOpt1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnOpt1.Font = new System.Drawing.Font("Lucida Console", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnOpt1.Location = new System.Drawing.Point(73, 170); - this.btnOpt1.Name = "btnOpt1"; - this.btnOpt1.Size = new System.Drawing.Size(117, 23); - this.btnOpt1.TabIndex = 0; - this.btnOpt1.Text = "button1"; - this.btnOpt1.UseVisualStyleBackColor = true; - this.btnOpt1.Click += new System.EventHandler(this.btnOpt1_Click); - // - // btnOpt2 - // - this.btnOpt2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.btnOpt2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnOpt2.Font = new System.Drawing.Font("Lucida Console", 9F); - this.btnOpt2.Location = new System.Drawing.Point(243, 170); - this.btnOpt2.Name = "btnOpt2"; - this.btnOpt2.Size = new System.Drawing.Size(117, 23); - this.btnOpt2.TabIndex = 1; - this.btnOpt2.Text = "button2"; - this.btnOpt2.UseVisualStyleBackColor = true; - this.btnOpt2.Click += new System.EventHandler(this.btnOpt2_Click); - // // pictureBox1 // this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -83,22 +55,57 @@ // // label1 // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Lucida Console", 9.25F); - this.label1.Location = new System.Drawing.Point(107, 48); + this.label1.BackColor = System.Drawing.Color.White; + this.label1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.label1.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.label1.Location = new System.Drawing.Point(90, 35); + this.label1.Multiline = true; this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(55, 13); - this.label1.TabIndex = 3; - this.label1.Text = "label1"; + this.label1.Size = new System.Drawing.Size(256, 125); + this.label1.TabIndex = 6; + // + // btnOpt2 + // + this.btnOpt2.BackColor = System.Drawing.SystemColors.Control; + this.btnOpt2.FlatAppearance.BorderColor = System.Drawing.Color.Black; + this.btnOpt2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnOpt2.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnOpt2.ForeColor = System.Drawing.Color.Black; + this.btnOpt2.Location = new System.Drawing.Point(229, 163); + this.btnOpt2.Margin = new System.Windows.Forms.Padding(0); + this.btnOpt2.MinimumSize = new System.Drawing.Size(75, 23); + this.btnOpt2.Name = "btnOpt2"; + this.btnOpt2.Padding = new System.Windows.Forms.Padding(3); + this.btnOpt2.Size = new System.Drawing.Size(117, 31); + this.btnOpt2.TabIndex = 5; + this.btnOpt2.Text = "shiftButton2"; + this.btnOpt2.UseVisualStyleBackColor = false; + // + // btnOpt1 + // + this.btnOpt1.BackColor = System.Drawing.SystemColors.Control; + this.btnOpt1.FlatAppearance.BorderColor = System.Drawing.Color.Black; + this.btnOpt1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnOpt1.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnOpt1.ForeColor = System.Drawing.Color.Black; + this.btnOpt1.Location = new System.Drawing.Point(90, 163); + this.btnOpt1.Margin = new System.Windows.Forms.Padding(0); + this.btnOpt1.MinimumSize = new System.Drawing.Size(75, 23); + this.btnOpt1.Name = "btnOpt1"; + this.btnOpt1.Padding = new System.Windows.Forms.Padding(3); + this.btnOpt1.Size = new System.Drawing.Size(117, 31); + this.btnOpt1.TabIndex = 4; + this.btnOpt1.Text = "shiftButton1"; + this.btnOpt1.UseVisualStyleBackColor = false; // // InfoboxTemplate // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.label1); - this.Controls.Add(this.pictureBox1); this.Controls.Add(this.btnOpt2); this.Controls.Add(this.btnOpt1); + this.Controls.Add(this.pictureBox1); this.Name = "InfoboxTemplate"; this.Size = new System.Drawing.Size(438, 210); this.Load += new System.EventHandler(this.InfoboxTemplate_Load); @@ -109,11 +116,10 @@ } #endregion - - public System.Windows.Forms.Button btnOpt1; - public System.Windows.Forms.Button btnOpt2; public System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Timer changeSize; - public System.Windows.Forms.Label label1; + private UI.ShiftButton btnOpt1; + private UI.ShiftButton btnOpt2; + public System.Windows.Forms.TextBox label1; } } diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs index 5d55cf2..72bb530 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs @@ -23,32 +23,25 @@ namespace ShiftOS.Engine.WindowManager Cancel, Ok } - - int _buttonChoice; - int _buttonSelected; Stream _str; public InfoboxTemplate(ButtonType type) { InitializeComponent(); - switch (type) { case ButtonType.Ok: btnOpt1.Text = "OK"; btnOpt2.Hide(); - btnOpt1.Location = new Point(109, 134); - _buttonChoice = 1; + btnOpt1.Location = new Point(156, 163); break; case ButtonType.OkCancel: btnOpt1.Text = "OK"; btnOpt2.Text = "Cancel"; - _buttonChoice = 2; break; case ButtonType.YesNo: btnOpt1.Text = "Yes"; btnOpt2.Text = "No"; - _buttonChoice = 3; break; } } @@ -58,11 +51,12 @@ namespace ShiftOS.Engine.WindowManager switch (btnOpt1.Text) { case "OK": - ParentForm?.Close(); + btnOpt1.DialogResult = System.Windows.Forms.DialogResult.OK; + ParentForm?.Close(); break; case "Yes": - _buttonSelected = 2; - ParentForm?.Close(); + btnOpt1.DialogResult = System.Windows.Forms.DialogResult.Yes; + ParentForm?.Close(); break; } } @@ -72,11 +66,12 @@ namespace ShiftOS.Engine.WindowManager switch (btnOpt2.Text) { case "No": - _buttonSelected = 3; - break; + btnOpt2.DialogResult = System.Windows.Forms.DialogResult.No; + ParentForm?.Close(); + break; case "Cancel": - _buttonSelected = 4; - break; + btnOpt2.DialogResult = System.Windows.Forms.DialogResult.Cancel; + break; } } @@ -89,6 +84,16 @@ namespace ShiftOS.Engine.WindowManager } void InfoboxTemplate_Load(object sender, EventArgs e) - => Play(); - } + { + Play(); + SizeAndLoad(label1.Size.Width, label1.Size.Width); + } + private Size SizeAndLoad(int x, int y) + { + this.Size = new Size(x, y); + Left = (Screen.PrimaryScreen.Bounds.Width - Width) / 2; + Top = (Screen.PrimaryScreen.Bounds.Top - Height) / 2; + return Size; + } + } } \ No newline at end of file diff --git a/ShiftOS.Engine/WindowManager/ShiftSkinData.cs b/ShiftOS.Engine/WindowManager/ShiftSkinData.cs index 165f5bb..cfaf4be 100644 --- a/ShiftOS.Engine/WindowManager/ShiftSkinData.cs +++ b/ShiftOS.Engine/WindowManager/ShiftSkinData.cs @@ -5,19 +5,36 @@ namespace ShiftOS.Engine.WindowManager public abstract class ShiftSkinData { // ColorData - 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 BtnCloseHoverColor = Color.Empty; - public static Color BtnMaxHoverColor = Color.Empty; - public static Color BtnMinHoverColor = 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; - } + public static skinColors Colors = new skinColors(); + public static skinTextures Images = new skinTextures(); + } + + public class skinTextures + { + public skinTextures() + { + + } + } +} + +namespace ShiftOS.Engine.WindowManager +{ + public class skinColors + { + public Color LeftTopCornerColor; + public Color TitleBarColor; + public Color RightTopCornerColor; + public Color BtnCloseColor; + public Color BtnMaxColor; + public Color BtnMinColor; + public Color BtnCloseHoverColor; + public Color BtnMaxHoverColor; + public Color BtnMinHoverColor; + public Color LeftSideColor; + public Color RightSideColor; + public Color LeftBottomCornerColor; + public Color BottomSideColor; + public Color RightBottomCornerColor; + } } \ No newline at end of file diff --git a/ShiftOS.Engine/WindowManager/ShiftWM.cs b/ShiftOS.Engine/WindowManager/ShiftWM.cs index 4b57961..a910c0c 100644 --- a/ShiftOS.Engine/WindowManager/ShiftWM.cs +++ b/ShiftOS.Engine/WindowManager/ShiftWM.cs @@ -43,36 +43,36 @@ namespace ShiftOS.Engine.WindowManager 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) + if (ShiftSkinData.Colors.TitleBarColor == Color.Empty) { - var borderColor = Color.FromArgb(64, 64, 64); - ShiftSkinData.BtnCloseColor = Color.Black; - ShiftSkinData.BtnCloseHoverColor = Color.FromArgb(40, 40, 40); - ShiftSkinData.BtnMaxColor = Color.Black; - ShiftSkinData.BtnMaxHoverColor = Color.FromArgb(40, 40, 40); - ShiftSkinData.BtnMinColor = Color.Black; - ShiftSkinData.BtnMinHoverColor = Color.FromArgb(40, 40, 40); - ShiftSkinData.LeftTopCornerColor = borderColor; - ShiftSkinData.TitleBarColor = borderColor; - ShiftSkinData.RightTopCornerColor = borderColor; - ShiftSkinData.LeftSideColor = borderColor; - ShiftSkinData.RightSideColor = borderColor; - ShiftSkinData.LeftBottomCornerColor = borderColor; - ShiftSkinData.BottomSideColor = borderColor; - ShiftSkinData.RightBottomCornerColor = borderColor; + Color borderColor = Color.FromArgb(64, 64, 64); + ShiftSkinData.Colors.BtnCloseColor = Color.Black; + ShiftSkinData.Colors.BtnCloseHoverColor = Color.FromArgb(40, 40, 40); + ShiftSkinData.Colors.BtnMaxColor = Color.Black; + ShiftSkinData.Colors.BtnMaxHoverColor = Color.FromArgb(40, 40, 40); + ShiftSkinData.Colors.BtnMinColor = Color.Black; + ShiftSkinData.Colors.BtnMinHoverColor = Color.FromArgb(40, 40, 40); + ShiftSkinData.Colors.LeftTopCornerColor = borderColor; + ShiftSkinData.Colors.TitleBarColor = borderColor; + ShiftSkinData.Colors.RightTopCornerColor = borderColor; + ShiftSkinData.Colors.LeftSideColor = borderColor; + ShiftSkinData.Colors.RightSideColor = borderColor; + ShiftSkinData.Colors.LeftBottomCornerColor = borderColor; + ShiftSkinData.Colors.BottomSideColor = borderColor; + ShiftSkinData.Colors.RightBottomCornerColor = borderColor; } - 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; + app.btnClose.BackColor = ShiftSkinData.Colors.BtnCloseColor; + app.btnMax.BackColor = ShiftSkinData.Colors.BtnMaxColor; + app.btnMin.BackColor = ShiftSkinData.Colors.BtnMinColor; + app.leftTopCorner.BackColor = ShiftSkinData.Colors.LeftTopCornerColor; + app.titleBar.BackColor = ShiftSkinData.Colors.TitleBarColor; + app.rightTopCorner.BackColor = ShiftSkinData.Colors.RightTopCornerColor; + app.leftSide.BackColor = ShiftSkinData.Colors.LeftSideColor; + app.rightSide.BackColor = ShiftSkinData.Colors.RightSideColor; + app.leftBottomCorner.BackColor = ShiftSkinData.Colors.LeftBottomCornerColor; + app.bottomSide.BackColor = ShiftSkinData.Colors.BottomSideColor; + app.rightBottomCorner.BackColor = ShiftSkinData.Colors.RightBottomCornerColor; // Icon Setup diff --git a/ShiftOS.Engine/WindowManager/ShiftWindow.cs b/ShiftOS.Engine/WindowManager/ShiftWindow.cs index e407e33..95ae4a9 100644 --- a/ShiftOS.Engine/WindowManager/ShiftWindow.cs +++ b/ShiftOS.Engine/WindowManager/ShiftWindow.cs @@ -52,23 +52,23 @@ namespace ShiftOS.Engine.WindowManager => Close(); void closebutton_MouseEnter(object sender, EventArgs e) - => btnClose.BackColor = ShiftSkinData.BtnCloseHoverColor; + => btnClose.BackColor = ShiftSkinData.Colors.BtnCloseHoverColor; void closebutton_MouseLeave(object sender, EventArgs e) - => btnClose.BackColor = ShiftSkinData.BtnCloseColor; + => btnClose.BackColor = ShiftSkinData.Colors.BtnCloseColor; void maximizebutton_MouseEnter(object sender, EventArgs e) - => btnMax.BackColor = ShiftSkinData.BtnMaxHoverColor; + => btnMax.BackColor = ShiftSkinData.Colors.BtnMaxHoverColor; void maximizebutton_MouseLeave(object sender, EventArgs e) - => btnMax.BackColor = ShiftSkinData.BtnMaxColor; + => btnMax.BackColor = ShiftSkinData.Colors.BtnMaxColor; void minimizebutton_MouseEnter(object sender, EventArgs e) - => btnMin.BackColor = ShiftSkinData.BtnMinHoverColor; + => btnMin.BackColor = ShiftSkinData.Colors.BtnMinHoverColor; void minimizebutton_MouseLeave(object sender, EventArgs e) - => btnMin.BackColor = ShiftSkinData.BtnMinColor; + => btnMin.BackColor = ShiftSkinData.Colors.BtnMinColor; /* private void closebutton_MouseDown(object sender, MouseEventArgs e) -- cgit v1.2.3