public TEditor(ListBox lb, Song song, GUI owner, Translation trans)
 {
     //
     // Erforderlich für die Windows Form-Designerunterstützung
     //
     InitializeComponent();
     this.song = song;
     this.trans = trans;
     this.lb = lb;
     this.owner = owner;
     this.textBox2.Text = this.song.Number.ToString();
     this.textBox2.Enabled = false;
     TEditor.tEditor = this;
     TEditor.TEditorOpen = true;
     if (this.trans != null)
     {
         this.textBox1.Text = this.trans.Title;
         this.richTextBox1.Text = this.trans.Text;
         this.checkBox1.Checked = this.trans.Unformatted;
         this.panel1.Enabled = !this.trans.Unformatted;
     }
     else
     {
         this.textBox1.Text = "";
         this.richTextBox1.Text = "";
     }
 }
 // ok
 private void button1_Click(object sender, System.EventArgs e)
 {
     if (this.trans != null)
     {
         this.trans.Title = this.textBox1.Text;
         this.trans.Text = this.richTextBox1.Text;
         this.trans.Language = this.comboBox2.SelectedIndex;
         this.trans.Unformatted = this.checkBox1.Checked;
     }
     else
     {
         this.trans = new Translation(this.textBox1.Text, this.richTextBox1.Text, this.comboBox2.SelectedIndex, this.checkBox1.Checked, PhysicalXML.HighestTrID, true);
         this.song.AddTranslation(this.trans);
     }
     this.song.ShowTranslations(this.lb);
     this.song.RefreshTransMenu();
     this.song.Update();
     this.owner.ToUpdate(true);
     this.Close();
 }
Exemple #3
0
 public void refresh(Song song, Translation trans)
 {
     this.song = song;
     this.trans = trans;
     this.refresh();
 }
Exemple #4
0
 public static void ShowSong(Song song, Translation trans, GUI owner, ListBox navigate)
 {
     if(_this == null)
     {
         _this = new View();
     }
     _this.menuItem1.Visible = false;
     _this.owner = owner;
     _this.navigate = navigate;
     _this.menuItem6.Checked = Util.SHOWRIGHT;
     _this.richTextBox1.Font = Util.FONT;
     _this.richTextBox2.Font = Util.FONT;
     if (trans != null)
     {
         _this.refresh(song, trans);
     }
     else
     {
         _this.refresh(song);
     }
     _this.richTextBox1.Focus();
     _this.pos = navigate.Items.IndexOf(_this.song);
     _this.Show();
 }
Exemple #5
0
 public void RemoveTranslation(Translation t)
 {
     t.Delete();
     this.Translations.Remove(t.ID);
     this.transMenu = this.getTransMenuItem();
 }
Exemple #6
0
 public void AddTranslation(Translation t)
 {
     this.Translations.Add(t.ID, t);
     this.transMenu = this.getTransMenuItem();
 }