aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/OS/Win98/Win98.cs
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-07-23 17:42:07 +0100
committerAlex-TIMEHACK <[email protected]>2017-07-23 17:42:07 +0100
commit62a2bc4706a331eaed2bcd7c08ffb88b4afe8b91 (patch)
tree0af751bf2de9485a0dda49058a444d321b7e870d /TimeHACK.Main/OS/Win98/Win98.cs
parent110089e0d7fcbc454dc55c0619ec4ccebc1a7e85 (diff)
downloadhistacom2-62a2bc4706a331eaed2bcd7c08ffb88b4afe8b91.tar.gz
histacom2-62a2bc4706a331eaed2bcd7c08ffb88b4afe8b91.tar.bz2
histacom2-62a2bc4706a331eaed2bcd7c08ffb88b4afe8b91.zip
Finished the realistic desktop
Diffstat (limited to 'TimeHACK.Main/OS/Win98/Win98.cs')
-rw-r--r--TimeHACK.Main/OS/Win98/Win98.cs162
1 files changed, 150 insertions, 12 deletions
diff --git a/TimeHACK.Main/OS/Win98/Win98.cs b/TimeHACK.Main/OS/Win98/Win98.cs
index 2fe4e3c..73702a5 100644
--- a/TimeHACK.Main/OS/Win98/Win98.cs
+++ b/TimeHACK.Main/OS/Win98/Win98.cs
@@ -110,6 +110,16 @@ namespace TimeHACK.OS.Win98
// Bring to this the front
this.BringToFront();
+ // Update the desktop Icons!
+
+ DesktopController.RefreshDesktopIcons(new ListViewItem[] { new System.Windows.Forms.ListViewItem("My Computer", 0),
+ new System.Windows.Forms.ListViewItem("Network Neighborhood", 5),
+ new System.Windows.Forms.ListViewItem("Inbox", 3),
+ new System.Windows.Forms.ListViewItem("Recycle Bin", 7),
+ new System.Windows.Forms.ListViewItem("Internet Explorer", 2),
+ new System.Windows.Forms.ListViewItem("Online Services", 1),
+ new System.Windows.Forms.ListViewItem("Set Up The Microsoft Network", 4),
+ new System.Windows.Forms.ListViewItem("Outlook Express", 6) }, ref desktopicons, Path.Combine(ProfileWindowsDirectory, "Desktop"));
}
private void fontLoad()
@@ -145,12 +155,6 @@ namespace TimeHACK.OS.Win98
#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)
{
@@ -168,6 +172,19 @@ namespace TimeHACK.OS.Win98
{
if (e.Button == MouseButtons.Right)
{
+ // Check if an item is selected and if so show the Delete option
+
+ if (desktopicons.FocusedItem != null)
+ {
+ deleteToolStripMenuItem.Visible = true;
+ }
+ else
+ {
+ deleteToolStripMenuItem.Visible = false;
+ }
+
+ desktopupdate_Tick(null, null); // Update the Desktop Icons
+
rightclickbackproperties.Show();
rightclickbackproperties.BringToFront();
rightclickbackproperties.Location = MousePosition;
@@ -232,7 +249,7 @@ namespace TimeHACK.OS.Win98
startmenu.Hide();
}
- private void desktopicons_Click(object sender, EventArgs e)
+ private void desktopicons_DoubleClick(object sender, EventArgs e)
{
Point objDrawingPoint = desktopicons.PointToClient(Cursor.Position);
ListViewItem objListViewItem;
@@ -251,15 +268,60 @@ namespace TimeHACK.OS.Win98
ie.FormClosing += new FormClosingEventHandler(InternetExplorer4_Closing);
startmenu.Hide();
}
- else if (objListViewItem.Text == "Web Chat Setup")
+ else if (objListViewItem.Text == "My Computer")
{
- Win95Installer inst = new Win95Installer("Web Chat 1998");
- inst.InstallCompleted += (sendr, args) => WebChatToolStripMenuItem.Visible = true;
- WinClassic app = wm.StartWin95(inst, "Web Chat Setup", null, true, true);
- AddTaskBarItem(app, app.Tag.ToString(), "Web Chat Setup", null);
+ WinClassic app = wm.StartWin95(new Win95WindowsExplorer(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true);
+ AddTaskBarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer);
app.BringToFront();
startmenu.Hide();
}
+ else if (objListViewItem.Text == "Network Neighborhood")
+ {
+ // Alex's TODO here
+
+ }
+ else if (objListViewItem.Text == "Recycle Bin")
+ {
+ // Another thing you may need to digital poke Alex about doing.
+
+ }
+ else if (objListViewItem.Text == "Set Up The Microsoft Network")
+ {
+ wm.StartInfobox95("Microsoft Network", "The Microsoft Network is already set up!", Properties.Resources.Win95Info);
+ }
+ else if (objListViewItem.Text == "Outlook Express")
+ {
+ wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error);
+ }
+ else if (objListViewItem.Text == "Inbox")
+ {
+ wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error);
+ }
+ else
+ {
+ // It is an actual file on the disk
+
+ Win95WindowsExplorer we = new Win95WindowsExplorer();
+
+ // If it is a directory
+
+ if (Directory.Exists(objListViewItem.Tag.ToString()))
+ {
+ we.CurrentDirectory = objListViewItem.Tag.ToString();
+
+ WinClassic app = wm.StartWin95(we, "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true);
+ AddTaskBarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer);
+ app.BringToFront();
+ startmenu.Hide();
+ }
+ else
+ {
+ // Just open the file...
+
+ we.OpenFile(objListViewItem.Tag.ToString());
+ }
+
+ }
}
}
}
@@ -433,6 +495,82 @@ namespace TimeHACK.OS.Win98
app.BringToFront();
startmenu.Hide();
}
+
+ private void desktopupdate_Tick(object sender, EventArgs e)
+ {
+ DesktopController.RefreshDesktopIcons(new ListViewItem[] { new System.Windows.Forms.ListViewItem("My Computer", 0),
+ new System.Windows.Forms.ListViewItem("Network Neighborhood", 5),
+ new System.Windows.Forms.ListViewItem("Inbox", 3),
+ new System.Windows.Forms.ListViewItem("Recycle Bin", 7),
+ new System.Windows.Forms.ListViewItem("Internet Explorer", 2),
+ new System.Windows.Forms.ListViewItem("Online Services", 1),
+ new System.Windows.Forms.ListViewItem("Set Up The Microsoft Network", 4),
+ new System.Windows.Forms.ListViewItem("Outlook Express", 6) }, ref desktopicons, Path.Combine(ProfileWindowsDirectory, "Desktop"));
+ }
+
+ private void FolderToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ if (Directory.Exists(Path.Combine(ProfileWindowsDirectory, "Desktop", "New Folder")))
+ {
+ wm.StartAboutBox95("Windows Explorer", "A folder called New Folder already exists - please rename it.", Properties.Resources.Win95Error);
+ }
+ else
+ {
+ SaveDirectoryInfo(Path.Combine(ProfileWindowsDirectory, "Desktop", "New Folder"), false, "New folder", true);
+ }
+ }
+
+ private void TextDocumentToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ if (File.Exists(Path.Combine(ProfileWindowsDirectory, "Desktop", "New Text Document.txt")))
+ {
+ wm.StartAboutBox95("Windows Explorer", "A folder called New Text Document already exists - please rename it.", Properties.Resources.Win95Error);
+ }
+ else
+ {
+ File.Create(Path.Combine(ProfileWindowsDirectory, "Desktop", "New Text Document.txt"));
+ }
+
+ desktopupdate_Tick(null, null); // Update the Desktop Icons
+ }
+
+ private void deleteToolStripMenuItem_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.Tag != null)
+ {
+ if (Directory.Exists(objListViewItem.Tag.ToString()))
+ {
+ Directory.Delete(objListViewItem.Tag.ToString(), true);
+ desktopupdate_Tick(null, null); // Update the desktop Icons
+ }
+ else
+ {
+ if (File.Exists(objListViewItem.Tag.ToString()))
+ {
+ File.Delete(objListViewItem.Tag.ToString());
+ desktopupdate_Tick(null, null); // Update the desktop Icons
+ }
+ else
+ {
+ wm.StartInfobox95("Windows Explorer", "This object cannot be deleted.", Properties.Resources.Win95Error);
+ }
+ }
+ }
+ else
+ {
+ wm.StartInfobox95("Windows Explorer", "This object cannot be deleted.", Properties.Resources.Win95Error);
+ }
+ }
+ }
+ }
}
public class MyRenderer : ToolStripProfessionalRenderer
{