From 12c253ab76b8117a563b021e969262da13eaec9d Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sun, 30 Apr 2017 15:46:36 +0100 Subject: Half done the taskbars --- TimeHACK.Main/OS/Win95/Win95.Designer.cs | 11 ++ TimeHACK.Main/OS/Win95/Win95.cs | 33 ++++++ TimeHACK.Main/OS/Win95/Win95.resx | 2 +- .../Win95Apps/WinClassicAddressBook.Designer.cs | 45 ++++++++ .../OS/Win95/Win95Apps/WinClassicAddressBook.cs | 20 ++++ .../OS/Win95/Win95Apps/WinClassicAddressBook.resx | 120 +++++++++++++++++++++ .../OS/Win95/Win95Apps/WinClassicWordPad.cs | 4 +- .../OS/Win95/Win95TaskBarItem.Designer.cs | 74 +++++++++++++ TimeHACK.Main/OS/Win95/Win95TaskBarItem.cs | 29 +++++ TimeHACK.Main/OS/Win95/Win95TaskBarItem.resx | 120 +++++++++++++++++++++ 10 files changed, 455 insertions(+), 3 deletions(-) create mode 100644 TimeHACK.Main/OS/Win95/Win95Apps/WinClassicAddressBook.Designer.cs create mode 100644 TimeHACK.Main/OS/Win95/Win95Apps/WinClassicAddressBook.cs create mode 100644 TimeHACK.Main/OS/Win95/Win95Apps/WinClassicAddressBook.resx create mode 100644 TimeHACK.Main/OS/Win95/Win95TaskBarItem.Designer.cs create mode 100644 TimeHACK.Main/OS/Win95/Win95TaskBarItem.cs create mode 100644 TimeHACK.Main/OS/Win95/Win95TaskBarItem.resx (limited to 'TimeHACK.Main/OS') diff --git a/TimeHACK.Main/OS/Win95/Win95.Designer.cs b/TimeHACK.Main/OS/Win95/Win95.Designer.cs index 3fedcd1..d6fba17 100644 --- a/TimeHACK.Main/OS/Win95/Win95.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95.Designer.cs @@ -41,6 +41,7 @@ this.panel1 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel(); this.taskbar = new System.Windows.Forms.Panel(); + this.taskbarItems = new System.Windows.Forms.Panel(); this.taskbartime = new System.Windows.Forms.Label(); this.clockPanel = new System.Windows.Forms.Panel(); this.startbutton = new System.Windows.Forms.PictureBox(); @@ -158,6 +159,7 @@ // this.taskbar.BackColor = System.Drawing.Color.Silver; this.taskbar.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("taskbar.BackgroundImage"))); + this.taskbar.Controls.Add(this.taskbarItems); this.taskbar.Controls.Add(this.taskbartime); this.taskbar.Controls.Add(this.clockPanel); this.taskbar.Controls.Add(this.startbutton); @@ -167,6 +169,13 @@ this.taskbar.Size = new System.Drawing.Size(640, 28); this.taskbar.TabIndex = 2; // + // taskbarItems + // + this.taskbarItems.Location = new System.Drawing.Point(63, 3); + this.taskbarItems.Name = "taskbarItems"; + this.taskbarItems.Size = new System.Drawing.Size(506, 22); + this.taskbarItems.TabIndex = 5; + // // taskbartime // this.taskbartime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -1128,6 +1137,7 @@ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Windows95"; + this.Tag = "ignoreFormOnTaskbar"; this.Text = "TimeHACKDesktop"; this.Load += new System.EventHandler(this.Desktop_Load); this.panel1.ResumeLayout(false); @@ -1237,5 +1247,6 @@ private System.Windows.Forms.ToolStripMenuItem windowManagerTestToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem downloaderTestToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem installerTestToolStripMenuItem; + private System.Windows.Forms.Panel taskbarItems; } } \ No newline at end of file diff --git a/TimeHACK.Main/OS/Win95/Win95.cs b/TimeHACK.Main/OS/Win95/Win95.cs index 194815f..8b6e381 100644 --- a/TimeHACK.Main/OS/Win95/Win95.cs +++ b/TimeHACK.Main/OS/Win95/Win95.cs @@ -6,6 +6,7 @@ using System.Media; using System.Windows.Forms; using TimeHACK.Engine; using TimeHACK.Engine.Template; +using TimeHACK.Engine.Template.Taskbars; using TimeHACK.OS.Win95.Win95Apps; using TimeHACK.WinClassicForms; @@ -20,6 +21,7 @@ namespace TimeHACK.OS.Win95 public List nonimportantapps = new List(); public WinClassic webchat; public WinClassic ie; + public TaskBarController tb = new TaskBarController(); public int currentappcount = 0; @@ -59,6 +61,9 @@ namespace TimeHACK.OS.Win95 //nonimportantapps.Capacity = 100; this.SendToBack(); + + // THIS IS TESTING STUFF HERE: + taskbarItems = tb.AddTaskbarItem95(0, "Test app", Properties.Resources.Win95IconWordpad, (UserControl)new Win95TaskBarItem(), taskbarItems); } private void fontLoad() @@ -118,6 +123,7 @@ namespace TimeHACK.OS.Win95 private void taskbartime_Click(object sender, EventArgs e) { //TODO: Set Up Year Codes + // We are actually thinking about not having save code because it would be nice if we could save tons of data! } // Set the Clock @@ -237,9 +243,36 @@ namespace TimeHACK.OS.Win95 { WinClassicWordPad wp = new WinClassicWordPad(); WinClassic app = wm.startWin95(wp, "Wordpad", Properties.Resources.Win95IconWordpad, true, true); + AddTaskBarItem(app, (int)app.Tag, "Wordpad", Properties.Resources.Win95IconWordpad); + MessageBox.Show(app.Tag.ToString()); app.BringToFront(); startmenu.Hide(); } + + public void AddTaskBarItem(Form Application, int ApplicationID, string ApplicationName, Image ApplicationIcon) + { + taskbarItems = tb.AddTaskbarItem95(ApplicationID, ApplicationName, ApplicationIcon, (UserControl)new Win95TaskBarItem(), taskbarItems); + Application.FormClosing += new FormClosingEventHandler(UpdateTaskbarFromClosedApplication); + } + + public void UpdateTaskbarFromClosedApplication(object sender, FormClosingEventArgs e) + { + UpdateTaskbar(); + } + + public void UpdateTaskbar() + { + // Clears out all the items on the taskbar + taskbarItems.Controls.Clear(); + + // Loops through all the Applications which are open + + foreach (Form form in tb.GetAllOpenApps()) + { + // Calls that "AddToTaskbar" thing + taskbarItems = tb.AddTaskbarItem95((int)form.Tag, form.Text, (Image)form.Icon.ToBitmap(), (UserControl)new Win95TaskBarItem(), taskbarItems); + } + } } } diff --git a/TimeHACK.Main/OS/Win95/Win95.resx b/TimeHACK.Main/OS/Win95/Win95.resx index 3038697..ae3e1b6 100644 --- a/TimeHACK.Main/OS/Win95/Win95.resx +++ b/TimeHACK.Main/OS/Win95/Win95.resx @@ -330,7 +330,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADq - ggAAAk1TRnQBSQFMAgEBDAEAARABAQEQAQEBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA + ggAAAk1TRnQBSQFMAgEBDAEAATABAQEwAQEBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA AwABgAMAAQEBAAEgBwABAf8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AXAAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/x8AAf8DAAH/ diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicAddressBook.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicAddressBook.Designer.cs new file mode 100644 index 0000000..09f32df --- /dev/null +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicAddressBook.Designer.cs @@ -0,0 +1,45 @@ +namespace TimeHACK.OS.Win95.Win95Apps +{ + partial class WinClassicAddressBook + { + /// + /// 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.SuspendLayout(); + // + // WinClassicAddressBook + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Name = "WinClassicAddressBook"; + this.Size = new System.Drawing.Size(260, 264); + this.ResumeLayout(false); + + } + + #endregion + } +} diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicAddressBook.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicAddressBook.cs new file mode 100644 index 0000000..3934fa7 --- /dev/null +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicAddressBook.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace TimeHACK.OS.Win95.Win95Apps +{ + public partial class WinClassicAddressBook : UserControl + { + public WinClassicAddressBook() + { + InitializeComponent(); + } + } +} diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicAddressBook.resx b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicAddressBook.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicAddressBook.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/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs index 217de42..4ddb045 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs @@ -17,8 +17,8 @@ namespace TimeHACK.OS.Win95.Win95Apps WindowManager wm = new WindowManager(); bool btnBoldSelected = true; - bool btnItalicSelected; - bool btnUnderlineSelected; + bool btnItalicSelected = true; + bool btnUnderlineSelected = true; bool doBold; bool doItalic; bool doUnderline; diff --git a/TimeHACK.Main/OS/Win95/Win95TaskBarItem.Designer.cs b/TimeHACK.Main/OS/Win95/Win95TaskBarItem.Designer.cs new file mode 100644 index 0000000..e369909 --- /dev/null +++ b/TimeHACK.Main/OS/Win95/Win95TaskBarItem.Designer.cs @@ -0,0 +1,74 @@ +namespace TimeHACK.Engine.Template.Taskbars +{ + partial class Win95TaskBarItem + { + /// + /// 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.progPic = new System.Windows.Forms.PictureBox(); + this.progName = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.progPic)).BeginInit(); + this.SuspendLayout(); + // + // progPic + // + this.progPic.Location = new System.Drawing.Point(3, 3); + this.progPic.Name = "progPic"; + this.progPic.Size = new System.Drawing.Size(28, 24); + this.progPic.TabIndex = 0; + this.progPic.TabStop = false; + // + // progName + // + this.progName.AutoSize = true; + this.progName.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.progName.Location = new System.Drawing.Point(37, 3); + this.progName.Name = "progName"; + this.progName.Size = new System.Drawing.Size(60, 24); + this.progName.TabIndex = 1; + this.progName.Text = "label1"; + // + // Win95TaskBarItem + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.progName); + this.Controls.Add(this.progPic); + this.Name = "Win95TaskBarItem"; + this.Size = new System.Drawing.Size(193, 30); + this.Load += new System.EventHandler(this.Win95TaskBarItem_Load); + ((System.ComponentModel.ISupportInitialize)(this.progPic)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox progPic; + private System.Windows.Forms.Label progName; + } +} diff --git a/TimeHACK.Main/OS/Win95/Win95TaskBarItem.cs b/TimeHACK.Main/OS/Win95/Win95TaskBarItem.cs new file mode 100644 index 0000000..9cff376 --- /dev/null +++ b/TimeHACK.Main/OS/Win95/Win95TaskBarItem.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace TimeHACK.Engine.Template.Taskbars +{ + public partial class Win95TaskBarItem : UserControl + { + public Win95TaskBarItem() + { + InitializeComponent(); + progName.Font = new Font(TitleScreen.pfc.Families[0], 16f, FontStyle.Regular, GraphicsUnit.Point, ((0))); + this.BackColor = Color.Silver; + } + + private void Win95TaskBarItem_Load(object sender, EventArgs e) + { + progName.Text = (string)this.Tag; + progPic.Image = this.BackgroundImage; + this.BackgroundImage = null; + } + } +} diff --git a/TimeHACK.Main/OS/Win95/Win95TaskBarItem.resx b/TimeHACK.Main/OS/Win95/Win95TaskBarItem.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/TimeHACK.Main/OS/Win95/Win95TaskBarItem.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 -- cgit v1.2.3