/// <summary> /// Creates a new <c>NewTextContextMenu</c>, wiring each menuitem to the specified UI. /// </summary> /// <param name="ui">The user interface displaying this context menu</param> internal NewTextContextMenu(NewTextUI ui) { InitializeComponent(); new UserAction(ctxHorizontal, ui.ToggleHorizontal); uint sizeFactor = ui.SizeFactor; new TextSizeAction(ctx500, ui.SetSizeFactor, 500, sizeFactor); new TextSizeAction(ctx200, ui.SetSizeFactor, 200, sizeFactor); new TextSizeAction(ctx150, ui.SetSizeFactor, 150, sizeFactor); new TextSizeAction(ctx100, ui.SetSizeFactor, 100, sizeFactor); new TextSizeAction(ctx75, ui.SetSizeFactor, 75, sizeFactor); new TextSizeAction(ctx50, ui.SetSizeFactor, 50, sizeFactor); new TextSizeAction(ctx25, ui.SetSizeFactor, 25, sizeFactor); new UserAction(ctxCancel, ui.Cancel); ctxHorizontal.Checked = ui.IsHorizontalChecked; ctxHorizontal.Enabled = ui.IsHorizontalEnabled; }
/// <summary> /// Starts the Text - Add Miscellaneous Text command. This involves an initial /// check to confirm that text is currently drawn (if not, the user will be told /// and the command will not be started). /// </summary> /// <param name="action">The action that initiated this call</param> private void TextAddMiscellaneousText(IUserAction action) { // Confirm that text is currently displayed if (!IsTextDrawn) { MessageBox.Show("Text is not currently displayed. Use Edit-Preferences to change the scale at which text will be drawn"); return; } CommandUI cmd = new NewTextUI(this, action); m_Controller.StartCommand(cmd); }