コード例 #1
0
        public ThreadsPad()
        {
            this.ShadowType = ShadowType.None;

            store = new TreeStore(typeof(string), typeof(string), typeof(string), typeof(object), typeof(int), typeof(string));

            tree                = new MonoDevelop.Ide.Gui.Components.PadTreeView(store);
            tree.RulesHint      = true;
            tree.HeadersVisible = true;
            treeViewState       = new TreeViewState(tree, (int)Columns.Object);

            TreeViewColumn col = new TreeViewColumn();
            CellRenderer   crp = new CellRendererIcon();

            col.PackStart(crp, false);
            col.AddAttribute(crp, "stock_id", (int)Columns.Icon);
            tree.AppendColumn(col);

            TreeViewColumn FrameCol = new TreeViewColumn();

            FrameCol.Title = GettextCatalog.GetString("Id");
            FrameCol.PackStart(tree.TextRenderer, true);
            FrameCol.AddAttribute(tree.TextRenderer, "text", (int)Columns.Id);
            FrameCol.AddAttribute(tree.TextRenderer, "weight", (int)Columns.Weight);
            FrameCol.Resizable = true;
            FrameCol.Alignment = 0.0f;
            tree.AppendColumn(FrameCol);

            col           = new TreeViewColumn();
            col.Title     = GettextCatalog.GetString("Name");
            col.Resizable = true;
            col.PackStart(tree.TextRenderer, false);
            col.AddAttribute(tree.TextRenderer, "text", (int)Columns.Name);
            col.AddAttribute(tree.TextRenderer, "weight", (int)Columns.Weight);
            tree.AppendColumn(col);

            col           = new TreeViewColumn();
            col.Title     = GettextCatalog.GetString("Location");
            col.Resizable = true;
            col.PackStart(tree.TextRenderer, false);
            col.AddAttribute(tree.TextRenderer, "text", (int)Columns.Location);
            col.AddAttribute(tree.TextRenderer, "weight", (int)Columns.Weight);
            tree.AppendColumn(col);

            Add(tree);
            ShowAll();

            UpdateDisplay();

            tree.RowActivated += OnRowActivated;
            DebuggingService.CallStackChanged += OnStackChanged;
            DebuggingService.PausedEvent      += OnDebuggerPaused;
            DebuggingService.ResumedEvent     += OnDebuggerResumed;
            DebuggingService.StoppedEvent     += OnDebuggerStopped;
        }
コード例 #2
0
ファイル: ThreadsPad.cs プロジェクト: newky2k/monodevelop
		public ThreadsPad ()
		{
			this.ShadowType = ShadowType.None;

			store = new TreeStore (typeof(string), typeof (string), typeof(string), typeof(object), typeof(int), typeof(string));

			tree = new PadTreeView (store);
			tree.RulesHint = true;
			tree.HeadersVisible = true;
			treeViewState = new TreeViewState (tree, (int)Columns.Object);
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRenderer crp = new CellRendererImage ();
			col.PackStart (crp, false);
			col.AddAttribute (crp, "stock_id", (int) Columns.Icon);
			tree.AppendColumn (col);
				
			TreeViewColumn FrameCol = new TreeViewColumn ();
			FrameCol.Title = GettextCatalog.GetString ("Id");
			FrameCol.PackStart (tree.TextRenderer, true);
			FrameCol.AddAttribute (tree.TextRenderer, "text", (int) Columns.Id);
			FrameCol.AddAttribute (tree.TextRenderer, "weight", (int) Columns.Weight);
			FrameCol.Resizable = true;
			FrameCol.Alignment = 0.0f;
			tree.AppendColumn (FrameCol);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("Name");
			col.Resizable = true;
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", (int) Columns.Name);
			col.AddAttribute (tree.TextRenderer, "weight", (int) Columns.Weight);
			tree.AppendColumn (col);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("Location");
			col.Resizable = true;
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", (int) Columns.Location);
			col.AddAttribute (tree.TextRenderer, "weight", (int) Columns.Weight);
			tree.AppendColumn (col);
			
			Add (tree);
			ShowAll ();
			
			UpdateDisplay ();
			
			tree.RowActivated += OnRowActivated;
			DebuggingService.CallStackChanged += OnStackChanged;
			DebuggingService.PausedEvent += OnDebuggerPaused;
			DebuggingService.ResumedEvent += OnDebuggerResumed;
			DebuggingService.StoppedEvent += OnDebuggerStopped;
		}
コード例 #3
0
        void AddColumns()
        {
            Gtk.CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();

            Gtk.CellRendererToggle toggleRender = new Gtk.CellRendererToggle();
            toggleRender.Toggled += new ToggledHandler(ItemToggled);

            TreeViewColumn col;

            col = view.AppendColumn("!", iconRender, "pixbuf", DataColumns.Type);

            col = view.AppendColumn("", toggleRender);
            col.SetCellDataFunc(toggleRender, new Gtk.TreeCellDataFunc(ToggleDataFunc));

            col = view.AppendColumn(GettextCatalog.GetString("Line"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(LineDataFunc));

            col = view.AppendColumn(GettextCatalog.GetString("Description"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(DescriptionDataFunc));
            col.Resizable = true;

            col = view.AppendColumn(GettextCatalog.GetString("File"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(FileDataFunc));
            col.Resizable = true;

            col = view.AppendColumn(GettextCatalog.GetString("Project"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(ProjectDataFunc));
            col.Resizable = true;

            col = view.AppendColumn(GettextCatalog.GetString("Path"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(PathDataFunc));
            col.Resizable = true;
        }
コード例 #4
0
		public StackTracePadWidget ()
		{
			this.ShadowType = ShadowType.None;

			store = new ListStore (typeof(bool), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(Pango.Style), typeof(object), typeof(int), typeof(bool));
			SemanticModelAttribute modelAttr = new SemanticModelAttribute ("store__Icon", "store__Method","store_File",
				"store_Lang", "store_Addr", "store_Foreground", "store_Style", "store_Frame", "store_FrameIndex");
			TypeDescriptor.AddAttributes (store, modelAttr);

			tree = new PadTreeView (store);
			tree.RulesHint = true;
			tree.HeadersVisible = true;
			tree.Selection.Mode = SelectionMode.Multiple;
			tree.SearchEqualFunc = Search;
			tree.EnableSearch = true;
			tree.SearchColumn = 1;
			tree.DoPopupMenu = ShowPopup;

			var col = new TreeViewColumn ();
			var crp = new CellRendererImage ();
			col.PackStart (crp, false);
			crp.Image = pointerImage;
			col.AddAttribute (crp, "visible", IconColumn);
			tree.AppendColumn (col);
			
			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("Name");
			col.PackStart (tree.TextRenderer, true);
			col.AddAttribute (tree.TextRenderer, "text", MethodColumn);
			col.AddAttribute (tree.TextRenderer, "foreground", ForegroundColumn);
			col.AddAttribute (tree.TextRenderer, "style", StyleColumn);
			col.Resizable = true;
			col.Alignment = 0.0f;
			tree.AppendColumn (col);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("File");
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", FileColumn);
			col.AddAttribute (tree.TextRenderer, "foreground", ForegroundColumn);
			tree.AppendColumn (col);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("Language");
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", LangColumn);
			col.AddAttribute (tree.TextRenderer, "foreground", ForegroundColumn);
			col.Visible = false;//By default Language column is hidden
			tree.AppendColumn (col);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("Address");
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", AddrColumn);
			col.AddAttribute (tree.TextRenderer, "foreground", ForegroundColumn);
			col.Visible = false;//By default Address column is hidden
			tree.AppendColumn (col);
			
			Add (tree);

			LoadColumnsVisibility ();
			LoadSettings ();

			ShowAll ();
			UpdateDisplay ();
			
			DebuggingService.CallStackChanged += OnClassStackChanged;
			DebuggingService.CurrentFrameChanged += OnFrameChanged;
			DebuggingService.StoppedEvent += OnDebuggingServiceStopped;

			tree.RowActivated += OnRowActivated;
		}
コード例 #5
0
ファイル: BreakpointPad.cs プロジェクト: IBBoard/monodevelop
		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.DeleteKey);
			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 PadTreeView ();
			tree.Model = store;
			tree.RulesHint = true;
			tree.HeadersVisible = true;
			tree.DoPopupMenu = ShowPopup;
			tree.KeyPressEvent += OnKeyPressEvent;
			
			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 ("Name");
			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 ();

			breakpointUpdatedHandler = DispatchService.GuiDispatch<EventHandler<BreakpointEventArgs>> (OnBreakpointUpdated);
			breakpointRemovedHandler = DispatchService.GuiDispatch<EventHandler<BreakpointEventArgs>> (OnBreakpointRemoved);
			breakpointAddedHandler = DispatchService.GuiDispatch<EventHandler<BreakpointEventArgs>> (OnBreakpointAdded);
			breakpointChangedHandler = DispatchService.GuiDispatch<EventHandler> (OnBreakpointChanged);
			
			DebuggingService.Breakpoints.BreakpointAdded += breakpointAddedHandler;
			DebuggingService.Breakpoints.BreakpointRemoved += breakpointRemovedHandler;
			DebuggingService.Breakpoints.Changed += breakpointChangedHandler;
			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 ();
		}
コード例 #6
0
		public SearchResultWidget ()
		{
			var vbox = new VBox ();
			var toolbar = new Toolbar () {
				Orientation = Orientation.Vertical,
				IconSize = IconSize.Menu,
				ToolbarStyle = ToolbarStyle.Icons,
			};
			this.PackStart (vbox, true, true, 0);
			this.PackStart (toolbar, false, false, 0);
			labelStatus = new Label () {
				Xalign = 0,
				Justify = Justification.Left,
			};
			var hpaned = new HPaned ();
			vbox.PackStart (hpaned, true, true, 0);
			vbox.PackStart (labelStatus, false, false, 0);
			var resultsScroll = new CompactScrolledWindow ();
			hpaned.Pack1 (resultsScroll, true, true);
			scrolledwindowLogView = new CompactScrolledWindow ();
			hpaned.Pack2 (scrolledwindowLogView, true, true);
			textviewLog = new TextView () {
				Editable = false,
			};
			scrolledwindowLogView.Add (textviewLog);
			
			store = new ListStore (typeof (SearchResult),
				typeof (bool) // didRead
				);
			
			treeviewSearchResults = new PadTreeView () {
				Model = store,
				HeadersClickable = true,
				RulesHint = true,
			};

			treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
			resultsScroll.Add (treeviewSearchResults);

			var projectColumn = new TreeViewColumn {
				Resizable = true,
				SortColumnId = 1,
				Title = GettextCatalog.GetString ("Project"),
				Sizing = TreeViewColumnSizing.Fixed,
				FixedWidth = 100
			};

			var projectPixbufRenderer = new CellRendererImage ();
			projectColumn.PackStart (projectPixbufRenderer, false);
			projectColumn.SetCellDataFunc (projectPixbufRenderer, ResultProjectIconDataFunc);

			var renderer = treeviewSearchResults.TextRenderer;
			renderer.Ellipsize = Pango.EllipsizeMode.End;
			projectColumn.PackStart (renderer, true);
			projectColumn.SetCellDataFunc (renderer, ResultProjectDataFunc);
			treeviewSearchResults.AppendColumn (projectColumn);

			var fileNameColumn = new TreeViewColumn {
				Resizable = true,
				SortColumnId = 2,
				Title = GettextCatalog.GetString ("File"),
				Sizing = TreeViewColumnSizing.Fixed,
				FixedWidth = 200
			};

			var fileNamePixbufRenderer = new CellRendererImage ();
			fileNameColumn.PackStart (fileNamePixbufRenderer, false);
			fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, FileIconDataFunc);
			
			fileNameColumn.PackStart (renderer, true);
			fileNameColumn.SetCellDataFunc (renderer, FileNameDataFunc);
			treeviewSearchResults.AppendColumn (fileNameColumn);


			TreeViewColumn textColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Text"),
				renderer, ResultTextDataFunc);
			textColumn.Resizable = true;
			textColumn.Sizing = TreeViewColumnSizing.Fixed;
			textColumn.FixedWidth = 300;

			pathColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Path"),
				                            renderer, ResultPathDataFunc);
			pathColumn.SortColumnId = 3;
			pathColumn.Resizable = true;
			pathColumn.Sizing = TreeViewColumnSizing.Fixed;
			pathColumn.FixedWidth = 500;

			store.DefaultSortFunc = DefaultSortFunc;
			store.SetSortFunc (1, CompareProjectFileNames);
			store.SetSortFunc (2, CompareFileNames);
			store.SetSortFunc (3, CompareFilePaths);

			treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;
			
			buttonStop = new ToolButton (new ImageView (Gui.Stock.Stop, Gtk.IconSize.Menu), null) { Sensitive = false };
			buttonStop.Clicked += ButtonStopClicked;
			buttonStop.TooltipText = GettextCatalog.GetString ("Stop");
			toolbar.Insert (buttonStop, -1);

			var buttonClear = new ToolButton (new ImageView (Gui.Stock.Clear, Gtk.IconSize.Menu), null);
			buttonClear.Clicked += ButtonClearClicked;
			buttonClear.TooltipText = GettextCatalog.GetString ("Clear results");
			toolbar.Insert (buttonClear, -1);
			
			var buttonOutput = new ToggleToolButton ();
			buttonOutput.IconWidget = new ImageView (Gui.Stock.OutputIcon, Gtk.IconSize.Menu);
			buttonOutput.Clicked += ButtonOutputClicked;
			buttonOutput.TooltipText = GettextCatalog.GetString ("Show output");
			toolbar.Insert (buttonOutput, -1);
			
			buttonPin = new ToggleToolButton ();
			buttonPin.IconWidget = new ImageView (Gui.Stock.PinUp, Gtk.IconSize.Menu);
			buttonPin.Clicked += ButtonPinClicked;
			buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad");
			toolbar.Insert (buttonPin, -1);

			// store.SetSortColumnId (3, SortType.Ascending);
			ShowAll ();
			
			scrolledwindowLogView.Hide ();
			treeviewSearchResults.FixedHeightMode = true;

			UpdateStyles ();
			IdeApp.Preferences.ColorScheme.Changed += UpdateStyles;
		}
コード例 #7
0
ファイル: StackTracePad.cs プロジェクト: kenkendk/monodevelop
		public StackTracePad ()
		{
			this.ShadowType = ShadowType.None;

			ActionCommand evalCmd = new ActionCommand ("StackTracePad.EvaluateMethodParams", GettextCatalog.GetString ("Evaluate Method Parameters"));
			ActionCommand gotoCmd = new ActionCommand ("StackTracePad.ActivateFrame", GettextCatalog.GetString ("Activate Stack Frame"));
			
			menuSet = new CommandEntrySet ();
			menuSet.Add (evalCmd);
			menuSet.Add (gotoCmd);
			menuSet.AddSeparator ();
			menuSet.AddItem (EditCommands.SelectAll);
			menuSet.AddItem (EditCommands.Copy);
			
			store = new ListStore (typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (Pango.Style), typeof (object), typeof (bool));

			tree = new PadTreeView (store);
			tree.RulesHint = true;
			tree.HeadersVisible = true;
			tree.Selection.Mode = SelectionMode.Multiple;
			tree.EnableSearch = true;
			tree.SearchColumn = 1;
			tree.ButtonPressEvent += HandleButtonPressEvent;
			tree.DoPopupMenu = ShowPopup;

			TreeViewColumn col = new TreeViewColumn ();
			CellRenderer crp = new CellRendererIcon ();
			col.PackStart (crp, false);
			col.AddAttribute (crp, "stock_id", 0);
			tree.AppendColumn (col);
			
			TreeViewColumn FrameCol = new TreeViewColumn ();
			FrameCol.Title = GettextCatalog.GetString ("Name");
			refresh = new CellRendererIcon ();
			refresh.Pixbuf = ImageService.GetPixbuf (Gtk.Stock.Refresh).ScaleSimple (12, 12, Gdk.InterpType.Hyper);
			FrameCol.PackStart (refresh, false);
			FrameCol.AddAttribute (refresh, "visible", 8);
			FrameCol.PackStart (tree.TextRenderer, true);
			FrameCol.AddAttribute (tree.TextRenderer, "text", 1);
			FrameCol.AddAttribute (tree.TextRenderer, "foreground", 5);
			FrameCol.AddAttribute (tree.TextRenderer, "style", 6);
			FrameCol.Resizable = true;
			FrameCol.Alignment = 0.0f;
			tree.AppendColumn (FrameCol);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("File");
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", 2);
			col.AddAttribute (tree.TextRenderer, "foreground", 5);
			tree.AppendColumn (col);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("Language");
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", 3);
			col.AddAttribute (tree.TextRenderer, "foreground", 5);
			tree.AppendColumn (col);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("Address");
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", 4);
			col.AddAttribute (tree.TextRenderer, "foreground", 5);
			tree.AppendColumn (col);
			
			Add (tree);
			ShowAll ();

			current_backtrace = DebuggingService.CurrentCallStack;
			UpdateDisplay ();
			
			DebuggingService.CallStackChanged += (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnClassStackChanged));
			DebuggingService.CurrentFrameChanged += (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnFrameChanged));
			tree.RowActivated += OnRowActivated;
		}
コード例 #8
0
        private PadTreeView CreateTree(TreeStore store)
        {
            var tree = new PadTreeView ();
            tree.Model = store;
            tree.RulesHint = true;
            tree.HeadersVisible = true;
            tree.DoPopupMenu = ShowPopup;

            treeState = new TreeViewState (tree, (int)Columns.Bookmark);

            TreeViewColumn col = new TreeViewColumn ();
            CellRenderer crp = new CellRendererBookmark ();
            col.PackStart (crp, true);
            col.AddAttribute (crp, "stock-id", (int)Columns.Icon);
            tree.AppendColumn (col);

            col = new TreeViewColumn ();
            CellRenderer crt = tree.TextRenderer;
            col.Title = GettextCatalog.GetString ("Name");
            col.PackStart (crt, true);
            col.AddAttribute (crt, "text", (int)Columns.FileName);
            col.Resizable = true;
            //col.Expand = true;
            col.Alignment = 0.0f;

            tree.AppendColumn (col);
            col = tree.AppendColumn (GettextCatalog.GetString ("Line Number"), crt, "text", (int)Columns.LineNumber);
            col.Resizable = true;

            col = tree.AppendColumn (GettextCatalog.GetString ("Line Content"), crt, "text", (int)Columns.LineContent);
            col.Resizable = true;
            tree.RowActivated += (o, args) => GoToBookmark ();
            return tree;
        }
コード例 #9
0
        public StackTracePad()
        {
            this.ShadowType = ShadowType.None;

            ActionCommand gotoCmd = new ActionCommand("StackTracePad.ActivateFrame", GettextCatalog.GetString("Activate Stack Frame"));

            menuSet = new CommandEntrySet();
            menuSet.Add(gotoCmd);
            menuSet.AddSeparator();
            menuSet.AddItem(EditCommands.SelectAll);
            menuSet.AddItem(EditCommands.Copy);

            store = new ListStore(typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(Pango.Style));

            tree                = new MonoDevelop.Ide.Gui.Components.PadTreeView(store);
            tree.RulesHint      = true;
            tree.HeadersVisible = true;
            tree.Selection.Mode = SelectionMode.Multiple;
            tree.DoPopupMenu    = ShowPopup;

            TreeViewColumn col = new TreeViewColumn();
            CellRenderer   crp = new CellRendererIcon();

            col.PackStart(crp, false);
            col.AddAttribute(crp, "stock_id", 0);
            tree.AppendColumn(col);

            TreeViewColumn FrameCol = new TreeViewColumn();

            FrameCol.Title = GettextCatalog.GetString("Name");
            FrameCol.PackStart(tree.TextRenderer, true);
            FrameCol.AddAttribute(tree.TextRenderer, "text", 1);
            FrameCol.AddAttribute(tree.TextRenderer, "foreground", 5);
            FrameCol.AddAttribute(tree.TextRenderer, "style", 6);
            FrameCol.Resizable = true;
            FrameCol.Alignment = 0.0f;
            tree.AppendColumn(FrameCol);

            col       = new TreeViewColumn();
            col.Title = GettextCatalog.GetString("File");
            col.PackStart(tree.TextRenderer, false);
            col.AddAttribute(tree.TextRenderer, "text", 2);
            col.AddAttribute(tree.TextRenderer, "foreground", 5);
            tree.AppendColumn(col);

            col       = new TreeViewColumn();
            col.Title = GettextCatalog.GetString("Language");
            col.PackStart(tree.TextRenderer, false);
            col.AddAttribute(tree.TextRenderer, "text", 3);
            col.AddAttribute(tree.TextRenderer, "foreground", 5);
            tree.AppendColumn(col);

            col       = new TreeViewColumn();
            col.Title = GettextCatalog.GetString("Address");
            col.PackStart(tree.TextRenderer, false);
            col.AddAttribute(tree.TextRenderer, "text", 4);
            col.AddAttribute(tree.TextRenderer, "foreground", 5);
            tree.AppendColumn(col);

            Add(tree);
            ShowAll();

            current_backtrace = DebuggingService.CurrentCallStack;
            UpdateDisplay();

            DebuggingService.CallStackChanged    += (EventHandler)DispatchService.GuiDispatch(new EventHandler(OnClassStackChanged));
            DebuggingService.CurrentFrameChanged += (EventHandler)DispatchService.GuiDispatch(new EventHandler(OnFrameChanged));
            tree.RowActivated += OnRowActivated;
        }
コード例 #10
0
ファイル: StackTracePad.cs プロジェクト: nieve/monodevelop
		public StackTracePad ()
		{
			this.ShadowType = ShadowType.None;

			ActionCommand gotoCmd = new ActionCommand ("StackTracePad.ActivateFrame", GettextCatalog.GetString ("Activate Stack Frame"));
			
			menuSet = new CommandEntrySet ();
			menuSet.Add (gotoCmd);
			menuSet.AddSeparator ();
			menuSet.AddItem (EditCommands.SelectAll);
			menuSet.AddItem (EditCommands.Copy);
			
			store = new ListStore (typeof(string), typeof (string), typeof(string), typeof(string), typeof(string), typeof(string), typeof (Pango.Style));

			tree = new MonoDevelop.Ide.Gui.Components.PadTreeView (store);
			tree.RulesHint = true;
			tree.HeadersVisible = true;
			tree.Selection.Mode = SelectionMode.Multiple;
			tree.DoPopupMenu = ShowPopup;

			TreeViewColumn col = new TreeViewColumn ();
			CellRenderer crp = new CellRendererIcon ();
			col.PackStart (crp, false);
			col.AddAttribute (crp, "stock_id", 0);
			tree.AppendColumn (col);
			
			TreeViewColumn FrameCol = new TreeViewColumn ();
			FrameCol.Title = GettextCatalog.GetString ("Name");
			FrameCol.PackStart (tree.TextRenderer, true);
			FrameCol.AddAttribute (tree.TextRenderer, "text", 1);
			FrameCol.AddAttribute (tree.TextRenderer, "foreground", 5);
			FrameCol.AddAttribute (tree.TextRenderer, "style", 6);
			FrameCol.Resizable = true;
			FrameCol.Alignment = 0.0f;
			tree.AppendColumn (FrameCol);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("File");
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", 2);
			col.AddAttribute (tree.TextRenderer, "foreground", 5);
			tree.AppendColumn (col);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("Language");
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", 3);
			col.AddAttribute (tree.TextRenderer, "foreground", 5);
			tree.AppendColumn (col);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("Address");
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", 4);
			col.AddAttribute (tree.TextRenderer, "foreground", 5);
			tree.AppendColumn (col);
			
			Add (tree);
			ShowAll ();

			current_backtrace = DebuggingService.CurrentCallStack;
			UpdateDisplay ();
			
			DebuggingService.CallStackChanged += (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnClassStackChanged));
			DebuggingService.CurrentFrameChanged += (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnFrameChanged));
			tree.RowActivated += OnRowActivated;
		}
コード例 #11
0
		public SearchResultWidget ()
		{
			var vbox = new VBox ();
			var toolbar = new Toolbar () {
				Orientation = Orientation.Vertical,
				IconSize = IconSize.Menu,
				ToolbarStyle = ToolbarStyle.Icons,
			};
			this.PackStart (vbox, true, true, 0);
			this.PackStart (toolbar, false, false, 0);
			labelStatus = new Label () {
				Xalign = 0,
				Justify = Justification.Left,
			};
			var hpaned = new HPaned ();
			vbox.PackStart (hpaned, true, true, 0);
			vbox.PackStart (labelStatus, false, false, 0);
			var resultsScroll = new CompactScrolledWindow ();
			hpaned.Pack1 (resultsScroll, true, true);
			scrolledwindowLogView = new CompactScrolledWindow ();
			hpaned.Pack2 (scrolledwindowLogView, true, true);
			textviewLog = new TextView () {
				Editable = false,
			};
			scrolledwindowLogView.Add (textviewLog);
			
			store = new ListStore (typeof (SearchResult),
				typeof (bool) // didRead
				);
			
			treeviewSearchResults = new PadTreeView () {
				Model = store,
				HeadersClickable = true,
				RulesHint = true,
			};
			treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
			resultsScroll.Add (treeviewSearchResults);
			
			this.ShowAll ();
			
			var fileNameColumn = new TreeViewColumn {
				Resizable = true,
				SortColumnId = 0,
				Title = GettextCatalog.GetString("File")
			};

			fileNameColumn.FixedWidth = 200;

			var fileNamePixbufRenderer = new CellRendererPixbuf ();
			fileNameColumn.PackStart (fileNamePixbufRenderer, false);
			fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, FileIconDataFunc);
			
			fileNameColumn.PackStart (treeviewSearchResults.TextRenderer, true);
			fileNameColumn.SetCellDataFunc (treeviewSearchResults.TextRenderer, FileNameDataFunc);
			treeviewSearchResults.AppendColumn (fileNameColumn);
			
//			TreeViewColumn lineColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Line"), new CellRendererText (), ResultLineDataFunc);
//			lineColumn.SortColumnId = 1;
//			lineColumn.FixedWidth = 50;
//			
			
			TreeViewColumn textColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Text"),
				treeviewSearchResults.TextRenderer, ResultTextDataFunc);
			textColumn.SortColumnId = 2;
			textColumn.Resizable = true;
			textColumn.FixedWidth = 300;

			
			TreeViewColumn pathColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Path"),
				treeviewSearchResults.TextRenderer, ResultPathDataFunc);
			pathColumn.SortColumnId = 3;
			pathColumn.Resizable = true;
			pathColumn.FixedWidth = 500;

			
			store.SetSortFunc (0, CompareFileNames);
//			store.SetSortFunc (1, CompareLineNumbers);
			store.SetSortFunc (3, CompareFilePaths);

			treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;
			
			buttonStop = new ToolButton (Stock.Stop) { Sensitive = false };

			buttonStop.Clicked += ButtonStopClicked;
			
			buttonStop.TooltipText = GettextCatalog.GetString ("Stop");
			toolbar.Insert (buttonStop, -1);

			var buttonClear = new ToolButton (Gtk.Stock.Clear);
			buttonClear.Clicked += ButtonClearClicked;
			buttonClear.TooltipText = GettextCatalog.GetString ("Clear results");
			toolbar.Insert (buttonClear, -1);
			
			var buttonOutput = new ToggleToolButton (Gui.Stock.OutputIcon);
			buttonOutput.Clicked += ButtonOutputClicked;
			buttonOutput.TooltipText = GettextCatalog.GetString ("Show output");
			toolbar.Insert (buttonOutput, -1);
			
			buttonPin = new ToggleToolButton (Gui.Stock.PinUp);
			buttonPin.Clicked += ButtonPinClicked;
			buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad");
			toolbar.Insert (buttonPin, -1);
			
			store.SetSortColumnId (3, SortType.Ascending);
			ShowAll ();
			
			scrolledwindowLogView.Hide ();
		}
コード例 #12
0
ファイル: StackTracePad.cs プロジェクト: Kalnor/monodevelop
		public StackTracePad ()
		{
			this.ShadowType = ShadowType.None;

			var evalCmd = new ActionCommand ("StackTracePad.EvaluateMethodParams", GettextCatalog.GetString ("Evaluate Method Parameters"));
			var gotoCmd = new ActionCommand ("StackTracePad.ActivateFrame", GettextCatalog.GetString ("Activate Stack Frame"));
			
			menuSet = new CommandEntrySet ();
			menuSet.Add (evalCmd);
			menuSet.Add (gotoCmd);
			menuSet.AddSeparator ();
			menuSet.AddItem (EditCommands.SelectAll);
			menuSet.AddItem (EditCommands.Copy);
			
			store = new ListStore (typeof (bool), typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (Pango.Style), typeof (object), typeof (int), typeof (bool));

			tree = new PadTreeView (store);
			tree.RulesHint = true;
			tree.HeadersVisible = true;
			tree.Selection.Mode = SelectionMode.Multiple;
			tree.SearchEqualFunc = Search;
			tree.EnableSearch = true;
			tree.SearchColumn = 1;
			tree.ButtonPressEvent += HandleButtonPressEvent;
			tree.DoPopupMenu = ShowPopup;

			var col = new TreeViewColumn ();
			var crp = new CellRendererImage ();
			col.PackStart (crp, false);
			crp.Image = pointerImage;
			col.AddAttribute (crp, "visible", IconColumn);
			tree.AppendColumn (col);
			
			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("Name");
			refresh = new CellRendererImage ();
			refresh.Image = ImageService.GetIcon (Gtk.Stock.Refresh).WithSize (12, 12);
			col.PackStart (refresh, false);
			col.AddAttribute (refresh, "visible", CanRefreshColumn);
			col.PackStart (tree.TextRenderer, true);
			col.AddAttribute (tree.TextRenderer, "text", MethodColumn);
			col.AddAttribute (tree.TextRenderer, "foreground", ForegroundColumn);
			col.AddAttribute (tree.TextRenderer, "style", StyleColumn);
			col.Resizable = true;
			col.Alignment = 0.0f;
			tree.AppendColumn (col);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("File");
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", FileColumn);
			col.AddAttribute (tree.TextRenderer, "foreground", ForegroundColumn);
			tree.AppendColumn (col);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("Language");
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", LangColumn);
			col.AddAttribute (tree.TextRenderer, "foreground", ForegroundColumn);
			tree.AppendColumn (col);

			col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString ("Address");
			col.PackStart (tree.TextRenderer, false);
			col.AddAttribute (tree.TextRenderer, "text", AddrColumn);
			col.AddAttribute (tree.TextRenderer, "foreground", ForegroundColumn);
			tree.AppendColumn (col);
			
			Add (tree);
			ShowAll ();
			UpdateDisplay ();
			
			DebuggingService.CallStackChanged += OnClassStackChanged;
			DebuggingService.CurrentFrameChanged += OnFrameChanged;
			DebuggingService.StoppedEvent += OnDebuggingServiceStopped;

			tree.RowActivated += OnRowActivated;
		}
コード例 #13
0
ファイル: BreakpointPad.cs プロジェクト: kdubau/monodevelop
		protected override void Initialize (IPadWindow window)
		{
			Id = "MonoDevelop.Debugger.BreakpointPad";
			// Toolbar and menu definitions
			
			ActionCommand gotoCmd = new ActionCommand (LocalCommands.GoToFile, GettextCatalog.GetString ("Go to File"));
			ActionCommand propertiesCmd = new ActionCommand (LocalCommands.Properties, GettextCatalog.GetString ("Edit Breakpoint…"), Stock.Properties);
			
			menuSet = new CommandEntrySet ();
			menuSet.Add (propertiesCmd);
			menuSet.Add (gotoCmd);
			menuSet.AddSeparator ();
			menuSet.AddItem (DebugCommands.EnableDisableBreakpoint);
			menuSet.AddItem (DebugCommands.DisableAllBreakpoints);
			menuSet.AddSeparator ();
			menuSet.AddItem (EditCommands.DeleteKey);
			menuSet.AddItem (DebugCommands.ClearAllBreakpoints);
			
			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);
			toolbarSet.AddSeparator ();
			toolbarSet.Add (new CommandEntry (DebugCommands.NewFunctionBreakpoint){ DisplayType = CommandEntryDisplayType.IconAndText });
			toolbarSet.Add (new CommandEntry (DebugCommands.NewCatchpoint){ DisplayType = CommandEntryDisplayType.IconAndText });
			
			// The breakpoint list
			
			store = new TreeStore (typeof(string), typeof (bool), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));
			SemanticModelAttribute modelAttr = new SemanticModelAttribute ("store__Icon", "store__Selected","store_FileName",
				"store_Breakpoint", "store_Condition", "store_TraceExp", "store_HitCount", "store_LastTrace");
			TypeDescriptor.AddAttributes (store, modelAttr);

			tree = new PadTreeView ();
			tree.Model = store;
			tree.RulesHint = true;
			tree.HeadersVisible = true;
			tree.DoPopupMenu = ShowPopup;
			tree.KeyPressEvent += OnKeyPressEvent;
			tree.Selection.Mode = SelectionMode.Multiple;
			
			treeState = new TreeViewState (tree, (int) Columns.Breakpoint);
							
			TreeViewColumn col = new TreeViewColumn ();
			CellRenderer crp = new CellRendererImage ();
			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 ("Name");
			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 ();
			
			breakpoints = DebuggingService.Breakpoints;
			
			UpdateDisplay ();

			breakpoints.BreakpointAdded += OnBreakpointAdded;
			breakpoints.BreakpointRemoved += OnBreakpointRemoved;
			breakpoints.Changed += OnBreakpointChanged;
			breakpoints.BreakpointUpdated += OnBreakpointUpdated;
			
			DebuggingService.PausedEvent += OnDebuggerStatusCheck;
			DebuggingService.ResumedEvent += OnDebuggerStatusCheck;
			DebuggingService.StoppedEvent += OnDebuggerStatusCheck;
			
			tree.RowActivated += OnRowActivated;
			
			DockItemToolbar toolbar = window.GetToolbar (DockPositionType.Top);
			toolbar.Add (toolbarSet, sw);
			toolbar.ShowAll ();
		}