public static Control NewControl(Model model, object o) { IHasCoordinate ihc = (IHasCoordinate)o; TextBox rtb = new TextBox(); rtb.Multiline = true; rtb.ScrollBars = ScrollBars.Both; rtb.WordWrap = false; rtb.HideSelection = false; ILTextView stv = new ILTextView(model, rtb); if (ihc is AST) { AST p = (AST)ihc; while (p.parent != null && p.parent.begin.file == ihc.begin.file && !(p is compilation_unit)) { p = p.parent; } stv.ASTRoot = p; if (stv.ASTRoot is compilation_unit) { compilation_unit c = (compilation_unit)stv.ASTRoot; Tracking tracking = new Tracking(); tracking_ilgen ti = new tracking_ilgen(tracking, c); tracking.tracked = ti; stv.tracking = ti.create(c); stv.Text = stv.tracking.Text; } } rtb.MouseUp += new MouseEventHandler(stv.Select); stv.ObjectChanged(); return(rtb); }
private void addILButton_Click(object sender, System.EventArgs e) { addBrowser(ILTextView.NewBrowser(this.model)); }