aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/OS/Win95/Win95.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/Win95/Win95.cs
parent110089e0d7fcbc454dc55c0619ec4ccebc1a7e85 (diff)
downloadhistacom2-62a2bc4706a331eaed2bcd7c08ffb88b4afe8b91.tar.gz
histacom2-62a2bc4706a331eaed2bcd7c08ffb88b4afe8b91.tar.bz2
histacom2-62a2bc4706a331eaed2bcd7c08ffb88b4afe8b91.zip
Finished the realistic desktop
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95.cs')
-rw-r--r--TimeHACK.Main/OS/Win95/Win95.cs99
1 files changed, 93 insertions, 6 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95.cs b/TimeHACK.Main/OS/Win95/Win95.cs
index d2f7507..3649982 100644
--- a/TimeHACK.Main/OS/Win95/Win95.cs
+++ b/TimeHACK.Main/OS/Win95/Win95.cs
@@ -172,12 +172,6 @@ namespace TimeHACK.OS.Win95
#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)
{
@@ -195,6 +189,17 @@ namespace TimeHACK.OS.Win95
{
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;
@@ -285,6 +290,25 @@ namespace TimeHACK.OS.Win95
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
@@ -484,6 +508,69 @@ namespace TimeHACK.OS.Win95
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"));
}
+
+ // When add new folder is clicked
+ private void FolderToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ if (Directory.Exists(Path.Combine(ProfileWindowsDirectory, "Desktop", "New Folder")))
+ {
+ wm.StartInfobox95("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);
+ desktopupdate_Tick(null, null); // Update the desktop Icons
+ }
+ }
+
+ private void TextDocumentToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ if (File.Exists(Path.Combine(ProfileWindowsDirectory, "Desktop", "New Text Document.txt")))
+ {
+ wm.StartInfobox95("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
{