public ParseTreeWindow(RuntimeThread runtimeThread) : base("Parse Tree")
 {
     runtimeThread.Runtime.ParseTrace.ParsedEvent += OnParsed;
     
     SetDefaultSize(250, 300);
     SkipPagerHint = true;
     SkipTaskbarHint = true;
     
     scroller = new ScrolledWindow();
     scroller.BorderWidth = 5;
     scroller.ShadowType = ShadowType.In;
     Add(scroller);
     
     store = new TreeStore(typeof(string), typeof(object));
     
     view = new TreeView(store);
     column = view.AppendColumn(null, new CellRendererText(), "text", VALUE_TEXT);
     view.HeadersVisible = false;
     view.RowActivated += OnTreeRowActivated;
     view.ButtonPressEvent += OnTreeButtonPress;
     scroller.Add(view);
     
     MenuBuilder menuBuilder = new MenuBuilder();
     menu = menuBuilder.StartMenu();
     menuBuilder.Add("Show source", OnMenuShowSource);
     menuBuilder.Add("Show object", OnMenuShowObject);
     menu.ShowAll();
 }
 public GrammarWindow(RuntimeThread runtimeThread) : base("Grammar")
 {
     runtimeThread.Runtime.Grammar.Trace.PatternDefinedEvent += OnGrammarPatternDefined;
     runtimeThread.Runtime.Grammar.Trace.PatternChangedEvent += OnGrammarPatternChanged;
     
     SetDefaultSize(250, 300);
     SkipPagerHint = true;
     SkipTaskbarHint = true;
     
     scroller = new ScrolledWindow();
     scroller.BorderWidth = 5;
     scroller.ShadowType = ShadowType.In;
     Add(scroller);
     
     store = new TreeStore(typeof(string), typeof(Source));
     
     // FIXME - only want to sort top level
     
     //TreeModelSort storeSort = new TreeModelSort(store);
     //storeSort.SetSortColumnId(0, SortType.Ascending);
     
     view = new TreeView(store);
     
     view.AppendColumn(null, new CellRendererText(), "text", VALUE_TEXT);
     view.HeadersVisible = false;
     view.RowActivated += OnTreeRowActivated;
     view.ButtonPressEvent += OnTreeButtonPress;
     scroller.Add(view);
     
     MenuBuilder menuBuilder = new MenuBuilder();
     menu = menuBuilder.StartMenu();
     menuBuilder.Add("Show source", OnMenuShowSource);
     menuBuilder.Add("Show object", OnMenuShowObject);
     menu.ShowAll();
 }
Exemple #3
0
 public MainWindow()
     : base("Katahdin Debugger")
 {
     SetDefaultSize(500, 400);
     
     try
     {
         PathResolver pathResolver = new PathResolver();
         SetIconFromFile(pathResolver.Resolve("katahdin.svg"));
     }
     catch
     {
     }
     
     Destroyed += delegate
     {
         if (runtimeThread != null)
             runtimeThread.Shutdown();
     };
     
     VBox vertical = new VBox();
     Add(vertical);
     
     MenuBuilder menuBuilder = new MenuBuilder();
     
     MenuBar menuBar = menuBuilder.StartMenuBar();
     vertical.PackStart(menuBar, false, false, 0);
     
     menuBuilder.StartMenu("Debug");
     debugRun = menuBuilder.Add("Run", OnDebugRun);
     menuBuilder.End();
     
     menuBuilder.StartMenu("View");
     viewGrammar = menuBuilder.AddCheck("Grammar", OnViewGrammarToggled);
     viewParseTrace = menuBuilder.AddCheck("Parse Trace", OnViewParseTraceToggled);
     viewParseTree = menuBuilder.AddCheck("Parse Tree", OnViewParseTreeToggled);
     menuBuilder.Separate();
     menuBuilder.Add("View runtime object", OnViewRuntimeModule);
     menuBuilder.End();
     
     menuBuilder.End();
     
     console = new ConsoleWidget();
     vertical.PackStart(console, true, true, 0);
     
     vertical.PackStart(new HSeparator(), false, false, 0);
     
     HBox statusBar = new HBox();
     vertical.PackStart(statusBar, false, false, 1);
     
     progress = new ProgressBar();
     statusBar.PackStart(progress, false, false, 1);
     
     statusLabel = new Label();
     statusLabel.SetAlignment(0, (float) 0.5);
     statusLabel.LineWrap = true;
     statusBar.PackStart(statusLabel, true, true, 0);
 }