From d94c79dbf5183230e5fd3342848408f776de60ea Mon Sep 17 00:00:00 2001 From: Richie Moch Date: Sat, 22 Dec 2018 15:24:55 -0600 Subject: Various changes, began working on the texture skinning. --- ShiftOS.Engine/UI/ShiftStripRenderer.cs | 19 +- .../WindowManager/InfoboxTemplate.Designer.cs | 46 ++-- ShiftOS.Engine/WindowManager/InfoboxTemplate.cs | 24 +- ShiftOS.Engine/WindowManager/ShiftSkinData.cs | 18 +- ShiftOS.Main/MainGame/Apps/FileSkimmer.Designer.cs | 260 +++++++++++++++++++ ShiftOS.Main/MainGame/Apps/FileSkimmer.cs | 106 ++++++++ ShiftOS.Main/MainGame/Apps/FileSkimmer.resx | 163 ++++++++++++ ShiftOS.Main/MainGame/Apps/ShiftDemo.Designer.cs | 74 ++++++ ShiftOS.Main/MainGame/Apps/ShiftDemo.cs | 18 ++ ShiftOS.Main/MainGame/Apps/ShiftDemo.resx | 120 +++++++++ .../Apps/ShifterStuff/SelectColor.Designer.cs | 150 +++++++++++ .../MainGame/Apps/ShifterStuff/SelectColor.cs | 63 +++++ .../MainGame/Apps/ShifterStuff/SelectColor.resx | 120 +++++++++ .../MainGame/Apps/ShifterStuff/Shifter.Designer.cs | 281 +++++++++++++++++++++ ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.cs | 227 +++++++++++++++++ .../MainGame/Apps/ShifterStuff/Shifter.resx | 120 +++++++++ ShiftOS.Main/MainGame/Apps/Terminal.Designer.cs | 66 +++++ ShiftOS.Main/MainGame/Apps/Terminal.cs | 172 +++++++++++++ ShiftOS.Main/MainGame/Apps/Terminal.resx | 120 +++++++++ ShiftOS.Main/MainGame/Apps/TestForm.Designer.cs | 132 ++++++++++ ShiftOS.Main/MainGame/Apps/TestForm.cs | 27 ++ ShiftOS.Main/MainGame/Apps/TestForm.resx | 123 +++++++++ ShiftOS.Main/MainGame/Apps/TextPad.Designer.cs | 215 ++++++++++++++++ ShiftOS.Main/MainGame/Apps/TextPad.cs | 40 +++ ShiftOS.Main/MainGame/Apps/TextPad.resx | 129 ++++++++++ ShiftOS.Main/MainGame/Desktop.Designer.cs | 186 ++++++++++++++ ShiftOS.Main/MainGame/Desktop.cs | 72 ++++++ ShiftOS.Main/MainGame/Desktop.resx | 126 +++++++++ ShiftOS.Main/ShiftOS.Main.csproj | 38 +-- ShiftOS.Main/ShiftOS/Apps/FileSkimmer.Designer.cs | 260 ------------------- ShiftOS.Main/ShiftOS/Apps/FileSkimmer.cs | 106 -------- ShiftOS.Main/ShiftOS/Apps/FileSkimmer.resx | 163 ------------ ShiftOS.Main/ShiftOS/Apps/ShiftDemo.Designer.cs | 74 ------ ShiftOS.Main/ShiftOS/Apps/ShiftDemo.cs | 18 -- ShiftOS.Main/ShiftOS/Apps/ShiftDemo.resx | 120 --------- .../Apps/ShifterStuff/SelectColor.Designer.cs | 150 ----------- .../ShiftOS/Apps/ShifterStuff/SelectColor.cs | 63 ----- .../ShiftOS/Apps/ShifterStuff/SelectColor.resx | 120 --------- .../ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs | 257 ------------------- ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs | 174 ------------- .../ShiftOS/Apps/ShifterStuff/Shifter.resx | 120 --------- ShiftOS.Main/ShiftOS/Apps/Terminal.Designer.cs | 66 ----- ShiftOS.Main/ShiftOS/Apps/Terminal.cs | 172 ------------- ShiftOS.Main/ShiftOS/Apps/Terminal.resx | 120 --------- ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs | 132 ---------- ShiftOS.Main/ShiftOS/Apps/TestForm.cs | 27 -- ShiftOS.Main/ShiftOS/Apps/TestForm.resx | 123 --------- ShiftOS.Main/ShiftOS/Apps/TextPad.Designer.cs | 215 ---------------- ShiftOS.Main/ShiftOS/Apps/TextPad.cs | 40 --- ShiftOS.Main/ShiftOS/Apps/TextPad.resx | 129 ---------- ShiftOS.Main/ShiftOS/Desktop.Designer.cs | 185 -------------- ShiftOS.Main/ShiftOS/Desktop.cs | 67 ----- ShiftOS.Main/ShiftOS/Desktop.resx | 126 --------- 53 files changed, 3189 insertions(+), 3093 deletions(-) create mode 100644 ShiftOS.Main/MainGame/Apps/FileSkimmer.Designer.cs create mode 100644 ShiftOS.Main/MainGame/Apps/FileSkimmer.cs create mode 100644 ShiftOS.Main/MainGame/Apps/FileSkimmer.resx create mode 100644 ShiftOS.Main/MainGame/Apps/ShiftDemo.Designer.cs create mode 100644 ShiftOS.Main/MainGame/Apps/ShiftDemo.cs create mode 100644 ShiftOS.Main/MainGame/Apps/ShiftDemo.resx create mode 100644 ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.Designer.cs create mode 100644 ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.cs create mode 100644 ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.resx create mode 100644 ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.Designer.cs create mode 100644 ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.cs create mode 100644 ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.resx create mode 100644 ShiftOS.Main/MainGame/Apps/Terminal.Designer.cs create mode 100644 ShiftOS.Main/MainGame/Apps/Terminal.cs create mode 100644 ShiftOS.Main/MainGame/Apps/Terminal.resx create mode 100644 ShiftOS.Main/MainGame/Apps/TestForm.Designer.cs create mode 100644 ShiftOS.Main/MainGame/Apps/TestForm.cs create mode 100644 ShiftOS.Main/MainGame/Apps/TestForm.resx create mode 100644 ShiftOS.Main/MainGame/Apps/TextPad.Designer.cs create mode 100644 ShiftOS.Main/MainGame/Apps/TextPad.cs create mode 100644 ShiftOS.Main/MainGame/Apps/TextPad.resx create mode 100644 ShiftOS.Main/MainGame/Desktop.Designer.cs create mode 100644 ShiftOS.Main/MainGame/Desktop.cs create mode 100644 ShiftOS.Main/MainGame/Desktop.resx delete mode 100644 ShiftOS.Main/ShiftOS/Apps/FileSkimmer.Designer.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/FileSkimmer.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/FileSkimmer.resx delete mode 100644 ShiftOS.Main/ShiftOS/Apps/ShiftDemo.Designer.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/ShiftDemo.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/ShiftDemo.resx delete mode 100644 ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.Designer.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.resx delete mode 100644 ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.resx delete mode 100644 ShiftOS.Main/ShiftOS/Apps/Terminal.Designer.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/Terminal.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/Terminal.resx delete mode 100644 ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/TestForm.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/TestForm.resx delete mode 100644 ShiftOS.Main/ShiftOS/Apps/TextPad.Designer.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/TextPad.cs delete mode 100644 ShiftOS.Main/ShiftOS/Apps/TextPad.resx delete mode 100644 ShiftOS.Main/ShiftOS/Desktop.Designer.cs delete mode 100644 ShiftOS.Main/ShiftOS/Desktop.cs delete mode 100644 ShiftOS.Main/ShiftOS/Desktop.resx diff --git a/ShiftOS.Engine/UI/ShiftStripRenderer.cs b/ShiftOS.Engine/UI/ShiftStripRenderer.cs index 7b8498f..fe64ff9 100644 --- a/ShiftOS.Engine/UI/ShiftStripRenderer.cs +++ b/ShiftOS.Engine/UI/ShiftStripRenderer.cs @@ -8,14 +8,23 @@ using System.Windows.Forms; namespace ShiftOS.Engine.UI { - public class ShiftStripRenderer : ToolStripProfessionalRenderer + public class ShiftStripRenderer : ToolStripRenderer { - protected override void OnRenderLabelBackground(ToolStripItemRenderEventArgs e) + SolidBrush sb; + + protected override void OnRenderButtonBackground(ToolStripItemRenderEventArgs e) { - using (var b = new SolidBrush(e.Item.BackColor)) + if (!e.Item.Selected) + { + base.OnRenderButtonBackground(e); + } + else { - e.Graphics.FillRectangle(b, new Rectangle(Point.Empty, e.Item.Size)); + sb = new SolidBrush(Color.FromArgb(64, 64, 64)); + Rectangle rectangle = new Rectangle(0, 0, e.Item.Size.Width - 1, e.Item.Size.Height - 1); + e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(64,64,64)), rectangle); + e.Graphics.DrawRectangle(new Pen(sb, 1F), rectangle); } } } -} +} \ No newline at end of file diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs index 3279179..82575d1 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs @@ -32,8 +32,8 @@ this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.changeSize = new System.Windows.Forms.Timer(this.components); this.label1 = new System.Windows.Forms.TextBox(); - this.btnOpt2 = new ShiftOS.Engine.UI.ShiftButton(); this.btnOpt1 = new ShiftOS.Engine.UI.ShiftButton(); + this.btnOpt2 = new ShiftOS.Engine.UI.ShiftButton(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // @@ -64,9 +64,26 @@ this.label1.Size = new System.Drawing.Size(256, 125); this.label1.TabIndex = 6; // + // btnOpt1 + // + this.btnOpt1.BackColor = System.Drawing.Color.White; + 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(105, 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(105, 26); + this.btnOpt1.TabIndex = 7; + this.btnOpt1.Text = "shiftButton1"; + this.btnOpt1.UseVisualStyleBackColor = false; + // // btnOpt2 // - this.btnOpt2.BackColor = System.Drawing.SystemColors.Control; + this.btnOpt2.BackColor = System.Drawing.Color.White; 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))); @@ -76,35 +93,18 @@ 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.Size = new System.Drawing.Size(105, 26); + this.btnOpt2.TabIndex = 8; 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.btnOpt2); this.Controls.Add(this.btnOpt1); + this.Controls.Add(this.label1); this.Controls.Add(this.pictureBox1); this.Name = "InfoboxTemplate"; this.Size = new System.Drawing.Size(438, 210); @@ -118,8 +118,8 @@ #endregion public System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Timer changeSize; + public System.Windows.Forms.TextBox 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 72bb530..54d2a0a 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs @@ -8,8 +8,10 @@ using ShiftOS.Engine.Properties; namespace ShiftOS.Engine.WindowManager { public partial class InfoboxTemplate : UserControl - { - public enum ButtonType + { + public bool isOK = false; + public bool isNo = false; + public enum ButtonType { YesNo, OkCancel, @@ -48,17 +50,9 @@ namespace ShiftOS.Engine.WindowManager void btnOpt1_Click(object sender, EventArgs e) { - switch (btnOpt1.Text) - { - case "OK": - btnOpt1.DialogResult = System.Windows.Forms.DialogResult.OK; - ParentForm?.Close(); - break; - case "Yes": - btnOpt1.DialogResult = System.Windows.Forms.DialogResult.Yes; - ParentForm?.Close(); - break; - } + isOK = true; + MessageBox.Show("button was clicked"); + ParentForm?.Close(); } void btnOpt2_Click(object sender, EventArgs e) @@ -66,11 +60,11 @@ namespace ShiftOS.Engine.WindowManager switch (btnOpt2.Text) { case "No": - btnOpt2.DialogResult = System.Windows.Forms.DialogResult.No; + isNo = true; ParentForm?.Close(); break; case "Cancel": - btnOpt2.DialogResult = System.Windows.Forms.DialogResult.Cancel; + isNo = true; break; } } diff --git a/ShiftOS.Engine/WindowManager/ShiftSkinData.cs b/ShiftOS.Engine/WindowManager/ShiftSkinData.cs index cfaf4be..0b00db0 100644 --- a/ShiftOS.Engine/WindowManager/ShiftSkinData.cs +++ b/ShiftOS.Engine/WindowManager/ShiftSkinData.cs @@ -11,10 +11,20 @@ namespace ShiftOS.Engine.WindowManager public class skinTextures { - public skinTextures() - { - - } + public Image LeftTopCornerImage; + public Image TitleBarImage; + public Image RightTopCornerImage; + public Image BtnCloseImage; + public Image BtnMaxImage; + public Image BtnMinImage; + public Image BtnCloseHoverImage; + public Image BtnMaxHoverImage; + public Image BtnMinHoverImage; + public Image LeftSideImage; + public Image RightSideImage; + public Image LeftBottomCornerImage; + public Image BottomSideImage; + public Image RightBottomCornerImage; } } diff --git a/ShiftOS.Main/MainGame/Apps/FileSkimmer.Designer.cs b/ShiftOS.Main/MainGame/Apps/FileSkimmer.Designer.cs new file mode 100644 index 0000000..5a23ec7 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/FileSkimmer.Designer.cs @@ -0,0 +1,260 @@ +using System.Windows.Forms; + +namespace ShiftOS.Main.ShiftOS.Apps +{ + partial class FileSkimmer + { + /// + /// 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.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FileSkimmer)); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.textFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.breadcrumbsBar = new System.Windows.Forms.ToolStrip(); + this.toolStrip2 = new System.Windows.Forms.ToolStrip(); + this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); + this.largeIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.smallIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.detailsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.listToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.listView1 = new System.Windows.Forms.ListView(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.renameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip1.SuspendLayout(); + this.toolStrip2.SuspendLayout(); + this.contextMenuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24); + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Padding = new System.Windows.Forms.Padding(4, 1, 0, 1); + this.menuStrip1.Size = new System.Drawing.Size(1027, 24); + this.menuStrip1.TabIndex = 1; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newFileToolStripMenuItem, + this.newFolderToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 22); + this.fileToolStripMenuItem.Text = "File"; + // + // newFileToolStripMenuItem + // + this.newFileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.textFileToolStripMenuItem}); + this.newFileToolStripMenuItem.Name = "newFileToolStripMenuItem"; + this.newFileToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.newFileToolStripMenuItem.Text = "New File"; + // + // textFileToolStripMenuItem + // + this.textFileToolStripMenuItem.Name = "textFileToolStripMenuItem"; + this.textFileToolStripMenuItem.Size = new System.Drawing.Size(114, 22); + this.textFileToolStripMenuItem.Text = "Text file"; + this.textFileToolStripMenuItem.Click += new System.EventHandler(this.textFileToolStripMenuItem_Click); + // + // newFolderToolStripMenuItem + // + this.newFolderToolStripMenuItem.Name = "newFolderToolStripMenuItem"; + this.newFolderToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.newFolderToolStripMenuItem.Text = "New Folder"; + // + // breadcrumbsBar + // + this.breadcrumbsBar.ImageScalingSize = new System.Drawing.Size(24, 24); + this.breadcrumbsBar.Location = new System.Drawing.Point(0, 24); + this.breadcrumbsBar.Name = "breadcrumbsBar"; + this.breadcrumbsBar.Size = new System.Drawing.Size(1027, 25); + this.breadcrumbsBar.TabIndex = 2; + this.breadcrumbsBar.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.breadcrumbsBar_ItemClicked); + // + // toolStrip2 + // + this.toolStrip2.ImageScalingSize = new System.Drawing.Size(24, 24); + this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripButton1, + this.toolStripDropDownButton1}); + this.toolStrip2.Location = new System.Drawing.Point(0, 49); + this.toolStrip2.Name = "toolStrip2"; + this.toolStrip2.Size = new System.Drawing.Size(1027, 25); + this.toolStrip2.TabIndex = 3; + this.toolStrip2.Text = "toolbar"; + // + // toolStripButton1 + // + this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image"))); + this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton1.Name = "toolStripButton1"; + this.toolStripButton1.Size = new System.Drawing.Size(23, 22); + this.toolStripButton1.Text = "^"; + this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click); + // + // toolStripDropDownButton1 + // + this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.largeIconsToolStripMenuItem, + this.smallIconsToolStripMenuItem, + this.detailsToolStripMenuItem, + this.listToolStripMenuItem, + this.tilesToolStripMenuItem}); + this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image"))); + this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; + this.toolStripDropDownButton1.Size = new System.Drawing.Size(79, 22); + this.toolStripDropDownButton1.Text = "View Mode"; + this.toolStripDropDownButton1.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolStripDropDownButton1_DropDownItemClicked); + // + // largeIconsToolStripMenuItem + // + this.largeIconsToolStripMenuItem.Name = "largeIconsToolStripMenuItem"; + this.largeIconsToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.largeIconsToolStripMenuItem.Text = "Large Icons"; + // + // smallIconsToolStripMenuItem + // + this.smallIconsToolStripMenuItem.Name = "smallIconsToolStripMenuItem"; + this.smallIconsToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.smallIconsToolStripMenuItem.Text = "Small Icons"; + // + // detailsToolStripMenuItem + // + this.detailsToolStripMenuItem.Name = "detailsToolStripMenuItem"; + this.detailsToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.detailsToolStripMenuItem.Text = "Details"; + // + // listToolStripMenuItem + // + this.listToolStripMenuItem.Name = "listToolStripMenuItem"; + this.listToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.listToolStripMenuItem.Text = "List"; + // + // tilesToolStripMenuItem + // + this.tilesToolStripMenuItem.Name = "tilesToolStripMenuItem"; + this.tilesToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.tilesToolStripMenuItem.Text = "Tiles"; + // + // listView1 + // + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.Location = new System.Drawing.Point(0, 74); + this.listView1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(1027, 437); + this.listView1.TabIndex = 4; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseClick); + this.listView1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseDoubleClick); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24); + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.openToolStripMenuItem, + this.renameToolStripMenuItem, + this.deleteToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(118, 70); + // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.Size = new System.Drawing.Size(117, 22); + this.openToolStripMenuItem.Text = "Open"; + // + // renameToolStripMenuItem + // + this.renameToolStripMenuItem.Name = "renameToolStripMenuItem"; + this.renameToolStripMenuItem.Size = new System.Drawing.Size(117, 22); + this.renameToolStripMenuItem.Text = "Rename"; + // + // deleteToolStripMenuItem + // + this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; + this.deleteToolStripMenuItem.Size = new System.Drawing.Size(117, 22); + this.deleteToolStripMenuItem.Text = "Delete"; + // + // FileSkimmer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView1); + this.Controls.Add(this.toolStrip2); + this.Controls.Add(this.breadcrumbsBar); + this.Controls.Add(this.menuStrip1); + this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.Name = "FileSkimmer"; + this.Size = new System.Drawing.Size(1027, 511); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.toolStrip2.ResumeLayout(false); + this.toolStrip2.PerformLayout(); + this.contextMenuStrip1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStrip breadcrumbsBar; + private System.Windows.Forms.ToolStrip toolStrip2; + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1; + private System.Windows.Forms.ToolStripMenuItem largeIconsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem smallIconsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem detailsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem listToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem tilesToolStripMenuItem; + private System.Windows.Forms.ToolStripButton toolStripButton1; + private ToolStripMenuItem fileToolStripMenuItem; + private ToolStripMenuItem newFileToolStripMenuItem; + private ToolStripMenuItem newFolderToolStripMenuItem; + private ToolStripMenuItem textFileToolStripMenuItem; + private ContextMenuStrip contextMenuStrip1; + private ToolStripMenuItem openToolStripMenuItem; + private ToolStripMenuItem renameToolStripMenuItem; + private ToolStripMenuItem deleteToolStripMenuItem; + } +} diff --git a/ShiftOS.Main/MainGame/Apps/FileSkimmer.cs b/ShiftOS.Main/MainGame/Apps/FileSkimmer.cs new file mode 100644 index 0000000..58cc126 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/FileSkimmer.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Windows.Forms; +using ShiftOS.Engine.Misc; +using ShiftOS.Engine.ShiftFS; +using ShiftOS.Engine.WindowManager; +using System.Linq; +using ShiftOS.Engine.UI; + +namespace ShiftOS.Main.ShiftOS.Apps +{ + public partial class FileSkimmer : UserControl, IShiftWindowExtensions + { + ShiftDirectory _currentDirectory; + + public FileSkimmer() + { + InitializeComponent(); + + } + + public void OnLoaded(ShiftWindow window) + { + Debug.WriteLine(ShiftFS.Drives.Count); + listView1.ShowDrivesList(window); + } + + void toolStripDropDownButton1_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + switch (e.ClickedItem.Text) + { + case "Small Icons": + listView1.View = View.SmallIcon; + break; + case "Details": + listView1.View = View.Details; + break; + case "List": + listView1.View = View.List; + break; + case "Tiles": + listView1.View = View.Tile; + break; + default: + listView1.View = View.LargeIcon; + break; + } + } + + void listView1_MouseDoubleClick(object sender, MouseEventArgs e) + { + var hit = listView1.HitTest(e.Location); + + if (!(hit.Item.Tag is ShiftDirectory dir)) return; + + listView1.Items.Clear(); + listView1.DisplayShiftFolder(dir); + _currentDirectory = dir; + breadcrumbsBar.Items.Add(new ToolStripButton(dir.Name) { Tag = dir }); + } + + void toolStripButton1_Click(object sender, EventArgs e) + { + listView1.Items.Clear(); + if (breadcrumbsBar.Items.Count > 1) + { + breadcrumbsBar.Items.Remove(breadcrumbsBar.Items.OfType().Last()); + var dir = breadcrumbsBar.Items.OfType().Last().Tag as ShiftDirectory; + _currentDirectory = dir; + listView1.DisplayShiftFolder(dir); + } + else + { + breadcrumbsBar.Items.Clear(); + listView1.ShowDrivesList(); + } + } + + void breadcrumbsBar_ItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + var items = new List(breadcrumbsBar.Items.OfType() + .Where((_, y) => y > breadcrumbsBar.Items.IndexOf(e.ClickedItem))); + + foreach (var item in items) + { + breadcrumbsBar.Items.Remove(item); + } + + toolStripButton1_Click(null, EventArgs.Empty); + } + + void textFileToolStripMenuItem_Click(object sender, EventArgs e) + { + _currentDirectory.Add(new ShiftFile("Text file")); + } + + void listView1_MouseClick(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Right) + { + contextMenuStrip1.Show(MousePosition); + } + } + } +} diff --git a/ShiftOS.Main/MainGame/Apps/FileSkimmer.resx b/ShiftOS.Main/MainGame/Apps/FileSkimmer.resx new file mode 100644 index 0000000..aeeea08 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/FileSkimmer.resx @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 175, 17 + + + 331, 17 + + + 473, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + + + 615, 17 + + \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Apps/ShiftDemo.Designer.cs b/ShiftOS.Main/MainGame/Apps/ShiftDemo.Designer.cs new file mode 100644 index 0000000..f8ee8e3 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/ShiftDemo.Designer.cs @@ -0,0 +1,74 @@ +namespace ShiftOS.Main.ShiftOS.Apps +{ + partial class ShiftDemo + { + /// + /// 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.label1 = new System.Windows.Forms.Label(); + this.icon = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.icon)).BeginInit(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(27, 25); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(51, 20); + this.label1.TabIndex = 0; + this.label1.Text = "label1"; + // + // icon + // + this.icon.Location = new System.Drawing.Point(31, 61); + this.icon.Name = "icon"; + this.icon.Size = new System.Drawing.Size(300, 300); + this.icon.TabIndex = 1; + this.icon.TabStop = false; + // + // ShiftDemo + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.icon); + this.Controls.Add(this.label1); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.Name = "ShiftDemo"; + this.Size = new System.Drawing.Size(450, 462); + ((System.ComponentModel.ISupportInitialize)(this.icon)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + public System.Windows.Forms.Label label1; + private System.Windows.Forms.PictureBox icon; + } +} diff --git a/ShiftOS.Main/MainGame/Apps/ShiftDemo.cs b/ShiftOS.Main/MainGame/Apps/ShiftDemo.cs new file mode 100644 index 0000000..ced10d2 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/ShiftDemo.cs @@ -0,0 +1,18 @@ +using System.Windows.Forms; +using ShiftOS.Engine.WindowManager; + +namespace ShiftOS.Main.ShiftOS.Apps +{ + public partial class ShiftDemo : UserControl, IShiftWindowExtensions + { + public ShiftDemo() + { + InitializeComponent(); + } + + public void OnLoaded(ShiftWindow window) + { + icon.Image = this.GetShiftWindow().Icon.ToBitmap(); + } + } +} \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Apps/ShiftDemo.resx b/ShiftOS.Main/MainGame/Apps/ShiftDemo.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/ShiftDemo.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/MainGame/Apps/ShifterStuff/SelectColor.Designer.cs b/ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.Designer.cs new file mode 100644 index 0000000..5e617cb --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.Designer.cs @@ -0,0 +1,150 @@ +namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff +{ + partial class SelectColor + { + /// + /// 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.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + 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 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(21, 34); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(39, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Red:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(21, 62); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(55, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Green:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(21, 92); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(47, 13); + this.label3.TabIndex = 2; + this.label3.Text = "Blue:"; + // + // btnSetColor + // + this.btnSetColor.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSetColor.Location = new System.Drawing.Point(75, 121); + this.btnSetColor.Name = "btnSetColor"; + this.btnSetColor.Size = new System.Drawing.Size(93, 23); + this.btnSetColor.TabIndex = 6; + this.btnSetColor.Text = "Set Color"; + 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.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); + this.Load += new System.EventHandler(this.SelectColor_Load); + ((System.ComponentModel.ISupportInitialize)(this.redUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.greenUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.blueUpDown)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + 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/MainGame/Apps/ShifterStuff/SelectColor.cs b/ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.cs new file mode 100644 index 0000000..3da3b98 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.cs @@ -0,0 +1,63 @@ +using System; +using System.Drawing; +using System.Globalization; +using System.Windows.Forms; +using ShiftOS.Engine.WindowManager; +using ShiftOS.Engine.UI; + +namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff +{ + public partial class SelectColor : UserControl + { + int _colorType1; + int _colorType2; + int _colorType3; + Color _finalColor; + + public SelectColor() + { + InitializeComponent(); + } + + Color SetColor() + { + _colorType1 = int.Parse(redUpDown.Value.ToString(CultureInfo.InvariantCulture)); + _colorType2 = int.Parse(greenUpDown.Value.ToString(CultureInfo.InvariantCulture)); + _colorType3 = int.Parse(blueUpDown.Value.ToString(CultureInfo.InvariantCulture)); + try + { + _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3); + + + foreach (var window in ShiftWM.Windows) + { + window.Invoke(new Action(() => window.titleBar.BackColor = _finalColor)); + } + + + ShiftWM.StartInfoboxSession( + "Success!", + $"Changed color to:\r\n{_colorType1}, {_colorType2}, {_colorType3}.", + InfoboxTemplate.ButtonType.Ok); + } + catch (Exception) + { + ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok); + } + return _finalColor; + } + + void btnSetColor_Click(object sender, EventArgs e) + { + SetColor(); + } + + private void SelectColor_Load(object sender, EventArgs e) + { + var s = new ShiftButton(); + s.Location = new System.Drawing.Point(211, 48); + s.Text = "test"; + Controls.Add(s); + } + } +} \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.resx b/ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.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/MainGame/Apps/ShifterStuff/Shifter.Designer.cs b/ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.Designer.cs new file mode 100644 index 0000000..fc0d417 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.Designer.cs @@ -0,0 +1,281 @@ +using ShiftOS.Engine.UI; +namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff +{ + partial class Shifter + { + /// + /// 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.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.shiftButton2 = new ShiftButton(); + this.button7 = new System.Windows.Forms.Button(); + this.shiftButton1 = new Engine.UI.ShiftButton(); + this.button6 = new System.Windows.Forms.Button(); + this.btnLoad = new System.Windows.Forms.Button(); + this.btnSave = new System.Windows.Forms.Button(); + 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.tabControl1.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // tabControl1 + // + this.tabControl1.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.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Controls.Add(this.tabPage2); + this.tabControl1.Location = new System.Drawing.Point(3, 3); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(334, 322); + this.tabControl1.TabIndex = 0; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.shiftButton2); + this.tabPage1.Controls.Add(this.button7); + this.tabPage1.Controls.Add(this.shiftButton1); + this.tabPage1.Controls.Add(this.button6); + this.tabPage1.Controls.Add(this.btnLoad); + this.tabPage1.Controls.Add(this.btnSave); + 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); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(326, 296); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "Titlebar"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // shiftButton2 + // + this.shiftButton2.BackColor = System.Drawing.Color.White; + this.shiftButton2.FlatAppearance.BorderColor = System.Drawing.Color.Black; + this.shiftButton2.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.shiftButton2.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.shiftButton2.ForeColor = System.Drawing.Color.Black; + this.shiftButton2.Location = new System.Drawing.Point(194, 77); + this.shiftButton2.Margin = new System.Windows.Forms.Padding(0); + this.shiftButton2.MinimumSize = new System.Drawing.Size(75, 23); + this.shiftButton2.Name = "shiftButton2"; + this.shiftButton2.Padding = new System.Windows.Forms.Padding(3); + this.shiftButton2.Size = new System.Drawing.Size(121, 27); + this.shiftButton2.TabIndex = 11; + this.shiftButton2.Text = "Test Textures"; + this.shiftButton2.UseVisualStyleBackColor = false; + this.shiftButton2.Click += new System.EventHandler(this.shiftButton2_Click); + // + // button7 + // + this.button7.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button7.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.button7.Location = new System.Drawing.Point(205, 51); + this.button7.Name = "button7"; + this.button7.Size = new System.Drawing.Size(100, 23); + this.button7.TabIndex = 10; + this.button7.Text = "NormalBtn"; + this.button7.UseVisualStyleBackColor = true; + this.button7.Click += new System.EventHandler(this.shiftButton2_Click); + // + // shiftButton1 + // + this.shiftButton1.BackColor = System.Drawing.Color.White; + this.shiftButton1.FlatAppearance.BorderColor = System.Drawing.Color.Gray; + this.shiftButton1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.shiftButton1.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.shiftButton1.ForeColor = System.Drawing.Color.Black; + this.shiftButton1.Location = new System.Drawing.Point(205, 25); + this.shiftButton1.Margin = new System.Windows.Forms.Padding(0); + this.shiftButton1.MinimumSize = new System.Drawing.Size(75, 23); + this.shiftButton1.Name = "shiftButton1"; + this.shiftButton1.Padding = new System.Windows.Forms.Padding(3); + this.shiftButton1.Size = new System.Drawing.Size(100, 23); + this.shiftButton1.TabIndex = 9; + this.shiftButton1.Text = "ShiftButton"; + this.shiftButton1.UseVisualStyleBackColor = false; + this.shiftButton1.Click += new System.EventHandler(this.shiftButton1_Click); + // + // button6 + // + this.button6.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button6.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.button6.Location = new System.Drawing.Point(6, 152); + this.button6.Name = "button6"; + this.button6.Size = new System.Drawing.Size(314, 23); + this.button6.TabIndex = 8; + this.button6.Text = "Set Midnight Skin"; + this.button6.UseVisualStyleBackColor = true; + this.button6.Click += new System.EventHandler(this.button6_Click); + // + // btnLoad + // + this.btnLoad.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnLoad.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.btnLoad.Location = new System.Drawing.Point(165, 267); + this.btnLoad.Name = "btnLoad"; + this.btnLoad.Size = new System.Drawing.Size(155, 23); + this.btnLoad.TabIndex = 7; + this.btnLoad.Text = "Load Skin"; + this.btnLoad.UseVisualStyleBackColor = true; + this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click); + // + // btnSave + // + this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSave.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.btnSave.Location = new System.Drawing.Point(6, 267); + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(155, 23); + this.btnSave.TabIndex = 6; + this.btnSave.Text = "Save Skin"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); + // + // 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, 239); + 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; + // + // 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, 181); + 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, 210); + 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(165, 210); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(155, 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); + this.groupBox1.Location = new System.Drawing.Point(6, 6); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(161, 108); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "groupBox1"; + // + // button1 + // + this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button1.Font = new System.Drawing.Font("Lucida Console", 8.25F); + this.button1.Location = new System.Drawing.Point(6, 19); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(149, 23); + this.button1.TabIndex = 1; + this.button1.Text = "Set Titlebar Color"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // tabPage2 + // + this.tabPage2.Location = new System.Drawing.Point(4, 22); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(326, 296); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "tabPage2"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // Shifter + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.tabControl1); + this.Name = "Shifter"; + this.Size = new System.Drawing.Size(340, 325); + this.tabControl1.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tabPage1; + 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; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.Button button5; + private System.Windows.Forms.Button btnSave; + private System.Windows.Forms.Button btnLoad; + private System.Windows.Forms.Button button6; + private System.Windows.Forms.Button button7; + private Engine.UI.ShiftButton shiftButton1; + private Engine.UI.ShiftButton shiftButton2; + } +} diff --git a/ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.cs b/ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.cs new file mode 100644 index 0000000..529e603 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.cs @@ -0,0 +1,227 @@ +using System; +using System.Drawing; +using System.IO; +using System.Windows.Forms; +using ShiftOS.Engine.Misc; +using ShiftOS.Engine.WindowManager; +using ShiftOS.Main.Properties; +using Whoa; + +namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff +{ + public partial class Shifter : UserControl + { + public static readonly ImageConverter imageConverter = new ImageConverter(); + public int ColorType; //This is a check to see what option was chosen. + public Shifter() + { + InitializeComponent(); + } + + void button1_Click(object sender, EventArgs e) + { + ColorType = 1; + ShiftWM.Init(new SelectColor(), "Select a color", Resources.iconColourPicker_fw); + } + + /// + /// Modifies the values in ShiftShiftSkinData.Colors. + /// + /// The border color of the window. + /// The close button color of the window. + /// The close button color of the window while hovering. + /// The maximize button color of the window. + /// The maximize button color of the window while hovering. + /// The minimize button color of the window. + /// The minimize button color of the window while hovering. + void ModifyData(Color borderColor, Color btnClose, Color btnCloseHover, Color btnMax, Color btnMaxHover, Color btnMin, Color btnMinHover) + { + SetBorderColor(borderColor); + ShiftSkinData.Colors.BtnCloseColor = btnClose; + ShiftSkinData.Colors.BtnCloseHoverColor = btnCloseHover; + ShiftSkinData.Colors.BtnMaxColor = btnMax; + ShiftSkinData.Colors.BtnMaxHoverColor = btnMaxHover; + ShiftSkinData.Colors.BtnMinColor = btnMin; + ShiftSkinData.Colors.BtnMinHoverColor = btnMinHover; + } + + // SetBorderColor + public void SetBorderColor(Color borderColor) + { + 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; + } + + void SetDefaultSkin(object sender, EventArgs e) + { + ModifyData(Color.FromArgb(64, 64, 64), Color.Black, Color.FromArgb(40, 40, 40), Color.Black, Color.FromArgb(40, 40, 40), Color.Black, Color.FromArgb(40, 40, 40)); + ApplySkin(); + } + + void SetColorSkin(object sender, EventArgs e) + { + ModifyData(Color.Blue, Color.Red, Color.FromArgb(255, 102, 102), Color.Yellow, Color.FromArgb(255, 255, 153), Color.Green, Color.FromArgb(102, 255, 102)); + ApplySkin(); + } + + void SetRandomSkin(object sender, EventArgs e) + { + var rnd = new Random(); + ModifyData( + Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)), // Border Color + Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)), // Close Button Color + Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)), // Close Hover Color + Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)), // Maximize Button Color + Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)), // Maximize Hover Color + Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)), // Minimize Button Color + Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255))); // Minimize Hover Color + ApplySkin(); + } + + void ApplySkin() + { + foreach (var window in ShiftWM.Windows) + { + window.Invoke(new Action(() => window.titleBar.BackColor = ShiftSkinData.Colors.TitleBarColor)); + window.Invoke(new Action(() => window.leftTopCorner.BackColor = ShiftSkinData.Colors.LeftTopCornerColor)); + window.Invoke(new Action(() => window.rightTopCorner.BackColor = ShiftSkinData.Colors.RightTopCornerColor)); + window.Invoke(new Action(() => window.leftSide.BackColor = ShiftSkinData.Colors.LeftSideColor)); + window.Invoke(new Action(() => window.rightSide.BackColor = ShiftSkinData.Colors.RightSideColor)); + window.Invoke(new Action(() => window.leftBottomCorner.BackColor = ShiftSkinData.Colors.LeftBottomCornerColor)); + window.Invoke(new Action(() => window.bottomSide.BackColor = ShiftSkinData.Colors.BottomSideColor)); + window.Invoke(new Action(() => window.rightBottomCorner.BackColor = ShiftSkinData.Colors.RightBottomCornerColor)); + window.Invoke(new Action(() => window.btnClose.BackColor = ShiftSkinData.Colors.BtnCloseColor)); + window.Invoke(new Action(() => window.btnMax.BackColor = ShiftSkinData.Colors.BtnMaxColor)); + window.Invoke(new Action(() => window.btnMin.BackColor = ShiftSkinData.Colors.BtnMinColor)); + } + } + void ApplyTexturedSkin() //not implemented + { + throw new NotImplementedException("Not implemented."); + + /*foreach (var window in ShiftWM.Windows) + { + window.Invoke(new Action(() => window.titleBar.Height = ShiftSkinData.Images.TitleBarImage.Height)); + window.Invoke(new Action(() => window.leftTopCorner.Width = ShiftSkinData.Images.LeftTopCornerImage.Width)); + window.Invoke(new Action(() => window.rightTopCorner.Width = ShiftSkinData.Images.RightTopCornerImage.Width)); + window.Invoke(new Action(() => window.leftSide.Width = ShiftSkinData.Images.LeftSideImage.Width)); + window.Invoke(new Action(() => window.rightSide.Width = ShiftSkinData.Images.RightSideImage.Width)); + window.Invoke(new Action(() => window.leftBottomCorner.Width = ShiftSkinData.Images.LeftBottomCornerImage.Width)); + window.Invoke(new Action(() => window.bottomSide.Width = ShiftSkinData.Images.BottomSideImage.Width)); + window.Invoke(new Action(() => window.rightBottomCorner.Width = ShiftSkinData.Images.RightBottomCornerImage.Width)); + window.Invoke(new Action(() => window.btnClose.Width = ShiftSkinData.Images.BtnCloseImage.Width)); + window.Invoke(new Action(() => window.btnMax.Width = ShiftSkinData.Images.BtnMaxImage.Width)); + window.Invoke(new Action(() => window.btnMin.Width = ShiftSkinData.Images.BtnMinImage.Width)); + window.Invoke(new Action(() => window.titleBar.BackgroundImage = ShiftSkinData.Images.TitleBarImage)); + window.Invoke(new Action(() => window.leftTopCorner.BackgroundImage = ShiftSkinData.Images.LeftTopCornerImage)); + window.Invoke(new Action(() => window.rightTopCorner.BackgroundImage = ShiftSkinData.Images.RightTopCornerImage)); + window.Invoke(new Action(() => window.leftSide.BackgroundImage = ShiftSkinData.Images.LeftSideImage)); + window.Invoke(new Action(() => window.rightSide.BackgroundImage = ShiftSkinData.Images.RightSideImage)); + window.Invoke(new Action(() => window.leftBottomCorner.BackgroundImage = ShiftSkinData.Images.LeftBottomCornerImage)); + window.Invoke(new Action(() => window.bottomSide.BackgroundImage = ShiftSkinData.Images.BottomSideImage)); + window.Invoke(new Action(() => window.rightBottomCorner.BackgroundImage = ShiftSkinData.Images.RightBottomCornerImage)); + window.Invoke(new Action(() => window.btnClose.BackgroundImage = ShiftSkinData.Images.BtnCloseImage)); + window.Invoke(new Action(() => window.btnMax.BackgroundImage = ShiftSkinData.Images.BtnMaxImage)); + window.Invoke(new Action(() => window.btnMin.BackgroundImage = ShiftSkinData.Images.BtnMinImage)); + }*/ + } + + void btnSave_Click(object sender, EventArgs e) + { + Color[] shiftSkinColors = new Color[14]; + + shiftSkinColors[0] = ShiftSkinData.Colors.LeftTopCornerColor; + shiftSkinColors[1] = ShiftSkinData.Colors.TitleBarColor; + shiftSkinColors[2] = ShiftSkinData.Colors.RightTopCornerColor; + shiftSkinColors[3] = ShiftSkinData.Colors.LeftSideColor; + shiftSkinColors[4] = ShiftSkinData.Colors.RightSideColor; + shiftSkinColors[5] = ShiftSkinData.Colors.LeftBottomCornerColor; + shiftSkinColors[6] = ShiftSkinData.Colors.BottomSideColor; + shiftSkinColors[7] = ShiftSkinData.Colors.RightBottomCornerColor; + shiftSkinColors[8] = ShiftSkinData.Colors.BtnCloseColor; + shiftSkinColors[9] = ShiftSkinData.Colors.BtnCloseHoverColor; + shiftSkinColors[10] = ShiftSkinData.Colors.BtnMaxColor; + shiftSkinColors[11] = ShiftSkinData.Colors.BtnMaxHoverColor; + shiftSkinColors[12] = ShiftSkinData.Colors.BtnMinColor; + shiftSkinColors[13] = ShiftSkinData.Colors.BtnMinHoverColor; + + using (var fobj = File.OpenWrite(@"C:\Users\Public\Documents\Skin.whoa")) + Whoa.Whoa.SerialiseObject(fobj, shiftSkinColors); + + InfoboxTemplate shiftWindow = ShiftWM.StartInfoboxSession( + "Saved Skin", + "Saved Skin to C:\\Users\\Public\\Documents\\Skin.whoa", + InfoboxTemplate.ButtonType.Ok); + + } + + private void btnLoad_Click(object sender, EventArgs e) + { + Color[] shiftSkinColors = new Color[14]; + using (var fobj = File.OpenRead(@"C:\Users\Public\Documents\Skin.whoa")) + shiftSkinColors = Whoa.Whoa.DeserialiseObject(fobj); + + ShiftSkinData.Colors.LeftTopCornerColor = shiftSkinColors[0]; + ShiftSkinData.Colors.TitleBarColor = shiftSkinColors[1]; + ShiftSkinData.Colors.RightTopCornerColor = shiftSkinColors[2]; + ShiftSkinData.Colors.LeftSideColor = shiftSkinColors[3]; + ShiftSkinData.Colors.RightSideColor = shiftSkinColors[4]; + ShiftSkinData.Colors.LeftBottomCornerColor = shiftSkinColors[5]; + ShiftSkinData.Colors.BottomSideColor = shiftSkinColors[6]; + ShiftSkinData.Colors.RightBottomCornerColor = shiftSkinColors[7]; + ShiftSkinData.Colors.BtnCloseColor = shiftSkinColors[8]; + ShiftSkinData.Colors.BtnCloseHoverColor = shiftSkinColors[9]; + ShiftSkinData.Colors.BtnMaxColor = shiftSkinColors[10]; + ShiftSkinData.Colors.BtnMaxHoverColor = shiftSkinColors[11]; + ShiftSkinData.Colors.BtnMinColor = shiftSkinColors[12]; + ShiftSkinData.Colors.BtnMinHoverColor = shiftSkinColors[13]; + + ApplySkin(); + ShiftWM.StartInfoboxSession( + "Loaded Skin", + "Loaded Skin from C:\\Users\\Public\\Documents\\Skin.whoa", + InfoboxTemplate.ButtonType.Ok); + } + + private void button6_Click(object sender, EventArgs e) + { + ModifyData( + Color.FromArgb(15, 29, 45), + Color.FromArgb(15, 29, 78), + Color.FromArgb(15, 29, 100), + Color.FromArgb(15, 29, 130), + Color.FromArgb(15, 29, 108), + Color.FromArgb(15, 29, 130), + Color.FromArgb(15, 29, 160)); + ApplySkin(); + } + + private void shiftButton1_Click(object sender, EventArgs e) + { + MessageBox.Show("This was clicked."); + } + + private void shiftButton2_Click(object sender, EventArgs e) + { + + } + public static Bitmap LoadImage(byte[] byteArray) + { + var bm = (Bitmap)imageConverter.ConvertFrom(byteArray); + + if (bm != null && (bm.HorizontalResolution != (int)bm.HorizontalResolution || + bm.VerticalResolution != (int)bm.VerticalResolution)) + { + bm.SetResolution((int)(bm.HorizontalResolution + 0.5f), + (int)(bm.VerticalResolution + 0.5f)); + } + return bm; + } + } +} \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.resx b/ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.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/MainGame/Apps/Terminal.Designer.cs b/ShiftOS.Main/MainGame/Apps/Terminal.Designer.cs new file mode 100644 index 0000000..a746456 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/Terminal.Designer.cs @@ -0,0 +1,66 @@ +namespace ShiftOS.Main.ShiftOS.Apps +{ + partial class Terminal + { + /// + /// 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.termmain = new System.Windows.Forms.RichTextBox(); + this.SuspendLayout(); + // + // termmain + // + this.termmain.BackColor = System.Drawing.Color.Black; + this.termmain.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.termmain.Dock = System.Windows.Forms.DockStyle.Fill; + this.termmain.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.termmain.ForeColor = System.Drawing.Color.White; + this.termmain.Location = new System.Drawing.Point(0, 0); + this.termmain.Name = "termmain"; + this.termmain.Size = new System.Drawing.Size(476, 394); + this.termmain.TabIndex = 0; + this.termmain.Text = ""; + this.termmain.SelectionChanged += new System.EventHandler(this.termmain_SelectionChanged); + this.termmain.TextChanged += new System.EventHandler(this.termmain_TextChanged); + this.termmain.KeyDown += new System.Windows.Forms.KeyEventHandler(this.termmain_KeyDown); + // + // Terminal + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.termmain); + this.Name = "Terminal"; + this.Size = new System.Drawing.Size(476, 394); + this.Load += new System.EventHandler(this.Terminal_Load); + this.ResumeLayout(false); + + } + + #endregion + + public System.Windows.Forms.RichTextBox termmain; + } +} diff --git a/ShiftOS.Main/MainGame/Apps/Terminal.cs b/ShiftOS.Main/MainGame/Apps/Terminal.cs new file mode 100644 index 0000000..f0efec0 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/Terminal.cs @@ -0,0 +1,172 @@ +using System; +using System.Windows.Forms; +using ShiftOS.Engine; +using ShiftOS.Main.Terminal; +using System.Linq; +using System.Collections.Generic; +using System.Drawing.Text; +using System.IO; +using ShiftOS.Main.Properties; +using Whoa; + +namespace ShiftOS.Main.ShiftOS.Apps +{ + public partial class Terminal : UserControl + { + public int TerminalID = TerminalBackend.trmTopID++; // Used so that we can have multiple instances of the terminal whilst the command begin run knowing what terminal to send the text to - very complicated ;) + public string defaulttextBefore = "user> "; + public string defaulttextResult = "[user@shiftos ~]$ "; // NOT YET IMPLEMENTED!!! + public bool DoClear = false; + public bool RunningCommand = false; + public bool WaitingResponse = false; + public string InputReturnText = ""; + public Stack c = TerminalBackend.commandBuffer; + private PrivateFontCollection fontCollection = new PrivateFontCollection(); + + + // The below variables makes the terminal... a terminal! + string OldText = ""; + + int TrackingPosition; + + public Terminal() + { + InitializeComponent(); + + termmain.ContextMenuStrip = new ContextMenuStrip(); // Disables the right click of a richtextbox! + + TerminalBackend.trm.Add(this); + + + Setup(); + } + + void Print() + { + termmain.AppendText($"\n {defaulttextResult}"); + TrackingPosition = termmain.Text.Length; + } + + void Print(string text) + { + termmain.AppendText($"\n {text} \n {defaulttextResult}"); + TrackingPosition = termmain.Text.Length; + } + + //if (e.Control && e.KeyCode == Keys.V) + // { + // //if (Clipboard.ContainsText()) + // // termmain.Paste(DataFormats.GetFormat(DataFormats.Text)); + // e.Handled = true; + // } else if (e.KeyCode == Keys.Enter) { + // RunningCommand = true; + // TerminalBackend.RunCommand(termmain.Text.Substring(TrackingPosition, termmain.Text.Length - TrackingPosition), TerminalID); // The most horrific line in the entire application! + // RunningCommand = false; + // termmain.AppendText($"\n {defaulttextResult}"); + // TrackingPosition = termmain.Text.Length; + // e.Handled = true; + // } + //} + + private void termmain_TextChanged(object sender, EventArgs e) + { + if (!RunningCommand) + { + if (termmain.SelectionStart < TrackingPosition) + { + if (!DoClear) // If it's not clearing the terminal + { + termmain.Text = OldText; + termmain.Select(termmain.Text.Length, 0); + } + } + else + { + OldText = termmain.Text; + } + } + } + + private void termmain_SelectionChanged(object sender, EventArgs e) + { + if (!RunningCommand) + { + if (termmain.SelectionStart < TrackingPosition) + { + termmain.Text = OldText; + termmain.Select(termmain.Text.Length, 0); + } + } + } + + private void Terminal_Load(object sender, EventArgs e) + { + termmain.Text = $"\n {defaulttextResult}"; + TrackingPosition = termmain.Text.Length; + termmain.Select(termmain.TextLength, 1); + } + + public void Input(string request) + { + InputReturnText = ""; + RunningCommand = false; + + termmain.AppendText($"\n {request} "); + TrackingPosition = termmain.Text.Length; + } + + public void Clear() + { + DoClear = true; + OldText = ""; + termmain.Text = ""; + TrackingPosition = termmain.Text.Length; + DoClear = false; + } + + void termmain_KeyDown(object sender, KeyEventArgs e) + { + // The below code disables the ability to paste anything other then text... + + if (e.Control && e.KeyCode == Keys.V) + { + //if (Clipboard.ContainsText()) + // termmain.Paste(DataFormats.GetFormat(DataFormats.Text)); + e.Handled = true; + } + else if (e.KeyCode == Keys.Enter) + { + TerminalBackend.RunCommand(termmain.Text.Substring(TrackingPosition, termmain.Text.Length - TrackingPosition), TerminalID); // The most horrific line in the entire application! + Print(); + e.Handled = true; + } + else if (e.KeyCode == Keys.Up) + { + if (c.Count == 0) return; + termmain.AppendText(c.Pop()); + } + } + public void Setup() + { + if (!Directory.Exists(SaveSystem.gameDir)) Directory.CreateDirectory(SaveSystem.gameDir); + if (!Directory.Exists(SaveSystem.fontDir)) Directory.CreateDirectory(SaveSystem.fontDir); + if (!Directory.Exists(SaveSystem.dataDir)) Directory.CreateDirectory(SaveSystem.dataDir); + if (!File.Exists(SaveSystem.fontDir + "\\termFont.ttf")) File.WriteAllBytes(SaveSystem.fontDir + "\\termFont.ttf", Resources.UbuntuMono_R); + if (!File.Exists(SaveSystem.dataDir + "\\userCodePoints.whoa")) + { + using (var fobj = File.OpenWrite(SaveSystem.dataDir + "\\userCodePoints.whoa")) + { + Whoa.Whoa.SerialiseObject(fobj, SaveSystem.User.codePoints); + } + } + if (!Directory.Exists(SaveSystem.baseGameDir)) Directory.CreateDirectory(SaveSystem.baseGameDir); + if (!Directory.Exists(SaveSystem.desktopDir)) Directory.CreateDirectory(SaveSystem.desktopDir); + if (!Directory.Exists(SaveSystem.docDir)) Directory.CreateDirectory(SaveSystem.docDir); + if (!Directory.Exists(SaveSystem.downloadsDir)) Directory.CreateDirectory(SaveSystem.downloadsDir); + if (!Directory.Exists(SaveSystem.musicDir)) Directory.CreateDirectory(SaveSystem.musicDir); + if (!Directory.Exists(SaveSystem.picDir)) Directory.CreateDirectory(SaveSystem.picDir); + fontCollection.AddFontFile(SaveSystem.fontDir + "\\termFont.ttf"); + termmain.Font = new System.Drawing.Font(fontCollection.Families[0], 12F, System.Drawing.FontStyle.Regular); + } + } +} \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Apps/Terminal.resx b/ShiftOS.Main/MainGame/Apps/Terminal.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/Terminal.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/MainGame/Apps/TestForm.Designer.cs b/ShiftOS.Main/MainGame/Apps/TestForm.Designer.cs new file mode 100644 index 0000000..b49924e --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/TestForm.Designer.cs @@ -0,0 +1,132 @@ +namespace ShiftOS.Main.ShiftOS.Apps +{ + partial class TestForm + { + /// + /// 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 Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + 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[] { + "Application", + "Asterisk", + "Error", + "Exclamation", + "Hand", + "Information", + "Question", + "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(); + + } + + #endregion + + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.ComboBox comboBox1; + private System.Windows.Forms.BindingSource systemIconsBindingSource; + } +} \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Apps/TestForm.cs b/ShiftOS.Main/MainGame/Apps/TestForm.cs new file mode 100644 index 0000000..a0c12c0 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/TestForm.cs @@ -0,0 +1,27 @@ +using System; +using System.Windows.Forms; +using ShiftOS.Engine.Misc; +using ShiftOS.Engine.WindowManager; +using ShiftOS.Main.Properties; +using ShiftOS.Main.ShiftOS.Apps.ShifterStuff; + +namespace ShiftOS.Main.ShiftOS.Apps +{ + public partial class TestForm : Form + { + public TestForm() + { + InitializeComponent(); + } + + void Button1_Click(object sender, EventArgs e) + { + var demo = new ShiftDemo(); + ShiftWM.Init(demo, textBox1.Text, null); + ShiftWM.StartInfoboxSession(textBox1.Text, textBox2.Text, InfoboxTemplate.ButtonType.Ok); + } + + void button2_Click(object sender, EventArgs e) + => ShiftWM.Init(new Shifter(), "Shifter", Resources.iconShifter); + } +} \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Apps/TestForm.resx b/ShiftOS.Main/MainGame/Apps/TestForm.resx new file mode 100644 index 0000000..6dba9d3 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/TestForm.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Apps/TextPad.Designer.cs b/ShiftOS.Main/MainGame/Apps/TextPad.Designer.cs new file mode 100644 index 0000000..7d83c68 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/TextPad.Designer.cs @@ -0,0 +1,215 @@ +namespace ShiftOS.Main.ShiftOS.Apps +{ + partial class TextPad + { + /// + /// 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.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.fontToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.wordWrapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.insertToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.timeAndDateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.textBox = new System.Windows.Forms.RichTextBox(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + this.menuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.editToolStripMenuItem, + this.insertToolStripMenuItem, + this.helpToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(315, 24); + this.menuStrip1.TabIndex = 0; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newToolStripMenuItem, + this.openToolStripMenuItem, + this.saveToolStripMenuItem, + this.saveAsToolStripMenuItem, + this.toolStripMenuItem1, + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "File"; + // + // newToolStripMenuItem + // + this.newToolStripMenuItem.Name = "newToolStripMenuItem"; + this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.newToolStripMenuItem.Text = "New..."; + this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); + // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.openToolStripMenuItem.Text = "Open..."; + this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + // + // saveToolStripMenuItem + // + this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; + this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.saveToolStripMenuItem.Text = "Save..."; + // + // saveAsToolStripMenuItem + // + this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.saveAsToolStripMenuItem.Text = "Save As..."; + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(149, 6); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.exitToolStripMenuItem.Text = "Exit"; + // + // editToolStripMenuItem + // + this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fontToolStripMenuItem, + this.wordWrapToolStripMenuItem}); + this.editToolStripMenuItem.Name = "editToolStripMenuItem"; + this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); + this.editToolStripMenuItem.Text = "Edit"; + // + // fontToolStripMenuItem + // + this.fontToolStripMenuItem.Name = "fontToolStripMenuItem"; + this.fontToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.fontToolStripMenuItem.Text = "Font"; + // + // wordWrapToolStripMenuItem + // + this.wordWrapToolStripMenuItem.Checked = true; + this.wordWrapToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.wordWrapToolStripMenuItem.Name = "wordWrapToolStripMenuItem"; + this.wordWrapToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.wordWrapToolStripMenuItem.Text = "Word Wrap"; + // + // insertToolStripMenuItem + // + this.insertToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.timeAndDateToolStripMenuItem}); + this.insertToolStripMenuItem.Name = "insertToolStripMenuItem"; + this.insertToolStripMenuItem.Size = new System.Drawing.Size(48, 20); + this.insertToolStripMenuItem.Text = "Insert"; + // + // timeAndDateToolStripMenuItem + // + this.timeAndDateToolStripMenuItem.Name = "timeAndDateToolStripMenuItem"; + this.timeAndDateToolStripMenuItem.Size = new System.Drawing.Size(160, 22); + this.timeAndDateToolStripMenuItem.Text = "Time and Date..."; + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.aboutToolStripMenuItem}); + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.helpToolStripMenuItem.Text = "Help"; + // + // aboutToolStripMenuItem + // + this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.aboutToolStripMenuItem.Text = "About..."; + // + // textBox + // + this.textBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBox.Location = new System.Drawing.Point(0, 24); + this.textBox.Name = "textBox"; + this.textBox.Size = new System.Drawing.Size(315, 265); + this.textBox.TabIndex = 1; + this.textBox.Text = ""; + // + // openFileDialog1 + // + this.openFileDialog1.FileName = "openFileDialog1"; + // + // TextPad + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.textBox); + this.Controls.Add(this.menuStrip1); + this.Name = "TextPad"; + this.Size = new System.Drawing.Size(315, 289); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem fontToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem wordWrapToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem insertToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem timeAndDateToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; + private System.Windows.Forms.RichTextBox textBox; + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.SaveFileDialog saveFileDialog1; + } +} diff --git a/ShiftOS.Main/MainGame/Apps/TextPad.cs b/ShiftOS.Main/MainGame/Apps/TextPad.cs new file mode 100644 index 0000000..66863cf --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/TextPad.cs @@ -0,0 +1,40 @@ +using ShiftOS.Engine.ShiftFS.FileGUI; +using ShiftOS.Engine.WindowManager; +using System; +using System.IO; +using System.Windows.Forms; + +namespace ShiftOS.Main.ShiftOS.Apps +{ + public partial class TextPad : UserControl + { + readonly string _editedText; + + public TextPad() + { + InitializeComponent(); + _editedText = textBox.Text; + } + + bool IsEdited() => _editedText != textBox.Text; + + void openToolStripMenuItem_Click(object sender, EventArgs e) + { + if (openFileDialog1.ShowDialog() != DialogResult.OK) return; + + var sr = new StreamReader(openFileDialog1.FileName); + textBox.Text = sr.ReadToEnd(); + sr.Close(); + } + + void newToolStripMenuItem_Click(object sender, EventArgs e) + { + if (IsEdited()) + { + MessageBox.Show("yay it works"); + } + var f = new FileOpener(); + ShiftWM.Init(f, "testing", null); + } + } +} \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Apps/TextPad.resx b/ShiftOS.Main/MainGame/Apps/TextPad.resx new file mode 100644 index 0000000..53f75e1 --- /dev/null +++ b/ShiftOS.Main/MainGame/Apps/TextPad.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 153, 17 + + + 268, 17 + + + 17, 17 + + \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Desktop.Designer.cs b/ShiftOS.Main/MainGame/Desktop.Designer.cs new file mode 100644 index 0000000..5378aac --- /dev/null +++ b/ShiftOS.Main/MainGame/Desktop.Designer.cs @@ -0,0 +1,186 @@ +namespace ShiftOS.Main.ShiftOS +{ + partial class Desktop + { + /// + /// 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 Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.taskbar = new System.Windows.Forms.Panel(); + this.clockPanel = new System.Windows.Forms.Panel(); + this.lblClock = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.applicationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.shifterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.terminalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.textPadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.fileSkimmerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.taskbar.SuspendLayout(); + this.clockPanel.SuspendLayout(); + this.panel2.SuspendLayout(); + this.menuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // taskbar + // + this.taskbar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.taskbar.Controls.Add(this.clockPanel); + this.taskbar.Controls.Add(this.panel2); + this.taskbar.Dock = System.Windows.Forms.DockStyle.Top; + this.taskbar.Location = new System.Drawing.Point(0, 0); + this.taskbar.Name = "taskbar"; + this.taskbar.Size = new System.Drawing.Size(640, 24); + this.taskbar.TabIndex = 0; + // + // clockPanel + // + this.clockPanel.Controls.Add(this.lblClock); + this.clockPanel.Dock = System.Windows.Forms.DockStyle.Right; + this.clockPanel.Location = new System.Drawing.Point(574, 0); + this.clockPanel.Name = "clockPanel"; + this.clockPanel.Size = new System.Drawing.Size(66, 24); + this.clockPanel.TabIndex = 1; + // + // lblClock + // + this.lblClock.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.lblClock.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblClock.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblClock.ForeColor = System.Drawing.Color.White; + this.lblClock.Location = new System.Drawing.Point(0, 0); + this.lblClock.Name = "lblClock"; + this.lblClock.Size = new System.Drawing.Size(66, 24); + this.lblClock.TabIndex = 1; + this.lblClock.Text = "00:00:00"; + this.lblClock.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // panel2 + // + this.panel2.Controls.Add(this.menuStrip1); + this.panel2.Dock = System.Windows.Forms.DockStyle.Left; + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(102, 24); + this.panel2.TabIndex = 0; + // + // menuStrip1 + // + this.menuStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.menuStrip1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.menuStrip1.Dock = System.Windows.Forms.DockStyle.None; + this.menuStrip1.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.applicationsToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(231, 24); + this.menuStrip1.TabIndex = 2; + this.menuStrip1.Text = "Applications"; + this.menuStrip1.MenuActivate += new System.EventHandler(this.menuStrip1_MenuActivate); + // + // applicationsToolStripMenuItem + // + this.applicationsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.shifterToolStripMenuItem, + this.terminalToolStripMenuItem, + this.textPadToolStripMenuItem, + this.fileSkimmerToolStripMenuItem}); + this.applicationsToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.applicationsToolStripMenuItem.Name = "applicationsToolStripMenuItem"; + this.applicationsToolStripMenuItem.Size = new System.Drawing.Size(103, 20); + this.applicationsToolStripMenuItem.Text = "Applications"; + // + // shifterToolStripMenuItem + // + this.shifterToolStripMenuItem.Name = "shifterToolStripMenuItem"; + this.shifterToolStripMenuItem.Size = new System.Drawing.Size(158, 22); + this.shifterToolStripMenuItem.Text = "Shifter"; + this.shifterToolStripMenuItem.Click += new System.EventHandler(this.shifterToolStripMenuItem_Click); + // + // terminalToolStripMenuItem + // + this.terminalToolStripMenuItem.Name = "terminalToolStripMenuItem"; + this.terminalToolStripMenuItem.Size = new System.Drawing.Size(158, 22); + this.terminalToolStripMenuItem.Text = "Terminal"; + this.terminalToolStripMenuItem.Click += new System.EventHandler(this.terminalToolStripMenuItem_Click); + // + // textPadToolStripMenuItem + // + this.textPadToolStripMenuItem.Name = "textPadToolStripMenuItem"; + this.textPadToolStripMenuItem.Size = new System.Drawing.Size(158, 22); + this.textPadToolStripMenuItem.Text = "TextPad"; + this.textPadToolStripMenuItem.Click += new System.EventHandler(this.textPadToolStripMenuItem_Click); + // + // fileSkimmerToolStripMenuItem + // + this.fileSkimmerToolStripMenuItem.Name = "fileSkimmerToolStripMenuItem"; + this.fileSkimmerToolStripMenuItem.Size = new System.Drawing.Size(158, 22); + this.fileSkimmerToolStripMenuItem.Text = "File Skimmer"; + this.fileSkimmerToolStripMenuItem.Click += new System.EventHandler(this.fileSkimmerToolStripMenuItem_Click); + // + // timer1 + // + 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.BackColor = System.Drawing.Color.Black; + this.ClientSize = new System.Drawing.Size(640, 480); + this.Controls.Add(this.taskbar); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Margin = new System.Windows.Forms.Padding(2); + this.Name = "Desktop"; + this.Text = "Desktop"; + this.Load += new System.EventHandler(this.Desktop_Load); + this.taskbar.ResumeLayout(false); + this.clockPanel.ResumeLayout(false); + this.panel2.ResumeLayout(false); + this.panel2.PerformLayout(); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel taskbar; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Panel clockPanel; + private System.Windows.Forms.Label lblClock; + private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem applicationsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem shifterToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem terminalToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem textPadToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem fileSkimmerToolStripMenuItem; + } +} \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Desktop.cs b/ShiftOS.Main/MainGame/Desktop.cs new file mode 100644 index 0000000..0cb3583 --- /dev/null +++ b/ShiftOS.Main/MainGame/Desktop.cs @@ -0,0 +1,72 @@ +using System; +using System.Windows.Forms; +using ShiftOS.Engine.WindowManager; +using ShiftOS.Main.Properties; +using ShiftOS.Main.ShiftOS.Apps; +using System.IO; +using ShiftOS.Engine; +using System.Drawing; +using ShiftOS.Engine.UI; + +namespace ShiftOS.Main.ShiftOS +{ + // testing github because git hates me + public partial class Desktop : Form + { + + public Desktop() + { + InitializeComponent(); + foreach (object t in applicationsToolStripMenuItem.DropDownItems) + { + var appList = t as ToolStripItem; + if (t == null) continue; + appList.BackColor = Color.FromArgb(64, 64, 64); + appList.ForeColor = Color.White; + } + timer1.Start(); + Closed += (sender, args) => { Application.Exit(); }; + + } + + private void shifterToolStripMenuItem_Click(object sender, EventArgs e) + { + Apps.ShifterStuff.Shifter app = new Apps.ShifterStuff.Shifter(); + ShiftWM.Init(app, "Shifter", Resources.iconShifter); + } + + private void Desktop_Load(object sender, EventArgs e) + { + this.WindowState = FormWindowState.Maximized; + } + + private void terminalToolStripMenuItem_Click(object sender, EventArgs e) + { + var t = new Apps.Terminal(); + ShiftWM.Init(t, "Terminal", Resources.iconTerminal, false); + + } + + private void textPadToolStripMenuItem_Click(object sender, EventArgs e) + { + var t = new TextPad(); + ShiftWM.Init(t, "TextPad", Resources.iconTextPad); + } + + private void fileSkimmerToolStripMenuItem_Click(object sender, EventArgs e) + { + var fs = new FileSkimmer(); + ShiftWM.Init(fs, "File Skimmer", Resources.iconFileSkimmer); + } + + private void timer1_Tick(object sender, EventArgs e) + { + lblClock.Text = DateTime.Now.ToString("hh:mm:ss"); + } + + private void menuStrip1_MenuActivate(object sender, EventArgs e) + { + menuStrip1.BackColor = Color.FromArgb(64, 64, 64); + } + } +} diff --git a/ShiftOS.Main/MainGame/Desktop.resx b/ShiftOS.Main/MainGame/Desktop.resx new file mode 100644 index 0000000..f706e8f --- /dev/null +++ b/ShiftOS.Main/MainGame/Desktop.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 219, 17 + + + 132, 17 + + \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS.Main.csproj b/ShiftOS.Main/ShiftOS.Main.csproj index 7105060..86746dd 100644 --- a/ShiftOS.Main/ShiftOS.Main.csproj +++ b/ShiftOS.Main/ShiftOS.Main.csproj @@ -54,40 +54,40 @@ - + UserControl - + FileSkimmer.cs - + UserControl - + SelectColor.cs - + UserControl - + Shifter.cs - + UserControl - + Terminal.cs - + UserControl - + TextPad.cs - + Form - + Desktop.cs @@ -111,22 +111,22 @@ Resources.resx True - + FileSkimmer.cs - + SelectColor.cs - + Shifter.cs - + Terminal.cs - + TextPad.cs - + Desktop.cs @@ -153,7 +153,7 @@ - + diff --git a/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.Designer.cs deleted file mode 100644 index 5a23ec7..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.Designer.cs +++ /dev/null @@ -1,260 +0,0 @@ -using System.Windows.Forms; - -namespace ShiftOS.Main.ShiftOS.Apps -{ - partial class FileSkimmer - { - /// - /// 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.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FileSkimmer)); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.textFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.breadcrumbsBar = new System.Windows.Forms.ToolStrip(); - this.toolStrip2 = new System.Windows.Forms.ToolStrip(); - this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); - this.largeIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.smallIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.detailsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.listToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.tilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.listView1 = new System.Windows.Forms.ListView(); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.renameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.menuStrip1.SuspendLayout(); - this.toolStrip2.SuspendLayout(); - this.contextMenuStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // menuStrip1 - // - this.menuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24); - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Padding = new System.Windows.Forms.Padding(4, 1, 0, 1); - this.menuStrip1.Size = new System.Drawing.Size(1027, 24); - this.menuStrip1.TabIndex = 1; - this.menuStrip1.Text = "menuStrip1"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newFileToolStripMenuItem, - this.newFolderToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 22); - this.fileToolStripMenuItem.Text = "File"; - // - // newFileToolStripMenuItem - // - this.newFileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.textFileToolStripMenuItem}); - this.newFileToolStripMenuItem.Name = "newFileToolStripMenuItem"; - this.newFileToolStripMenuItem.Size = new System.Drawing.Size(134, 22); - this.newFileToolStripMenuItem.Text = "New File"; - // - // textFileToolStripMenuItem - // - this.textFileToolStripMenuItem.Name = "textFileToolStripMenuItem"; - this.textFileToolStripMenuItem.Size = new System.Drawing.Size(114, 22); - this.textFileToolStripMenuItem.Text = "Text file"; - this.textFileToolStripMenuItem.Click += new System.EventHandler(this.textFileToolStripMenuItem_Click); - // - // newFolderToolStripMenuItem - // - this.newFolderToolStripMenuItem.Name = "newFolderToolStripMenuItem"; - this.newFolderToolStripMenuItem.Size = new System.Drawing.Size(134, 22); - this.newFolderToolStripMenuItem.Text = "New Folder"; - // - // breadcrumbsBar - // - this.breadcrumbsBar.ImageScalingSize = new System.Drawing.Size(24, 24); - this.breadcrumbsBar.Location = new System.Drawing.Point(0, 24); - this.breadcrumbsBar.Name = "breadcrumbsBar"; - this.breadcrumbsBar.Size = new System.Drawing.Size(1027, 25); - this.breadcrumbsBar.TabIndex = 2; - this.breadcrumbsBar.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.breadcrumbsBar_ItemClicked); - // - // toolStrip2 - // - this.toolStrip2.ImageScalingSize = new System.Drawing.Size(24, 24); - this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripButton1, - this.toolStripDropDownButton1}); - this.toolStrip2.Location = new System.Drawing.Point(0, 49); - this.toolStrip2.Name = "toolStrip2"; - this.toolStrip2.Size = new System.Drawing.Size(1027, 25); - this.toolStrip2.TabIndex = 3; - this.toolStrip2.Text = "toolbar"; - // - // toolStripButton1 - // - this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image"))); - this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton1.Name = "toolStripButton1"; - this.toolStripButton1.Size = new System.Drawing.Size(23, 22); - this.toolStripButton1.Text = "^"; - this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click); - // - // toolStripDropDownButton1 - // - this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.largeIconsToolStripMenuItem, - this.smallIconsToolStripMenuItem, - this.detailsToolStripMenuItem, - this.listToolStripMenuItem, - this.tilesToolStripMenuItem}); - this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image"))); - this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; - this.toolStripDropDownButton1.Size = new System.Drawing.Size(79, 22); - this.toolStripDropDownButton1.Text = "View Mode"; - this.toolStripDropDownButton1.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolStripDropDownButton1_DropDownItemClicked); - // - // largeIconsToolStripMenuItem - // - this.largeIconsToolStripMenuItem.Name = "largeIconsToolStripMenuItem"; - this.largeIconsToolStripMenuItem.Size = new System.Drawing.Size(134, 22); - this.largeIconsToolStripMenuItem.Text = "Large Icons"; - // - // smallIconsToolStripMenuItem - // - this.smallIconsToolStripMenuItem.Name = "smallIconsToolStripMenuItem"; - this.smallIconsToolStripMenuItem.Size = new System.Drawing.Size(134, 22); - this.smallIconsToolStripMenuItem.Text = "Small Icons"; - // - // detailsToolStripMenuItem - // - this.detailsToolStripMenuItem.Name = "detailsToolStripMenuItem"; - this.detailsToolStripMenuItem.Size = new System.Drawing.Size(134, 22); - this.detailsToolStripMenuItem.Text = "Details"; - // - // listToolStripMenuItem - // - this.listToolStripMenuItem.Name = "listToolStripMenuItem"; - this.listToolStripMenuItem.Size = new System.Drawing.Size(134, 22); - this.listToolStripMenuItem.Text = "List"; - // - // tilesToolStripMenuItem - // - this.tilesToolStripMenuItem.Name = "tilesToolStripMenuItem"; - this.tilesToolStripMenuItem.Size = new System.Drawing.Size(134, 22); - this.tilesToolStripMenuItem.Text = "Tiles"; - // - // listView1 - // - this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.listView1.Location = new System.Drawing.Point(0, 74); - this.listView1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.listView1.Name = "listView1"; - this.listView1.Size = new System.Drawing.Size(1027, 437); - this.listView1.TabIndex = 4; - this.listView1.UseCompatibleStateImageBehavior = false; - this.listView1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseClick); - this.listView1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseDoubleClick); - // - // contextMenuStrip1 - // - this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24); - this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.openToolStripMenuItem, - this.renameToolStripMenuItem, - this.deleteToolStripMenuItem}); - this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(118, 70); - // - // openToolStripMenuItem - // - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(117, 22); - this.openToolStripMenuItem.Text = "Open"; - // - // renameToolStripMenuItem - // - this.renameToolStripMenuItem.Name = "renameToolStripMenuItem"; - this.renameToolStripMenuItem.Size = new System.Drawing.Size(117, 22); - this.renameToolStripMenuItem.Text = "Rename"; - // - // deleteToolStripMenuItem - // - this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; - this.deleteToolStripMenuItem.Size = new System.Drawing.Size(117, 22); - this.deleteToolStripMenuItem.Text = "Delete"; - // - // FileSkimmer - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.listView1); - this.Controls.Add(this.toolStrip2); - this.Controls.Add(this.breadcrumbsBar); - this.Controls.Add(this.menuStrip1); - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.Name = "FileSkimmer"; - this.Size = new System.Drawing.Size(1027, 511); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.toolStrip2.ResumeLayout(false); - this.toolStrip2.PerformLayout(); - this.contextMenuStrip1.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.ToolStrip breadcrumbsBar; - private System.Windows.Forms.ToolStrip toolStrip2; - private System.Windows.Forms.ListView listView1; - private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1; - private System.Windows.Forms.ToolStripMenuItem largeIconsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem smallIconsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem detailsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem listToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem tilesToolStripMenuItem; - private System.Windows.Forms.ToolStripButton toolStripButton1; - private ToolStripMenuItem fileToolStripMenuItem; - private ToolStripMenuItem newFileToolStripMenuItem; - private ToolStripMenuItem newFolderToolStripMenuItem; - private ToolStripMenuItem textFileToolStripMenuItem; - private ContextMenuStrip contextMenuStrip1; - private ToolStripMenuItem openToolStripMenuItem; - private ToolStripMenuItem renameToolStripMenuItem; - private ToolStripMenuItem deleteToolStripMenuItem; - } -} diff --git a/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.cs b/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.cs deleted file mode 100644 index 58cc126..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Windows.Forms; -using ShiftOS.Engine.Misc; -using ShiftOS.Engine.ShiftFS; -using ShiftOS.Engine.WindowManager; -using System.Linq; -using ShiftOS.Engine.UI; - -namespace ShiftOS.Main.ShiftOS.Apps -{ - public partial class FileSkimmer : UserControl, IShiftWindowExtensions - { - ShiftDirectory _currentDirectory; - - public FileSkimmer() - { - InitializeComponent(); - - } - - public void OnLoaded(ShiftWindow window) - { - Debug.WriteLine(ShiftFS.Drives.Count); - listView1.ShowDrivesList(window); - } - - void toolStripDropDownButton1_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) - { - switch (e.ClickedItem.Text) - { - case "Small Icons": - listView1.View = View.SmallIcon; - break; - case "Details": - listView1.View = View.Details; - break; - case "List": - listView1.View = View.List; - break; - case "Tiles": - listView1.View = View.Tile; - break; - default: - listView1.View = View.LargeIcon; - break; - } - } - - void listView1_MouseDoubleClick(object sender, MouseEventArgs e) - { - var hit = listView1.HitTest(e.Location); - - if (!(hit.Item.Tag is ShiftDirectory dir)) return; - - listView1.Items.Clear(); - listView1.DisplayShiftFolder(dir); - _currentDirectory = dir; - breadcrumbsBar.Items.Add(new ToolStripButton(dir.Name) { Tag = dir }); - } - - void toolStripButton1_Click(object sender, EventArgs e) - { - listView1.Items.Clear(); - if (breadcrumbsBar.Items.Count > 1) - { - breadcrumbsBar.Items.Remove(breadcrumbsBar.Items.OfType().Last()); - var dir = breadcrumbsBar.Items.OfType().Last().Tag as ShiftDirectory; - _currentDirectory = dir; - listView1.DisplayShiftFolder(dir); - } - else - { - breadcrumbsBar.Items.Clear(); - listView1.ShowDrivesList(); - } - } - - void breadcrumbsBar_ItemClicked(object sender, ToolStripItemClickedEventArgs e) - { - var items = new List(breadcrumbsBar.Items.OfType() - .Where((_, y) => y > breadcrumbsBar.Items.IndexOf(e.ClickedItem))); - - foreach (var item in items) - { - breadcrumbsBar.Items.Remove(item); - } - - toolStripButton1_Click(null, EventArgs.Empty); - } - - void textFileToolStripMenuItem_Click(object sender, EventArgs e) - { - _currentDirectory.Add(new ShiftFile("Text file")); - } - - void listView1_MouseClick(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Right) - { - contextMenuStrip1.Show(MousePosition); - } - } - } -} diff --git a/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.resx b/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.resx deleted file mode 100644 index aeeea08..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.resx +++ /dev/null @@ -1,163 +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 - - - 175, 17 - - - 331, 17 - - - 473, 17 - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG - YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 - 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw - bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc - VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 - c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 - Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo - mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ - kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D - TgDQASA1MVpwzwAAAABJRU5ErkJggg== - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG - YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 - 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw - bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc - VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 - c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 - Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo - mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ - kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D - TgDQASA1MVpwzwAAAABJRU5ErkJggg== - - - - 615, 17 - - \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.Designer.cs deleted file mode 100644 index f8ee8e3..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.Designer.cs +++ /dev/null @@ -1,74 +0,0 @@ -namespace ShiftOS.Main.ShiftOS.Apps -{ - partial class ShiftDemo - { - /// - /// 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.label1 = new System.Windows.Forms.Label(); - this.icon = new System.Windows.Forms.PictureBox(); - ((System.ComponentModel.ISupportInitialize)(this.icon)).BeginInit(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(27, 25); - this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(51, 20); - this.label1.TabIndex = 0; - this.label1.Text = "label1"; - // - // icon - // - this.icon.Location = new System.Drawing.Point(31, 61); - this.icon.Name = "icon"; - this.icon.Size = new System.Drawing.Size(300, 300); - this.icon.TabIndex = 1; - this.icon.TabStop = false; - // - // ShiftDemo - // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.icon); - this.Controls.Add(this.label1); - this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.Name = "ShiftDemo"; - this.Size = new System.Drawing.Size(450, 462); - ((System.ComponentModel.ISupportInitialize)(this.icon)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - public System.Windows.Forms.Label label1; - private System.Windows.Forms.PictureBox icon; - } -} diff --git a/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.cs b/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.cs deleted file mode 100644 index ced10d2..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Windows.Forms; -using ShiftOS.Engine.WindowManager; - -namespace ShiftOS.Main.ShiftOS.Apps -{ - public partial class ShiftDemo : UserControl, IShiftWindowExtensions - { - public ShiftDemo() - { - InitializeComponent(); - } - - public void OnLoaded(ShiftWindow window) - { - icon.Image = this.GetShiftWindow().Icon.ToBitmap(); - } - } -} \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.resx b/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.resx deleted file mode 100644 index 1af7de1..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.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/ShifterStuff/SelectColor.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.Designer.cs deleted file mode 100644 index 5e617cb..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.Designer.cs +++ /dev/null @@ -1,150 +0,0 @@ -namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff -{ - partial class SelectColor - { - /// - /// 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.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - 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 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(21, 34); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(39, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Red:"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(21, 62); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(55, 13); - this.label2.TabIndex = 1; - this.label2.Text = "Green:"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(21, 92); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(47, 13); - this.label3.TabIndex = 2; - this.label3.Text = "Blue:"; - // - // btnSetColor - // - this.btnSetColor.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnSetColor.Location = new System.Drawing.Point(75, 121); - this.btnSetColor.Name = "btnSetColor"; - this.btnSetColor.Size = new System.Drawing.Size(93, 23); - this.btnSetColor.TabIndex = 6; - this.btnSetColor.Text = "Set Color"; - 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.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); - this.Load += new System.EventHandler(this.SelectColor_Load); - ((System.ComponentModel.ISupportInitialize)(this.redUpDown)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.greenUpDown)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.blueUpDown)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - 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 deleted file mode 100644 index 3da3b98..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Drawing; -using System.Globalization; -using System.Windows.Forms; -using ShiftOS.Engine.WindowManager; -using ShiftOS.Engine.UI; - -namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff -{ - public partial class SelectColor : UserControl - { - int _colorType1; - int _colorType2; - int _colorType3; - Color _finalColor; - - public SelectColor() - { - InitializeComponent(); - } - - Color SetColor() - { - _colorType1 = int.Parse(redUpDown.Value.ToString(CultureInfo.InvariantCulture)); - _colorType2 = int.Parse(greenUpDown.Value.ToString(CultureInfo.InvariantCulture)); - _colorType3 = int.Parse(blueUpDown.Value.ToString(CultureInfo.InvariantCulture)); - try - { - _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3); - - - foreach (var window in ShiftWM.Windows) - { - window.Invoke(new Action(() => window.titleBar.BackColor = _finalColor)); - } - - - ShiftWM.StartInfoboxSession( - "Success!", - $"Changed color to:\r\n{_colorType1}, {_colorType2}, {_colorType3}.", - InfoboxTemplate.ButtonType.Ok); - } - catch (Exception) - { - ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok); - } - return _finalColor; - } - - void btnSetColor_Click(object sender, EventArgs e) - { - SetColor(); - } - - private void SelectColor_Load(object sender, EventArgs e) - { - var s = new ShiftButton(); - s.Location = new System.Drawing.Point(211, 48); - s.Text = "test"; - Controls.Add(s); - } - } -} \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.resx b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.resx deleted file mode 100644 index 1af7de1..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.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/ShifterStuff/Shifter.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs deleted file mode 100644 index d94aebe..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs +++ /dev/null @@ -1,257 +0,0 @@ -namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff -{ - partial class Shifter - { - /// - /// 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.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.button6 = new System.Windows.Forms.Button(); - this.btnLoad = new System.Windows.Forms.Button(); - this.btnSave = new System.Windows.Forms.Button(); - 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.shiftButton1 = new Engine.UI.ShiftButton(); - this.button7 = new System.Windows.Forms.Button(); - this.tabControl1.SuspendLayout(); - this.tabPage1.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.SuspendLayout(); - // - // tabControl1 - // - this.tabControl1.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.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Controls.Add(this.tabPage2); - this.tabControl1.Location = new System.Drawing.Point(3, 3); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(334, 322); - this.tabControl1.TabIndex = 0; - // - // tabPage1 - // - this.tabPage1.Controls.Add(this.button7); - this.tabPage1.Controls.Add(this.shiftButton1); - this.tabPage1.Controls.Add(this.button6); - this.tabPage1.Controls.Add(this.btnLoad); - this.tabPage1.Controls.Add(this.btnSave); - 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); - this.tabPage1.Location = new System.Drawing.Point(4, 22); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(326, 296); - this.tabPage1.TabIndex = 0; - this.tabPage1.Text = "Titlebar"; - this.tabPage1.UseVisualStyleBackColor = true; - // - // button6 - // - this.button6.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button6.Font = new System.Drawing.Font("Lucida Console", 8.25F); - this.button6.Location = new System.Drawing.Point(6, 152); - this.button6.Name = "button6"; - this.button6.Size = new System.Drawing.Size(314, 23); - this.button6.TabIndex = 8; - this.button6.Text = "Set Midnight Skin"; - this.button6.UseVisualStyleBackColor = true; - this.button6.Click += new System.EventHandler(this.button6_Click); - // - // btnLoad - // - this.btnLoad.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnLoad.Font = new System.Drawing.Font("Lucida Console", 8.25F); - this.btnLoad.Location = new System.Drawing.Point(165, 267); - this.btnLoad.Name = "btnLoad"; - this.btnLoad.Size = new System.Drawing.Size(155, 23); - this.btnLoad.TabIndex = 7; - this.btnLoad.Text = "Load Skin"; - this.btnLoad.UseVisualStyleBackColor = true; - this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click); - // - // btnSave - // - this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnSave.Font = new System.Drawing.Font("Lucida Console", 8.25F); - this.btnSave.Location = new System.Drawing.Point(6, 267); - this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(155, 23); - this.btnSave.TabIndex = 6; - this.btnSave.Text = "Save Skin"; - this.btnSave.UseVisualStyleBackColor = true; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); - // - // 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, 239); - 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; - // - // 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, 181); - 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, 210); - 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(165, 210); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(155, 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); - this.groupBox1.Location = new System.Drawing.Point(6, 6); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(161, 108); - this.groupBox1.TabIndex = 0; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "groupBox1"; - // - // button1 - // - this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button1.Font = new System.Drawing.Font("Lucida Console", 8.25F); - this.button1.Location = new System.Drawing.Point(6, 19); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(149, 23); - this.button1.TabIndex = 1; - this.button1.Text = "Set Titlebar Color"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // tabPage2 - // - this.tabPage2.Location = new System.Drawing.Point(4, 22); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(326, 296); - this.tabPage2.TabIndex = 1; - this.tabPage2.Text = "tabPage2"; - this.tabPage2.UseVisualStyleBackColor = true; - // - // shiftButton1 - // - this.shiftButton1.BackColor = System.Drawing.Color.White; - this.shiftButton1.FlatAppearance.BorderColor = System.Drawing.Color.Gray; - this.shiftButton1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.shiftButton1.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.shiftButton1.ForeColor = System.Drawing.Color.Black; - this.shiftButton1.Location = new System.Drawing.Point(205, 25); - this.shiftButton1.Margin = new System.Windows.Forms.Padding(0); - this.shiftButton1.MinimumSize = new System.Drawing.Size(75, 23); - this.shiftButton1.Name = "shiftButton1"; - this.shiftButton1.Padding = new System.Windows.Forms.Padding(3); - this.shiftButton1.Size = new System.Drawing.Size(100, 23); - this.shiftButton1.TabIndex = 9; - this.shiftButton1.Text = "ShiftButton"; - this.shiftButton1.UseVisualStyleBackColor = false; - // - // button7 - // - this.button7.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button7.Font = new System.Drawing.Font("Lucida Console", 8.25F); - this.button7.Location = new System.Drawing.Point(205, 51); - this.button7.Name = "button7"; - this.button7.Size = new System.Drawing.Size(100, 23); - this.button7.TabIndex = 10; - this.button7.Text = "NormalBtn"; - this.button7.UseVisualStyleBackColor = true; - // - // Shifter - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.tabControl1); - this.Name = "Shifter"; - this.Size = new System.Drawing.Size(340, 325); - this.tabControl1.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tabPage1; - 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; - private System.Windows.Forms.Button button4; - private System.Windows.Forms.Button button5; - private System.Windows.Forms.Button btnSave; - private System.Windows.Forms.Button btnLoad; - private System.Windows.Forms.Button button6; - private System.Windows.Forms.Button button7; - private Engine.UI.ShiftButton shiftButton1; - } -} diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs deleted file mode 100644 index 2c3cd8e..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs +++ /dev/null @@ -1,174 +0,0 @@ -using System; -using System.Drawing; -using System.IO; -using System.Windows.Forms; -using ShiftOS.Engine.Misc; -using ShiftOS.Engine.WindowManager; -using ShiftOS.Main.Properties; -using Whoa; - -namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff -{ - public partial class Shifter : UserControl - { - public int ColorType; //This is a check to see what option was chosen. - public Shifter() - { - InitializeComponent(); - } - - void button1_Click(object sender, EventArgs e) - { - ColorType = 1; - ShiftWM.Init(new SelectColor(), "Select a color", Resources.iconColourPicker_fw); - } - - /// - /// Modifies the values in ShiftShiftSkinData.Colors. - /// - /// The border color of the window. - /// The close button color of the window. - /// The close button color of the window while hovering. - /// The maximize button color of the window. - /// The maximize button color of the window while hovering. - /// The minimize button color of the window. - /// The minimize button color of the window while hovering. - void ModifyData(Color borderColor, Color btnClose, Color btnCloseHover, Color btnMax, Color btnMaxHover, Color btnMin, Color btnMinHover) - { - SetBorderColor(borderColor); - ShiftSkinData.Colors.BtnCloseColor = btnClose; - ShiftSkinData.Colors.BtnCloseHoverColor = btnCloseHover; - ShiftSkinData.Colors.BtnMaxColor = btnMax; - ShiftSkinData.Colors.BtnMaxHoverColor = btnMaxHover; - ShiftSkinData.Colors.BtnMinColor = btnMin; - ShiftSkinData.Colors.BtnMinHoverColor = btnMinHover; - } - - // SetBorderColor - public void SetBorderColor(Color borderColor) - { - 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; - } - - void SetDefaultSkin(object sender, EventArgs e) - { - ModifyData(Color.FromArgb(64, 64, 64), Color.Black, Color.FromArgb(40, 40, 40), Color.Black, Color.FromArgb(40, 40, 40), Color.Black, Color.FromArgb(40, 40, 40)); - ApplySkin(); - } - - void SetColorSkin(object sender, EventArgs e) - { - ModifyData(Color.Blue, Color.Red, Color.FromArgb(255, 102, 102), Color.Yellow, Color.FromArgb(255, 255, 153), Color.Green, Color.FromArgb(102, 255, 102)); - ApplySkin(); - } - - void SetRandomSkin(object sender, EventArgs e) - { - var rnd = new Random(); - ModifyData( - Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)), // Border Color - Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)), // Close Button Color - Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)), // Close Hover Color - Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)), // Maximize Button Color - Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)), // Maximize Hover Color - Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)), // Minimize Button Color - Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255))); // Minimize Hover Color - ApplySkin(); - } - - void ApplySkin() - { - foreach (var window in ShiftWM.Windows) - { - window.Invoke(new Action(() => window.titleBar.BackColor = ShiftSkinData.Colors.TitleBarColor)); - window.Invoke(new Action(() => window.leftTopCorner.BackColor = ShiftSkinData.Colors.LeftTopCornerColor)); - window.Invoke(new Action(() => window.rightTopCorner.BackColor = ShiftSkinData.Colors.RightTopCornerColor)); - window.Invoke(new Action(() => window.leftSide.BackColor = ShiftSkinData.Colors.LeftSideColor)); - window.Invoke(new Action(() => window.rightSide.BackColor = ShiftSkinData.Colors.RightSideColor)); - window.Invoke(new Action(() => window.leftBottomCorner.BackColor = ShiftSkinData.Colors.LeftBottomCornerColor)); - window.Invoke(new Action(() => window.bottomSide.BackColor = ShiftSkinData.Colors.BottomSideColor)); - window.Invoke(new Action(() => window.rightBottomCorner.BackColor = ShiftSkinData.Colors.RightBottomCornerColor)); - window.Invoke(new Action(() => window.btnClose.BackColor = ShiftSkinData.Colors.BtnCloseColor)); - window.Invoke(new Action(() => window.btnMax.BackColor = ShiftSkinData.Colors.BtnMaxColor)); - window.Invoke(new Action(() => window.btnMin.BackColor = ShiftSkinData.Colors.BtnMinColor)); - } - } - - void btnSave_Click(object sender, EventArgs e) - { - Color[] shiftSkinColors = new Color[14]; - int i = 0; - - shiftSkinColors[0] = ShiftSkinData.Colors.LeftTopCornerColor; - shiftSkinColors[1] = ShiftSkinData.Colors.TitleBarColor; - shiftSkinColors[2] = ShiftSkinData.Colors.RightTopCornerColor; - shiftSkinColors[3] = ShiftSkinData.Colors.LeftSideColor; - shiftSkinColors[4] = ShiftSkinData.Colors.RightSideColor; - shiftSkinColors[5] = ShiftSkinData.Colors.LeftBottomCornerColor; - shiftSkinColors[6] = ShiftSkinData.Colors.BottomSideColor; - shiftSkinColors[7] = ShiftSkinData.Colors.RightBottomCornerColor; - shiftSkinColors[8] = ShiftSkinData.Colors.BtnCloseColor; - shiftSkinColors[9] = ShiftSkinData.Colors.BtnCloseHoverColor; - shiftSkinColors[10] = ShiftSkinData.Colors.BtnMaxColor; - shiftSkinColors[11] = ShiftSkinData.Colors.BtnMaxHoverColor; - shiftSkinColors[12] = ShiftSkinData.Colors.BtnMinColor; - shiftSkinColors[13] = ShiftSkinData.Colors.BtnMinHoverColor; - - using (var fobj = File.OpenWrite(@"C:\Users\Public\Documents\Skin.whoa")) - Whoa.Whoa.SerialiseObject(fobj, shiftSkinColors); - - ShiftWM.StartInfoboxSession( - "Saved Skin", - "Saved Skin to C:\\Users\\Public\\Documents\\Skin.whoa", - InfoboxTemplate.ButtonType.Ok); - } - - private void btnLoad_Click(object sender, EventArgs e) - { - Color[] shiftSkinColors = new Color[14]; - using (var fobj = File.OpenRead(@"C:\Users\Public\Documents\Skin.whoa")) - shiftSkinColors = Whoa.Whoa.DeserialiseObject(fobj); - - ShiftSkinData.Colors.LeftTopCornerColor = shiftSkinColors[0]; - ShiftSkinData.Colors.TitleBarColor = shiftSkinColors[1]; - ShiftSkinData.Colors.RightTopCornerColor = shiftSkinColors[2]; - ShiftSkinData.Colors.LeftSideColor = shiftSkinColors[3]; - ShiftSkinData.Colors.RightSideColor = shiftSkinColors[4]; - ShiftSkinData.Colors.LeftBottomCornerColor = shiftSkinColors[5]; - ShiftSkinData.Colors.BottomSideColor = shiftSkinColors[6]; - ShiftSkinData.Colors.RightBottomCornerColor = shiftSkinColors[7]; - ShiftSkinData.Colors.BtnCloseColor = shiftSkinColors[8]; - ShiftSkinData.Colors.BtnCloseHoverColor = shiftSkinColors[9]; - ShiftSkinData.Colors.BtnMaxColor = shiftSkinColors[10]; - ShiftSkinData.Colors.BtnMaxHoverColor = shiftSkinColors[11]; - ShiftSkinData.Colors.BtnMinColor = shiftSkinColors[12]; - ShiftSkinData.Colors.BtnMinHoverColor = shiftSkinColors[13]; - - ApplySkin(); - ShiftWM.StartInfoboxSession( - "Loaded Skin", - "Loaded Skin from C:\\Users\\Public\\Documents\\Skin.whoa", - InfoboxTemplate.ButtonType.Ok); - } - - private void button6_Click(object sender, EventArgs e) - { - ModifyData( - Color.FromArgb(15, 29, 45), - Color.FromArgb(15, 29, 78), - Color.FromArgb(15, 29, 100), - Color.FromArgb(15, 29, 130), - Color.FromArgb(15, 29, 108), - Color.FromArgb(15, 29, 130), - Color.FromArgb(15, 29, 160)); - ApplySkin(); - } - } -} \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.resx b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.resx deleted file mode 100644 index 1af7de1..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.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/Terminal.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/Terminal.Designer.cs deleted file mode 100644 index a746456..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/Terminal.Designer.cs +++ /dev/null @@ -1,66 +0,0 @@ -namespace ShiftOS.Main.ShiftOS.Apps -{ - partial class Terminal - { - /// - /// 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.termmain = new System.Windows.Forms.RichTextBox(); - this.SuspendLayout(); - // - // termmain - // - this.termmain.BackColor = System.Drawing.Color.Black; - this.termmain.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.termmain.Dock = System.Windows.Forms.DockStyle.Fill; - this.termmain.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.termmain.ForeColor = System.Drawing.Color.White; - this.termmain.Location = new System.Drawing.Point(0, 0); - this.termmain.Name = "termmain"; - this.termmain.Size = new System.Drawing.Size(476, 394); - this.termmain.TabIndex = 0; - this.termmain.Text = ""; - this.termmain.SelectionChanged += new System.EventHandler(this.termmain_SelectionChanged); - this.termmain.TextChanged += new System.EventHandler(this.termmain_TextChanged); - this.termmain.KeyDown += new System.Windows.Forms.KeyEventHandler(this.termmain_KeyDown); - // - // Terminal - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.termmain); - this.Name = "Terminal"; - this.Size = new System.Drawing.Size(476, 394); - this.Load += new System.EventHandler(this.Terminal_Load); - this.ResumeLayout(false); - - } - - #endregion - - public System.Windows.Forms.RichTextBox termmain; - } -} diff --git a/ShiftOS.Main/ShiftOS/Apps/Terminal.cs b/ShiftOS.Main/ShiftOS/Apps/Terminal.cs deleted file mode 100644 index f0efec0..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/Terminal.cs +++ /dev/null @@ -1,172 +0,0 @@ -using System; -using System.Windows.Forms; -using ShiftOS.Engine; -using ShiftOS.Main.Terminal; -using System.Linq; -using System.Collections.Generic; -using System.Drawing.Text; -using System.IO; -using ShiftOS.Main.Properties; -using Whoa; - -namespace ShiftOS.Main.ShiftOS.Apps -{ - public partial class Terminal : UserControl - { - public int TerminalID = TerminalBackend.trmTopID++; // Used so that we can have multiple instances of the terminal whilst the command begin run knowing what terminal to send the text to - very complicated ;) - public string defaulttextBefore = "user> "; - public string defaulttextResult = "[user@shiftos ~]$ "; // NOT YET IMPLEMENTED!!! - public bool DoClear = false; - public bool RunningCommand = false; - public bool WaitingResponse = false; - public string InputReturnText = ""; - public Stack c = TerminalBackend.commandBuffer; - private PrivateFontCollection fontCollection = new PrivateFontCollection(); - - - // The below variables makes the terminal... a terminal! - string OldText = ""; - - int TrackingPosition; - - public Terminal() - { - InitializeComponent(); - - termmain.ContextMenuStrip = new ContextMenuStrip(); // Disables the right click of a richtextbox! - - TerminalBackend.trm.Add(this); - - - Setup(); - } - - void Print() - { - termmain.AppendText($"\n {defaulttextResult}"); - TrackingPosition = termmain.Text.Length; - } - - void Print(string text) - { - termmain.AppendText($"\n {text} \n {defaulttextResult}"); - TrackingPosition = termmain.Text.Length; - } - - //if (e.Control && e.KeyCode == Keys.V) - // { - // //if (Clipboard.ContainsText()) - // // termmain.Paste(DataFormats.GetFormat(DataFormats.Text)); - // e.Handled = true; - // } else if (e.KeyCode == Keys.Enter) { - // RunningCommand = true; - // TerminalBackend.RunCommand(termmain.Text.Substring(TrackingPosition, termmain.Text.Length - TrackingPosition), TerminalID); // The most horrific line in the entire application! - // RunningCommand = false; - // termmain.AppendText($"\n {defaulttextResult}"); - // TrackingPosition = termmain.Text.Length; - // e.Handled = true; - // } - //} - - private void termmain_TextChanged(object sender, EventArgs e) - { - if (!RunningCommand) - { - if (termmain.SelectionStart < TrackingPosition) - { - if (!DoClear) // If it's not clearing the terminal - { - termmain.Text = OldText; - termmain.Select(termmain.Text.Length, 0); - } - } - else - { - OldText = termmain.Text; - } - } - } - - private void termmain_SelectionChanged(object sender, EventArgs e) - { - if (!RunningCommand) - { - if (termmain.SelectionStart < TrackingPosition) - { - termmain.Text = OldText; - termmain.Select(termmain.Text.Length, 0); - } - } - } - - private void Terminal_Load(object sender, EventArgs e) - { - termmain.Text = $"\n {defaulttextResult}"; - TrackingPosition = termmain.Text.Length; - termmain.Select(termmain.TextLength, 1); - } - - public void Input(string request) - { - InputReturnText = ""; - RunningCommand = false; - - termmain.AppendText($"\n {request} "); - TrackingPosition = termmain.Text.Length; - } - - public void Clear() - { - DoClear = true; - OldText = ""; - termmain.Text = ""; - TrackingPosition = termmain.Text.Length; - DoClear = false; - } - - void termmain_KeyDown(object sender, KeyEventArgs e) - { - // The below code disables the ability to paste anything other then text... - - if (e.Control && e.KeyCode == Keys.V) - { - //if (Clipboard.ContainsText()) - // termmain.Paste(DataFormats.GetFormat(DataFormats.Text)); - e.Handled = true; - } - else if (e.KeyCode == Keys.Enter) - { - TerminalBackend.RunCommand(termmain.Text.Substring(TrackingPosition, termmain.Text.Length - TrackingPosition), TerminalID); // The most horrific line in the entire application! - Print(); - e.Handled = true; - } - else if (e.KeyCode == Keys.Up) - { - if (c.Count == 0) return; - termmain.AppendText(c.Pop()); - } - } - public void Setup() - { - if (!Directory.Exists(SaveSystem.gameDir)) Directory.CreateDirectory(SaveSystem.gameDir); - if (!Directory.Exists(SaveSystem.fontDir)) Directory.CreateDirectory(SaveSystem.fontDir); - if (!Directory.Exists(SaveSystem.dataDir)) Directory.CreateDirectory(SaveSystem.dataDir); - if (!File.Exists(SaveSystem.fontDir + "\\termFont.ttf")) File.WriteAllBytes(SaveSystem.fontDir + "\\termFont.ttf", Resources.UbuntuMono_R); - if (!File.Exists(SaveSystem.dataDir + "\\userCodePoints.whoa")) - { - using (var fobj = File.OpenWrite(SaveSystem.dataDir + "\\userCodePoints.whoa")) - { - Whoa.Whoa.SerialiseObject(fobj, SaveSystem.User.codePoints); - } - } - if (!Directory.Exists(SaveSystem.baseGameDir)) Directory.CreateDirectory(SaveSystem.baseGameDir); - if (!Directory.Exists(SaveSystem.desktopDir)) Directory.CreateDirectory(SaveSystem.desktopDir); - if (!Directory.Exists(SaveSystem.docDir)) Directory.CreateDirectory(SaveSystem.docDir); - if (!Directory.Exists(SaveSystem.downloadsDir)) Directory.CreateDirectory(SaveSystem.downloadsDir); - if (!Directory.Exists(SaveSystem.musicDir)) Directory.CreateDirectory(SaveSystem.musicDir); - if (!Directory.Exists(SaveSystem.picDir)) Directory.CreateDirectory(SaveSystem.picDir); - fontCollection.AddFontFile(SaveSystem.fontDir + "\\termFont.ttf"); - termmain.Font = new System.Drawing.Font(fontCollection.Families[0], 12F, System.Drawing.FontStyle.Regular); - } - } -} \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/Terminal.resx b/ShiftOS.Main/ShiftOS/Apps/Terminal.resx deleted file mode 100644 index 1af7de1..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/Terminal.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 deleted file mode 100644 index b49924e..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs +++ /dev/null @@ -1,132 +0,0 @@ -namespace ShiftOS.Main.ShiftOS.Apps -{ - partial class TestForm - { - /// - /// 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 Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - 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[] { - "Application", - "Asterisk", - "Error", - "Exclamation", - "Hand", - "Information", - "Question", - "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(); - - } - - #endregion - - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.TextBox textBox2; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.ComboBox comboBox1; - private System.Windows.Forms.BindingSource systemIconsBindingSource; - } -} \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/TestForm.cs b/ShiftOS.Main/ShiftOS/Apps/TestForm.cs deleted file mode 100644 index a0c12c0..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/TestForm.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Windows.Forms; -using ShiftOS.Engine.Misc; -using ShiftOS.Engine.WindowManager; -using ShiftOS.Main.Properties; -using ShiftOS.Main.ShiftOS.Apps.ShifterStuff; - -namespace ShiftOS.Main.ShiftOS.Apps -{ - public partial class TestForm : Form - { - public TestForm() - { - InitializeComponent(); - } - - void Button1_Click(object sender, EventArgs e) - { - var demo = new ShiftDemo(); - ShiftWM.Init(demo, textBox1.Text, null); - ShiftWM.StartInfoboxSession(textBox1.Text, textBox2.Text, InfoboxTemplate.ButtonType.Ok); - } - - void button2_Click(object sender, EventArgs e) - => ShiftWM.Init(new Shifter(), "Shifter", Resources.iconShifter); - } -} \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/TestForm.resx b/ShiftOS.Main/ShiftOS/Apps/TestForm.resx deleted file mode 100644 index 6dba9d3..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/TestForm.resx +++ /dev/null @@ -1,123 +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 - - - 17, 17 - - \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/TextPad.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/TextPad.Designer.cs deleted file mode 100644 index 7d83c68..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/TextPad.Designer.cs +++ /dev/null @@ -1,215 +0,0 @@ -namespace ShiftOS.Main.ShiftOS.Apps -{ - partial class TextPad - { - /// - /// 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.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.fontToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.wordWrapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.insertToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.timeAndDateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.textBox = new System.Windows.Forms.RichTextBox(); - this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); - this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); - this.menuStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // menuStrip1 - // - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.editToolStripMenuItem, - this.insertToolStripMenuItem, - this.helpToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(315, 24); - this.menuStrip1.TabIndex = 0; - this.menuStrip1.Text = "menuStrip1"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newToolStripMenuItem, - this.openToolStripMenuItem, - this.saveToolStripMenuItem, - this.saveAsToolStripMenuItem, - this.toolStripMenuItem1, - this.exitToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); - this.fileToolStripMenuItem.Text = "File"; - // - // newToolStripMenuItem - // - this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.newToolStripMenuItem.Text = "New..."; - this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); - // - // openToolStripMenuItem - // - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.openToolStripMenuItem.Text = "Open..."; - this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); - // - // saveToolStripMenuItem - // - this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.saveToolStripMenuItem.Text = "Save..."; - // - // saveAsToolStripMenuItem - // - this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.saveAsToolStripMenuItem.Text = "Save As..."; - // - // toolStripMenuItem1 - // - this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(149, 6); - // - // exitToolStripMenuItem - // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.exitToolStripMenuItem.Text = "Exit"; - // - // editToolStripMenuItem - // - this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fontToolStripMenuItem, - this.wordWrapToolStripMenuItem}); - this.editToolStripMenuItem.Name = "editToolStripMenuItem"; - this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); - this.editToolStripMenuItem.Text = "Edit"; - // - // fontToolStripMenuItem - // - this.fontToolStripMenuItem.Name = "fontToolStripMenuItem"; - this.fontToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.fontToolStripMenuItem.Text = "Font"; - // - // wordWrapToolStripMenuItem - // - this.wordWrapToolStripMenuItem.Checked = true; - this.wordWrapToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.wordWrapToolStripMenuItem.Name = "wordWrapToolStripMenuItem"; - this.wordWrapToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.wordWrapToolStripMenuItem.Text = "Word Wrap"; - // - // insertToolStripMenuItem - // - this.insertToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.timeAndDateToolStripMenuItem}); - this.insertToolStripMenuItem.Name = "insertToolStripMenuItem"; - this.insertToolStripMenuItem.Size = new System.Drawing.Size(48, 20); - this.insertToolStripMenuItem.Text = "Insert"; - // - // timeAndDateToolStripMenuItem - // - this.timeAndDateToolStripMenuItem.Name = "timeAndDateToolStripMenuItem"; - this.timeAndDateToolStripMenuItem.Size = new System.Drawing.Size(160, 22); - this.timeAndDateToolStripMenuItem.Text = "Time and Date..."; - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.aboutToolStripMenuItem}); - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.helpToolStripMenuItem.Text = "Help"; - // - // aboutToolStripMenuItem - // - this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.aboutToolStripMenuItem.Text = "About..."; - // - // textBox - // - this.textBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox.Location = new System.Drawing.Point(0, 24); - this.textBox.Name = "textBox"; - this.textBox.Size = new System.Drawing.Size(315, 265); - this.textBox.TabIndex = 1; - this.textBox.Text = ""; - // - // openFileDialog1 - // - this.openFileDialog1.FileName = "openFileDialog1"; - // - // TextPad - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.textBox); - this.Controls.Add(this.menuStrip1); - this.Name = "TextPad"; - this.Size = new System.Drawing.Size(315, 289); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem fontToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem wordWrapToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem insertToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem timeAndDateToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; - private System.Windows.Forms.RichTextBox textBox; - private System.Windows.Forms.OpenFileDialog openFileDialog1; - private System.Windows.Forms.SaveFileDialog saveFileDialog1; - } -} diff --git a/ShiftOS.Main/ShiftOS/Apps/TextPad.cs b/ShiftOS.Main/ShiftOS/Apps/TextPad.cs deleted file mode 100644 index 66863cf..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/TextPad.cs +++ /dev/null @@ -1,40 +0,0 @@ -using ShiftOS.Engine.ShiftFS.FileGUI; -using ShiftOS.Engine.WindowManager; -using System; -using System.IO; -using System.Windows.Forms; - -namespace ShiftOS.Main.ShiftOS.Apps -{ - public partial class TextPad : UserControl - { - readonly string _editedText; - - public TextPad() - { - InitializeComponent(); - _editedText = textBox.Text; - } - - bool IsEdited() => _editedText != textBox.Text; - - void openToolStripMenuItem_Click(object sender, EventArgs e) - { - if (openFileDialog1.ShowDialog() != DialogResult.OK) return; - - var sr = new StreamReader(openFileDialog1.FileName); - textBox.Text = sr.ReadToEnd(); - sr.Close(); - } - - void newToolStripMenuItem_Click(object sender, EventArgs e) - { - if (IsEdited()) - { - MessageBox.Show("yay it works"); - } - var f = new FileOpener(); - ShiftWM.Init(f, "testing", null); - } - } -} \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/TextPad.resx b/ShiftOS.Main/ShiftOS/Apps/TextPad.resx deleted file mode 100644 index 53f75e1..0000000 --- a/ShiftOS.Main/ShiftOS/Apps/TextPad.resx +++ /dev/null @@ -1,129 +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 - - - 153, 17 - - - 268, 17 - - - 17, 17 - - \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Desktop.Designer.cs b/ShiftOS.Main/ShiftOS/Desktop.Designer.cs deleted file mode 100644 index 722f619..0000000 --- a/ShiftOS.Main/ShiftOS/Desktop.Designer.cs +++ /dev/null @@ -1,185 +0,0 @@ -namespace ShiftOS.Main.ShiftOS -{ - partial class Desktop - { - /// - /// 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 Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.taskbar = new System.Windows.Forms.Panel(); - this.clockPanel = new System.Windows.Forms.Panel(); - this.lblClock = new System.Windows.Forms.Label(); - this.panel2 = new System.Windows.Forms.Panel(); - this.timer1 = new System.Windows.Forms.Timer(this.components); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.applicationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.shifterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.terminalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.textPadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.fileSkimmerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.taskbar.SuspendLayout(); - this.clockPanel.SuspendLayout(); - this.panel2.SuspendLayout(); - this.menuStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // taskbar - // - this.taskbar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.taskbar.Controls.Add(this.clockPanel); - this.taskbar.Controls.Add(this.panel2); - this.taskbar.Dock = System.Windows.Forms.DockStyle.Top; - this.taskbar.Location = new System.Drawing.Point(0, 0); - this.taskbar.Name = "taskbar"; - this.taskbar.Size = new System.Drawing.Size(640, 24); - this.taskbar.TabIndex = 0; - // - // clockPanel - // - this.clockPanel.Controls.Add(this.lblClock); - this.clockPanel.Dock = System.Windows.Forms.DockStyle.Right; - this.clockPanel.Location = new System.Drawing.Point(574, 0); - this.clockPanel.Name = "clockPanel"; - this.clockPanel.Size = new System.Drawing.Size(66, 24); - this.clockPanel.TabIndex = 1; - // - // lblClock - // - this.lblClock.BackColor = System.Drawing.Color.Transparent; - this.lblClock.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblClock.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblClock.ForeColor = System.Drawing.Color.White; - this.lblClock.Location = new System.Drawing.Point(0, 0); - this.lblClock.Name = "lblClock"; - this.lblClock.Size = new System.Drawing.Size(66, 24); - this.lblClock.TabIndex = 1; - this.lblClock.Text = "00:00:00"; - this.lblClock.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // panel2 - // - this.panel2.Controls.Add(this.menuStrip1); - this.panel2.Dock = System.Windows.Forms.DockStyle.Left; - this.panel2.Location = new System.Drawing.Point(0, 0); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(102, 24); - this.panel2.TabIndex = 0; - // - // timer1 - // - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // - // menuStrip1 - // - this.menuStrip1.BackgroundImage = global::ShiftOS.Main.Properties.Resources.pixel; - this.menuStrip1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.menuStrip1.Dock = System.Windows.Forms.DockStyle.None; - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.applicationsToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; - this.menuStrip1.Size = new System.Drawing.Size(93, 24); - this.menuStrip1.TabIndex = 2; - this.menuStrip1.Text = "Applications"; - // - // applicationsToolStripMenuItem - // - this.applicationsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.shifterToolStripMenuItem, - this.terminalToolStripMenuItem, - this.textPadToolStripMenuItem, - this.fileSkimmerToolStripMenuItem}); - this.applicationsToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.applicationsToolStripMenuItem.Name = "applicationsToolStripMenuItem"; - this.applicationsToolStripMenuItem.Size = new System.Drawing.Size(85, 20); - this.applicationsToolStripMenuItem.Text = "Applications"; - // - // shifterToolStripMenuItem - // - this.shifterToolStripMenuItem.Name = "shifterToolStripMenuItem"; - this.shifterToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.shifterToolStripMenuItem.Text = "Shifter"; - this.shifterToolStripMenuItem.Click += new System.EventHandler(this.shifterToolStripMenuItem_Click); - // - // terminalToolStripMenuItem - // - this.terminalToolStripMenuItem.Name = "terminalToolStripMenuItem"; - this.terminalToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.terminalToolStripMenuItem.Text = "Terminal"; - this.terminalToolStripMenuItem.Click += new System.EventHandler(this.terminalToolStripMenuItem_Click); - // - // textPadToolStripMenuItem - // - this.textPadToolStripMenuItem.Name = "textPadToolStripMenuItem"; - this.textPadToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.textPadToolStripMenuItem.Text = "TextPad"; - this.textPadToolStripMenuItem.Click += new System.EventHandler(this.textPadToolStripMenuItem_Click); - // - // fileSkimmerToolStripMenuItem - // - this.fileSkimmerToolStripMenuItem.Name = "fileSkimmerToolStripMenuItem"; - this.fileSkimmerToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.fileSkimmerToolStripMenuItem.Text = "File Skimmer"; - this.fileSkimmerToolStripMenuItem.Click += new System.EventHandler(this.fileSkimmerToolStripMenuItem_Click); - // - // Desktop - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Black; - this.ClientSize = new System.Drawing.Size(640, 480); - this.Controls.Add(this.taskbar); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Margin = new System.Windows.Forms.Padding(2); - this.Name = "Desktop"; - this.Text = "Desktop"; - this.Load += new System.EventHandler(this.Desktop_Load); - this.taskbar.ResumeLayout(false); - this.clockPanel.ResumeLayout(false); - this.panel2.ResumeLayout(false); - this.panel2.PerformLayout(); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Panel taskbar; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Panel clockPanel; - private System.Windows.Forms.Label lblClock; - private System.Windows.Forms.Timer timer1; - private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.ToolStripMenuItem applicationsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem shifterToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem terminalToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem textPadToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem fileSkimmerToolStripMenuItem; - } -} \ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Desktop.cs b/ShiftOS.Main/ShiftOS/Desktop.cs deleted file mode 100644 index 64dafdc..0000000 --- a/ShiftOS.Main/ShiftOS/Desktop.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.Windows.Forms; -using ShiftOS.Engine.WindowManager; -using ShiftOS.Main.Properties; -using ShiftOS.Main.ShiftOS.Apps; -using System.IO; -using ShiftOS.Engine; -using System.Drawing; -using ShiftOS.Engine.UI; - -namespace ShiftOS.Main.ShiftOS -{ - // testing github because git hates me - public partial class Desktop : Form - { - Graphics g; - public Desktop() - { - InitializeComponent(); - timer1.Start(); - Closed += (sender, args) => { Application.Exit(); }; - var s = new ShiftStripRenderer(); - - } - - private void shifterToolStripMenuItem_Click(object sender, EventArgs e) - { - Apps.ShifterStuff.Shifter app = new Apps.ShifterStuff.Shifter(); - ShiftWM.Init(app, "Shifter", Resources.iconShifter); - } - - private void Desktop_Load(object sender, EventArgs e) - { - this.WindowState = FormWindowState.Maximized; - } - - private void terminalToolStripMenuItem_Click(object sender, EventArgs e) - { - var t = new Apps.Terminal(); - ShiftWM.Init(t, "Terminal", Resources.iconTerminal, false); - - } - - private void textPadToolStripMenuItem_Click(object sender, EventArgs e) - { - var t = new TextPad(); - ShiftWM.Init(t, "TextPad", Resources.iconTextPad); - } - - private void fileSkimmerToolStripMenuItem_Click(object sender, EventArgs e) - { - var fs = new FileSkimmer(); - ShiftWM.Init(fs, "File Skimmer", Resources.iconFileSkimmer); - } - - private void timer1_Tick(object sender, EventArgs e) - { - lblClock.Text = DateTime.Now.ToString("hh:mm:ss"); - } - - private void SetupToolStrip(ToolStripRenderEventArgs e, Graphics g) - { - var s = new ShiftStripRenderer(); - s.DrawToolStripBackground(e); - } - } -} diff --git a/ShiftOS.Main/ShiftOS/Desktop.resx b/ShiftOS.Main/ShiftOS/Desktop.resx deleted file mode 100644 index f706e8f..0000000 --- a/ShiftOS.Main/ShiftOS/Desktop.resx +++ /dev/null @@ -1,126 +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 - - - 219, 17 - - - 132, 17 - - \ No newline at end of file -- cgit v1.2.3