aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/OS/Win95/Win95.cs
diff options
context:
space:
mode:
authorAShifter <[email protected]>2017-04-22 13:41:33 -0600
committerAShifter <[email protected]>2017-04-22 13:41:33 -0600
commit51177cd4c24b9b107726bdbae914d49f6b5fa7b5 (patch)
tree08d585cb8e2b0241aaede964a38973af42a1c470 /TimeHACK.Main/OS/Win95/Win95.cs
parent5773e8ac9aeac2d395a700eac26d86db90c60c13 (diff)
parente6474bbf221d26d227e42174c4d1ab939987be2b (diff)
downloadhistacom2-51177cd4c24b9b107726bdbae914d49f6b5fa7b5.tar.gz
histacom2-51177cd4c24b9b107726bdbae914d49f6b5fa7b5.tar.bz2
histacom2-51177cd4c24b9b107726bdbae914d49f6b5fa7b5.zip
Merge remote-tracking branch 'refs/remotes/TimeHACKDevs/master'
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95.cs')
-rw-r--r--TimeHACK.Main/OS/Win95/Win95.cs234
1 files changed, 234 insertions, 0 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95.cs b/TimeHACK.Main/OS/Win95/Win95.cs
new file mode 100644
index 0000000..fd09c2b
--- /dev/null
+++ b/TimeHACK.Main/OS/Win95/Win95.cs
@@ -0,0 +1,234 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.IO;
+using System.Media;
+using System.Windows.Forms;
+using TimeHACK.Engine;
+using TimeHACK.Engine.Template;
+using TimeHACK.OS.Win95.Win95Apps;
+using TimeHACK.WinClassicForms;
+
+namespace TimeHACK.OS.Win95
+{
+ public partial class Windows95 : Form
+ {
+ private SoundPlayer startsound;
+ private SoundPlayer stopsound;
+ public WindowManager wm = new WindowManager();
+
+ public List<WinClassic> nonimportantapps;
+ public WinClassic webchat;
+ public WinClassic ie;
+
+ public bool webchatInstalled = false;
+
+ // Init the form
+ public Windows95()
+ {
+ InitializeComponent();
+ }
+
+ // When New Game is clicked in TitleScreen.cs
+ private void Desktop_Load(object sender, EventArgs e)
+ {
+ // Make Font Mandatory
+ fontLoad();
+
+ // Play Windows 95 Start Sound
+ Stream audio = Properties.Resources.Win95Start;
+ startsound = new SoundPlayer(audio);
+ startsound.Play();
+
+ // Hide the Startmenu
+ startmenu.Hide();
+
+ // Check for and set VM Mode
+ if (this.FormBorderStyle != FormBorderStyle.None)
+ {
+ this.Text = "TimeHACK - VM Mode";
+ }
+
+ // Start the ClockTimer
+ clockTimer.Start();
+
+ // Set the StartMenu seperator
+ startmenuitems.Items.Insert(6, new ToolStripSeparator());
+
+ this.SendToBack();
+ }
+
+ private void fontLoad()
+ {
+ this.taskbartime.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
+ this.ProgramsToolStripMenuItem.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
+ this.DocumentsToolStripMenuItem.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
+ this.SettingsToolStripMenuItem.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
+ this.FindToolStripMenuItem.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
+ this.HelpToolStripMenuItem.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
+ this.RunToolStripMenuItem.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
+ this.SuspendToolStripMenuItem.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
+ this.ShutdownToolStripMenuItem.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
+ this.desktopicons.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
+ }
+
+ #region StartMenu
+
+ // Paint StartMenu
+ private void startmenu_Paint(object sender, PaintEventArgs e)
+ {
+ // Paint the StartMenu
+ ControlPaint.DrawBorder(e.Graphics, startmenu.ClientRectangle,
+ SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset,
+ SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset,
+ SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset,
+ SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset);
+ }
+
+ // StartButton Click
+ private void startbutton_Click(object sender, EventArgs e)
+ {
+ startmenu.Show();
+ startmenu.BringToFront();
+ }
+
+ // Shutdown button
+ private void ShutdownToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ startsound.Stop();
+ Stream audio = Properties.Resources.tada;
+ stopsound = new SoundPlayer(audio);
+ stopsound.Play();
+ System.Threading.Thread.Sleep(1500);
+ Application.Exit();
+ }
+
+ #endregion //Region
+
+ // When add new folder is clicked
+ private void FolderToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ desktopicons.Items.Add("New Folder");
+ }
+
+ // Give Year Code - NYI
+ private void taskbartime_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ // Set the Clock
+ private void clockTimer_Tick(object sender, EventArgs e)
+ {
+ taskbartime.Text = DateTime.Now.ToString("h:mm tt");
+ }
+
+ // On Desktop MouseDown
+ private void desktop_mousedown(object sender, MouseEventArgs e)
+ {
+ if (e.Button == MouseButtons.Right)
+ {
+ rightclickbackproperties.Show();
+ rightclickbackproperties.BringToFront();
+ rightclickbackproperties.Location = MousePosition;
+ }
+
+ // If
+ else if (e.Button == MouseButtons.Left)
+ {
+ rightclickbackproperties.Hide();
+ startmenu.Hide();
+ }
+
+ else if (e.Button == MouseButtons.Middle)
+ {
+ rightclickbackproperties.Hide();
+ }
+ }
+
+ private void NotePadToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ nonimportantapps.Add(wm.startWin95(new Win95Notepad(), "Notepad", Properties.Resources.Win95IconNotepad, true, true));
+ nonimportantapps[nonimportantapps.Count - 1].BringToFront();
+ nonimportantapps[nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(NonImportantApp_Closing);
+ startmenu.Hide();
+ }
+ private void windowManagerTestToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ TestApp test = new TestApp();
+ wm.startWin95(test, "TestApp", null, true, true);
+ }
+
+ private void downloaderTestToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ WinClassicDownloader opendownload = new WinClassicDownloader();
+ wm.startWin95(opendownload, "Downloader", null, false, true);
+ opendownload.appName.Text = "Downloading: Survive The Day";
+ }
+
+ private void installerTestToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ WinClassicInstaller openinstaller = new WinClassicInstaller();
+ wm.startWin95(openinstaller, "Installer", null, false, true);
+ }
+
+ private void InternetExplorerToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ 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", (Image)resources.GetObject("InternetExplorerToolStripMenuItem.Image"), true, true);
+ ie.BringToFront();
+ ie.FormClosing += new FormClosingEventHandler(InternetExplorer4_Closing);
+ startmenu.Hide();
+ }
+
+ private void desktopicons_Click(object sender, EventArgs e)
+ {
+ Point objDrawingPoint = desktopicons.PointToClient(Cursor.Position);
+ ListViewItem objListViewItem;
+
+ if (objDrawingPoint != null)
+ {
+ objListViewItem = desktopicons.GetItemAt(objDrawingPoint.X, objDrawingPoint.Y);
+ if (objListViewItem != null)
+ {
+ if (objListViewItem.Text == "Internet Explorer")
+ {
+ 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", (Image)resources.GetObject("InternetExplorerToolStripMenuItem.Image"), true, true);
+ ie.BringToFront();
+ ie.FormClosing += new FormClosingEventHandler(InternetExplorer4_Closing);
+ startmenu.Hide();
+ } else if (objListViewItem.Text == "Web Chat Setup")
+ {
+ WinClassicInstaller inst = new WinClassicInstaller();
+ inst.installname.Text = "Web Chat 1998";
+ WinClassic app = wm.startWin95(inst, "Web Chat Setup", null, true, true);
+ app.BringToFront();
+ startmenu.Hide();
+ }
+ }
+ }
+ }
+
+ private void infoboxTestToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ wm.startInfobox95("AShifter's Infobox", "This is the very first TimeHACK Infobox. It's really easy to call, too! \n Just use wm.startInfobox95(String title, String text, Image erroricon)!", Properties.Resources.Win95Info);
+ }
+ private void WebChatToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ WebChat1998 wc = new WebChat1998();
+ WinClassic app = wm.startWin95(wc, "Web Chat 1998", null, true, true);
+ app.BringToFront();
+ startmenu.Hide();
+ }
+ private void NonImportantApp_Closing(object sender, FormClosingEventArgs e)
+ {
+ nonimportantapps.Remove((WinClassic)sender);
+ }
+ private void InternetExplorer4_Closing(object sender, FormClosingEventArgs e)
+ {
+ ie = null;
+ }
+ }
+}
+