From 414133b35d39b84537f4375e27e3e5f206655c5a Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Fri, 18 Aug 2017 14:56:56 +0100 Subject: Quite Big revamp on Explorer Part 1 --- TimeHACK.Engine/FileDialogBoxManager.cs | 24 ++++ .../Win95Apps/Win95WindowsExplorer.Designer.cs | 51 ++++---- .../OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 14 +- .../Win98/Win98Apps/WinClassicWindowsExplorer.cs | 141 +++++++++------------ TimeHACK.Main/Properties/Resources.Designer.cs | 20 +++ TimeHACK.Main/Properties/Resources.resx | 6 + TimeHACK.Main/Resources/WinClassicRtfFile.png | Bin 0 -> 458 bytes TimeHACK.Main/Resources/WinClassicTextFile.png | Bin 0 -> 352 bytes TimeHACK.Main/TimeHACK.Main.csproj | 2 + 9 files changed, 147 insertions(+), 111 deletions(-) create mode 100644 TimeHACK.Main/Resources/WinClassicRtfFile.png create mode 100644 TimeHACK.Main/Resources/WinClassicTextFile.png diff --git a/TimeHACK.Engine/FileDialogBoxManager.cs b/TimeHACK.Engine/FileDialogBoxManager.cs index f6d30ae..3bffe30 100644 --- a/TimeHACK.Engine/FileDialogBoxManager.cs +++ b/TimeHACK.Engine/FileDialogBoxManager.cs @@ -13,6 +13,7 @@ namespace TimeHACK.Engine public static bool IsInOpenDialog = false; public static bool IsInSaveDialog = false; public static string OnlyViewExtension = ""; + public static void ActivateOpenFileDialog(string ExtensionToView) { IsInOpenDialog = true; @@ -36,5 +37,28 @@ namespace TimeHACK.Engine return ""; } } + + public static void SaveTextFile(string path, string contents, int fileIcon) + { + try + { + File.WriteAllText(path, contents); + FileSystemFolderInfo theDir = Newtonsoft.Json.JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(Path.GetPathRoot(path), "_data.info"))); + + + + using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read)) + { + theDir.Files.Add(new THFileInfo() + { + Name = Path.GetFileName(path), + ByteSize = (int)fs.Length, + FileIcon = fileIcon + }); + } + + + } catch { } + } } } diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs index de5c891..c854133 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs @@ -36,7 +36,6 @@ this.FileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.CreateShortcutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.FolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ShortcutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.TextDocumentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.BitmapImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.DeleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -69,6 +68,7 @@ // program // this.program.BackColor = System.Drawing.Color.Silver; + this.program.Controls.Add(this.pnlSave); this.program.Controls.Add(this.mainView); this.program.Controls.Add(this.diskView); this.program.Controls.Add(this.MenuStrip1); @@ -76,7 +76,6 @@ this.program.Controls.Add(this.bottomrightcorner); this.program.Controls.Add(this.bottomleftcorner); this.program.Controls.Add(this.topleftcorner); - this.program.Controls.Add(this.pnlSave); this.program.Dock = System.Windows.Forms.DockStyle.Fill; this.program.Location = new System.Drawing.Point(0, 0); this.program.Name = "program"; @@ -99,6 +98,9 @@ // // diskView // + this.diskView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.diskView.Location = new System.Drawing.Point(3, 27); this.diskView.Name = "diskView"; this.diskView.Size = new System.Drawing.Size(213, 444); @@ -128,63 +130,57 @@ this.RenameToolStripMenuItem, this.CloseToolStripMenuItem}); this.FileToolStripMenuItem.Name = "FileToolStripMenuItem"; - this.FileToolStripMenuItem.Size = new System.Drawing.Size(40, 20); + this.FileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.FileToolStripMenuItem.Text = "File"; // // CreateShortcutToolStripMenuItem // this.CreateShortcutToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.FolderToolStripMenuItem, - this.ShortcutToolStripMenuItem, this.TextDocumentToolStripMenuItem, this.BitmapImageToolStripMenuItem}); this.CreateShortcutToolStripMenuItem.Name = "CreateShortcutToolStripMenuItem"; - this.CreateShortcutToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.CreateShortcutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.CreateShortcutToolStripMenuItem.Text = "New"; // // FolderToolStripMenuItem // this.FolderToolStripMenuItem.Name = "FolderToolStripMenuItem"; - this.FolderToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.FolderToolStripMenuItem.Size = new System.Drawing.Size(154, 22); this.FolderToolStripMenuItem.Text = "Folder"; this.FolderToolStripMenuItem.Click += new System.EventHandler(this.FolderToolStripMenuItem_Click); // - // ShortcutToolStripMenuItem - // - this.ShortcutToolStripMenuItem.Name = "ShortcutToolStripMenuItem"; - this.ShortcutToolStripMenuItem.Size = new System.Drawing.Size(166, 22); - this.ShortcutToolStripMenuItem.Text = "Shortcut"; - // // TextDocumentToolStripMenuItem // this.TextDocumentToolStripMenuItem.Name = "TextDocumentToolStripMenuItem"; - this.TextDocumentToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.TextDocumentToolStripMenuItem.Size = new System.Drawing.Size(154, 22); this.TextDocumentToolStripMenuItem.Text = "Text Document"; + this.TextDocumentToolStripMenuItem.Click += new System.EventHandler(this.TextDocumentToolStripMenuItem_Click); // // BitmapImageToolStripMenuItem // this.BitmapImageToolStripMenuItem.Name = "BitmapImageToolStripMenuItem"; - this.BitmapImageToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.BitmapImageToolStripMenuItem.Size = new System.Drawing.Size(154, 22); this.BitmapImageToolStripMenuItem.Text = "Bitmap Image"; // // DeleteToolStripMenuItem // this.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem"; - this.DeleteToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.DeleteToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.DeleteToolStripMenuItem.Text = "Delete"; this.DeleteToolStripMenuItem.Click += new System.EventHandler(this.DeleteToolStripMenuItem_Click); // // RenameToolStripMenuItem // this.RenameToolStripMenuItem.Name = "RenameToolStripMenuItem"; - this.RenameToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.RenameToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.RenameToolStripMenuItem.Text = "Rename"; this.RenameToolStripMenuItem.Click += new System.EventHandler(this.RenameToolStripMenuItem_Click); // // CloseToolStripMenuItem // this.CloseToolStripMenuItem.Name = "CloseToolStripMenuItem"; - this.CloseToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.CloseToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.CloseToolStripMenuItem.Text = "Close"; this.CloseToolStripMenuItem.Click += new System.EventHandler(this.CloseToolStripMenuItem_Click); // @@ -196,34 +192,34 @@ this.PasteToolStripMenuItem, this.SellectAllCtrlAToolStripMenuItem}); this.EditToolStripMenuItem.Name = "EditToolStripMenuItem"; - this.EditToolStripMenuItem.Size = new System.Drawing.Size(43, 20); + this.EditToolStripMenuItem.Size = new System.Drawing.Size(39, 20); this.EditToolStripMenuItem.Text = "Edit"; // // CutCtrlXToolStripMenuItem // this.CutCtrlXToolStripMenuItem.Name = "CutCtrlXToolStripMenuItem"; - this.CutCtrlXToolStripMenuItem.Size = new System.Drawing.Size(206, 22); + this.CutCtrlXToolStripMenuItem.Size = new System.Drawing.Size(197, 22); this.CutCtrlXToolStripMenuItem.Text = "Cut Ctrl+X"; this.CutCtrlXToolStripMenuItem.Click += new System.EventHandler(this.CutCtrlXToolStripMenuItem_Click); // // CopyCtrlCToolStripMenuItem // this.CopyCtrlCToolStripMenuItem.Name = "CopyCtrlCToolStripMenuItem"; - this.CopyCtrlCToolStripMenuItem.Size = new System.Drawing.Size(206, 22); + this.CopyCtrlCToolStripMenuItem.Size = new System.Drawing.Size(197, 22); this.CopyCtrlCToolStripMenuItem.Text = "Copy Ctrl+C"; this.CopyCtrlCToolStripMenuItem.Click += new System.EventHandler(this.CopyCtrlCToolStripMenuItem_Click); // // PasteToolStripMenuItem // this.PasteToolStripMenuItem.Name = "PasteToolStripMenuItem"; - this.PasteToolStripMenuItem.Size = new System.Drawing.Size(206, 22); + this.PasteToolStripMenuItem.Size = new System.Drawing.Size(197, 22); this.PasteToolStripMenuItem.Text = "Paste Ctrl+V"; this.PasteToolStripMenuItem.Click += new System.EventHandler(this.PasteToolStripMenuItem_Click); // // SellectAllCtrlAToolStripMenuItem // this.SellectAllCtrlAToolStripMenuItem.Name = "SellectAllCtrlAToolStripMenuItem"; - this.SellectAllCtrlAToolStripMenuItem.Size = new System.Drawing.Size(206, 22); + this.SellectAllCtrlAToolStripMenuItem.Size = new System.Drawing.Size(197, 22); this.SellectAllCtrlAToolStripMenuItem.Text = "Select All Ctrl+A"; this.SellectAllCtrlAToolStripMenuItem.Click += new System.EventHandler(this.SellectAllCtrlAToolStripMenuItem_Click); // @@ -232,13 +228,13 @@ this.ViewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.RefreshToolStripMenuItem}); this.ViewToolStripMenuItem.Name = "ViewToolStripMenuItem"; - this.ViewToolStripMenuItem.Size = new System.Drawing.Size(47, 20); + this.ViewToolStripMenuItem.Size = new System.Drawing.Size(44, 20); this.ViewToolStripMenuItem.Text = "View"; // // RefreshToolStripMenuItem // this.RefreshToolStripMenuItem.Name = "RefreshToolStripMenuItem"; - this.RefreshToolStripMenuItem.Size = new System.Drawing.Size(121, 22); + this.RefreshToolStripMenuItem.Size = new System.Drawing.Size(113, 22); this.RefreshToolStripMenuItem.Text = "Refresh"; this.RefreshToolStripMenuItem.Click += new System.EventHandler(this.RefreshToolStripMenuItem_Click); // @@ -248,19 +244,19 @@ this.HelpToolStripMenuItem1, this.AboutWindows95ToolStripMenuItem}); this.HelpToolStripMenuItem.Name = "HelpToolStripMenuItem"; - this.HelpToolStripMenuItem.Size = new System.Drawing.Size(46, 20); + this.HelpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); this.HelpToolStripMenuItem.Text = "Help"; // // HelpToolStripMenuItem1 // this.HelpToolStripMenuItem1.Name = "HelpToolStripMenuItem1"; - this.HelpToolStripMenuItem1.Size = new System.Drawing.Size(188, 22); + this.HelpToolStripMenuItem1.Size = new System.Drawing.Size(174, 22); this.HelpToolStripMenuItem1.Text = "Help Topics"; // // AboutWindows95ToolStripMenuItem // this.AboutWindows95ToolStripMenuItem.Name = "AboutWindows95ToolStripMenuItem"; - this.AboutWindows95ToolStripMenuItem.Size = new System.Drawing.Size(188, 22); + this.AboutWindows95ToolStripMenuItem.Size = new System.Drawing.Size(174, 22); this.AboutWindows95ToolStripMenuItem.Text = "About Windows 95"; this.AboutWindows95ToolStripMenuItem.Click += new System.EventHandler(this.AboutWindows95ToolStripMenuItem_Click); // @@ -368,7 +364,6 @@ internal System.Windows.Forms.ToolStripMenuItem FileToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem CreateShortcutToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem FolderToolStripMenuItem; - internal System.Windows.Forms.ToolStripMenuItem ShortcutToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem TextDocumentToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem BitmapImageToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem DeleteToolStripMenuItem; diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index 9448b3a..ab7dd49 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -69,7 +69,9 @@ namespace TimeHACK.OS.Win95.Win95Apps Properties.Resources.WinClassicCalcBig, Properties.Resources.WinClassicNotepadBig, Properties.Resources.WinClassicRegedit, // 15 - Properties.Resources.WinClassicWordpad }); + Properties.Resources.WinClassicWordpad, + Properties.Resources.WinClassicTextFile, + Properties.Resources.WinClassicRtfFile}); program.BringToFront(); @@ -605,7 +607,10 @@ namespace TimeHACK.OS.Win95.Win95Apps { if (new DirectoryInfo((string)mainView.FocusedItem.Tag).Extension == null || new DirectoryInfo((string)mainView.FocusedItem.Tag).Extension == "") { // If it isn't a file - GoToDir(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text)); + if (mainView.FocusedItem.Text == "C:") + GoToDir(Path.Combine(CurrentDirectory, "CDrive")); + else + GoToDir(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text)); } else { // If it is a file @@ -979,5 +984,10 @@ namespace TimeHACK.OS.Win95.Win95Apps { } + + private void TextDocumentToolStripMenuItem_Click(object sender, EventArgs e) + { + + } } } diff --git a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs index f21a851..c148974 100644 --- a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs @@ -12,6 +12,7 @@ using System.IO; using TimeHACK.Engine; using Newtonsoft.Json; using TimeHACK.Engine.Template; +using System.Diagnostics; namespace TimeHACK.OS.Win95.Win95Apps { @@ -123,81 +124,54 @@ namespace TimeHACK.OS.Win95.Win95Apps } void RefreshAll() { - try { - - this.mainView.Items.Clear(); - - // Update the WebView - - if (CurrentDirectory == SaveSystem.ProfileMyComputerDirectory) - { - pictureBox1.Image = Properties.Resources.Win95HardDiskIcon; - } else if (CurrentDirectory == SaveSystem.ProfileFileSystemDirectory) { - pictureBox1.Image = Properties.Resources.Win95Computer; - } else { - pictureBox1.Image = Properties.Resources.WinClassicFolder; - } - - txtInfoTip.Show(); - InfoDesc.Hide(); + //try { + this.mainView.Items.Clear(); - string weblabel = ReadDataFile(CurrentDirectory, false); + foreach (string str in Directory.GetDirectories(CurrentDirectory)) + { + string label = ReadDataFile(str, false); + ListViewItem itm = this.mainView.Items.Add(label ?? Path.GetFileName(str)); + itm.ImageIndex = 1; + itm.Tag = str; + } + foreach (string str in Directory.GetFiles(CurrentDirectory)) + { + ListViewItem itm; - txtInfoTitle.Text = weblabel ?? new FileInfo(CurrentDirectory).Name; - foreach (string str in Directory.GetDirectories(CurrentDirectory)) - { - string label = ReadDataFile(str, false); - ListViewItem itm = this.mainView.Items.Add(label ?? Path.GetFileName(str)); - itm.ImageKey = str; - } - foreach (string str in Directory.GetFiles(CurrentDirectory)) + if (IsFileOpenDialog == true || IsFileSaveDialog == true) { - // Get the app Icon - - //int AppIcon = 2; - - //switch (new FileInfo(str).Extension) - //{ - // case ".exe": - // string contents; - - // contents = File.ReadAllText(str); - - // switch (contents.ToLower()) - // { - // case "calc": - // AppIcon = 3; - // break; - // case "explorer": - // AppIcon = 4; - // break; - // } - // break; - //} - - - - if (IsFileOpenDialog == true || IsFileSaveDialog == true) + if (!(Path.GetFileName(str) == "_data.info")) { - if (!(Path.GetFileName(str) == "_data.info")) + if (new FileInfo(str).Extension == onlyViewExtension) { - if (new FileInfo(str).Extension == onlyViewExtension) - { - ListViewItem itm = this.mainView.Items.Add(Path.GetFileName(str)); - itm.Tag = str; - } - } - } else { - if (!(Path.GetFileName(str) == "_data.info")) { - ListViewItem itm = this.mainView.Items.Add(Path.GetFileName(str)); + itm = this.mainView.Items.Add(Path.GetFileName(str)); itm.Tag = str; } + else break; } + else break; + } + else + { + if (!(Path.GetFileName(str) == "_data.info")) + { + itm = this.mainView.Items.Add(Path.GetFileName(str)); + itm.Tag = str; + } + else break; + } + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); + foreach (var item in fsfi.Files) + { + Debug.Print(item.Name + " " + Path.GetFileName(str)); + if (item.Name == Path.GetFileName(str)) { itm.ImageIndex = item.FileIcon; break; } } - } catch (Exception ex) { - //wm.StartInfobox95("Exploring - C:", "Error with the file explorer \n" + ex.Message, Properties.Resources.Win95Info); add illegal operation dialog here later - ((Form)this.TopLevelControl).Close(); } + /* + } catch (Exception ex) { + //wm.StartInfobox95("Exploring - C:", "Error with the file explorer \n" + ex.Message, Properties.Resources.Win95Info); add illegal operation dialog here later + ((Form)this.TopLevelControl).Close(); + }*/ } void RefreshTreeNode() @@ -602,31 +576,36 @@ namespace TimeHACK.OS.Win95.Win95Apps { try { - if (mainView.FocusedItem.Tag == null) + if (new DirectoryInfo((string)mainView.FocusedItem.Tag).Extension == null || new DirectoryInfo((string)mainView.FocusedItem.Tag).Extension == "") { // If it isn't a file - GoToDir(Path.Combine(CurrentDirectory, mainView.FocusedItem.ImageKey.ToString())); + if (mainView.FocusedItem.Text == "C:") + GoToDir(Path.Combine(CurrentDirectory, "CDrive")); + else + GoToDir(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text)); } else { // If it is a file - if (IsFileOpenDialog == true || IsFileSaveDialog == true) + if (IsFileOpenDialog == true || IsFileSaveDialog == true) + { + if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) { - if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) - { - Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); - } + Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); + } - FileDialogBoxManager.IsInOpenDialog = false; - FileDialogBoxManager.IsInSaveDialog = false; + FileDialogBoxManager.IsInOpenDialog = false; + FileDialogBoxManager.IsInSaveDialog = false; - ((Form)this.TopLevelControl).Close(); - } - else - { - OpenFile(mainView.FocusedItem.Tag.ToString()); - } + ((Form)this.TopLevelControl).Close(); + } + else + { + OpenFile(mainView.FocusedItem.Tag.ToString()); + } } - } catch (Exception ex) { + } + catch (Exception ex) + { MessageBox.Show(ex.Message); } } diff --git a/TimeHACK.Main/Properties/Resources.Designer.cs b/TimeHACK.Main/Properties/Resources.Designer.cs index 8f67f81..09a8c3b 100644 --- a/TimeHACK.Main/Properties/Resources.Designer.cs +++ b/TimeHACK.Main/Properties/Resources.Designer.cs @@ -1580,6 +1580,16 @@ namespace TimeHACK.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap WinClassicRtfFile { + get { + object obj = ResourceManager.GetObject("WinClassicRtfFile", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -1660,6 +1670,16 @@ namespace TimeHACK.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap WinClassicTextFile { + get { + object obj = ResourceManager.GetObject("WinClassicTextFile", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/TimeHACK.Main/Properties/Resources.resx b/TimeHACK.Main/Properties/Resources.resx index 6605b13..23c3c3f 100644 --- a/TimeHACK.Main/Properties/Resources.resx +++ b/TimeHACK.Main/Properties/Resources.resx @@ -804,4 +804,10 @@ ..\Resources\IE3\IE3_StopHover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\WinClassicRtfFile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\WinClassicTextFile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/TimeHACK.Main/Resources/WinClassicRtfFile.png b/TimeHACK.Main/Resources/WinClassicRtfFile.png new file mode 100644 index 0000000..c862152 Binary files /dev/null and b/TimeHACK.Main/Resources/WinClassicRtfFile.png differ diff --git a/TimeHACK.Main/Resources/WinClassicTextFile.png b/TimeHACK.Main/Resources/WinClassicTextFile.png new file mode 100644 index 0000000..a8daaf8 Binary files /dev/null and b/TimeHACK.Main/Resources/WinClassicTextFile.png differ diff --git a/TimeHACK.Main/TimeHACK.Main.csproj b/TimeHACK.Main/TimeHACK.Main.csproj index 5e04705..6fcf744 100644 --- a/TimeHACK.Main/TimeHACK.Main.csproj +++ b/TimeHACK.Main/TimeHACK.Main.csproj @@ -615,6 +615,8 @@ + + -- cgit v1.2.3 From f56e9b6232f34dec7693a1cf8968e50136a096ff Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Fri, 18 Aug 2017 15:05:28 +0100 Subject: Win 98+ Explorer is joining the party! --- .../WinClassicWindowsExplorer.Designer.cs | 10 --- .../Win98/Win98Apps/WinClassicWindowsExplorer.cs | 94 ++++++++++++++++++---- .../Win98/Win98Apps/WinClassicWindowsExplorer.resx | 3 - 3 files changed, 78 insertions(+), 29 deletions(-) diff --git a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs index 16ee161..5914b60 100644 --- a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs +++ b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs @@ -60,7 +60,6 @@ this.FileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.CreateShortcutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.FolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ShortcutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.TextDocumentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.BitmapImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.DeleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -117,7 +116,6 @@ this.mainView.Size = new System.Drawing.Size(308, 458); this.mainView.TabIndex = 10; this.mainView.UseCompatibleStateImageBehavior = false; - this.mainView.View = System.Windows.Forms.View.List; this.mainView.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.mainView_AfterLabelEdit); this.mainView.SelectedIndexChanged += new System.EventHandler(this.mainView_SelectedIndexChanged); this.mainView.DoubleClick += new System.EventHandler(this.mainView_DoubleClick); @@ -396,7 +394,6 @@ // this.CreateShortcutToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.FolderToolStripMenuItem, - this.ShortcutToolStripMenuItem, this.TextDocumentToolStripMenuItem, this.BitmapImageToolStripMenuItem}); this.CreateShortcutToolStripMenuItem.Name = "CreateShortcutToolStripMenuItem"; @@ -410,12 +407,6 @@ this.FolderToolStripMenuItem.Text = "Folder"; this.FolderToolStripMenuItem.Click += new System.EventHandler(this.FolderToolStripMenuItem_Click); // - // ShortcutToolStripMenuItem - // - this.ShortcutToolStripMenuItem.Name = "ShortcutToolStripMenuItem"; - this.ShortcutToolStripMenuItem.Size = new System.Drawing.Size(154, 22); - this.ShortcutToolStripMenuItem.Text = "Shortcut"; - // // TextDocumentToolStripMenuItem // this.TextDocumentToolStripMenuItem.Name = "TextDocumentToolStripMenuItem"; @@ -577,7 +568,6 @@ internal System.Windows.Forms.ToolStripMenuItem FileToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem CreateShortcutToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem FolderToolStripMenuItem; - internal System.Windows.Forms.ToolStripMenuItem ShortcutToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem TextDocumentToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem BitmapImageToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem DeleteToolStripMenuItem; diff --git a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs index c148974..425cff5 100644 --- a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs @@ -55,8 +55,32 @@ namespace TimeHACK.OS.Win95.Win95Apps diskView.ImageList.Images.Add(Properties.Resources.Win95NetworkIcon); diskView.ImageList.Images.Add(Properties.Resources.Win95RecycleIcon); + mainView.LargeImageList = new ImageList(); + mainView.LargeImageList.ImageSize = new Size(32, 32); + + mainView.LargeImageList.Images.AddRange(new Bitmap[] { Properties.Resources.Win95Computer, // 0 + Properties.Resources.WinClassicFolder, + Properties.Resources.WinClassicIE4, + Properties.Resources.WinClassicInbox, + Properties.Resources.WinClassicMSN, + Properties.Resources.WinClassicNetworking, // 5 + Properties.Resources.WinClassicOutlook, + Properties.Resources.WinClassicRecycle, + Properties.Resources.Win95File, + Properties.Resources.WinClassicFolder, + Properties.Resources.WinClassicApp, // 10 + Properties.Resources.WinClassicSetup, + Properties.Resources.WinClassicNotepad, + Properties.Resources.WinClassicCalcBig, + Properties.Resources.WinClassicNotepadBig, + Properties.Resources.WinClassicRegedit, // 15 + Properties.Resources.WinClassicWordpad, + Properties.Resources.WinClassicTextFile, + Properties.Resources.WinClassicRtfFile}); + program.BringToFront(); + //diskView.Items.Add("My Computer", 0); Application.DoEvents(); @@ -226,7 +250,7 @@ namespace TimeHACK.OS.Win95.Win95Apps break; case 12: - OpenApplication(FileDialogBoxManager.ReadTextFile(fileDir)); + OpenApplication(FileDialogBoxManager.ReadTextFile(fileDir), fileDir); break; } } catch { @@ -234,47 +258,85 @@ namespace TimeHACK.OS.Win95.Win95Apps } - void OpenApplication(string appname) + void OpenApplication(string appname, string path) { switch (appname.ToLower()) - { + { case "explorer": - Engine.Template.WinClassic app = wm.StartWin95(new Win95WindowsExplorer(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true); + WinClassic app = wm.StartWin95(new Win95WindowsExplorer(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true); Program.AddTaskbarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer); break; case "calc": - Engine.Template.WinClassic appCalc = wm.StartWin95(new WinClassicCalculator(), "Calculator", Properties.Resources.WinClassicCalc, true, true); + WinClassic appCalc = wm.StartWin95(new WinClassicCalculator(), "Calculator", Properties.Resources.WinClassicCalc, true, true); Program.AddTaskbarItem(appCalc, appCalc.Tag.ToString(), "Calculator", Properties.Resources.WinClassicCalc); Program.nonimportantapps.Add(appCalc); Program.nonimportantapps[Program.nonimportantapps.Count - 1].BringToFront(); Program.nonimportantapps[Program.nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(Program.NonImportantApp_Closing); + break; + case "notepad": + WinClassic appNP = wm.StartWin95(new WinClassicNotepad(), "Notepad", Properties.Resources.Win95IconNotepad_2, true, true); + Program.AddTaskbarItem(appNP, appNP.Tag.ToString(), "Notepad", Properties.Resources.Win95IconNotepad_2); + + Program.nonimportantapps.Add(appNP); + Program.nonimportantapps[Program.nonimportantapps.Count - 1].BringToFront(); + Program.nonimportantapps[Program.nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(Program.NonImportantApp_Closing); + break; case "wordpad": - Engine.Template.WinClassic appWP = wm.StartWin95(new WinClassicWordPad(), "Wordpad", Properties.Resources.WinClassicWordpad, true, true); - Program.AddTaskbarItem(appWP, appWP.Tag.ToString(), "Wordpad", Properties.Resources.WinClassicWordpad); + WinClassic appWP = wm.StartWin95(new WinClassicWordPad(), "Wordpad", Properties.Resources.Win95WordpadIcon2, true, true); + Program.AddTaskbarItem(appWP, appWP.Tag.ToString(), "Wordpad", Properties.Resources.Win95WordpadIcon2); Program.nonimportantapps.Add(appWP); Program.nonimportantapps[Program.nonimportantapps.Count - 1].BringToFront(); Program.nonimportantapps[Program.nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(Program.NonImportantApp_Closing); break; - case "iebrokeninstaller": - wm.StartInfobox95("Internet Explorer Installer", "Installation Failed: The INF file was not found", InfoboxType.Error, InfoboxButtons.OK); + case "ie": + if (TitleScreen.frm95.ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", InfoboxType.Warning, InfoboxButtons.OK); return; } + TitleScreen.frm95.ie = wm.StartWin95(new WinClassicIE3(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true); + Program.AddTaskbarItem(TitleScreen.frm95.ie, TitleScreen.frm95.ie.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconIE4); + TitleScreen.frm95.ie.BringToFront(); + TitleScreen.frm95.ie.FormClosing += new FormClosingEventHandler(TitleScreen.frm95.InternetExplorer4_Closing); break; - case "addressbook": - WinClassic appAdBk = wm.StartWin95(new WinClassicAddressBook(), "Address Book", Properties.Resources.WinClassicAddressBook, true, true); - Program.AddTaskbarItem(appAdBk, appAdBk.Tag.ToString(), "Address Book", Properties.Resources.WinClassicAddressBook); + case "web chat setup": + Win95Installer inst = new Win95Installer("Web Chat 1998"); + inst.InstallCompleted += (sendr, args) => TitleScreen.frm95.WebChatToolStripMenuItem.Visible = true; + WinClassic appInstaller = wm.StartWin95(inst, "Web Chat Setup", null, true, true); + Program.AddTaskbarItem(appInstaller, appInstaller.Tag.ToString(), "Web Chat Setup", null); + appInstaller.BringToFront(); - Program.nonimportantapps.Add(appAdBk); - Program.nonimportantapps[Program.nonimportantapps.Count - 1].BringToFront(); - Program.nonimportantapps[Program.nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(Program.NonImportantApp_Closing); + break; + case "ftp client setup": + Win95Installer instFtp = new Win95Installer("FTP Client"); + instFtp.InstallCompleted += (sendr, args) => TitleScreen.frm95.FTPClientToolStripMenuItem.Visible = true; + WinClassic appFtp = wm.StartWin95(instFtp, "FTP Client Setup", null, true, true); + Program.AddTaskbarItem(appFtp, appFtp.Tag.ToString(), "FTP Client Setup", null); + appFtp.BringToFront(); + break; + case "time distorter setup": + Win95Installer instTd = new Win95Installer("Time Distorter 0.1"); + instTd.InstallCompleted += (sendr, args) => + { + TitleScreen.frm95.TimeDistorterToolStripMenuItem.Visible = true; + }; + WinClassic appTd = wm.StartWin95(instTd, "Time Distorter Setup", null, true, true); + Program.AddTaskbarItem(appTd, appTd.Tag.ToString(), "Time Distorter Setup", null); + appTd.BringToFront(); + + break; + case "iebrokeninstaller": + wm.StartInfobox95("Internet Explorer Installer", "Installation Failed: The INF file was not found", InfoboxType.Error, InfoboxButtons.OK); + + break; + default: + wm.StartInfobox95(path.Replace(ProfileMyComputerDirectory, "C:"), $"{path.Replace(ProfileMyComputerDirectory, "C:")} is not a valid Win32 application.", InfoboxType.Error, InfoboxButtons.OK); break; } - } + } string ReturnType(string extension) { string returnVal = ""; diff --git a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.resx b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.resx index d9ff80c..0975ed4 100644 --- a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.resx +++ b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.resx @@ -117,9 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - -- cgit v1.2.3 From bd3612eadf3181856d5033d3e47b97357d88c345 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Fri, 18 Aug 2017 16:03:13 +0100 Subject: Quite Big revamp on Explorer part 2 --- TimeHACK.Engine/FileDialogBoxManager.cs | 34 +++++++++++----------- .../GlobalPrograms/WinClassicNotepad.Designer.cs | 21 +++++++------ TimeHACK.Main/GlobalPrograms/WinClassicNotepad.cs | 34 +++++++++++++++++----- .../GlobalPrograms/WinClassicNotepad.resx | 3 ++ .../OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 3 +- .../Win98/Win98Apps/WinClassicWindowsExplorer.cs | 3 +- TimeHACK.Main/Properties/Resources.Designer.cs | 10 ------- TimeHACK.Main/Properties/Resources.resx | 3 -- 8 files changed, 61 insertions(+), 50 deletions(-) diff --git a/TimeHACK.Engine/FileDialogBoxManager.cs b/TimeHACK.Engine/FileDialogBoxManager.cs index 3bffe30..7ed4725 100644 --- a/TimeHACK.Engine/FileDialogBoxManager.cs +++ b/TimeHACK.Engine/FileDialogBoxManager.cs @@ -38,27 +38,27 @@ namespace TimeHACK.Engine } } - public static void SaveTextFile(string path, string contents, int fileIcon) - { - try - { - File.WriteAllText(path, contents); - FileSystemFolderInfo theDir = Newtonsoft.Json.JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(Path.GetPathRoot(path), "_data.info"))); + //public static void SaveTextFile(string path, string contents, int fileIcon) + //{ + // try + // { + // File.WriteAllText(path, contents); + // FileSystemFolderInfo theDir = Newtonsoft.Json.JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(Path.GetPathRoot(path), "_data.info"))); - using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read)) - { - theDir.Files.Add(new THFileInfo() - { - Name = Path.GetFileName(path), - ByteSize = (int)fs.Length, - FileIcon = fileIcon - }); - } + // using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read)) + // { + // theDir.Files.Add(new THFileInfo() + // { + // Name = Path.GetFileName(path), + // ByteSize = (int)fs.Length, + // FileIcon = fileIcon + // }); + // } - } catch { } - } + // } catch { } + //} } } diff --git a/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.Designer.cs b/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.Designer.cs index bd614eb..cf1d570 100644 --- a/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.Designer.cs +++ b/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.Designer.cs @@ -1,4 +1,6 @@ -namespace TimeHACK.OS.Win95.Win95Apps +using System; + +namespace TimeHACK.OS.Win95.Win95Apps { partial class WinClassicNotepad { @@ -93,7 +95,7 @@ this.newToolStripMenuItem.BackgroundImage = global::TimeHACK.Properties.Resources.sliversilver; this.newToolStripMenuItem.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(142, 22); + this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.newToolStripMenuItem.Text = "New"; // // openToolStripMenuItem @@ -102,7 +104,7 @@ this.openToolStripMenuItem.BackgroundImage = global::TimeHACK.Properties.Resources.sliversilver; this.openToolStripMenuItem.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(142, 22); + this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.openToolStripMenuItem.Text = "Open..."; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // @@ -112,7 +114,7 @@ this.saveToolStripMenuItem.BackgroundImage = global::TimeHACK.Properties.Resources.sliversilver; this.saveToolStripMenuItem.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.Size = new System.Drawing.Size(142, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.saveToolStripMenuItem.Text = "Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // @@ -122,8 +124,9 @@ this.saveAsToolStripMenuItem.BackgroundImage = global::TimeHACK.Properties.Resources.sliversilver; this.saveAsToolStripMenuItem.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(142, 22); + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.saveAsToolStripMenuItem.Text = "Save As..."; + this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); // // pageSetupToolStripMenuItem // @@ -131,7 +134,7 @@ this.pageSetupToolStripMenuItem.BackgroundImage = global::TimeHACK.Properties.Resources.sliversilver; this.pageSetupToolStripMenuItem.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.pageSetupToolStripMenuItem.Name = "pageSetupToolStripMenuItem"; - this.pageSetupToolStripMenuItem.Size = new System.Drawing.Size(142, 22); + this.pageSetupToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.pageSetupToolStripMenuItem.Text = "Page Setup..."; // // printToolStripMenuItem @@ -140,7 +143,7 @@ this.printToolStripMenuItem.BackgroundImage = global::TimeHACK.Properties.Resources.sliversilver; this.printToolStripMenuItem.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.printToolStripMenuItem.Name = "printToolStripMenuItem"; - this.printToolStripMenuItem.Size = new System.Drawing.Size(142, 22); + this.printToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.printToolStripMenuItem.Text = "Print"; // // exitToolStripMenuItem @@ -149,7 +152,7 @@ this.exitToolStripMenuItem.BackgroundImage = global::TimeHACK.Properties.Resources.sliversilver; this.exitToolStripMenuItem.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(142, 22); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.exitToolStripMenuItem.Text = "Exit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // @@ -320,7 +323,7 @@ // mainText // this.mainText.Dock = System.Windows.Forms.DockStyle.Fill; - this.mainText.Font = new System.Drawing.Font("Courier", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.mainText.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.mainText.Location = new System.Drawing.Point(0, 24); this.mainText.MaxLength = 131072; this.mainText.Multiline = true; diff --git a/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.cs b/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.cs index 8e3726d..3c9ac2f 100644 --- a/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.cs +++ b/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.cs @@ -15,6 +15,7 @@ namespace TimeHACK.OS.Win95.Win95Apps { public partial class WinClassicNotepad : UserControl { + string CurrentFilePath = ""; public WinClassicNotepad() { InitializeComponent(); @@ -36,7 +37,7 @@ namespace TimeHACK.OS.Win95.Win95Apps private void aboutNotepadToolStripMenuItem_Click(object sender, EventArgs e) { WindowManager wm = new WindowManager(); - wm.StartAboutBox95("Notepad", "Microsoft Notepad", Properties.Resources.WinClassicNotepad); + wm.StartAboutBox95("Notepad", "Microsoft Notepad", Properties.Resources.WinClassicNotepadBig); } private void wordWrapToolStripMenuItem_Click(object sender, EventArgs e) @@ -99,20 +100,39 @@ namespace TimeHACK.OS.Win95.Win95Apps } private void saveToolStripMenuItem_Click(object sender, EventArgs e) + { + if (CurrentFilePath == "") + { + // We aren't in a file right now + + SaveAs(); + } else { + + File.Delete(CurrentFilePath); + SaveSystem.CreateWindowsFile(new FileInfo(CurrentFilePath).Directory.FullName, CurrentFilePath.Split('\\').Last(), mainText.Text, 12, mainText.Text.Length); + } + } + + // TO LEMPAMO: THIS FUCTION IS A FUNCTION ON IT'S OWN BECUASE TWO THINGS CALL IT - OK? + void SaveAs() { try { ActivateSaveFileDialog(".txt"); string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); - List pathList = selectedPath.Split('\\').ToList(); - pathList.RemoveAt(selectedPath.Split('\\').Count() - 1); if (selectedPath != "") { - SaveSystem.CreateWindowsFile(pathList.ToString(), selectedPath.Split('\\').Last(), mainText.Text, 12, mainText.Text.Length); - } - } catch { - } + SaveSystem.CreateWindowsFile(new FileInfo(selectedPath).Directory.FullName, selectedPath.Split('\\').Last(), mainText.Text, 12, mainText.Text.Length); + CurrentFilePath = selectedPath; + } + } + catch { } + } + + private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) + { + SaveAs(); } } } diff --git a/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.resx b/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.resx index 1af7de1..d5494e3 100644 --- a/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.resx +++ b/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index ab7dd49..acb491f 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -65,12 +65,11 @@ namespace TimeHACK.OS.Win95.Win95Apps Properties.Resources.WinClassicFolder, Properties.Resources.WinClassicApp, // 10 Properties.Resources.WinClassicSetup, - Properties.Resources.WinClassicNotepad, + Properties.Resources.WinClassicTextFile, Properties.Resources.WinClassicCalcBig, Properties.Resources.WinClassicNotepadBig, Properties.Resources.WinClassicRegedit, // 15 Properties.Resources.WinClassicWordpad, - Properties.Resources.WinClassicTextFile, Properties.Resources.WinClassicRtfFile}); program.BringToFront(); diff --git a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs index 425cff5..d111fbe 100644 --- a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs @@ -70,12 +70,11 @@ namespace TimeHACK.OS.Win95.Win95Apps Properties.Resources.WinClassicFolder, Properties.Resources.WinClassicApp, // 10 Properties.Resources.WinClassicSetup, - Properties.Resources.WinClassicNotepad, + Properties.Resources.WinClassicTextFile, Properties.Resources.WinClassicCalcBig, Properties.Resources.WinClassicNotepadBig, Properties.Resources.WinClassicRegedit, // 15 Properties.Resources.WinClassicWordpad, - Properties.Resources.WinClassicTextFile, Properties.Resources.WinClassicRtfFile}); program.BringToFront(); diff --git a/TimeHACK.Main/Properties/Resources.Designer.cs b/TimeHACK.Main/Properties/Resources.Designer.cs index 09a8c3b..1cc8733 100644 --- a/TimeHACK.Main/Properties/Resources.Designer.cs +++ b/TimeHACK.Main/Properties/Resources.Designer.cs @@ -1490,16 +1490,6 @@ namespace TimeHACK.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap WinClassicNotepad { - get { - object obj = ResourceManager.GetObject("WinClassicNotepad", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/TimeHACK.Main/Properties/Resources.resx b/TimeHACK.Main/Properties/Resources.resx index 23c3c3f..3acdf99 100644 --- a/TimeHACK.Main/Properties/Resources.resx +++ b/TimeHACK.Main/Properties/Resources.resx @@ -615,9 +615,6 @@ ..\resources\winclassic\winclassicfind.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\resources\winclassic\winclassicnotepad.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\WinClassic\WinClassicPaste.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a -- cgit v1.2.3 From 943b4dcb5fa597264f13f2d0cfa305f4dd542dbe Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Fri, 18 Aug 2017 20:41:45 +0100 Subject: Wordpad Save, Open and Save As --- TimeHACK.Engine/FileDialogBoxManager.cs | 35 +++---- TimeHACK.Main/GlobalPrograms/WinClassicNotepad.cs | 6 +- .../OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 14 +-- .../Win95/Win95Apps/WinClassicWordPad.Designer.cs | 115 ++++++++++++++------- .../OS/Win95/Win95Apps/WinClassicWordPad.cs | 64 ++++++++++++ .../Win98/Win98Apps/WinClassicWindowsExplorer.cs | 4 +- .../SaveDialogs/SaveFileTroubleShooter.cs | 1 - 7 files changed, 165 insertions(+), 74 deletions(-) diff --git a/TimeHACK.Engine/FileDialogBoxManager.cs b/TimeHACK.Engine/FileDialogBoxManager.cs index 7ed4725..59533fa 100644 --- a/TimeHACK.Engine/FileDialogBoxManager.cs +++ b/TimeHACK.Engine/FileDialogBoxManager.cs @@ -38,27 +38,18 @@ namespace TimeHACK.Engine } } - //public static void SaveTextFile(string path, string contents, int fileIcon) - //{ - // try - // { - // File.WriteAllText(path, contents); - // FileSystemFolderInfo theDir = Newtonsoft.Json.JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(Path.GetPathRoot(path), "_data.info"))); - - - - // using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read)) - // { - // theDir.Files.Add(new THFileInfo() - // { - // Name = Path.GetFileName(path), - // ByteSize = (int)fs.Length, - // FileIcon = fileIcon - // }); - // } - - - // } catch { } - //} + public static void SaveRtfDocument(RichTextBox tbox, string path) + { + int fileBytes = 0; + tbox.SaveFile(path); + fileBytes = File.ReadAllText(path).Length; + + THFileInfo info = new THFileInfo(); + info.Name = Path.GetFileName(path); + info.FileIcon = 17; + info.ByteSize = fileBytes; + SaveSystem.CurrentSave.BytesLeft -= fileBytes; + SaveSystem.UpdateDirectoryInfo(new FileInfo(path).Directory.FullName, info); + } } } diff --git a/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.cs b/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.cs index 3c9ac2f..f9382e3 100644 --- a/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.cs +++ b/TimeHACK.Main/GlobalPrograms/WinClassicNotepad.cs @@ -85,10 +85,9 @@ namespace TimeHACK.OS.Win95.Win95Apps { try { - ActivateSaveFileDialog(".txt"); + ActivateOpenFileDialog(".txt"); string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); - MessageBox.Show(selectedPath); if (selectedPath != "") { mainText.Text = ReadTextFile(selectedPath); @@ -113,7 +112,6 @@ namespace TimeHACK.OS.Win95.Win95Apps } } - // TO LEMPAMO: THIS FUCTION IS A FUNCTION ON IT'S OWN BECUASE TWO THINGS CALL IT - OK? void SaveAs() { try @@ -125,7 +123,7 @@ namespace TimeHACK.OS.Win95.Win95Apps { SaveSystem.CreateWindowsFile(new FileInfo(selectedPath).Directory.FullName, selectedPath.Split('\\').Last(), mainText.Text, 12, mainText.Text.Length); CurrentFilePath = selectedPath; - } + } } catch { } } diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index acb491f..151dfd5 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -138,18 +138,18 @@ namespace TimeHACK.OS.Win95.Win95Apps { ListViewItem itm; - if (IsFileOpenDialog == true || IsFileSaveDialog == true) + if (IsFileOpenDialog || IsFileSaveDialog) { if (!(Path.GetFileName(str) == "_data.info")) - { + { if (new FileInfo(str).Extension == onlyViewExtension) { itm = this.mainView.Items.Add(Path.GetFileName(str)); itm.Tag = str; } - else break; + else continue; } - else break; + else continue; } else { if (!(Path.GetFileName(str) == "_data.info")) @@ -157,7 +157,7 @@ namespace TimeHACK.OS.Win95.Win95Apps itm = this.mainView.Items.Add(Path.GetFileName(str)); itm.Tag = str; } - else break; + else continue; } FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); foreach (var item in fsfi.Files) @@ -604,7 +604,7 @@ namespace TimeHACK.OS.Win95.Win95Apps { try { - if (new DirectoryInfo((string)mainView.FocusedItem.Tag).Extension == null || new DirectoryInfo((string)mainView.FocusedItem.Tag).Extension == "") + if (Directory.Exists(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text))) { // If it isn't a file if (mainView.FocusedItem.Text == "C:") GoToDir(Path.Combine(CurrentDirectory, "CDrive")); @@ -613,7 +613,7 @@ namespace TimeHACK.OS.Win95.Win95Apps } else { // If it is a file - if (IsFileOpenDialog == true || IsFileSaveDialog == true) + if (IsFileOpenDialog || IsFileSaveDialog) { if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) { diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.Designer.cs index fab5fb9..85ad4b9 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.Designer.cs @@ -57,6 +57,7 @@ this.aboutWordpadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mainText = new System.Windows.Forms.RichTextBox(); this.pnlToolbar = new System.Windows.Forms.Panel(); + this.pictureBox5 = new System.Windows.Forms.PictureBox(); this.btnFind = new System.Windows.Forms.Button(); this.btnPrintPreview = new System.Windows.Forms.Button(); this.btnPrint = new System.Windows.Forms.Button(); @@ -78,16 +79,19 @@ this.lblStatus = new System.Windows.Forms.Label(); this.pictureBox3 = new System.Windows.Forms.PictureBox(); this.pictureBox4 = new System.Windows.Forms.PictureBox(); - this.pictureBox5 = new System.Windows.Forms.PictureBox(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.topmenu.SuspendLayout(); this.pnlToolbar.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.pnlFormatBar.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); this.statusBar.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit(); this.SuspendLayout(); // // topmenu @@ -111,36 +115,40 @@ // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.newToolStripMenuItem, + this.openToolStripMenuItem1, + this.saveToolStripMenuItem, + this.saveAsToolStripMenuItem, this.toolStripSeparator1, + this.openToolStripMenuItem, this.sendToolStripMenuItem, this.exitToolStripMenuItem}); - this.fileToolStripMenuItem.Font = new System.Drawing.Font("Contemporary", 9.75F); + this.fileToolStripMenuItem.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0); - this.fileToolStripMenuItem.Size = new System.Drawing.Size(33, 19); + this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 24); this.fileToolStripMenuItem.Text = "File"; // // newToolStripMenuItem // this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(108, 22); + this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.newToolStripMenuItem.Text = "New"; // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(105, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6); // // sendToolStripMenuItem // this.sendToolStripMenuItem.Name = "sendToolStripMenuItem"; - this.sendToolStripMenuItem.Size = new System.Drawing.Size(108, 22); + this.sendToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.sendToolStripMenuItem.Text = "Send..."; // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(108, 22); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.exitToolStripMenuItem.Text = "Exit"; // // editToolStripMenuItem @@ -156,53 +164,53 @@ this.selectAllToolStripMenuItem}); this.editToolStripMenuItem.Name = "editToolStripMenuItem"; this.editToolStripMenuItem.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0); - this.editToolStripMenuItem.Size = new System.Drawing.Size(36, 19); + this.editToolStripMenuItem.Size = new System.Drawing.Size(32, 24); this.editToolStripMenuItem.Text = "Edit"; // // undoToolStripMenuItem // this.undoToolStripMenuItem.Name = "undoToolStripMenuItem"; - this.undoToolStripMenuItem.Size = new System.Drawing.Size(129, 22); + this.undoToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.undoToolStripMenuItem.Text = "Undo"; // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(126, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(119, 6); // // cutToolStripMenuItem // this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; - this.cutToolStripMenuItem.Size = new System.Drawing.Size(129, 22); + this.cutToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.cutToolStripMenuItem.Text = "Cut"; // // copyToolStripMenuItem // this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; - this.copyToolStripMenuItem.Size = new System.Drawing.Size(129, 22); + this.copyToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.copyToolStripMenuItem.Text = "Copy"; // // pasteToolStripMenuItem // this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; - this.pasteToolStripMenuItem.Size = new System.Drawing.Size(129, 22); + this.pasteToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.pasteToolStripMenuItem.Text = "Paste"; // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(126, 6); + this.toolStripSeparator3.Size = new System.Drawing.Size(119, 6); // // clearToolStripMenuItem // this.clearToolStripMenuItem.Name = "clearToolStripMenuItem"; - this.clearToolStripMenuItem.Size = new System.Drawing.Size(129, 22); + this.clearToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.clearToolStripMenuItem.Text = "Clear"; // // selectAllToolStripMenuItem // this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; - this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(129, 22); + this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.selectAllToolStripMenuItem.Text = "Select All"; // // viewToolStripMenuItem @@ -213,7 +221,7 @@ this.statusBarToolStripMenuItem}); this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; this.viewToolStripMenuItem.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0); - this.viewToolStripMenuItem.Size = new System.Drawing.Size(40, 19); + this.viewToolStripMenuItem.Size = new System.Drawing.Size(37, 24); this.viewToolStripMenuItem.Text = "View"; // // toolbarToolStripMenuItem @@ -222,7 +230,7 @@ this.toolbarToolStripMenuItem.CheckOnClick = true; this.toolbarToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.toolbarToolStripMenuItem.Name = "toolbarToolStripMenuItem"; - this.toolbarToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.toolbarToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.toolbarToolStripMenuItem.Text = "Toolbar"; // // formatBarToolStripMenuItem @@ -231,7 +239,7 @@ this.formatBarToolStripMenuItem.CheckOnClick = true; this.formatBarToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.formatBarToolStripMenuItem.Name = "formatBarToolStripMenuItem"; - this.formatBarToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.formatBarToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.formatBarToolStripMenuItem.Text = "Format Bar"; // // statusBarToolStripMenuItem @@ -240,7 +248,7 @@ this.statusBarToolStripMenuItem.CheckOnClick = true; this.statusBarToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.statusBarToolStripMenuItem.Name = "statusBarToolStripMenuItem"; - this.statusBarToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.statusBarToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.statusBarToolStripMenuItem.Text = "Status Bar"; // // insertToolStripMenuItem @@ -249,13 +257,13 @@ this.dateTimeToolStripMenuItem}); this.insertToolStripMenuItem.Name = "insertToolStripMenuItem"; this.insertToolStripMenuItem.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0); - this.insertToolStripMenuItem.Size = new System.Drawing.Size(47, 19); + this.insertToolStripMenuItem.Size = new System.Drawing.Size(41, 24); this.insertToolStripMenuItem.Text = "Insert"; // // dateTimeToolStripMenuItem // this.dateTimeToolStripMenuItem.Name = "dateTimeToolStripMenuItem"; - this.dateTimeToolStripMenuItem.Size = new System.Drawing.Size(137, 22); + this.dateTimeToolStripMenuItem.Size = new System.Drawing.Size(130, 22); this.dateTimeToolStripMenuItem.Text = "Date/Time"; // // formatToolStripMenuItem @@ -264,14 +272,14 @@ this.bulletStyleToolStripMenuItem}); this.formatToolStripMenuItem.Name = "formatToolStripMenuItem"; this.formatToolStripMenuItem.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0); - this.formatToolStripMenuItem.Size = new System.Drawing.Size(57, 19); + this.formatToolStripMenuItem.Size = new System.Drawing.Size(50, 24); this.formatToolStripMenuItem.Text = "Format"; // // bulletStyleToolStripMenuItem // this.bulletStyleToolStripMenuItem.CheckOnClick = true; this.bulletStyleToolStripMenuItem.Name = "bulletStyleToolStripMenuItem"; - this.bulletStyleToolStripMenuItem.Size = new System.Drawing.Size(141, 22); + this.bulletStyleToolStripMenuItem.Size = new System.Drawing.Size(131, 22); this.bulletStyleToolStripMenuItem.Text = "Bullet style"; // // helpToolStripMenuItem @@ -282,24 +290,24 @@ this.aboutWordpadToolStripMenuItem}); this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; this.helpToolStripMenuItem.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0); - this.helpToolStripMenuItem.Size = new System.Drawing.Size(39, 19); + this.helpToolStripMenuItem.Size = new System.Drawing.Size(37, 24); this.helpToolStripMenuItem.Text = "Help"; // // helpTopicsToolStripMenuItem // this.helpTopicsToolStripMenuItem.Name = "helpTopicsToolStripMenuItem"; - this.helpTopicsToolStripMenuItem.Size = new System.Drawing.Size(169, 22); + this.helpTopicsToolStripMenuItem.Size = new System.Drawing.Size(159, 22); this.helpTopicsToolStripMenuItem.Text = "Help Topics"; // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(166, 6); + this.toolStripSeparator4.Size = new System.Drawing.Size(156, 6); // // aboutWordpadToolStripMenuItem // this.aboutWordpadToolStripMenuItem.Name = "aboutWordpadToolStripMenuItem"; - this.aboutWordpadToolStripMenuItem.Size = new System.Drawing.Size(169, 22); + this.aboutWordpadToolStripMenuItem.Size = new System.Drawing.Size(159, 22); this.aboutWordpadToolStripMenuItem.Text = "About Wordpad"; // // mainText @@ -331,6 +339,16 @@ this.pnlToolbar.Size = new System.Drawing.Size(593, 28); this.pnlToolbar.TabIndex = 2; // + // pictureBox5 + // + this.pictureBox5.BackgroundImage = global::TimeHACK.Properties.Resources.ie4_vsplitter; + this.pictureBox5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.pictureBox5.Location = new System.Drawing.Point(297, 0); + this.pictureBox5.Name = "pictureBox5"; + this.pictureBox5.Size = new System.Drawing.Size(2, 28); + this.pictureBox5.TabIndex = 7; + this.pictureBox5.TabStop = false; + // // btnFind // this.btnFind.BackgroundImage = global::TimeHACK.Properties.Resources.wordpad_find; @@ -595,15 +613,32 @@ this.pictureBox4.TabIndex = 6; this.pictureBox4.TabStop = false; // - // pictureBox5 + // saveToolStripMenuItem // - this.pictureBox5.BackgroundImage = global::TimeHACK.Properties.Resources.ie4_vsplitter; - this.pictureBox5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBox5.Location = new System.Drawing.Point(297, 0); - this.pictureBox5.Name = "pictureBox5"; - this.pictureBox5.Size = new System.Drawing.Size(2, 28); - this.pictureBox5.TabIndex = 7; - this.pictureBox5.TabStop = false; + this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; + this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.saveToolStripMenuItem.Text = "Save..."; + this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); + // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.openToolStripMenuItem.Text = "Open..."; + // + // saveAsToolStripMenuItem + // + this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.saveAsToolStripMenuItem.Text = "Save As..."; + this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); + // + // openToolStripMenuItem1 + // + this.openToolStripMenuItem1.Name = "openToolStripMenuItem1"; + this.openToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.openToolStripMenuItem1.Text = "Open..."; + this.openToolStripMenuItem1.Click += new System.EventHandler(this.openToolStripMenuItem1_Click); // // WinClassicWordPad // @@ -620,6 +655,7 @@ this.topmenu.ResumeLayout(false); this.topmenu.PerformLayout(); this.pnlToolbar.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.pnlFormatBar.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); @@ -627,7 +663,6 @@ this.statusBar.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -685,5 +720,9 @@ private System.Windows.Forms.Button btnPrintPreview; private System.Windows.Forms.Button btnFind; private System.Windows.Forms.PictureBox pictureBox5; + private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem1; } } diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs index 7d7956a..f8a927e 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs @@ -9,6 +9,8 @@ using System.Threading.Tasks; using System.Windows.Forms; using System.Drawing.Text; using TimeHACK.Engine; +using static TimeHACK.Engine.FileDialogBoxManager; +using System.IO; namespace TimeHACK.OS.Win95.Win95Apps { @@ -20,6 +22,8 @@ namespace TimeHACK.OS.Win95.Win95Apps bool doItalic = false; bool doUnderline = false; + string CurrentFilePath = ""; + public WinClassicWordPad() { InitializeComponent(); @@ -169,5 +173,65 @@ namespace TimeHACK.OS.Win95.Win95Apps if (doUnderline) Underline = FontStyle.Underline; mainText.SelectionFont = new Font(mainText.SelectionFont.FontFamily, mainText.SelectionFont.Size, Bold | Italic | Underline); } + + private void openToolStripMenuItem1_Click(object sender, EventArgs e) + { + try + { + ActivateOpenFileDialog(".rtf"); + string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + + if (selectedPath != null) + { + try + { + mainText.LoadFile(selectedPath); + } catch + { + (new WindowManager()).StartInfobox95("Wordpad", "An error occured opening the file.", Engine.Template.InfoboxType.Error, Engine.Template.InfoboxButtons.OK); + } + + } + } + catch + { + } + } + + private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) + { + SaveAs(); + } + + private void saveToolStripMenuItem_Click(object sender, EventArgs e) + { + if (CurrentFilePath == "") + { + // We aren't in a file right now + + SaveAs(); + } + else + { + File.Delete(CurrentFilePath); + SaveRtfDocument(mainText, CurrentFilePath); + } + } + + void SaveAs() + { + try + { + ActivateSaveFileDialog(".rtf"); + string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + + if (selectedPath != "") + { + SaveRtfDocument(mainText, selectedPath); + CurrentFilePath = selectedPath; + } + } + catch (Exception ex) { MessageBox.Show(ex.Message); } + } } } \ No newline at end of file diff --git a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs index d111fbe..04f0405 100644 --- a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs @@ -161,7 +161,7 @@ namespace TimeHACK.OS.Win95.Win95Apps { ListViewItem itm; - if (IsFileOpenDialog == true || IsFileSaveDialog == true) + if (IsFileOpenDialog || IsFileSaveDialog) { if (!(Path.GetFileName(str) == "_data.info")) { @@ -637,7 +637,7 @@ namespace TimeHACK.OS.Win95.Win95Apps { try { - if (new DirectoryInfo((string)mainView.FocusedItem.Tag).Extension == null || new DirectoryInfo((string)mainView.FocusedItem.Tag).Extension == "") + if (Directory.Exists(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text))) { // If it isn't a file if (mainView.FocusedItem.Text == "C:") GoToDir(Path.Combine(CurrentDirectory, "CDrive")); diff --git a/TimeHACK.Main/SaveDialogs/SaveFileTroubleShooter.cs b/TimeHACK.Main/SaveDialogs/SaveFileTroubleShooter.cs index 410d2d6..4a593b0 100644 --- a/TimeHACK.Main/SaveDialogs/SaveFileTroubleShooter.cs +++ b/TimeHACK.Main/SaveDialogs/SaveFileTroubleShooter.cs @@ -16,7 +16,6 @@ namespace TimeHACK.SaveDialogs { public string log; Save savedata; - string json; public SaveFileTroubleShooter() { InitializeComponent(); -- cgit v1.2.3 From bffcb720f811623015ed4795032e5c57d1064c8a Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Fri, 18 Aug 2017 21:56:48 +0100 Subject: Fixed the Rename and Delete --- .../OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 132 +++++++++++++++++---- .../WinClassicWindowsExplorer.Designer.cs | 10 +- .../Win98/Win98Apps/WinClassicWindowsExplorer.cs | 131 ++++++++++++++------ 3 files changed, 209 insertions(+), 64 deletions(-) diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index 151dfd5..80f48dd 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -124,7 +124,8 @@ namespace TimeHACK.OS.Win95.Win95Apps private void RefreshAll() { - //try { + //try + //{ this.mainView.Items.Clear(); foreach (string str in Directory.GetDirectories(CurrentDirectory)) @@ -631,9 +632,7 @@ namespace TimeHACK.OS.Win95.Win95Apps OpenFile(mainView.FocusedItem.Tag.ToString()); } } - } catch (Exception ex) { - MessageBox.Show(ex.Message); - } + } catch { /* TODO: Illegal operation */ } } void diskView_AfterSelect(object sender, EventArgs e) @@ -738,10 +737,50 @@ namespace TimeHACK.OS.Win95.Win95Apps } else { - if (Directory.Exists(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text))) Directory.Delete(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text), true); - else File.Delete(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text)); + if (Directory.Exists(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text))) + { + Directory.Delete(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text), true); + + // Remove the directory now from the _data.info + + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); + + foreach (THDirInfo dir in fsfi.SubDirs) + { + if (dir.Name == mainView.FocusedItem.Text) + { + // Delete it + + fsfi.SubDirs.Remove(dir); + } + } + + File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi)); + } + else + { + File.Delete(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text)); + + // Remove the file now from the _data.info + + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); + + foreach (THFileInfo file in fsfi.Files) + { + if (file.Name == mainView.FocusedItem.Text) + { + // Delete it + + fsfi.Files.Remove(file); + } + } + + File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi)); + + } RefreshAll(); + RefreshTreeNode(); } } catch { @@ -782,37 +821,80 @@ namespace TimeHACK.OS.Win95.Win95Apps private void mainView_AfterLabelEdit(object sender, LabelEditEventArgs e) { - string setText = e.Label; - if (setText == "") wm.StartInfobox95("Rename", "You must type a filename.", InfoboxType.Error, InfoboxButtons.OK); - else + try { - if (Directory.Exists(setText)) wm.StartInfobox95("Error Renaming File", $"Cannot rename {new DirectoryInfo(setText).Name}: A file with the name you specified already exists. Specify a different filename.", InfoboxType.Error, InfoboxButtons.OK); + string setText = e.Label; + if (setText == "") wm.StartInfobox95("Rename", "You must type a filename.", InfoboxType.Error, InfoboxButtons.OK); else { - if (File.Exists(setText)) wm.StartInfobox95("Error Renaming File", $"Cannot rename {new FileInfo(setText).Name}: A file with the name you specified already exists. Specify a different filename.", InfoboxType.Error, InfoboxButtons.OK); + if (Directory.Exists(setText)) wm.StartInfobox95("Error Renaming File", $"Cannot rename {new DirectoryInfo(setText).Name}: A file with the name you specified already exists. Specify a different filename.", InfoboxType.Error, InfoboxButtons.OK); else { - if (Directory.Exists((string)mainView.FocusedItem.Tag)) + if (File.Exists(setText)) wm.StartInfobox95("Error Renaming File", $"Cannot rename {new FileInfo(setText).Name}: A file with the name you specified already exists. Specify a different filename.", InfoboxType.Error, InfoboxButtons.OK); + else { - // It was a directory + if (Directory.Exists(Path.Combine(CurrentDirectory, OldLabelText))) + { + // It was a directory - Directory.Move((string)mainView.FocusedItem.Tag, Path.Combine(CurrentDirectory, setText)); + Directory.Move(Path.Combine(CurrentDirectory, OldLabelText), Path.Combine(CurrentDirectory, setText)); - File.Delete(Path.Combine(CurrentDirectory, setText, "_data.info")); - SaveDirectoryInfo(CurrentDirectory, setText, false, setText, true); - } - else - { - // It was a file + File.Delete(Path.Combine(CurrentDirectory, setText, "_data.info")); + SaveDirectoryInfo(CurrentDirectory, setText, false, setText, true); + + // Rename the directory now in the _data.info + + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); + + foreach (THDirInfo dir in fsfi.SubDirs) + { + if (dir.Name == mainView.FocusedItem.Tag.ToString()) + { + // Rename it + THDirInfo oldDirInfo = dir; + oldDirInfo.Name = Path.Combine(CurrentDirectory, setText); + + fsfi.SubDirs.Remove(dir); + fsfi.SubDirs.Add(oldDirInfo); + } + } + + File.Delete(Path.Combine(CurrentDirectory, "_data.info")); + File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi)); + } + else + { + // It was a file + + File.Copy(Path.Combine(CurrentDirectory, OldLabelText), Path.Combine(CurrentDirectory, setText)); + File.Delete(Path.Combine(CurrentDirectory, OldLabelText)); + + // Rename the file now in the _data.info + + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); + + foreach (THFileInfo file in fsfi.Files) + { + if (file.Name == mainView.FocusedItem.Tag.ToString()) + { + // Rename it + THFileInfo oldFileInfo = file; + oldFileInfo.Name = Path.Combine(CurrentDirectory, setText); - File.Copy((string)mainView.FocusedItem.Tag, Path.Combine(CurrentDirectory, setText)); - File.Delete((string)mainView.FocusedItem.Tag); + fsfi.Files.Remove(file); + fsfi.Files.Add(oldFileInfo); + } + } + + File.Delete(Path.Combine(CurrentDirectory, "_data.info")); + File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi)); + } } } } - } - RefreshAll(); - RefreshTreeNode(); + RefreshAll(); + RefreshTreeNode(); + } catch { } } private TreeNode[] createSubDirNodes(DirectoryInfo folder) diff --git a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs index 5914b60..20304ff 100644 --- a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs +++ b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs @@ -397,7 +397,7 @@ this.TextDocumentToolStripMenuItem, this.BitmapImageToolStripMenuItem}); this.CreateShortcutToolStripMenuItem.Name = "CreateShortcutToolStripMenuItem"; - this.CreateShortcutToolStripMenuItem.Size = new System.Drawing.Size(117, 22); + this.CreateShortcutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.CreateShortcutToolStripMenuItem.Text = "New"; // // FolderToolStripMenuItem @@ -422,21 +422,21 @@ // DeleteToolStripMenuItem // this.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem"; - this.DeleteToolStripMenuItem.Size = new System.Drawing.Size(117, 22); + this.DeleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.DeleteToolStripMenuItem.Text = "Delete"; this.DeleteToolStripMenuItem.Click += new System.EventHandler(this.DeleteToolStripMenuItem_Click); // // RenameToolStripMenuItem // this.RenameToolStripMenuItem.Name = "RenameToolStripMenuItem"; - this.RenameToolStripMenuItem.Size = new System.Drawing.Size(117, 22); + this.RenameToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.RenameToolStripMenuItem.Text = "Rename"; this.RenameToolStripMenuItem.Click += new System.EventHandler(this.RenameToolStripMenuItem_Click); // // CloseToolStripMenuItem // this.CloseToolStripMenuItem.Name = "CloseToolStripMenuItem"; - this.CloseToolStripMenuItem.Size = new System.Drawing.Size(117, 22); + this.CloseToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.CloseToolStripMenuItem.Text = "Close"; this.CloseToolStripMenuItem.Click += new System.EventHandler(this.CloseToolStripMenuItem_Click); // @@ -529,7 +529,7 @@ // refresh // this.refresh.Enabled = true; - this.refresh.Interval = 15000; + this.refresh.Interval = 4000; this.refresh.Tick += new System.EventHandler(this.refresh_Tick); // // WinClassicWindowsExplorer diff --git a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs index 04f0405..c5bf384 100644 --- a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs @@ -664,11 +664,7 @@ namespace TimeHACK.OS.Win95.Win95Apps OpenFile(mainView.FocusedItem.Tag.ToString()); } } - } - catch (Exception ex) - { - MessageBox.Show(ex.Message); - } + } catch { /* TODO: Illegal operation */ } } void diskView_AfterSelect(object sender, EventArgs e) @@ -770,23 +766,62 @@ namespace TimeHACK.OS.Win95.Win95Apps { try { - if (!FileOrDirectoryExists(mainView.FocusedItem.ImageKey)) + if (!FileOrDirectoryExists(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text))) { wm.StartInfobox95("Windows Explorer", "This directory doesn't exist", InfoboxType.Info, InfoboxButtons.OK); } else { - if (Directory.Exists(mainView.FocusedItem.ImageKey)) Directory.Delete(mainView.FocusedItem.ImageKey, true); - else File.Delete(mainView.FocusedItem.ImageKey); + if (Directory.Exists(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text))) + { + Directory.Delete(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text), true); + + // Remove the directory now from the _data.info + + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); + + foreach (THDirInfo dir in fsfi.SubDirs) + { + if (dir.Name == mainView.FocusedItem.Text) + { + // Delete it + + fsfi.SubDirs.Remove(dir); + } + } + + File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); + } + else + { + File.Delete(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text)); + + // Remove the file now from the _data.info + + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); + + foreach (THFileInfo file in fsfi.Files) + { + if (file.Name == mainView.FocusedItem.Text) + { + // Delete it + + fsfi.Files.Remove(file); + } + } + + File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); + + } RefreshAll(); RefreshTreeNode(); } - } catch + } + catch { RefreshAll(); } - } internal static bool FileOrDirectoryExists(string path) @@ -820,53 +855,81 @@ namespace TimeHACK.OS.Win95.Win95Apps private void mainView_AfterLabelEdit(object sender, LabelEditEventArgs e) { - try { - string setText; - setText = e.Label; - if (setText == "") - { - wm.StartInfobox95("Windows Explorer", "Please enter a new directory name", InfoboxType.Info, InfoboxButtons.OK); - } + try + { + string setText = e.Label; + if (setText == "") wm.StartInfobox95("Rename", "You must type a filename.", InfoboxType.Error, InfoboxButtons.OK); else { - if (Directory.Exists(setText)) - { - wm.StartInfobox95("Windows Explorer", "That directory already exists.", InfoboxType.Info, InfoboxButtons.OK); - } + if (Directory.Exists(setText)) wm.StartInfobox95("Error Renaming File", $"Cannot rename {new DirectoryInfo(setText).Name}: A file with the name you specified already exists. Specify a different filename.", InfoboxType.Error, InfoboxButtons.OK); else { - if (File.Exists(setText)) - { - wm.StartInfobox95("Windows Explorer", "That file already exists.", InfoboxType.Info, InfoboxButtons.OK); - } + if (File.Exists(setText)) wm.StartInfobox95("Error Renaming File", $"Cannot rename {new FileInfo(setText).Name}: A file with the name you specified already exists. Specify a different filename.", InfoboxType.Error, InfoboxButtons.OK); else { - if (Directory.Exists(mainView.FocusedItem.ImageKey)) + if (Directory.Exists(Path.Combine(CurrentDirectory, OldLabelText))) { // It was a directory - Directory.Move(mainView.FocusedItem.ImageKey, Path.Combine(CurrentDirectory, setText)); + Directory.Move(Path.Combine(CurrentDirectory, OldLabelText), Path.Combine(CurrentDirectory, setText)); File.Delete(Path.Combine(CurrentDirectory, setText, "_data.info")); + SaveDirectoryInfo(CurrentDirectory, setText, false, setText, true); - SaveDirectoryInfo(CurrentDirectory, setText, false, $"{setText}", true); + // Rename the directory now in the _data.info + + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); + + foreach (THDirInfo dir in fsfi.SubDirs) + { + if (dir.Name == mainView.FocusedItem.Tag.ToString()) + { + // Rename it + THDirInfo oldDirInfo = dir; + oldDirInfo.Name = Path.Combine(CurrentDirectory, setText); + + fsfi.SubDirs.Remove(dir); + fsfi.SubDirs.Add(oldDirInfo); + } + } + + File.Delete(Path.Combine(CurrentDirectory, "_data.info")); + File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); } else { - // It was a file + // It was a file + + File.Copy(Path.Combine(CurrentDirectory, OldLabelText), Path.Combine(CurrentDirectory, setText)); + File.Delete(Path.Combine(CurrentDirectory, OldLabelText)); + + // Rename the file now in the _data.info - File.Copy(mainView.FocusedItem.ImageKey, Path.Combine(CurrentDirectory, setText)); - File.Delete(mainView.FocusedItem.ImageKey); + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); + + foreach (THFileInfo file in fsfi.Files) + { + if (file.Name == mainView.FocusedItem.Tag.ToString()) + { + // Rename it + THFileInfo oldFileInfo = file; + oldFileInfo.Name = Path.Combine(CurrentDirectory, setText); + + fsfi.Files.Remove(file); + fsfi.Files.Add(oldFileInfo); + } + } + + File.Delete(Path.Combine(CurrentDirectory, "_data.info")); + File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); } } - } } RefreshAll(); RefreshTreeNode(); - } catch { } - + catch { } } private TreeNode[] createSubDirNodes(DirectoryInfo folder) -- cgit v1.2.3 From d1a0c6419bbaf87c9a5de06ba1c7e63a080e5c27 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sun, 27 Aug 2017 14:34:43 +0100 Subject: very little changes - but I need to reclone --- Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs | 1 - Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 5 ----- .../OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs | 10 +++++----- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs index fa51dc7..9e0d2e5 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs @@ -94,7 +94,6 @@ this.mainView.UseCompatibleStateImageBehavior = false; this.mainView.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.mainView_AfterLabelEdit); this.mainView.DoubleClick += new System.EventHandler(this.mainView_DoubleClick); - this.mainView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.mainView_MouseClick); // // diskView // diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index e205283..59c81d7 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -1034,11 +1034,6 @@ namespace Histacom2.OS.Win95.Win95Apps foreach (ListViewItem item in mainView.Items) item.Selected = true; } - private void mainView_MouseClick(object sender, MouseEventArgs e) - { - - } - private void TextDocumentToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs index 335a7bc..958c602 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs @@ -29,7 +29,7 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WinClassicWindowsExplorer)); + //System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WinClassicWindowsExplorer)); this.program = new System.Windows.Forms.Panel(); this.mainView = new System.Windows.Forms.ListView(); this.pnlInfo = new System.Windows.Forms.Panel(); @@ -157,8 +157,8 @@ // // pnlInfoContent // - this.pnlInfoContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.pnlInfoContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.pnlInfoContent.BackColor = System.Drawing.Color.Transparent; this.pnlInfoContent.Controls.Add(this.InfoDesc); @@ -280,7 +280,7 @@ // btnFolderClose // this.btnFolderClose.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(208)))), ((int)(((byte)(200))))); - this.btnFolderClose.Image = ((System.Drawing.Image)(resources.GetObject("btnFolderClose.Image"))); + //this.btnFolderClose.Image = ((System.Drawing.Image)(resources.GetObject("btnFolderClose.Image"))); this.btnFolderClose.Location = new System.Drawing.Point(172, 3); this.btnFolderClose.Name = "btnFolderClose"; this.btnFolderClose.Size = new System.Drawing.Size(21, 16); @@ -358,7 +358,7 @@ // // txtSave // - this.txtSave.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtSave.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtSave.Location = new System.Drawing.Point(60, 3); this.txtSave.Name = "txtSave"; -- cgit v1.2.3 From 1d2e7331e356f71547972f30b6bbbca4c40b35ae Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sun, 27 Aug 2017 14:44:52 +0100 Subject: Updated .gitignore --- .gitignore | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index 855b400..3fd5a81 100644 --- a/.gitignore +++ b/.gitignore @@ -416,34 +416,34 @@ __pycache__/ # End of https://www.gitignore.io/api/macos,linux,windows,jetbrains,visualstudio,visualstudiocode -### TimeHack Extra ### -TimeHACK.Main\bin\Debug -TimeHACK.Main\bin\Release -TimeHACK.Main\obj\Debug\* -TimeHACK.Main\obj\Release\* -TimeHACK.Engine\bin\Debug -TimeHACK.Engine\bin\Release -TimeHACK.Engine\obj\Debug\* -TimeHACK.Engine\obj\Release\* +### Histacom Extra ### +Histacom2\bin\Debug +Histacom2\bin\Release +Histacom2\obj\Debug\* +Histacom2\obj\Release\* +Histacom2.Engine\bin\Debug +Histacom2.Engine\bin\Release +Histacom2.Engine\obj\Debug\* +Histacom2.Engine\obj\Release\* # The below files keep the Resources working -!TimeHACK.Main\obj\Debug\TempPE -!TimeHACK.Main\obj\Debug\DesignTimeResolveAssemblyReferences.cache -!TimeHACK.Main\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache -!TimeHACK.Main\obj\Debug\CoreCompileInputs.cache -!TimeHACK.Main\obj\Release\TempPE -!TimeHACK.Main\obj\Release\DesignTimeResolveAssemblyReferences.cache -!TimeHACK.Main\obj\Release\DesignTimeResolveAssemblyReferencesInput.cache -!TimeHACK.Main\obj\Release\CoreCompileInputs.cache -!TimeHACK.Engine\obj\Debug\TempPE -!TimeHACK.Engine\obj\Debug\DesignTimeResolveAssemblyReferences.cache -!TimeHACK.Engine\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache -!TimeHACK.Engine\obj\Debug\CoreCompileInputs.cache -!TimeHACK.Engine\obj\Release\TempPE -!TimeHACK.Engine\obj\Release\DesignTimeResolveAssemblyReferences.cache -!TimeHACK.Engine\obj\Release\DesignTimeResolveAssemblyReferencesInput.cache -!TimeHACK.Engine\obj\Release\CoreCompileInputs.cache +!Histacom2\obj\Debug\TempPE +!Histacom2\obj\Debug\DesignTimeResolveAssemblyReferences.cache +!Histacom2\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache +!Histacom2\obj\Debug\CoreCompileInputs.cache +!Histacom2\obj\Release\TempPE +!Histacom2\obj\Release\DesignTimeResolveAssemblyReferences.cache +!Histacom2\obj\Release\DesignTimeResolveAssemblyReferencesInput.cache +!Histacom2\obj\Release\CoreCompileInputs.cache +!Histacom2.Engine\obj\Debug\TempPE +!Histacom2.Engine\obj\Debug\DesignTimeResolveAssemblyReferences.cache +!Histacom2.Engine\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache +!Histacom2.Engine\obj\Debug\CoreCompileInputs.cache +!Histacom2.Engine\obj\Release\TempPE +!Histacom2.Engine\obj\Release\DesignTimeResolveAssemblyReferences.cache +!Histacom2.Engine\obj\Release\DesignTimeResolveAssemblyReferencesInput.cache +!Histacom2.Engine\obj\Release\CoreCompileInputs.cache !packages # Including the .idea directory within repositories is a BAD idea: -- cgit v1.2.3 From a751c8fcac0aab40de9cf0539fff65791da51f34 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sun, 27 Aug 2017 15:48:28 +0100 Subject: Fixed up a few things --- Histacom2.Engine/FileDialogBoxManager.cs | 2 +- .../OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 7 +++ .../Win95/Win95Apps/WinClassicWordPad.Designer.cs | 71 +++++++++------------- Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs | 46 ++++++++++++++ 4 files changed, 83 insertions(+), 43 deletions(-) diff --git a/Histacom2.Engine/FileDialogBoxManager.cs b/Histacom2.Engine/FileDialogBoxManager.cs index c3a2372..161c393 100644 --- a/Histacom2.Engine/FileDialogBoxManager.cs +++ b/Histacom2.Engine/FileDialogBoxManager.cs @@ -46,7 +46,7 @@ namespace Histacom2.Engine THFileInfo info = new THFileInfo(); info.Name = Path.GetFileName(path); - info.FileIcon = 17; + info.FileIcon = 20; info.ByteSize = fileBytes; SaveSystem.CurrentSave.BytesLeft -= fileBytes; SaveSystem.UpdateDirectoryInfo(new FileInfo(path).Directory.FullName, info); diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index 59c81d7..bb385da 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -226,6 +226,13 @@ namespace Histacom2.OS.Win95.Win95Apps Program.AddTaskbarItem(app, app.Tag.ToString(), "Notepad", Properties.Resources.Win95IconNotepad); break; + case 2: + WinClassicWordPad wp = new WinClassicWordPad(); + wp.mainText.LoadFile(fileDir); + WinClassic app2 = wm.StartWin95(wp, "Wordpad", Properties.Resources.Win95IconWordpad, true, true); + + Program.AddTaskbarItem(app2, app2.Tag.ToString(), "Wordpad", Properties.Resources.Win95IconWordpad); + break; case 12: OpenApplication(FileDialogBoxManager.ReadTextFile(fileDir), fileDir); break; diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.Designer.cs b/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.Designer.cs index 44eb551..c393579 100644 --- a/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.Designer.cs +++ b/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.Designer.cs @@ -31,6 +31,9 @@ this.topmenu = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.sendToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -79,10 +82,6 @@ this.lblStatus = new System.Windows.Forms.Label(); this.pictureBox3 = new System.Windows.Forms.PictureBox(); this.pictureBox4 = new System.Windows.Forms.PictureBox(); - this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.topmenu.SuspendLayout(); this.pnlToolbar.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit(); @@ -119,7 +118,6 @@ this.saveToolStripMenuItem, this.saveAsToolStripMenuItem, this.toolStripSeparator1, - this.openToolStripMenuItem, this.sendToolStripMenuItem, this.exitToolStripMenuItem}); this.fileToolStripMenuItem.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F); @@ -134,6 +132,27 @@ this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.newToolStripMenuItem.Text = "New"; // + // openToolStripMenuItem1 + // + this.openToolStripMenuItem1.Name = "openToolStripMenuItem1"; + this.openToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.openToolStripMenuItem1.Text = "Open..."; + this.openToolStripMenuItem1.Click += new System.EventHandler(this.openToolStripMenuItem1_Click); + // + // saveToolStripMenuItem + // + this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; + this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.saveToolStripMenuItem.Text = "Save..."; + this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); + // + // saveAsToolStripMenuItem + // + this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.saveAsToolStripMenuItem.Text = "Save As..."; + this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); + // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; @@ -279,7 +298,7 @@ // this.bulletStyleToolStripMenuItem.CheckOnClick = true; this.bulletStyleToolStripMenuItem.Name = "bulletStyleToolStripMenuItem"; - this.bulletStyleToolStripMenuItem.Size = new System.Drawing.Size(131, 22); + this.bulletStyleToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.bulletStyleToolStripMenuItem.Text = "Bullet style"; // // helpToolStripMenuItem @@ -392,6 +411,7 @@ this.btnSave.Size = new System.Drawing.Size(23, 22); this.btnSave.TabIndex = 3; this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // // btnOpen // @@ -403,6 +423,7 @@ this.btnOpen.Size = new System.Drawing.Size(23, 22); this.btnOpen.TabIndex = 2; this.btnOpen.UseVisualStyleBackColor = true; + this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click); // // btnPaste // @@ -447,6 +468,7 @@ this.btnNew.Size = new System.Drawing.Size(23, 22); this.btnNew.TabIndex = 1; this.btnNew.UseVisualStyleBackColor = true; + this.btnNew.Click += new System.EventHandler(this.btnNew_Click); // // pictureBox1 // @@ -613,40 +635,6 @@ this.pictureBox4.TabIndex = 6; this.pictureBox4.TabStop = false; // - // saveToolStripMenuItem - // - this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.saveToolStripMenuItem.Text = "Save..."; - this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); - // - // openToolStripMenuItem - // - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.openToolStripMenuItem.Text = "Open..."; - // - // saveAsToolStripMenuItem - // - this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.saveAsToolStripMenuItem.Text = "Save As..."; - this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); - // - // openToolStripMenuItem1 - // - this.openToolStripMenuItem1.Name = "openToolStripMenuItem1"; - this.openToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); - this.openToolStripMenuItem1.Text = "Open..."; - this.openToolStripMenuItem1.Click += new System.EventHandler(this.openToolStripMenuItem1_Click); - this.pictureBox5.BackgroundImage = global::Histacom2.Properties.Resources.ie4_vsplitter; - this.pictureBox5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBox5.Location = new System.Drawing.Point(297, 0); - this.pictureBox5.Name = "pictureBox5"; - this.pictureBox5.Size = new System.Drawing.Size(2, 28); - this.pictureBox5.TabIndex = 7; - this.pictureBox5.TabStop = false; - // // WinClassicWordPad // this.BackColor = System.Drawing.Color.Silver; @@ -687,7 +675,7 @@ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripMenuItem sendToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.RichTextBox mainText; + public System.Windows.Forms.RichTextBox mainText; private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem; @@ -729,7 +717,6 @@ private System.Windows.Forms.PictureBox pictureBox5; private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem1; } } diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs b/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs index 77d307b..05b5ec1 100644 --- a/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs +++ b/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs @@ -186,6 +186,7 @@ namespace Histacom2.OS.Win95.Win95Apps try { mainText.LoadFile(selectedPath); + CurrentFilePath = selectedPath; } catch { (new WindowManager()).StartInfobox95("Wordpad", "An error occured opening the file.", Engine.Template.InfoboxType.Error, Engine.Template.InfoboxButtons.OK); @@ -233,5 +234,50 @@ namespace Histacom2.OS.Win95.Win95Apps } catch (Exception ex) { MessageBox.Show(ex.Message); } } + + private void btnNew_Click(object sender, EventArgs e) + { + + } + + private void btnOpen_Click(object sender, EventArgs e) + { + try + { + ActivateOpenFileDialog(".rtf"); + string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + + if (selectedPath != null) + { + try + { + mainText.LoadFile(selectedPath); + } + catch + { + (new WindowManager()).StartInfobox95("Wordpad", "An error occured opening the file.", Engine.Template.InfoboxType.Error, Engine.Template.InfoboxButtons.OK); + } + + } + } + catch + { + } + } + + private void btnSave_Click(object sender, EventArgs e) + { + if (CurrentFilePath == "") + { + // We aren't in a file right now + + SaveAs(); + } + else + { + File.Delete(CurrentFilePath); + SaveRtfDocument(mainText, CurrentFilePath); + } + } } } \ No newline at end of file -- cgit v1.2.3 From 15b5a609e1a60035b74aebfc70fafd8e118e4c3a Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sun, 27 Aug 2017 17:27:52 +0100 Subject: This entire commit will be using the code lempamo wrote --- Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 10 ++++++---- .../Win98Apps/WinClassicWindowsExplorer.Designer.cs | 18 +++++++++--------- .../OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs | 2 ++ .../OS/Win98/Win98Apps/WinClassicWindowsExplorer.resx | 9 --------- 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index bb385da..52ea334 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -732,10 +732,11 @@ namespace Histacom2.OS.Win95.Win95Apps // Delete it fsfi.SubDirs.Remove(dir); + break; } } - File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi)); + File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); } else { @@ -752,10 +753,11 @@ namespace Histacom2.OS.Win95.Win95Apps // Delete it fsfi.Files.Remove(file); + continue; } } - File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi)); + File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); } @@ -828,7 +830,7 @@ namespace Histacom2.OS.Win95.Win95Apps foreach (THDirInfo dir in fsfi.SubDirs) { - if (dir.Name == mainView.FocusedItem.Tag.ToString()) + if (dir.Name == OldLabelText) { // Rename it THDirInfo oldDirInfo = dir; @@ -855,7 +857,7 @@ namespace Histacom2.OS.Win95.Win95Apps foreach (THFileInfo file in fsfi.Files) { - if (file.Name == mainView.FocusedItem.Tag.ToString()) + if (file.Name == OldLabelText) { // Rename it THFileInfo oldFileInfo = file; diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs index 958c602..25d29fd 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs @@ -29,7 +29,6 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - //System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WinClassicWindowsExplorer)); this.program = new System.Windows.Forms.Panel(); this.mainView = new System.Windows.Forms.ListView(); this.pnlInfo = new System.Windows.Forms.Panel(); @@ -137,6 +136,7 @@ // pictureBox1 // this.pictureBox1.BackColor = System.Drawing.Color.Transparent; + this.pictureBox1.Image = global::Histacom2.Properties.Resources.WinClassicFolderSmall; this.pictureBox1.Location = new System.Drawing.Point(15, 18); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(30, 30); @@ -157,8 +157,8 @@ // // pnlInfoContent // - this.pnlInfoContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.pnlInfoContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.pnlInfoContent.BackColor = System.Drawing.Color.Transparent; this.pnlInfoContent.Controls.Add(this.InfoDesc); @@ -280,7 +280,7 @@ // btnFolderClose // this.btnFolderClose.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(208)))), ((int)(((byte)(200))))); - //this.btnFolderClose.Image = ((System.Drawing.Image)(resources.GetObject("btnFolderClose.Image"))); + this.btnFolderClose.Image = global::Histacom2.Properties.Resources.XCross; this.btnFolderClose.Location = new System.Drawing.Point(172, 3); this.btnFolderClose.Name = "btnFolderClose"; this.btnFolderClose.Size = new System.Drawing.Size(21, 16); @@ -358,7 +358,7 @@ // // txtSave // - this.txtSave.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtSave.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtSave.Location = new System.Drawing.Point(60, 3); this.txtSave.Name = "txtSave"; @@ -397,7 +397,7 @@ this.TextDocumentToolStripMenuItem, this.BitmapImageToolStripMenuItem}); this.CreateShortcutToolStripMenuItem.Name = "CreateShortcutToolStripMenuItem"; - this.CreateShortcutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.CreateShortcutToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.CreateShortcutToolStripMenuItem.Text = "New"; // // FolderToolStripMenuItem @@ -422,21 +422,21 @@ // DeleteToolStripMenuItem // this.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem"; - this.DeleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.DeleteToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.DeleteToolStripMenuItem.Text = "Delete"; this.DeleteToolStripMenuItem.Click += new System.EventHandler(this.DeleteToolStripMenuItem_Click); // // RenameToolStripMenuItem // this.RenameToolStripMenuItem.Name = "RenameToolStripMenuItem"; - this.RenameToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.RenameToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.RenameToolStripMenuItem.Text = "Rename"; this.RenameToolStripMenuItem.Click += new System.EventHandler(this.RenameToolStripMenuItem_Click); // // CloseToolStripMenuItem // this.CloseToolStripMenuItem.Name = "CloseToolStripMenuItem"; - this.CloseToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.CloseToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.CloseToolStripMenuItem.Text = "Close"; this.CloseToolStripMenuItem.Click += new System.EventHandler(this.CloseToolStripMenuItem_Click); // diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs index a5f8ba8..bff593e 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs @@ -787,6 +787,7 @@ namespace Histacom2.OS.Win95.Win95Apps // Delete it fsfi.SubDirs.Remove(dir); + continue; } } @@ -807,6 +808,7 @@ namespace Histacom2.OS.Win95.Win95Apps // Delete it fsfi.Files.Remove(file); + continue; } } diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.resx b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.resx index 0975ed4..e1edd06 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.resx +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.resx @@ -117,15 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - iVBORw0KGgoAAAANSUhEUgAAAAwAAAAJCAIAAACJ2loDAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAABCSURBVChThYox - CgAwCAP9/8scHfqgklI0sUKDQ+6irfDv3Sc7SdtMDWKpA7MBKOIZwM8HpABFfDXauANH24wM84VvNpDG - mcWXeFkAAAAASUVORK5CYII= - - 17, 17 -- cgit v1.2.3 From d31cd4fbce0d51ff2a51ccf40d11613163ed2a46 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sun, 27 Aug 2017 19:40:33 +0100 Subject: Some tweaks --- Histacom2.Engine/Histacom2.Engine.csproj | 1 + Histacom2.Engine/SaveSystem.cs | 104 ++++++++++++++---- Histacom2/GlobalPrograms/WinClassicNotepad.cs | 2 +- .../Win95Apps/Win95WindowsExplorer.Designer.cs | 121 +++++++++------------ .../OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 89 ++++----------- Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs | 2 +- .../Win98/Win98Apps/WinClassicWindowsExplorer.cs | 86 ++++----------- 7 files changed, 185 insertions(+), 220 deletions(-) diff --git a/Histacom2.Engine/Histacom2.Engine.csproj b/Histacom2.Engine/Histacom2.Engine.csproj index beb4aa2..37c4489 100644 --- a/Histacom2.Engine/Histacom2.Engine.csproj +++ b/Histacom2.Engine/Histacom2.Engine.csproj @@ -20,6 +20,7 @@ DEBUG;TRACE prompt 4 + x86 pdbonly diff --git a/Histacom2.Engine/SaveSystem.cs b/Histacom2.Engine/SaveSystem.cs index 5557dca..7da916b 100644 --- a/Histacom2.Engine/SaveSystem.cs +++ b/Histacom2.Engine/SaveSystem.cs @@ -207,10 +207,58 @@ namespace Histacom2.Engine public static void UpdateDirectoryInfo(string path, THFileInfo newfile) { - newfile.DOSName = newfile.Name.ToUpper().Replace("*", "").Replace("+", "").Replace(":", "").Replace(";", "").Replace(" ", ""); - if (newfile.DOSName.Contains(".")) + SetDOSName(ref newfile); + + if (File.ReadAllText(Path.Combine(path, "_data.info")).Contains(newfile.DOSName)) return; + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(path, "_data.info"))); + fsfi.Files.Add(newfile); + fsfi.ByteSize += newfile.ByteSize; + + string toWrite = JsonConvert.SerializeObject(fsfi, Formatting.Indented); + + File.WriteAllText(Path.Combine(path, "_data.info"), toWrite); + } + + public static void RemoveFileFromDirectory(string path, string filename) + { + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(path, "_data.info"))); + THFileInfo fi = fsfi.Files.Find((THFileInfo f) => { return f.Name == filename; }); + if (fi == null) return; + + fsfi.ByteSize -= fi.ByteSize; + CurrentSave.BytesLeft += fi.ByteSize; + + fsfi.Files.Remove(fi); + string toWrite = JsonConvert.SerializeObject(fsfi, Formatting.Indented); + + File.WriteAllText(Path.Combine(path, "_data.info"), toWrite); + } + + public static void RemoveSubDirFromDirectory(string path, string dirname) + { + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(path, "_data.info"))); + THDirInfo di = fsfi.SubDirs.Find((THDirInfo f) => { return f.Name == dirname; }); + if (di == null) return; + + // Find the bytesize of the folder + + FileSystemFolderInfo dirfsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(path, "_data.info"))); + + fsfi.ByteSize -= dirfsfi.ByteSize; + CurrentSave.BytesLeft += dirfsfi.ByteSize; + + fsfi.SubDirs.Remove(di); + string toWrite = JsonConvert.SerializeObject(fsfi, Formatting.Indented); + + File.WriteAllText(Path.Combine(path, "_data.info"), toWrite); + } + + public static string SetDOSName(ref THFileInfo file) + { + file.DOSName = file.Name.ToUpper().Replace("*", "").Replace("+", "").Replace(":", "").Replace(";", "").Replace(" ", ""); + if (file.DOSName.Contains(".")) { - string[] dos = newfile.DOSName.Split('.'); + string[] dos = file.DOSName.Split('.'); if (dos.Count() > 2) { @@ -221,30 +269,45 @@ namespace Histacom2.Engine dos[1] = dos[1].Substring(0, 3); if (dos[0].Length > 8) dos[0] = dos[0].Substring(0, 6) + "~1"; - newfile.DOSName = dos[0] + "." + dos[1]; + file.DOSName = dos[0] + "." + dos[1]; } - else if (newfile.DOSName.Length > 8) newfile.DOSName = newfile.DOSName.Substring(0, 6) + "~1"; + else if (file.DOSName.Length > 8) file.DOSName = file.DOSName.Substring(0, 6) + "~1"; + return file.DOSName; + } - if (File.ReadAllText(Path.Combine(path, "_data.info")).Contains(newfile.DOSName)) return; + public static void RenameDirectory(string path, string dirname, string newname) + { FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(path, "_data.info"))); - fsfi.Files.Add(newfile); - fsfi.ByteSize += newfile.ByteSize; + THDirInfo di = fsfi.SubDirs.Find((THDirInfo f) => { return f.Name == dirname; }); + if (di == null) return; + + THDirInfo newDi = di; + + newDi.Name = newname; + THFileInfo tmpfi = new THFileInfo(); + newDi.DOSName = SetDOSName(ref tmpfi); + fsfi.SubDirs.Remove(di); + fsfi.SubDirs.Add(newDi); string toWrite = JsonConvert.SerializeObject(fsfi, Formatting.Indented); File.WriteAllText(Path.Combine(path, "_data.info"), toWrite); } - public static void RemoveFileFromDirectory(string path, string filename) + public static void RenameFile(string path, string filename, string newname) { FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(path, "_data.info"))); THFileInfo fi = fsfi.Files.Find((THFileInfo f) => { return f.Name == filename; }); if (fi == null) return; - fsfi.ByteSize -= fi.ByteSize; - CurrentSave.BytesLeft += fi.ByteSize; + THFileInfo newFi = fi; + newFi.Name = newname; + + THFileInfo tmpfi = new THFileInfo(); + newFi.DOSName = SetDOSName(ref tmpfi); fsfi.Files.Remove(fi); + fsfi.Files.Add(newFi); string toWrite = JsonConvert.SerializeObject(fsfi, Formatting.Indented); File.WriteAllText(Path.Combine(path, "_data.info"), toWrite); @@ -278,7 +341,7 @@ namespace Histacom2.Engine } } - public static void SaveDirectoryInfo(string parent, string dirname, bool isProtected, string label, bool allowback) + public static void SaveDirectoryInfo(string parent, string dirname, bool isProtected, string label, bool allowback, bool updateParent = true) { if (File.Exists(Path.Combine(parent, dirname, "_data.info")) && Path.Combine(parent, dirname) != ProfileFileSystemDirectory) return; Directory.CreateDirectory(Path.Combine(parent, dirname)); @@ -296,15 +359,18 @@ namespace Histacom2.Engine info.SubDirs = new List(256); info.ByteSize = 0; - if (parent != ProfileDirectory) + if (updateParent == true) { - FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(parent, "_data.info"))); - THDirInfo thd = new THDirInfo(); - thd.Name = info.Label; - thd.DOSName = info.DOSLabel; - fsfi.SubDirs.Add(thd); + if ((parent != ProfileDirectory)) + { + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(parent, "_data.info"))); + THDirInfo thd = new THDirInfo(); + thd.Name = info.Label; + thd.DOSName = info.DOSLabel; + fsfi.SubDirs.Add(thd); - File.WriteAllText(Path.Combine(parent, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); + File.WriteAllText(Path.Combine(parent, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); + } } string toWrite = JsonConvert.SerializeObject(info, Formatting.Indented); diff --git a/Histacom2/GlobalPrograms/WinClassicNotepad.cs b/Histacom2/GlobalPrograms/WinClassicNotepad.cs index 331f0d5..72f1e41 100644 --- a/Histacom2/GlobalPrograms/WinClassicNotepad.cs +++ b/Histacom2/GlobalPrograms/WinClassicNotepad.cs @@ -15,7 +15,7 @@ namespace Histacom2.OS.Win95.Win95Apps { public partial class WinClassicNotepad : UserControl { - string CurrentFilePath = ""; + public string CurrentFilePath = ""; public WinClassicNotepad() { InitializeComponent(); diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs index e015eda..123e477 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs @@ -30,6 +30,10 @@ { this.components = new System.ComponentModel.Container(); this.program = new System.Windows.Forms.Panel(); + this.pnlSave = new System.Windows.Forms.Panel(); + this.Button1 = new System.Windows.Forms.Button(); + this.Label1 = new System.Windows.Forms.Label(); + this.txtSave = new System.Windows.Forms.TextBox(); this.mainView = new System.Windows.Forms.ListView(); this.diskView = new System.Windows.Forms.TreeView(); this.MenuStrip1 = new System.Windows.Forms.MenuStrip(); @@ -37,7 +41,6 @@ this.CreateShortcutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.FolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.TextDocumentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.BitmapImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.DeleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.RenameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.CloseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -55,14 +58,10 @@ this.bottomrightcorner = new System.Windows.Forms.Panel(); this.bottomleftcorner = new System.Windows.Forms.Panel(); this.topleftcorner = new System.Windows.Forms.Panel(); - this.pnlSave = new System.Windows.Forms.Panel(); - this.Button1 = new System.Windows.Forms.Button(); - this.Label1 = new System.Windows.Forms.Label(); - this.txtSave = new System.Windows.Forms.TextBox(); this.refresh = new System.Windows.Forms.Timer(this.components); this.program.SuspendLayout(); - this.MenuStrip1.SuspendLayout(); this.pnlSave.SuspendLayout(); + this.MenuStrip1.SuspendLayout(); this.SuspendLayout(); // // program @@ -82,6 +81,47 @@ this.program.Size = new System.Drawing.Size(704, 517); this.program.TabIndex = 13; // + // pnlSave + // + this.pnlSave.Controls.Add(this.Button1); + this.pnlSave.Controls.Add(this.Label1); + this.pnlSave.Controls.Add(this.txtSave); + this.pnlSave.Location = new System.Drawing.Point(3, 474); + this.pnlSave.Name = "pnlSave"; + this.pnlSave.Size = new System.Drawing.Size(850, 35); + this.pnlSave.TabIndex = 18; + this.pnlSave.Visible = false; + // + // Button1 + // + this.Button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.Button1.Location = new System.Drawing.Point(608, 1); + this.Button1.Name = "Button1"; + this.Button1.Size = new System.Drawing.Size(75, 23); + this.Button1.TabIndex = 17; + this.Button1.Text = "Save"; + this.Button1.UseVisualStyleBackColor = true; + this.Button1.Click += new System.EventHandler(this.Button1_Click); + // + // Label1 + // + this.Label1.AutoSize = true; + this.Label1.Location = new System.Drawing.Point(3, 6); + this.Label1.Name = "Label1"; + this.Label1.Size = new System.Drawing.Size(57, 13); + this.Label1.TabIndex = 16; + this.Label1.Text = "File Name:"; + // + // txtSave + // + this.txtSave.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtSave.Location = new System.Drawing.Point(60, 3); + this.txtSave.Name = "txtSave"; + this.txtSave.Size = new System.Drawing.Size(542, 20); + this.txtSave.TabIndex = 15; + // // mainView // this.mainView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -136,10 +176,9 @@ // this.CreateShortcutToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.FolderToolStripMenuItem, - this.TextDocumentToolStripMenuItem, - this.BitmapImageToolStripMenuItem}); + this.TextDocumentToolStripMenuItem}); this.CreateShortcutToolStripMenuItem.Name = "CreateShortcutToolStripMenuItem"; - this.CreateShortcutToolStripMenuItem.Size = new System.Drawing.Size(117, 22); + this.CreateShortcutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.CreateShortcutToolStripMenuItem.Text = "New"; // // FolderToolStripMenuItem @@ -149,12 +188,6 @@ this.FolderToolStripMenuItem.Text = "Folder"; this.FolderToolStripMenuItem.Click += new System.EventHandler(this.FolderToolStripMenuItem_Click); // - // ShortcutToolStripMenuItem - // - this.ShortcutToolStripMenuItem.Name = "ShortcutToolStripMenuItem"; - this.ShortcutToolStripMenuItem.Size = new System.Drawing.Size(154, 22); - this.ShortcutToolStripMenuItem.Text = "Shortcut"; - // // TextDocumentToolStripMenuItem // this.TextDocumentToolStripMenuItem.Name = "TextDocumentToolStripMenuItem"; @@ -162,30 +195,24 @@ this.TextDocumentToolStripMenuItem.Text = "Text Document"; this.TextDocumentToolStripMenuItem.Click += new System.EventHandler(this.TextDocumentToolStripMenuItem_Click); // - // BitmapImageToolStripMenuItem - // - this.BitmapImageToolStripMenuItem.Name = "BitmapImageToolStripMenuItem"; - this.BitmapImageToolStripMenuItem.Size = new System.Drawing.Size(154, 22); - this.BitmapImageToolStripMenuItem.Text = "Bitmap Image"; - // // DeleteToolStripMenuItem // this.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem"; - this.DeleteToolStripMenuItem.Size = new System.Drawing.Size(117, 22); + this.DeleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.DeleteToolStripMenuItem.Text = "Delete"; this.DeleteToolStripMenuItem.Click += new System.EventHandler(this.DeleteToolStripMenuItem_Click); // // RenameToolStripMenuItem // this.RenameToolStripMenuItem.Name = "RenameToolStripMenuItem"; - this.RenameToolStripMenuItem.Size = new System.Drawing.Size(117, 22); + this.RenameToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.RenameToolStripMenuItem.Text = "Rename"; this.RenameToolStripMenuItem.Click += new System.EventHandler(this.RenameToolStripMenuItem_Click); // // CloseToolStripMenuItem // this.CloseToolStripMenuItem.Name = "CloseToolStripMenuItem"; - this.CloseToolStripMenuItem.Size = new System.Drawing.Size(117, 22); + this.CloseToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.CloseToolStripMenuItem.Text = "Close"; this.CloseToolStripMenuItem.Click += new System.EventHandler(this.CloseToolStripMenuItem_Click); // @@ -297,47 +324,6 @@ this.topleftcorner.Size = new System.Drawing.Size(4, 4); this.topleftcorner.TabIndex = 1; // - // pnlSave - // - this.pnlSave.Controls.Add(this.Button1); - this.pnlSave.Controls.Add(this.Label1); - this.pnlSave.Controls.Add(this.txtSave); - this.pnlSave.Location = new System.Drawing.Point(3, 474); - this.pnlSave.Name = "pnlSave"; - this.pnlSave.Size = new System.Drawing.Size(850, 35); - this.pnlSave.TabIndex = 18; - this.pnlSave.Visible = false; - // - // Button1 - // - this.Button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.Button1.Location = new System.Drawing.Point(608, 1); - this.Button1.Name = "Button1"; - this.Button1.Size = new System.Drawing.Size(75, 23); - this.Button1.TabIndex = 17; - this.Button1.Text = "Save"; - this.Button1.UseVisualStyleBackColor = true; - this.Button1.Click += new System.EventHandler(this.Button1_Click); - // - // Label1 - // - this.Label1.AutoSize = true; - this.Label1.Location = new System.Drawing.Point(3, 6); - this.Label1.Name = "Label1"; - this.Label1.Size = new System.Drawing.Size(57, 13); - this.Label1.TabIndex = 16; - this.Label1.Text = "File Name:"; - // - // txtSave - // - this.txtSave.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtSave.Location = new System.Drawing.Point(60, 3); - this.txtSave.Name = "txtSave"; - this.txtSave.Size = new System.Drawing.Size(542, 20); - this.txtSave.TabIndex = 15; - // // refresh // this.refresh.Interval = 15000; @@ -353,10 +339,10 @@ this.Load += new System.EventHandler(this.WinClassicWindowsExplorer_Load); this.program.ResumeLayout(false); this.program.PerformLayout(); - this.MenuStrip1.ResumeLayout(false); - this.MenuStrip1.PerformLayout(); this.pnlSave.ResumeLayout(false); this.pnlSave.PerformLayout(); + this.MenuStrip1.ResumeLayout(false); + this.MenuStrip1.PerformLayout(); this.ResumeLayout(false); } @@ -370,7 +356,6 @@ internal System.Windows.Forms.ToolStripMenuItem CreateShortcutToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem FolderToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem TextDocumentToolStripMenuItem; - internal System.Windows.Forms.ToolStripMenuItem BitmapImageToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem DeleteToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem RenameToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem CloseToolStripMenuItem; diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index 52ea334..eb24f7c 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -222,6 +222,7 @@ namespace Histacom2.OS.Win95.Win95Apps case 1: WinClassicNotepad np = new WinClassicNotepad(); np.mainText.Text = FileDialogBoxManager.ReadTextFile(fileDir); + np.CurrentFilePath = fileDir; WinClassic app = wm.StartWin95(np, "Notepad", Properties.Resources.Win95IconNotepad, true, true); Program.AddTaskbarItem(app, app.Tag.ToString(), "Notepad", Properties.Resources.Win95IconNotepad); @@ -229,6 +230,7 @@ namespace Histacom2.OS.Win95.Win95Apps case 2: WinClassicWordPad wp = new WinClassicWordPad(); wp.mainText.LoadFile(fileDir); + wp.CurrentFilePath = fileDir; WinClassic app2 = wm.StartWin95(wp, "Wordpad", Properties.Resources.Win95IconWordpad, true, true); Program.AddTaskbarItem(app2, app2.Tag.ToString(), "Wordpad", Properties.Resources.Win95IconWordpad); @@ -664,7 +666,7 @@ namespace Histacom2.OS.Win95.Win95Apps } else { - SaveDirectoryInfo(CurrentDirectory, "New Folder", false, "New Folder", true); + SaveDirectoryInfo(CurrentDirectory, "New Folder", false, "New Folder", true, false); RefreshAll(); OldLabelText = "New Folder"; @@ -723,20 +725,7 @@ namespace Histacom2.OS.Win95.Win95Apps // Remove the directory now from the _data.info - FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); - - foreach (THDirInfo dir in fsfi.SubDirs) - { - if (dir.Name == mainView.FocusedItem.Text) - { - // Delete it - - fsfi.SubDirs.Remove(dir); - break; - } - } - - File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); + SaveSystem.RemoveSubDirFromDirectory(CurrentDirectory, mainView.FocusedItem.Text); } else { @@ -744,20 +733,7 @@ namespace Histacom2.OS.Win95.Win95Apps // Remove the file now from the _data.info - FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); - - foreach (THFileInfo file in fsfi.Files) - { - if (file.Name == mainView.FocusedItem.Text) - { - // Delete it - - fsfi.Files.Remove(file); - continue; - } - } - - File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); + RemoveFileFromDirectory(CurrentDirectory, mainView.FocusedItem.Text); } @@ -822,54 +798,22 @@ namespace Histacom2.OS.Win95.Win95Apps Directory.Move(Path.Combine(CurrentDirectory, OldLabelText), Path.Combine(CurrentDirectory, setText)); File.Delete(Path.Combine(CurrentDirectory, setText, "_data.info")); - SaveDirectoryInfo(CurrentDirectory, setText, false, setText, true); + SaveDirectoryInfo(CurrentDirectory, setText, false, setText, true, true); // Rename the directory now in the _data.info - FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); - - foreach (THDirInfo dir in fsfi.SubDirs) - { - if (dir.Name == OldLabelText) - { - // Rename it - THDirInfo oldDirInfo = dir; - oldDirInfo.Name = Path.Combine(CurrentDirectory, setText); - - fsfi.SubDirs.Remove(dir); - fsfi.SubDirs.Add(oldDirInfo); - } - } - - File.Delete(Path.Combine(CurrentDirectory, "_data.info")); - File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi)); + RenameDirectory(CurrentDirectory, OldLabelText, setText); } else { - // It was a file + // It was a file File.Copy(Path.Combine(CurrentDirectory, OldLabelText), Path.Combine(CurrentDirectory, setText)); File.Delete(Path.Combine(CurrentDirectory, OldLabelText)); // Rename the file now in the _data.info - FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); - - foreach (THFileInfo file in fsfi.Files) - { - if (file.Name == OldLabelText) - { - // Rename it - THFileInfo oldFileInfo = file; - oldFileInfo.Name = Path.Combine(CurrentDirectory, setText); - - fsfi.Files.Remove(file); - fsfi.Files.Add(oldFileInfo); - } - } - - File.Delete(Path.Combine(CurrentDirectory, "_data.info")); - File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi)); + RenameFile(CurrentDirectory, OldLabelText, setText); } } } @@ -1045,7 +989,22 @@ namespace Histacom2.OS.Win95.Win95Apps private void TextDocumentToolStripMenuItem_Click(object sender, EventArgs e) { + if (File.Exists(CurrentDirectory + "\\New Text Document.txt")) + { + //wm.StartInfobox95("Windows Explorer", "This directory already exists", Properties.Resources.Win95Info); + //TODO: add making "New Folder (2)" + } + else + { + CreateWindowsFile(CurrentDirectory, "New Text Document.txt", "", 12, 0); + + RefreshAll(); + OldLabelText = "New Folder"; + mainView.LabelEdit = true; + mainView.FindItemWithText("New Text Document.txt").BeginEdit(); + } + RefreshTreeNode(); } } } diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs b/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs index 05b5ec1..91d9368 100644 --- a/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs +++ b/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs @@ -22,7 +22,7 @@ namespace Histacom2.OS.Win95.Win95Apps bool doItalic = false; bool doUnderline = false; - string CurrentFilePath = ""; + public string CurrentFilePath = ""; public WinClassicWordPad() { diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs index bff593e..9144c76 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs @@ -243,18 +243,28 @@ namespace Histacom2.OS.Win95.Win95Apps case 1: WinClassicNotepad np = new WinClassicNotepad(); np.mainText.Text = FileDialogBoxManager.ReadTextFile(fileDir); + np.CurrentFilePath = fileDir; WinClassic app = wm.StartWin95(np, "Notepad", Properties.Resources.Win95IconNotepad, true, true); Program.AddTaskbarItem(app, app.Tag.ToString(), "Notepad", Properties.Resources.Win95IconNotepad); + break; + case 2: + WinClassicWordPad wp = new WinClassicWordPad(); + wp.mainText.LoadFile(fileDir); + wp.CurrentFilePath = fileDir; + WinClassic app2 = wm.StartWin95(wp, "Wordpad", Properties.Resources.Win95IconWordpad, true, true); + Program.AddTaskbarItem(app2, app2.Tag.ToString(), "Wordpad", Properties.Resources.Win95IconWordpad); break; case 12: OpenApplication(FileDialogBoxManager.ReadTextFile(fileDir), fileDir); break; } - } catch { } - + catch + { + } + } void OpenApplication(string appname, string path) @@ -778,20 +788,7 @@ namespace Histacom2.OS.Win95.Win95Apps // Remove the directory now from the _data.info - FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); - - foreach (THDirInfo dir in fsfi.SubDirs) - { - if (dir.Name == mainView.FocusedItem.Text) - { - // Delete it - - fsfi.SubDirs.Remove(dir); - continue; - } - } - - File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); + SaveSystem.RemoveSubDirFromDirectory(CurrentDirectory, mainView.FocusedItem.Text); } else { @@ -799,20 +796,7 @@ namespace Histacom2.OS.Win95.Win95Apps // Remove the file now from the _data.info - FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); - - foreach (THFileInfo file in fsfi.Files) - { - if (file.Name == mainView.FocusedItem.Text) - { - // Delete it - - fsfi.Files.Remove(file); - continue; - } - } - - File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); + RemoveFileFromDirectory(CurrentDirectory, mainView.FocusedItem.Text); } @@ -824,6 +808,8 @@ namespace Histacom2.OS.Win95.Win95Apps { RefreshAll(); } + + RefreshTreeNode(); } internal static bool FileOrDirectoryExists(string path) @@ -876,54 +862,22 @@ namespace Histacom2.OS.Win95.Win95Apps Directory.Move(Path.Combine(CurrentDirectory, OldLabelText), Path.Combine(CurrentDirectory, setText)); File.Delete(Path.Combine(CurrentDirectory, setText, "_data.info")); - SaveDirectoryInfo(CurrentDirectory, setText, false, setText, true); + SaveDirectoryInfo(CurrentDirectory, setText, false, setText, true, true); // Rename the directory now in the _data.info - FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); - - foreach (THDirInfo dir in fsfi.SubDirs) - { - if (dir.Name == mainView.FocusedItem.Tag.ToString()) - { - // Rename it - THDirInfo oldDirInfo = dir; - oldDirInfo.Name = Path.Combine(CurrentDirectory, setText); - - fsfi.SubDirs.Remove(dir); - fsfi.SubDirs.Add(oldDirInfo); - } - } - - File.Delete(Path.Combine(CurrentDirectory, "_data.info")); - File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); + RenameDirectory(CurrentDirectory, OldLabelText, setText); } else { - // It was a file + // It was a file File.Copy(Path.Combine(CurrentDirectory, OldLabelText), Path.Combine(CurrentDirectory, setText)); File.Delete(Path.Combine(CurrentDirectory, OldLabelText)); // Rename the file now in the _data.info - FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); - - foreach (THFileInfo file in fsfi.Files) - { - if (file.Name == mainView.FocusedItem.Tag.ToString()) - { - // Rename it - THFileInfo oldFileInfo = file; - oldFileInfo.Name = Path.Combine(CurrentDirectory, setText); - - fsfi.Files.Remove(file); - fsfi.Files.Add(oldFileInfo); - } - } - - File.Delete(Path.Combine(CurrentDirectory, "_data.info")); - File.WriteAllText(Path.Combine(CurrentDirectory, "_data.info"), JsonConvert.SerializeObject(fsfi, Formatting.Indented)); + RenameFile(CurrentDirectory, OldLabelText, setText); } } } -- cgit v1.2.3 From bae9adbb7a79d696f3834a5a36a6fd431b2bc463 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sun, 27 Aug 2017 20:09:23 +0100 Subject: Fixed the icons --- Histacom2/Properties/Resources.resx | 8 ++++---- Histacom2/Properties/Resources1.Designer.cs | 7 ++----- Histacom2/Resources/WinClassicRtfFile.png | Bin 458 -> 458 bytes Histacom2/Resources/WinClassicTextFile.png | Bin 352 -> 888 bytes 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Histacom2/Properties/Resources.resx b/Histacom2/Properties/Resources.resx index 9331936..cd71880 100644 --- a/Histacom2/Properties/Resources.resx +++ b/Histacom2/Properties/Resources.resx @@ -822,9 +822,6 @@ ..\Resources\IE3\IE3_StopHover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\WinClassicRtfFile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\WinClassicTextFile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -1890,7 +1887,7 @@ } ] } - + ..\Resources\TitleScreen\CopyrightNotice.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -1927,4 +1924,7 @@ ..\Resources\WinClassic\WinClassicWebchat.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\WinClassicRtfFile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Histacom2/Properties/Resources1.Designer.cs b/Histacom2/Properties/Resources1.Designer.cs index 2a5653e..1d8d7ee 100644 --- a/Histacom2/Properties/Resources1.Designer.cs +++ b/Histacom2/Properties/Resources1.Designer.cs @@ -867,9 +867,7 @@ namespace Histacom2.Properties { /// "btn4txt": "", /// "btn4tag": "", /// "btn5txt": "", - /// "btn5tag": "" - /// }, - /// "inthe [rest of string was truncated]";. + /// "btn5tag": " [rest of string was truncated]";. /// public static string std_story { get { @@ -1040,8 +1038,7 @@ namespace Histacom2.Properties { /// "userchat": true /// }, /// { - /// "user": "SkyHigh", - /// [rest of string was truncated]";. + /// [rest of string was truncated]";. /// public static string webchat1998_convo { get { diff --git a/Histacom2/Resources/WinClassicRtfFile.png b/Histacom2/Resources/WinClassicRtfFile.png index c862152..ad714c6 100644 Binary files a/Histacom2/Resources/WinClassicRtfFile.png and b/Histacom2/Resources/WinClassicRtfFile.png differ diff --git a/Histacom2/Resources/WinClassicTextFile.png b/Histacom2/Resources/WinClassicTextFile.png index a8daaf8..7bfca4b 100644 Binary files a/Histacom2/Resources/WinClassicTextFile.png and b/Histacom2/Resources/WinClassicTextFile.png differ -- cgit v1.2.3 From 805a238822d3fdca7b75f63e622d93cba421755a Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sun, 27 Aug 2017 20:27:21 +0100 Subject: FIXED ALL THE ICONS AGAIN --- Histacom2/GlobalPrograms/WinClassicNotepad.cs | 2 +- Histacom2/Histacom2.csproj | 1 + .../Win95Apps/Win95WindowsExplorer.Designer.cs | 8 ++++---- .../OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 2 +- .../OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs | 2 +- Histacom2/Properties/Resources.resx | 6 +++--- Histacom2/Properties/Resources1.Designer.cs | 20 ++++++++++---------- Histacom2/Resources/WinClassicNotepad.png | Bin 0 -> 352 bytes 8 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 Histacom2/Resources/WinClassicNotepad.png diff --git a/Histacom2/GlobalPrograms/WinClassicNotepad.cs b/Histacom2/GlobalPrograms/WinClassicNotepad.cs index 72f1e41..e1a4019 100644 --- a/Histacom2/GlobalPrograms/WinClassicNotepad.cs +++ b/Histacom2/GlobalPrograms/WinClassicNotepad.cs @@ -37,7 +37,7 @@ namespace Histacom2.OS.Win95.Win95Apps private void aboutNotepadToolStripMenuItem_Click(object sender, EventArgs e) { WindowManager wm = new WindowManager(); - wm.StartAboutBox95("Notepad", "Microsoft Notepad", Properties.Resources.WinClassicNotepadBig); + wm.StartAboutBox95("Notepad", "Microsoft Notepad", Properties.Resources.WinClassicNotepad); } private void wordWrapToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/Histacom2/Histacom2.csproj b/Histacom2/Histacom2.csproj index be8df37..46750d2 100644 --- a/Histacom2/Histacom2.csproj +++ b/Histacom2/Histacom2.csproj @@ -636,6 +636,7 @@ + diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs index 123e477..e16d79b 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs @@ -178,7 +178,7 @@ this.FolderToolStripMenuItem, this.TextDocumentToolStripMenuItem}); this.CreateShortcutToolStripMenuItem.Name = "CreateShortcutToolStripMenuItem"; - this.CreateShortcutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.CreateShortcutToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.CreateShortcutToolStripMenuItem.Text = "New"; // // FolderToolStripMenuItem @@ -198,21 +198,21 @@ // DeleteToolStripMenuItem // this.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem"; - this.DeleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.DeleteToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.DeleteToolStripMenuItem.Text = "Delete"; this.DeleteToolStripMenuItem.Click += new System.EventHandler(this.DeleteToolStripMenuItem_Click); // // RenameToolStripMenuItem // this.RenameToolStripMenuItem.Name = "RenameToolStripMenuItem"; - this.RenameToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.RenameToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.RenameToolStripMenuItem.Text = "Rename"; this.RenameToolStripMenuItem.Click += new System.EventHandler(this.RenameToolStripMenuItem_Click); // // CloseToolStripMenuItem // this.CloseToolStripMenuItem.Name = "CloseToolStripMenuItem"; - this.CloseToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.CloseToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.CloseToolStripMenuItem.Text = "Close"; this.CloseToolStripMenuItem.Click += new System.EventHandler(this.CloseToolStripMenuItem_Click); // diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index eb24f7c..07f9e57 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -65,7 +65,7 @@ namespace Histacom2.OS.Win95.Win95Apps Properties.Resources.WinClassicFolder, Properties.Resources.WinClassicApp, // 10 Properties.Resources.WinClassicSetup, - Properties.Resources.WinClassicTextFile, + Properties.Resources.WinClassicNotepad, Properties.Resources.WinClassicCalcBig, Properties.Resources.WinClassicNotepadBig, Properties.Resources.WinClassicRegedit, // 15 diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs index 9144c76..8fbe14c 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs @@ -70,7 +70,7 @@ namespace Histacom2.OS.Win95.Win95Apps Properties.Resources.WinClassicFolder, Properties.Resources.WinClassicApp, // 10 Properties.Resources.WinClassicSetup, - Properties.Resources.WinClassicTextFile, + Properties.Resources.WinClassicNotepad, Properties.Resources.WinClassicCalcBig, Properties.Resources.WinClassicNotepadBig, Properties.Resources.WinClassicRegedit, // 15 diff --git a/Histacom2/Properties/Resources.resx b/Histacom2/Properties/Resources.resx index cd71880..6c51cf6 100644 --- a/Histacom2/Properties/Resources.resx +++ b/Histacom2/Properties/Resources.resx @@ -822,9 +822,6 @@ ..\Resources\IE3\IE3_StopHover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\WinClassicTextFile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - { "messages": [ @@ -1924,6 +1921,9 @@ ..\Resources\WinClassic\WinClassicWebchat.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\WinClassicNotepad.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\WinClassicRtfFile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/Histacom2/Properties/Resources1.Designer.cs b/Histacom2/Properties/Resources1.Designer.cs index 1d8d7ee..3ef5f6c 100644 --- a/Histacom2/Properties/Resources1.Designer.cs +++ b/Histacom2/Properties/Resources1.Designer.cs @@ -1703,6 +1703,16 @@ namespace Histacom2.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap WinClassicNotepad { + get { + object obj = ResourceManager.GetObject("WinClassicNotepad", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -1873,16 +1883,6 @@ namespace Histacom2.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap WinClassicTextFile { - get { - object obj = ResourceManager.GetObject("WinClassicTextFile", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/Histacom2/Resources/WinClassicNotepad.png b/Histacom2/Resources/WinClassicNotepad.png new file mode 100644 index 0000000..937d8ca Binary files /dev/null and b/Histacom2/Resources/WinClassicNotepad.png differ -- cgit v1.2.3