From 14d1d663f5c6f5f98719223c41005e96a0ac6830 Mon Sep 17 00:00:00 2001 From: jtsshieh Date: Fri, 14 Jul 2017 18:20:57 -0400 Subject: [PATCH] Copy/Paste Did Copy/Paste for Calculator BUT paste is not doing too well at filtering out the letters. --- .../WinClassicCalculator.Designer.cs | 7 +++-- .../Win95/Win95Apps/WinClassicCalculator.cs | 27 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.Designer.cs index 92190a3..70ad0a2 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.Designer.cs @@ -119,15 +119,17 @@ private void InitializeComponent() // this.PasteCtrlVToolStripMenuItem1.BackColor = System.Drawing.Color.Silver; this.PasteCtrlVToolStripMenuItem1.Name = "PasteCtrlVToolStripMenuItem1"; - this.PasteCtrlVToolStripMenuItem1.Size = new System.Drawing.Size(150, 22); + this.PasteCtrlVToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); this.PasteCtrlVToolStripMenuItem1.Text = "Paste Ctrl+V"; + this.PasteCtrlVToolStripMenuItem1.Click += new System.EventHandler(this.PasteCtrlVToolStripMenuItem1_Click); // // CopyCtrlCToolStripMenuItem1 // this.CopyCtrlCToolStripMenuItem1.BackColor = System.Drawing.Color.Silver; this.CopyCtrlCToolStripMenuItem1.Name = "CopyCtrlCToolStripMenuItem1"; - this.CopyCtrlCToolStripMenuItem1.Size = new System.Drawing.Size(150, 22); + this.CopyCtrlCToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); this.CopyCtrlCToolStripMenuItem1.Text = "Copy Ctrl+C"; + this.CopyCtrlCToolStripMenuItem1.Click += new System.EventHandler(this.CopyCtrlCToolStripMenuItem1_Click); // // EditToolStripMenuItem1 // @@ -388,6 +390,7 @@ private void InitializeComponent() this.Button15.TabIndex = 72; this.Button15.Text = "+/-"; this.Button15.UseVisualStyleBackColor = true; + this.Button15.Click += new System.EventHandler(this.Button15_Click); // // Button17 // diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.cs index 1a1c905..71ded89 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.cs @@ -144,5 +144,32 @@ private void AboutCalculatorToolStripMenuItem_Click(object sender, EventArgs e) WindowManager wm = new WindowManager(); wm.StartAboutBox95("Calculator", "Microsoft Calculator", Properties.Resources.WinClassicCalc); } + + private void Button15_Click(object sender, EventArgs e) + { + + } + + private void CopyCtrlCToolStripMenuItem1_Click(object sender, EventArgs e) + { + txtNumbers.Copy(); + } + + private void PasteCtrlVToolStripMenuItem1_Click(object sender, EventArgs e) + { + string pasteText = Clipboard.GetText(); + string strippedText = ""; + for (int i = 0; i < pasteText.Length; i++) + { + if (char.IsDigit(pasteText[i])) + strippedText += pasteText[i].ToString(); + MessageBox.Show("Test"); + } + if (strippedText!=pasteText) + { + txtNumbers.Text = pasteText; + } + } + } }