private void buttonNew_Click(object sender, EventArgs e) { InputDialog new_prop_stuff = new InputDialog(); new_prop_stuff.SetInstr("Name of new property ..."); new_prop_stuff.ShowDialog(); if (new_prop_stuff.DialogResult != System.Windows.Forms.DialogResult.OK) { return; } string new_prop_name = new_prop_stuff.TextValue; if (working_component.NonemptyPropertyNames().Contains(new_prop_name)) { MessageBox.Show("There's already a property with that name."); return; } new_prop_stuff = new InputDialog(); new_prop_stuff.SetInstr("Value of new property ..."); new_prop_stuff.ShowDialog(); if (new_prop_stuff.DialogResult != System.Windows.Forms.DialogResult.OK) { return; } working_component.SetCustomString(new_prop_name, new_prop_stuff.TextValue); RebuildList(); }
private void buttonNewGraph_Click(object sender, EventArgs e) { InputDialog new_name_dlg = new InputDialog(); new_name_dlg.SetInstr("Name of new graph ..."); new_name_dlg.ShowDialog(); if (new_name_dlg.DialogResult == System.Windows.Forms.DialogResult.OK) { string new_name = new_name_dlg.TextValue.Trim(); if (new_name == "") { return; } string err_msg = ""; GlGraph new_graph = GlobalsGraphAdmin.CreateGraph(new_name, out err_msg); if (new_graph == null) { MessageBox.Show(err_msg); return; } RebuildGraphList(); comboGraphs.SelectedItem = new_name; } }
private void buttonNewNode_Click(object sender, EventArgs e) { InputDialog new_name_dlg = new InputDialog(); new_name_dlg.SetInstr("Name of new node ..."); // in this example we're assuming that "name" will be required for nodes new_name_dlg.ShowDialog(); if (new_name_dlg.DialogResult == System.Windows.Forms.DialogResult.OK) { NodeWrapper.AddGraphNode(CurrentGraph, new_name_dlg.TextValue.Trim()); RebuildNodeList(); } }
private void buttonEdit_Click(object sender, EventArgs e) { string propname = comboProps.SelectedItem.ToString(); InputDialog new_prop_val_dlg = new InputDialog(); new_prop_val_dlg.SetInstr("New value property ..."); new_prop_val_dlg.ShowDialog(); if (new_prop_val_dlg.DialogResult != System.Windows.Forms.DialogResult.OK) { return; } working_component.SetCustomString(propname, new_prop_val_dlg.TextValue); DisplayPropVal(); }