Skip to content

Commit

Permalink
Change lbContext to custom control
Browse files Browse the repository at this point in the history
  • Loading branch information
Mc-muffin committed Nov 21, 2024
1 parent c4ba3c6 commit 0ed4a24
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 35 deletions.
28 changes: 15 additions & 13 deletions TranslationApp/fMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions TranslationApp/fMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1365,28 +1365,6 @@ private void lbDistinctTranslations_SelectedIndexChanged(object sender, EventArg
lbContext.DataSource = ContextTranslations;
}

private void lbContext_MeasureItem(object sender, MeasureItemEventArgs e)
{
if (e.Index >= ContextTranslations.Count)
return;

string text = GetTextBasedLanguage(e.Index, ContextTranslations);

text = text == null ? "" : text;

int nb = 2;
if (ContextTranslations[e.Index].SpeakerId != null)
{
nb += 1;
}

nb += Regex.Matches(text, "\\r*\\n").Count;

var size = (int)((nb + 1) * 14) + 6;

e.ItemHeight = size;
}

private void lbSearch_Click(object sender, EventArgs e)
{
if (!(cbDone.Checked && cbDone.Checked && cbProblematic.Checked && cbEditing.Checked && cbToDo.Checked && cbProof.Checked))
Expand Down

0 comments on commit 0ed4a24

Please sign in to comment.