aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-07-21 13:24:28 +0100
committerAlex-TIMEHACK <[email protected]>2017-07-21 13:24:28 +0100
commit75c05d35535267096b0c46e143be7a55bb21c9c4 (patch)
treeb9f175812ff8fde1f982ee0667a3853572ec8259 /TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs
parentfee528f280640948216f41f0569c79a6552e61c7 (diff)
parenta42b7b8d3219f5df18721afdf88bddb8dd11d463 (diff)
downloadhistacom2-75c05d35535267096b0c46e143be7a55bb21c9c4.tar.gz
histacom2-75c05d35535267096b0c46e143be7a55bb21c9c4.tar.bz2
histacom2-75c05d35535267096b0c46e143be7a55bb21c9c4.zip
Update My Fork PART 2!!!
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs')
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs196
1 files changed, 31 insertions, 165 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs
index 4d2fbf1..2453abc 100644
--- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.cs
@@ -42,6 +42,29 @@ namespace TimeHACK.OS.Win95.Win95Apps
comboFont.Items.Add(font.Name);
}
+
+ // Handlers
+ this.clearToolStripMenuItem.Click += (sender, args) => mainText.Text = mainText.Text.Remove(mainText.SelectionStart, mainText.SelectedText.Length);
+ this.pasteToolStripMenuItem.Click += (sender, args) => mainText.Paste();
+ this.btnPaste.Click += (sender, args) => mainText.Paste();
+ this.btnCopy.Click += (sender, args) => { if (mainText.SelectedText.Length >= 0) mainText.Copy(); };
+ this.copyToolStripMenuItem.Click += (sender, args) => { if (mainText.SelectedText.Length >= 0) mainText.Copy(); };
+ this.cutToolStripMenuItem.Click += (sender, args) => { if (mainText.SelectedText.Length >= 0) mainText.Cut(); };
+ this.btnCut.Click += (sender, args) => { if (mainText.SelectedText.Length >= 0) mainText.Cut(); };
+ this.undoToolStripMenuItem.Click += (sender, args) => mainText.Undo();
+ this.selectAllToolStripMenuItem.Click += (sender, args) => mainText.SelectAll();
+ this.dateTimeToolStripMenuItem.Click += (sender, args) => mainText.AppendText(DateTime.Now.ToString("HH:mm tt dd/MM/yyyy"));
+ this.toolbarToolStripMenuItem.Click += (sender, args) => pnlToolbar.Visible = toolbarToolStripMenuItem.Checked;
+ this.formatBarToolStripMenuItem.Click += (sender, args) => pnlFormatBar.Visible = formatBarToolStripMenuItem.Checked;
+ this.statusBarToolStripMenuItem.Click += (sender, args) => statusBar.Visible = statusBarToolStripMenuItem.Checked;
+ this.exitToolStripMenuItem.Click += (sender, args) => ((Form)this.TopLevelControl).Close();
+ this.aboutWordpadToolStripMenuItem.Click += (sender, args) => wm.StartAboutBox95("Wordpad", "Microsoft Wordpad", Properties.Resources.Win95IconWordpad);
+ this.btnNew.Click += (sender, args) => mainText.Text = "";
+ this.newToolStripMenuItem.Click += (sender, args) => mainText.Text = "";
+ this.sendToolStripMenuItem.Click += (sender, args) => wm.StartInfobox95("Wordpad", "An error occured opening send option.", null);
+ this.bulletStyleToolStripMenuItem.Click += (sender, args) => mainText.SelectionBullet = bulletStyleToolStripMenuItem.Checked;
+ this.comboFont.SelectedIndexChanged += (sender, args) => SetSelectedTextFont(comboFont.Text);
+ this.comboSize.SelectedIndexChanged += (sender, args) => SetSelectedTextSize(comboSize.Text);
}
#region Format_Buttons
@@ -96,139 +119,7 @@ namespace TimeHACK.OS.Win95.Win95Apps
#endregion
#region Designer-Stuff
- private void dateTimeToolStripMenuItem_Click(object sender, EventArgs e)
- {
- InsertDateTime();
- }
- private void toolbarToolStripMenuItem_Click(object sender, EventArgs e)
- {
- pnlToolbar.Visible = toolbarToolStripMenuItem.Checked;
- }
-
- private void formatBarToolStripMenuItem_Click(object sender, EventArgs e)
- {
- pnlFormatBar.Visible = formatBarToolStripMenuItem.Checked;
- }
-
- private void statusBarToolStripMenuItem_Click(object sender, EventArgs e)
- {
- statusBar.Visible = statusBarToolStripMenuItem.Checked;
- }
-
- private void exitToolStripMenuItem_Click(object sender, EventArgs e)
- {
- ((Form)this.TopLevelControl).Close();
- }
-
- private void aboutWordpadToolStripMenuItem_Click(object sender, EventArgs e)
- {
- wm.StartAboutBox95("Wordpad", "Microsoft Wordpad", Properties.Resources.Win95IconWordpad);
- }
-
- private void newToolStripMenuItem_Click(object sender, EventArgs e)
- {
- NewFile();
- }
-
- private void btnNew_Click(object sender, EventArgs e)
- {
- NewFile();
- }
-
- private void sendToolStripMenuItem_Click(object sender, EventArgs e)
- {
- wm.StartInfobox95("Wordpad", "An error occured opening send option.", null);
- }
-
- void Cut()
- {
- if (mainText.SelectedText.Length >= 0) {
- mainText.Cut();
- }
- }
-
- void Copy()
- {
- if (mainText.SelectedText.Length >= 0)
- {
- mainText.Copy();
- }
- }
-
- void Paste()
- {
- mainText.Paste();
- }
-
- void Clear()
- {
- mainText.Text = mainText.Text.Remove(mainText.SelectionStart, mainText.SelectedText.Length);
- }
-
- void SelectAll()
- {
- mainText.SelectAll();
- }
-
- private void undoToolStripMenuItem_Click(object sender, EventArgs e)
- {
- Undo();
- }
-
- private void cutToolStripMenuItem_Click(object sender, EventArgs e)
- {
- Cut();
- }
-
- private void copyToolStripMenuItem_Click(object sender, EventArgs e)
- {
- Copy();
- }
-
- private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
- {
- Paste();
- }
-
- private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SelectAll();
- }
-
- private void clearToolStripMenuItem_Click(object sender, EventArgs e)
- {
- Clear();
- }
-
- private void btnCut_Click(object sender, EventArgs e)
- {
- Cut();
- }
-
- private void btnCopy_Click(object sender, EventArgs e)
- {
- Copy();
- }
-
- private void btnPaste_Click(object sender, EventArgs e)
- {
- Paste();
- }
-
- private void bulletStyleToolStripMenuItem_Click(object sender, EventArgs e)
- {
- mainText.SelectionBullet = bulletStyleToolStripMenuItem.Checked;
- }
-
- private void comboFont_SelectedIndexChanged(object sender, EventArgs e)
- {
- SetSelectedTextFont(comboFont.Text);
- }
-
- private void comboSize_SelectedIndexChanged(object sender, EventArgs e)
- {
- SetSelectedTextSize(comboSize.Text);
- }
+
private void btnBold_MouseEnter(object sender, EventArgs e)
{
lblStatus.Text = "Makes the selected text Bold. (toggle)";
@@ -260,36 +151,20 @@ namespace TimeHACK.OS.Win95.Win95Apps
}
#endregion
- void NewFile()
- {
- mainText.Text = "";
- }
-
- void Undo()
- {
- mainText.Undo();
- }
-
- void InsertDateTime()
- {
- string DateTime = System.DateTime.Now.ToString("HH:mm tt dd/MM/yyyy");
- mainText.AppendText(DateTime);
- }
-
// Things for Cut/Copy/Paste have been placed in the "Designer-Stuff" region!
- void SetSelectedTextFont(String font)
+ void SetSelectedTextFont(string font)
{
- // The next two lines convert a String to a Font
+ // The next two lines convert a string to a Font
var cvt = new FontConverter();
Font f = cvt.ConvertFromString(font) as Font;
mainText.SelectionFont = f;
}
- void SetSelectedTextSize(String size)
+ void SetSelectedTextSize(string size)
{
- // The next few lines will ATTEMPT to convert a String to an Integer
+ // The next few lines will ATTEMPT to convert a string to an Integer
int SizeInt = Convert.ToInt32(size);
mainText.SelectionFont = new Font(mainText.SelectionFont.FontFamily, SizeInt, mainText.SelectionFont.Style);
@@ -300,18 +175,9 @@ namespace TimeHACK.OS.Win95.Win95Apps
FontStyle Bold = FontStyle.Regular;
FontStyle Italic = FontStyle.Regular;
FontStyle Underline = FontStyle.Regular;
- if (doBold == true)
- {
- Bold = FontStyle.Bold;
- }
- if (doItalic == true)
- {
- Italic = FontStyle.Italic;
- }
- if (doUnderline == true)
- {
- Underline = FontStyle.Underline;
- }
+ if (doBold == true) Bold = FontStyle.Bold;
+ if (doItalic == true) Italic = FontStyle.Italic;
+ if (doUnderline == true)Underline = FontStyle.Underline;
mainText.SelectionFont = new Font(mainText.SelectionFont.FontFamily, mainText.SelectionFont.Size, Bold | Italic | Underline);
}
}