More translation window basics

This commit is contained in:
Tim Young 2017-10-03 15:07:24 -05:00
parent 82a06495df
commit eca5aef396
2 changed files with 23 additions and 2 deletions

View File

@ -439,7 +439,7 @@ namespace EduNetworkBuilder
if(ModifierKeys == Keys.Control && e.Button == MouseButtons.Left)
{
//ctrl-click -- open translators window
TranslationWindow TW = new TranslationWindow();
TranslationWindow TW = new TranslationWindow(myNet);
TW.Show();
}
}

View File

@ -12,10 +12,31 @@ namespace EduNetworkBuilder
{
public partial class TranslationWindow : Form
{
public TranslationWindow()
Network myNet = null;
public TranslationWindow(Network ToEdit)
{
InitializeComponent();
this.KeyPreview = true;
myNet = ToEdit;
LocalSetup();
}
void LocalSetup()
{
string[,] LanguageChoices = NB.LanguageChoices;
cb1Language.Items.Clear();
cb2Language.Items.Clear();
for (int i = 0; i < LanguageChoices.GetLength(0); i++)
{
cb1Language.Items.Add(LanguageChoices[i, 0]);
cb2Language.Items.Add(LanguageChoices[i, 0]);
}
if (LanguageChoices.Length > 0)
cb1Language.SelectedIndex = 0;
if (LanguageChoices.Length > 1)
cb1Language.SelectedIndex = 1;
Icon = Properties.Resources.NBIco;
}
private void btnClose_Click(object sender, EventArgs e)