Allow translation window to show.

This commit is contained in:
Tim Young 2017-10-03 08:53:28 -05:00
parent c017cb42a3
commit 82a06495df
4 changed files with 33 additions and 0 deletions

View File

@ -127,6 +127,7 @@
this.tbMessage.Name = "tbMessage"; this.tbMessage.Name = "tbMessage";
this.tbMessage.Size = new System.Drawing.Size(306, 60); this.tbMessage.Size = new System.Drawing.Size(306, 60);
this.tbMessage.TabIndex = 9; this.tbMessage.TabIndex = 9;
this.tbMessage.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tbMessage_MouseDown);
// //
// lblNetMessage // lblNetMessage
// //

View File

@ -433,5 +433,15 @@ namespace EduNetworkBuilder
Location = tLocation; Location = tLocation;
} }
} }
private void tbMessage_MouseDown(object sender, MouseEventArgs e)
{
if(ModifierKeys == Keys.Control && e.Button == MouseButtons.Left)
{
//ctrl-click -- open translators window
TranslationWindow TW = new TranslationWindow();
TW.Show();
}
}
} }
} }

View File

@ -76,6 +76,7 @@
this.btnClose.TabIndex = 13; this.btnClose.TabIndex = 13;
this.btnClose.Text = "Close"; this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true; this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
// //
// btnSave // btnSave
// //
@ -99,6 +100,7 @@
this.Controls.Add(this.cb1Language); this.Controls.Add(this.cb1Language);
this.Name = "TranslationWindow"; this.Name = "TranslationWindow";
this.Text = "TranslationWindow"; this.Text = "TranslationWindow";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TranslationWindow_KeyDown);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();

View File

@ -15,6 +15,26 @@ namespace EduNetworkBuilder
public TranslationWindow() public TranslationWindow()
{ {
InitializeComponent(); InitializeComponent();
this.KeyPreview = true;
}
private void btnClose_Click(object sender, EventArgs e)
{
Close();
}
private void Save()
{
Console.WriteLine("Saved");
}
private void TranslationWindow_KeyDown(object sender, KeyEventArgs e)
{
if(e.Modifiers == Keys.Control && e.KeyCode == Keys.S)
{
//ctrl-s was pressed
Save();
}
} }
} }
} }