private void UpdateLayoutChoiceLabels()
{
if (_model == null || _model.BookSelection == null || _model.BookSelection.CurrentSelection == null)
return; // May get called when localization changes even though tab is not visible.
var layout = _model.PageLayout;
var layoutChoices = _model.BookSelection.CurrentSelection.GetLayoutChoices();
_layoutChoices.DropDownItems.Clear();
// _layoutChoices.Items.AddRange(layoutChoices.ToArray());
// _layoutChoices.SelectedText = _model.BookSelection.CurrentSelection.GetLayout().ToString();
foreach (var lc in layoutChoices)
{
var text = LocalizationManager.GetDynamicString("Bloom", "LayoutChoices." + lc, lc.ToString());
ToolStripMenuItem item = (ToolStripMenuItem) _layoutChoices.DropDownItems.Add(text);
item.Tag = lc;
item.Text = text;
item.Checked = lc.ToString() == layout.ToString();
item.CheckOnClick = true;
item.Click += OnLayoutChosen;
}
_layoutChoices.Text = LocalizationManager.GetDynamicString("Bloom", "LayoutChoices." + layout, layout.ToString());
_layoutChoices.DropDownItems.Add(new ToolStripSeparator());
var textItem = LocalizationManager.GetDynamicString("Bloom", "lessMemoryPdfMode", "Use less memory (slower)");
var menuItem = (ToolStripMenuItem) _layoutChoices.DropDownItems.Add(textItem);
menuItem.Checked = _model.BookSelection.CurrentSelection.UserPrefs.ReducePdfMemoryUse;
menuItem.CheckOnClick = true;
menuItem.CheckedChanged += OnSinglePageModeChanged;
// "EditTab" because it is the same text. No sense in having it listed twice.
_layoutChoices.ToolTipText = LocalizationManager.GetString("EditTab.PageSizeAndOrientation.Tooltip",
"Choose a page size and orientation");
}