public Edit_Translation()
{
// The form
MaximizeBox = false;
MinimizeBox = false;
Icon = Data.Icon;
BackColor = LayoutColors.ColorFormBack;
FormBorderStyle = FormBorderStyle.FixedDialog;
Text = Language.T("Edit Translation");
FormClosing += new FormClosingEventHandler(Actions_FormClosing);
// Controls
pnlCommon = new Fancy_Panel(Language.T("Common Parameters"));
pnlPhrases = new Fancy_Panel(Language.T("English Phrase - Translated Phrase"));
alblInputNames = new Label[5];
atbxInputValues = new TextBox[5];
atbxMain = new TextBox[TEXTBOXES];
atbxAlt = new TextBox[TEXTBOXES];
scrollBar = new VScrollBar();
tbxSearch = new TextBox();
btnSearch = new Button();
btnUntranslated = new Button();
btnAccept = new Button();
btnCancel = new Button();
// Common
pnlCommon.Parent = this;
// Phrases
pnlPhrases.Parent = this;
// Input Names
string[] asInputNames = new string[] {
Language.T("Language"),
Language.T("File name"),
Language.T("Author"),
Language.T("Website"),
Language.T("Contacts"),
};
// Input Values
string[] asInputValues = new string[] {
Configs.Language,
Language.LanguageFileName,
Language.Author,
Language.AuthorsWebsite,
Language.AuthorsEmail,
};
// Common parameters
for (int i = 0; i < asInputNames.Length; i++)
{
alblInputNames[i] = new Label();
alblInputNames[i].Parent = pnlCommon;
alblInputNames[i].ForeColor = LayoutColors.ColorControlText;
alblInputNames[i].BackColor = Color.Transparent;
alblInputNames[i].AutoSize = true;
alblInputNames[i].Text = asInputNames[i];
atbxInputValues[i] = new TextBox();
atbxInputValues[i].Parent = pnlCommon;
atbxInputValues[i].Text = asInputValues[i];
}
// Phrases
for (int i = 0; i < TEXTBOXES; i++)
{
atbxMain[i] = new TextBox();
atbxMain[i].Parent = pnlPhrases;
atbxMain[i].Multiline = true;
atbxMain[i].ReadOnly = true;
atbxMain[i].ForeColor = Color.DarkGray;
atbxAlt[i] = new TextBox();
atbxAlt[i].Parent = pnlPhrases;
atbxAlt[i].Multiline = true;
atbxAlt[i].Tag = i;
atbxAlt[i].TextChanged += new EventHandler(Edit_Translation_TextChanged);
}
// Vertical ScrollBar
scrollBar.Parent = pnlPhrases;
scrollBar.Visible = true;
scrollBar.Enabled = true;
scrollBar.ValueChanged += new EventHandler(ScrollBar_ValueChanged);
scrollBar.TabStop = true;
// TextBox Search
tbxSearch.Parent = this;
tbxSearch.TextChanged += new EventHandler(TbxSearch_TextChanged);
// Button Search
btnSearch.Parent = this;
btnSearch.Name = "Search";
btnSearch.Text = Language.T("Search");
btnSearch.Click += new EventHandler(Btn_Click);
btnSearch.UseVisualStyleBackColor = true;
// Button Untranslated
btnUntranslated.Parent = this;
btnUntranslated.Name = "Untranslated";
btnUntranslated.Text = Language.T("Not Translated");
btnUntranslated.Click += new EventHandler(Btn_Click);
btnUntranslated.UseVisualStyleBackColor = true;
// Button Cancel
btnCancel.Parent = this;
btnCancel.Name = "Cancel";
btnCancel.Text = Language.T("Cancel");
btnCancel.DialogResult = DialogResult.Cancel;
btnCancel.Click += new EventHandler(Btn_Click);
btnCancel.UseVisualStyleBackColor = true;
// Button Accept
btnAccept.Parent = this;
btnAccept.Name = "Accept";
btnAccept.Text = Language.T("Accept");
btnAccept.DialogResult = DialogResult.OK;
btnAccept.Click += new EventHandler(Btn_Click);
btnAccept.Enabled = false;
btnAccept.UseVisualStyleBackColor = true;
}