public void Initialize (IPadWindow window) { // Toolbar and menu definitions ActionCommand gotoCmd = new ActionCommand (LocalCommands.GoToFile, GettextCatalog.GetString ("Go to File")); ActionCommand propertiesCmd = new ActionCommand (LocalCommands.Properties, GettextCatalog.GetString ("Properties"), Gtk.Stock.Properties); menuSet = new CommandEntrySet (); menuSet.Add (gotoCmd); menuSet.AddSeparator (); menuSet.AddItem (DebugCommands.EnableDisableBreakpoint); menuSet.AddItem (DebugCommands.ClearAllBreakpoints); menuSet.AddItem (DebugCommands.DisableAllBreakpoints); menuSet.AddItem (EditCommands.Delete); menuSet.AddSeparator (); menuSet.Add (propertiesCmd); CommandEntrySet toolbarSet = new CommandEntrySet (); toolbarSet.AddItem (DebugCommands.EnableDisableBreakpoint); toolbarSet.AddItem (DebugCommands.ClearAllBreakpoints); toolbarSet.AddItem (DebugCommands.DisableAllBreakpoints); toolbarSet.AddItem (EditCommands.Delete); toolbarSet.AddSeparator (); toolbarSet.Add (propertiesCmd); // The breakpoint list store = new TreeStore (typeof(string), typeof (bool), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string), typeof(string)); tree = new BreakpointsTreeView (this); tree.Model = store; tree.RulesHint = true; tree.HeadersVisible = true; treeState = new TreeViewState (tree, (int) Columns.Breakpoint); TreeViewColumn col = new TreeViewColumn (); CellRenderer crp = new CellRendererIcon (); col.PackStart (crp, false); col.AddAttribute (crp, "stock_id", (int) Columns.Icon); tree.AppendColumn (col); Gtk.CellRendererToggle toggleRender = new Gtk.CellRendererToggle (); toggleRender.Toggled += new ToggledHandler (ItemToggled); col = new TreeViewColumn (); col.PackStart (toggleRender, false); col.AddAttribute (toggleRender, "active", (int) Columns.Selected); tree.AppendColumn (col); TreeViewColumn FrameCol = new TreeViewColumn (); CellRenderer crt = tree.TextRenderer; FrameCol.Title = GettextCatalog.GetString ("File"); FrameCol.PackStart (crt, true); FrameCol.AddAttribute (crt, "text", (int) Columns.FileName); FrameCol.Resizable = true; FrameCol.Alignment = 0.0f; tree.AppendColumn (FrameCol); col = tree.AppendColumn (GettextCatalog.GetString ("Condition"), crt, "text", (int) Columns.Condition); col.Resizable = true; col = tree.AppendColumn (GettextCatalog.GetString ("Trace Expression"), crt, "text", (int) Columns.TraceExp); col.Resizable = true; col = tree.AppendColumn (GettextCatalog.GetString ("Hit Count"), crt, "text", (int) Columns.HitCount); col.Resizable = true; col = tree.AppendColumn (GettextCatalog.GetString ("Last Trace"), crt, "text", (int) Columns.LastTrace); col.Resizable = true; sw = new Gtk.ScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (tree); control = sw; control.ShowAll (); bps = DebuggingService.Breakpoints; UpdateDisplay (); tree.PopupMenu += new PopupMenuHandler (OnPopupMenu); breakpointUpdatedHandler = DispatchService.GuiDispatch (new EventHandler<BreakpointEventArgs> (OnBreakpointUpdated)); DebuggingService.Breakpoints.BreakpointAdded += OnBpAdded; DebuggingService.Breakpoints.BreakpointRemoved += OnBpRemoved; DebuggingService.Breakpoints.Changed += OnBpChanged; DebuggingService.Breakpoints.BreakpointUpdated += breakpointUpdatedHandler; DebuggingService.PausedEvent += OnDebuggerStatusCheck; DebuggingService.ResumedEvent += OnDebuggerStatusCheck; DebuggingService.StoppedEvent += OnDebuggerStatusCheck; tree.RowActivated += OnRowActivated; DockItemToolbar toolbar = window.GetToolbar (PositionType.Top); toolbar.Add (toolbarSet, sw); toolbar.ShowAll (); }
public void Initialize(IPadWindow window) { // Toolbar and menu definitions ActionCommand gotoCmd = new ActionCommand(LocalCommands.GoToFile, GettextCatalog.GetString("Go to File")); ActionCommand propertiesCmd = new ActionCommand(LocalCommands.Properties, GettextCatalog.GetString("Properties"), Gtk.Stock.Properties); menuSet = new CommandEntrySet(); menuSet.Add(gotoCmd); menuSet.AddSeparator(); menuSet.AddItem(DebugCommands.EnableDisableBreakpoint); menuSet.AddItem(DebugCommands.ClearAllBreakpoints); menuSet.AddItem(DebugCommands.DisableAllBreakpoints); menuSet.AddItem(EditCommands.Delete); menuSet.AddSeparator(); menuSet.Add(propertiesCmd); CommandEntrySet toolbarSet = new CommandEntrySet(); toolbarSet.AddItem(DebugCommands.EnableDisableBreakpoint); toolbarSet.AddItem(DebugCommands.ClearAllBreakpoints); toolbarSet.AddItem(DebugCommands.DisableAllBreakpoints); toolbarSet.AddItem(EditCommands.Delete); toolbarSet.AddSeparator(); toolbarSet.Add(propertiesCmd); // The breakpoint list store = new TreeStore(typeof(string), typeof(bool), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string), typeof(string)); tree = new BreakpointsTreeView(this); tree.Model = store; tree.RulesHint = true; tree.HeadersVisible = true; treeState = new TreeViewState(tree, (int)Columns.Breakpoint); TreeViewColumn col = new TreeViewColumn(); CellRenderer crp = new CellRendererIcon(); col.PackStart(crp, false); col.AddAttribute(crp, "stock_id", (int)Columns.Icon); tree.AppendColumn(col); Gtk.CellRendererToggle toggleRender = new Gtk.CellRendererToggle(); toggleRender.Toggled += new ToggledHandler(ItemToggled); col = new TreeViewColumn(); col.PackStart(toggleRender, false); col.AddAttribute(toggleRender, "active", (int)Columns.Selected); tree.AppendColumn(col); TreeViewColumn FrameCol = new TreeViewColumn(); CellRenderer crt = tree.TextRenderer; FrameCol.Title = GettextCatalog.GetString("File"); FrameCol.PackStart(crt, true); FrameCol.AddAttribute(crt, "text", (int)Columns.FileName); FrameCol.Resizable = true; FrameCol.Alignment = 0.0f; tree.AppendColumn(FrameCol); col = tree.AppendColumn(GettextCatalog.GetString("Condition"), crt, "text", (int)Columns.Condition); col.Resizable = true; col = tree.AppendColumn(GettextCatalog.GetString("Trace Expression"), crt, "text", (int)Columns.TraceExp); col.Resizable = true; col = tree.AppendColumn(GettextCatalog.GetString("Hit Count"), crt, "text", (int)Columns.HitCount); col.Resizable = true; col = tree.AppendColumn(GettextCatalog.GetString("Last Trace"), crt, "text", (int)Columns.LastTrace); col.Resizable = true; sw = new Gtk.ScrolledWindow(); sw.ShadowType = ShadowType.None; sw.Add(tree); control = sw; control.ShowAll(); bps = DebuggingService.Breakpoints; UpdateDisplay(); tree.PopupMenu += new PopupMenuHandler(OnPopupMenu); breakpointUpdatedHandler = DispatchService.GuiDispatch(new EventHandler <BreakpointEventArgs> (OnBreakpointUpdated)); DebuggingService.Breakpoints.BreakpointAdded += OnBpAdded; DebuggingService.Breakpoints.BreakpointRemoved += OnBpRemoved; DebuggingService.Breakpoints.Changed += OnBpChanged; DebuggingService.Breakpoints.BreakpointUpdated += breakpointUpdatedHandler; DebuggingService.PausedEvent += OnDebuggerStatusCheck; DebuggingService.ResumedEvent += OnDebuggerStatusCheck; DebuggingService.StoppedEvent += OnDebuggerStatusCheck; tree.RowActivated += OnRowActivated; DockItemToolbar toolbar = window.GetToolbar(PositionType.Top); toolbar.Add(toolbarSet, sw); toolbar.ShowAll(); }