aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/OS
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-05-01 09:54:13 +0100
committerAlex-TIMEHACK <[email protected]>2017-05-01 09:54:13 +0100
commite0c8a9521719dcb6d702d489fed05ea28c6afe94 (patch)
tree242246acd5a750cb7ac3b25ddf467d5a638f9ede /TimeHACK.Main/OS
parent12c253ab76b8117a563b021e969262da13eaec9d (diff)
downloadhistacom2-e0c8a9521719dcb6d702d489fed05ea28c6afe94.tar.gz
histacom2-e0c8a9521719dcb6d702d489fed05ea28c6afe94.tar.bz2
histacom2-e0c8a9521719dcb6d702d489fed05ea28c6afe94.zip
Fully working taskbar!
IT WORKS!
Diffstat (limited to 'TimeHACK.Main/OS')
-rw-r--r--TimeHACK.Main/OS/Win95/Win95.cs23
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs2
-rw-r--r--TimeHACK.Main/OS/Win95/Win95TaskBarItem.Designer.cs3
-rw-r--r--TimeHACK.Main/OS/Win95/Win95TaskBarItem.cs12
4 files changed, 30 insertions, 10 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95.cs b/TimeHACK.Main/OS/Win95/Win95.cs
index 8b6e381..d0ea75e 100644
--- a/TimeHACK.Main/OS/Win95/Win95.cs
+++ b/TimeHACK.Main/OS/Win95/Win95.cs
@@ -63,7 +63,8 @@ namespace TimeHACK.OS.Win95
this.SendToBack();
// THIS IS TESTING STUFF HERE:
- taskbarItems = tb.AddTaskbarItem95(0, "Test app", Properties.Resources.Win95IconWordpad, (UserControl)new Win95TaskBarItem(), taskbarItems);
+ taskbarItems = tb.AddTaskbarItem95("0", "Test app", Properties.Resources.Win95IconWordpad, (UserControl)new Win95TaskBarItem(), taskbarItems);
+ UpdateTaskbar();
}
private void fontLoad()
@@ -157,9 +158,15 @@ namespace TimeHACK.OS.Win95
private void NotePadToolStripMenuItem_Click(object sender, EventArgs e)
{
- nonimportantapps.Add(wm.startWin95(new Win95Notepad(), "Notepad", Properties.Resources.Win95IconNotepad, true, true));
+ Win95Notepad wp = new Win95Notepad();
+ WinClassic app = wm.startWin95(wp, "Notepad", Properties.Resources.Win95IconNotepad, true, true);
+ AddTaskBarItem(app, app.Tag.ToString(), "Notepad", Properties.Resources.Win95IconNotepad);
+
+ nonimportantapps.Add(app);
nonimportantapps[nonimportantapps.Count - 1].BringToFront();
nonimportantapps[nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(NonImportantApp_Closing);
+
+ app.BringToFront();
startmenu.Hide();
}
private void windowManagerTestToolStripMenuItem_Click(object sender, EventArgs e)
@@ -185,6 +192,7 @@ namespace TimeHACK.OS.Win95
{
if (ie != null) { wm.startInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", Properties.Resources.Win95Warning); return; }
ie = wm.startWin95(new WinClassicIE4(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true);
+ AddTaskBarItem(ie, ie.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconIE4);
ie.BringToFront();
ie.FormClosing += new FormClosingEventHandler(InternetExplorer4_Closing);
startmenu.Hide();
@@ -243,19 +251,18 @@ 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());
+ AddTaskBarItem(app, app.Tag.ToString(), "Wordpad", Properties.Resources.Win95IconWordpad);
app.BringToFront();
startmenu.Hide();
}
- public void AddTaskBarItem(Form Application, int ApplicationID, string ApplicationName, Image ApplicationIcon)
+ public void AddTaskBarItem(Form Application, string ApplicationID, string ApplicationName, Image ApplicationIcon)
{
taskbarItems = tb.AddTaskbarItem95(ApplicationID, ApplicationName, ApplicationIcon, (UserControl)new Win95TaskBarItem(), taskbarItems);
- Application.FormClosing += new FormClosingEventHandler(UpdateTaskbarFromClosedApplication);
+ Application.FormClosed += new FormClosedEventHandler(UpdateTaskbarFromClosedApplication);
}
- public void UpdateTaskbarFromClosedApplication(object sender, FormClosingEventArgs e)
+ public void UpdateTaskbarFromClosedApplication(object sender, FormClosedEventArgs e)
{
UpdateTaskbar();
}
@@ -270,7 +277,7 @@ namespace TimeHACK.OS.Win95
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);
+ taskbarItems = tb.AddTaskbarItem95(form.Tag.ToString(), form.Text.ToString(), (Image)form.Icon.ToBitmap(), (UserControl)new Win95TaskBarItem(), taskbarItems);
}
}
}
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs
index 4ddb045..84ef3f6 100644
--- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs
@@ -122,7 +122,7 @@ namespace TimeHACK.OS.Win95.Win95Apps
private void aboutWordpadToolStripMenuItem_Click(object sender, EventArgs e)
{
- wm.startAboutBox95("Wordpad", "Microsoft Wordpad", Properties.Resources.WinClassicWordpad);
+ wm.startAboutBox95("Wordpad", "Microsoft Wordpad", Properties.Resources.Win95IconWordpad);
}
private void newToolStripMenuItem_Click(object sender, EventArgs e)
diff --git a/TimeHACK.Main/OS/Win95/Win95TaskBarItem.Designer.cs b/TimeHACK.Main/OS/Win95/Win95TaskBarItem.Designer.cs
index e369909..71ccfde 100644
--- a/TimeHACK.Main/OS/Win95/Win95TaskBarItem.Designer.cs
+++ b/TimeHACK.Main/OS/Win95/Win95TaskBarItem.Designer.cs
@@ -40,6 +40,7 @@
this.progPic.Size = new System.Drawing.Size(28, 24);
this.progPic.TabIndex = 0;
this.progPic.TabStop = false;
+ this.progPic.Click += new System.EventHandler(this.Win95TaskBarItem_Click);
//
// progName
//
@@ -50,6 +51,7 @@
this.progName.Size = new System.Drawing.Size(60, 24);
this.progName.TabIndex = 1;
this.progName.Text = "label1";
+ this.progName.Click += new System.EventHandler(this.Win95TaskBarItem_Click);
//
// Win95TaskBarItem
//
@@ -60,6 +62,7 @@
this.Name = "Win95TaskBarItem";
this.Size = new System.Drawing.Size(193, 30);
this.Load += new System.EventHandler(this.Win95TaskBarItem_Load);
+ this.Click += new System.EventHandler(this.Win95TaskBarItem_Click);
((System.ComponentModel.ISupportInitialize)(this.progPic)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
diff --git a/TimeHACK.Main/OS/Win95/Win95TaskBarItem.cs b/TimeHACK.Main/OS/Win95/Win95TaskBarItem.cs
index 9cff376..b193e38 100644
--- a/TimeHACK.Main/OS/Win95/Win95TaskBarItem.cs
+++ b/TimeHACK.Main/OS/Win95/Win95TaskBarItem.cs
@@ -7,11 +7,14 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
+using TimeHACK.Engine;
namespace TimeHACK.Engine.Template.Taskbars
{
public partial class Win95TaskBarItem : UserControl
{
+ TaskBarController tb = new TaskBarController();
+ public string ApplicationID;
public Win95TaskBarItem()
{
InitializeComponent();
@@ -23,7 +26,14 @@ namespace TimeHACK.Engine.Template.Taskbars
{
progName.Text = (string)this.Tag;
progPic.Image = this.BackgroundImage;
- this.BackgroundImage = null;
+ ApplicationID = (TaskBarController.AvalibleApplicationID - 1).ToString();
+ this.BackgroundImage = null;
+ this.Width = (progName.Left + progName.Width);
+ }
+
+ private void Win95TaskBarItem_Click(object sender, EventArgs e)
+ {
+ tb.FocusAppFromID(ApplicationID);
}
}
}