aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/GlobalPrograms
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-08-18 16:03:13 +0100
committerAlex-TIMEHACK <[email protected]>2017-08-18 16:03:13 +0100
commitbd3612eadf3181856d5033d3e47b97357d88c345 (patch)
treeb137f4b624135588af1a55b6ff1d3e490e56ca39 /TimeHACK.Main/GlobalPrograms
parentf56e9b6232f34dec7693a1cf8968e50136a096ff (diff)
downloadhistacom2-bd3612eadf3181856d5033d3e47b97357d88c345.tar.gz
histacom2-bd3612eadf3181856d5033d3e47b97357d88c345.tar.bz2
histacom2-bd3612eadf3181856d5033d3e47b97357d88c345.zip
Quite Big revamp on Explorer part 2
Diffstat (limited to 'TimeHACK.Main/GlobalPrograms')
-rw-r--r--TimeHACK.Main/GlobalPrograms/WinClassicNotepad.Designer.cs21
-rw-r--r--TimeHACK.Main/GlobalPrograms/WinClassicNotepad.cs34
-rw-r--r--TimeHACK.Main/GlobalPrograms/WinClassicNotepad.resx3
3 files changed, 42 insertions, 16 deletions
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)
@@ -100,19 +101,38 @@ 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<string> 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 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
+ <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
</root> \ No newline at end of file