diff options
| author | Alex-TIMEHACK <[email protected]> | 2017-04-30 15:46:36 +0100 |
|---|---|---|
| committer | Alex-TIMEHACK <[email protected]> | 2017-04-30 15:46:36 +0100 |
| commit | 12c253ab76b8117a563b021e969262da13eaec9d (patch) | |
| tree | e6a99881473b838873ecc91659b480594bcfcff5 /TimeHACK.Main/OS/Win95/Win95.cs | |
| parent | c56b38e8b2b8729d91a1ad96839b042af480eabe (diff) | |
| download | histacom2-12c253ab76b8117a563b021e969262da13eaec9d.tar.gz histacom2-12c253ab76b8117a563b021e969262da13eaec9d.tar.bz2 histacom2-12c253ab76b8117a563b021e969262da13eaec9d.zip | |
Half done the taskbars
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95.cs')
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95.cs | 33 |
1 files changed, 33 insertions, 0 deletions
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<WinClassic> nonimportantapps = new List<WinClassic>(); 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); + } + } } } |
