private void editTraceToolStripButton_Click(object sender, EventArgs e) { Trace o = traceListBox.SelectedItem as Trace; if (o != null) { using (LineDialog ld = new LineDialog()) { ld.Style = o.penstyle; ld.TraceStyle = o.tracestyle; ld.ShapeMode = LineDialog.LineDialogMode.Trace; if (ld.ShowDialog(this) == DialogResult.OK) { stv.UndoAdd(); o.penstyle = ld.Style; o.tracestyle = ld.TraceStyle; stv.UpdateTraces(); stv.UpdateEverything(true); } } } }
public bool DoDecoration(bool forReal) { //for some reason we don't use SelectionProxy on this one bool done = false; SyntaxTreeViewer syntaxTreeViewer = this; if (syntaxTreeViewer.GetSelection().Count > 0) { if (forReal) { Decoration decoration = syntaxTreeViewer.GetSelection()[0].GetNode().Decoration; using (LineDialog ld = new LineDialog()) { ld.Decoration = decoration; ld.ShapeMode = LineDialog.LineDialogMode.Decoration; if (ld.ShowDialog(this) == DialogResult.OK) { syntaxTreeViewer.UndoAdd(); decoration = ld.Decoration; foreach (Elem elem in syntaxTreeViewer.GetSelection()) { elem.GetNode().Decoration = decoration; elem.FreeCache(); /*this in only necessary because changing the padding setting will change the dimensions of the element*/ } syntaxTreeViewer.UpdateEverything(true); } } } done = true; } return done; }
private void lineToolStripMenuItem_Click(object sender, EventArgs e) { using (LineDialog ld = new LineDialog()) { TreeOptions to = syntaxTreeViewer.GetCurrentOptions(); ld.Style = to.linestyle; ld.ShapeMode = LineDialog.LineDialogMode.Line; if (ld.ShowDialog(this) == DialogResult.OK) { syntaxTreeViewer.UndoAdd(); to.linestyle = ld.Style; SetHasChanged(); syntaxTreeViewer.ReleaseGDIResources(); syntaxTreeViewer.UpdateEverything(true); } } }