public void setNovel(Datastructure.Novel nvl) { pnlView.Height = 600; lblTitle.Text = nvl.title; lblAutoreText.Text = nvl.author; // ogni volta che richiamo risize, restituisco la stessa posizione ma con la X aggiunta di qualche punto txtOriginText.Text = nvl.origin; Tuple <int, int> location = basicUtilities.resizeTextBox(txtOriginText); lblNota.Location = new Point(location.Item1, location.Item2); txtNoteText.Text = nvl.note; location = basicUtilities.resizeTextBox(txtNoteText); lblText.Location = new Point(location.Item1, location.Item2); txtTextText.Text = nvl.text; location = basicUtilities.resizeTextBox(txtTextText); lblTranslation.Location = new Point(location.Item1, location.Item2 + 5); txtTranslation.Text = ""; foreach (Translation trans in nvl.getTranslations()) { txtTranslation.Text += trans.getTranslated().title + ","; } txtTranslation.Text = txtTranslation.Text.Remove(txtTranslation.Text.Length - 1); location = basicUtilities.resizeTextBox(txtTranslation); // 20 px la distanza in verticale. pnlView.Height = txtTranslation.Location.Y + 10; }
public void setNovel(Datastructure.Novel nvl) { clsFields(); this.nvl = nvl; lblTitle.Text = this.nvl.title; txtOrigine.Text = this.nvl.origin; txtNota.Text = this.nvl.note; txtAuthor.Text = this.nvl.author; txtTesto.Text = this.nvl.text; txtTradu.Text = ""; foreach (Translation tra in nvl.getTranslations()) { txtTradu.Text += tra.getTranslated().title + ";"; } if (txtTradu.Text != "") { txtTradu.Text = txtTradu.Text.Remove(txtTradu.Text.Length - 1); } }