/// <summary> /// Creates a new <c>NewLabelContextMenu</c>, wiring each menuitem to the specified UI. /// </summary> /// <param name="ui">The user interface displaying this context menu</param> internal NewLabelContextMenu(NewLabelUI ui) { InitializeComponent(); new UserAction(ctxAutoPosition, ui.ToggleAutoPosition); new UserAction(ctxAutoAngle, ui.ToggleAutoAngle); ctxAutoPosition.Checked = ui.IsAutoPosition; ctxAutoAngle.Checked = ui.IsAutoAngle; // If we're auto-positioning, the auto-angle option should be disabled (it may // still be checked to signify that it'll be re-enabled on turning off the // auto-angle option). if (ui.IsAutoPosition) ctxAutoAngle.Enabled = false; 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(ctxFinish, ui.Finish); }
private void TextAddPolygonLabels(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 NewLabelUI(this, action); m_Controller.StartCommand(cmd); }