public ICommand CreateCommand() { ICommand ret = null; using (TextPromptDialog dlg = new TextPromptDialog("Add Marker At Camera", "Name", "&Add")) { if (dlg.ShowDialog() == DialogResult.OK) { ret = new AddMarkerAtCameraCommand(app, cont, dlg.TextBoxText); } } return ret; }
public ICommand CreateCommand() { ICommand ret = null; using (TextPromptDialog dlg = new TextPromptDialog("Add Marker", "Name", anchor, "&Add")) { if (dlg.ShowDialog() == DialogResult.OK) { ret = new AddMarkerCommand(app, parent, dlg.UserText, "directional_marker.mesh"); } } return ret; }
public ICommand CreateCommand() { ICommand ret = null; using (TextPromptDialog dlg = new TextPromptDialog("Add Marker At Camera", "Name", "&Add")) { if (dlg.ShowDialog() == DialogResult.OK) { ret = new AddMarkerAtCameraCommand(app, cont, dlg.TextBoxText); } } return(ret); }
public ICommand CreateCommand() { ICommand ret = null; using (TextPromptDialog dlg = new TextPromptDialog("Add Marker", "Name", anchor, "&Add")) { if (dlg.ShowDialog() == DialogResult.OK) { ret = new AddMarkerCommand(app, parent, dlg.UserText, "directional_marker.mesh"); } } return(ret); }
public ICommand CreateCommand() { ICommand ret = null; // string name; string title; // bool add = false; // add = true; title = "Add Vegetation"; using (TextPromptDialog dlg = new TextPromptDialog(title, "Name", anchor, "&Add")) { if (dlg.ShowDialog() == DialogResult.OK) { ret = new AddGrassCommand(app, (Boundary) bound, dlg.TextBoxText); this.name = dlg.TextBoxText; } } return ret; }
public ICommand CreateCommand() { ICommand ret = null; // string name; string title; // bool add = false; // add = true; title = "Add Vegetation"; using (TextPromptDialog dlg = new TextPromptDialog(title, "Name", anchor, "&Add")) { if (dlg.ShowDialog() == DialogResult.OK) { ret = new AddGrassCommand(app, (Boundary)bound, dlg.TextBoxText); this.name = dlg.TextBoxText; } } return(ret); }
public ICommand CreateCommand() { ICommand ret = null; // bool add = false; (unused) // add = true; string title = "Add Water"; bool showAgain = false; using (TextPromptDialog dlg = new TextPromptDialog(title, "Water height (mm):", anchor, "&Add")) { do { showAgain = false; dlg.TextBoxText = app.Config.WaterHeightDefault.ToString(); float h; DialogResult dlgRes = dlg.ShowDialog(); if (dlgRes == DialogResult.OK && float.TryParse(dlg.TextBoxText, out h)) { ret = new AddWaterCommand(app, bound, h); } else { if (dlgRes != DialogResult.Cancel) { MessageBox.Show("Height can not be parsed to a floating point number", "Incorrect height", MessageBoxButtons.OK); showAgain = true; } else { return(null); } } } while (showAgain); } return(ret); }
public ICommand CreateCommand() { ICommand ret = null; // bool add = false; (unused) // add = true; string title = "Add Water"; bool showAgain = false; using (TextPromptDialog dlg = new TextPromptDialog(title, "Water height (mm):", anchor, "&Add")) { do { showAgain = false; dlg.TextBoxText = app.Config.WaterHeightDefault.ToString(); float h; DialogResult dlgRes = dlg.ShowDialog(); if (dlgRes == DialogResult.OK && float.TryParse(dlg.TextBoxText, out h)) { ret = new AddWaterCommand(app, bound, h); } else { if (dlgRes != DialogResult.Cancel) { MessageBox.Show("Height can not be parsed to a floating point number", "Incorrect height", MessageBoxButtons.OK); showAgain = true; } else { return null; } } } while (showAgain); } return ret; }
private void newWorldToolStripMenuItem_Click(object sender, EventArgs e) { bool rv = canLoad(); if (!rv) { return; } if (worldRoot != null) { ClearWorld(); } using (TextPromptDialog dlg = new TextPromptDialog("Create a New World", "Enter the name of your new World:", "World")) { if (dlg.ShowDialog() == DialogResult.OK) { worldRoot = new WorldRoot(dlg.UserText, worldTreeView, this); saveWorldButton.Enabled = true; saveWorldToolStripMenuItem.Enabled = true; saveWorldAsMenuItem.Enabled = true; worldRoot.AddToTree(null); worldRoot.AddToScene(); setWorldDefaults(); undoRedo.ClearUndoRedo(); worldRoot.Node.Select(); worldRoot.Node.Expand(); } } }