Пример #1
0
        public ThreadsPadWidget()
        {
            this.ShadowType = ShadowType.None;

            store = new TreeStore(typeof(string), typeof(string), typeof(string), typeof(object), typeof(int), typeof(string), typeof(object));
            SemanticModelAttribute modelAttr = new SemanticModelAttribute("store__Icon", "store__Id", "store_Name",
                                                                          "store_Object", "store_Weight", "store_Location");

            TypeDescriptor.AddAttributes(store, modelAttr);

            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;
            tree.DoPopupMenu   = ShowPopup;
            DebuggingService.CallStackChanged += OnStackChanged;
            DebuggingService.PausedEvent      += OnDebuggerPaused;
            DebuggingService.ResumedEvent     += OnDebuggerResumed;
            DebuggingService.StoppedEvent     += OnDebuggerStopped;
        }
Пример #2
0
        protected int GetColumnNumber(string column, TreeModel model)
        {
            Type modelType = model.GetType();
            SemanticModelAttribute attr = modelType.GetCustomAttribute <SemanticModelAttribute> ();

            if (attr == null)
            {
                // Check if the instance has the attributes
                AttributeCollection attrs = TypeDescriptor.GetAttributes(model);
                attr = (SemanticModelAttribute)attrs [typeof(SemanticModelAttribute)];
                if (attr == null)
                {
                    if (column.StartsWith("column__"))
                    {
                        int columnNum;
                        if (int.TryParse(column.Replace("column__", string.Empty), out columnNum))
                        {
                            return(columnNum);
                        }
                    }
                    else
                    {
                        return(-1);
                    }
                }
            }
            return(Array.IndexOf(attr.ColumnNames, column));
        }
        public GtkNewProjectDialogBackend()
        {
            this.Build();

            // Set up the list store so the test framework can work out the correct columns
            SemanticModelAttribute modelAttr = new SemanticModelAttribute("templateCategoriesListStore__Name", "templateCategoriesListStore__Icon", "templateCategoriesListStore__Category");

            TypeDescriptor.AddAttributes(templateCategoriesTreeStore, modelAttr);
            modelAttr = new SemanticModelAttribute("templateListStore__Name", "templateListStore__Icon", "templateListStore__Template");
            TypeDescriptor.AddAttributes(templatesTreeStore, modelAttr);

            templateCategoriesTreeView.Selection.Changed       += TemplateCategoriesTreeViewSelectionChanged;
            templateCategoriesTreeView.Selection.SelectFunction = TemplateCategoriesTreeViewSelection;

            templatesTreeView.Selection.Changed       += TemplatesTreeViewSelectionChanged;
            templatesTreeView.ButtonPressEvent        += TemplatesTreeViewButtonPressed;
            templatesTreeView.Selection.SelectFunction = TemplatesTreeViewSelection;
            templatesTreeView.RowActivated            += TreeViewRowActivated;
            templatesTreeView.KeyPressEvent           += TemplatesTreeViewKeyPressed;

            cancelButton.Clicked   += CancelButtonClicked;
            nextButton.Clicked     += NextButtonClicked;
            previousButton.Clicked += (sender, e) => MoveToPreviousPage();

            nextButton.CanDefault = true;
            nextButton.GrabDefault();

            // Setup the treeview to be able to have a context menu
            var actionHandler = new ActionDelegate(templatesTreeView);

            actionHandler.PerformShowMenu += PerformShowMenu;
        }
        void CreateFolderTreeViewColumns()
        {
            folderTreeStore      = new TreeStore(typeof(string), typeof(string), typeof(Xwt.Drawing.Image));
            folderTreeView.Model = folderTreeStore;
            folderTreeView.Selection.SelectFunction = TreeViewSelection;
            folderTreeView.ShowExpanders            = false;
            folderTreeView.LevelIndentation         = 10;
            folderTreeView.CanFocus = false;

            SemanticModelAttribute modelAttr = new SemanticModelAttribute("folderTreeStore__IconId", "folderTreeStore__NodeName", "folderTreeStore__Image");

            TypeDescriptor.AddAttributes(folderTreeStore, modelAttr);

            var column       = new TreeViewColumn();
            var iconRenderer = new CellRendererImage();

            column.PackStart(iconRenderer, false);
            column.AddAttribute(iconRenderer, "stock-id", column: 0);
            column.AddAttribute(iconRenderer, "image", ImageColumn);

            var textRenderer = new CellRendererText();

            textRenderer.Ellipsize = Pango.EllipsizeMode.Middle;
            column.PackStart(textRenderer, true);
            column.AddAttribute(textRenderer, "markup", TextColumn);

            folderTreeView.AppendColumn(column);
        }
Пример #5
0
            public TemplateTreeView()
            {
                HeadersVisible = false;
                templateStore  = new ListStore(typeof(string), typeof(string), typeof(TemplateItem));
                Model          = templateStore;
                SearchColumn   = -1;               // disable the interactive search

                SemanticModelAttribute modelAttr = new SemanticModelAttribute("templateStore__Icon", "templateStore__Name", "templateStore__Template");

                TypeDescriptor.AddAttributes(templateStore, modelAttr);

                TreeViewColumn    col = new TreeViewColumn();
                CellRendererImage crp = new CellRendererImage();

                crp.StockSize = Gtk.IconSize.Dnd;
                crp.Ypad      = 2;
                col.PackStart(crp, false);
                col.AddAttribute(crp, "stock-id", 0);

                CellRendererText crt = new CellRendererText();

                col.PackStart(crt, false);
                col.AddAttribute(crt, "markup", 1);

                AppendColumn(col);
                ShowAll();
            }
Пример #6
0
        public EditBranchDialog(GitRepository repo, string name, string tracking)
        {
            this.Build();
            this.repo       = repo;
            oldName         = name;
            currentTracking = tracking;

            this.UseNativeContextMenus();

            comboStore         = new ListStore(typeof(string), typeof(Xwt.Drawing.Image), typeof(string), typeof(string));
            comboSources.Model = comboStore;
            var crp = new CellRendererImage();

            comboSources.PackStart(crp, false);
            comboSources.AddAttribute(crp, "image", 1);
            var crt = new CellRendererText();

            comboSources.PackStart(crt, true);
            comboSources.AddAttribute(crt, "text", 2);

            SemanticModelAttribute modelAttr = new SemanticModelAttribute("comboStore__Branch", "comboStore__Icon", "comboStore__Name", "comboStore__Tracking");

            TypeDescriptor.AddAttributes(comboStore, modelAttr);

            var token = destroyTokenSource.Token;

            repo.GetLocalBranchNamesAsync(token).ContinueWith(t => {
                if (token.IsCancellationRequested)
                {
                    return;
                }
                foreach (var b in t.Result)
                {
                    AddValues(b, ImageService.GetIcon("vc-branch", IconSize.Menu), "refs/heads/");
                }
            }, token, TaskContinuationOptions.NotOnCanceled | TaskContinuationOptions.NotOnFaulted, Runtime.MainTaskScheduler).Ignore();

            repo.GetRemoteBranchFullNamesAsync(token).ContinueWith(t => {
                if (token.IsCancellationRequested)
                {
                    return;
                }
                foreach (var r in t.Result)
                {
                    AddValues(r, ImageService.GetIcon("vc-repository", IconSize.Menu), "refs/remotes/");
                }
            }, token, TaskContinuationOptions.NotOnCanceled | TaskContinuationOptions.NotOnFaulted, Runtime.MainTaskScheduler).Ignore();

            entryName.Text    = name;
            checkTrack.Active = !string.IsNullOrEmpty(tracking);

            UpdateStatus();

            WidthRequest = 400;
        }
Пример #7
0
		protected int GetColumnNumber (string column, TreeModel model)
		{
			Type modelType = model.GetType ();
			SemanticModelAttribute attr = modelType.GetCustomAttribute<SemanticModelAttribute> ();
			if (attr == null) {
				// Check if the instance has the attributes
				AttributeCollection attrs = TypeDescriptor.GetAttributes (model);
				attr = (SemanticModelAttribute)attrs [typeof(SemanticModelAttribute)];
				if (attr == null) {
					return -1;
				}
			}
			return Array.IndexOf (attr.ColumnNames, column);
		}
Пример #8
0
        void InitializeTreeView()
        {
            packageSourcesStore = new ListStore(typeof(object), typeof(bool), typeof(IconId), typeof(PackageSourceViewModel));
            SemanticModelAttribute modelAttr = new SemanticModelAttribute("store__Data", "store__Selected",
                                                                          "store__IconId", "store__Model");

            TypeDescriptor.AddAttributes(packageSourcesStore, modelAttr);
            packageSourcesTreeView.Model        = packageSourcesStore;
            packageSourcesTreeView.SearchColumn = -1;             // disable the interactive search
            packageSourcesTreeView.AppendColumn(CreateTreeViewColumn());
            packageSourcesTreeView.Selection.Changed += PackageSourcesTreeViewSelectionChanged;
            packageSourcesTreeView.RowActivated      += PackageSourcesTreeViewRowActivated;
            packageSourcesTreeView.Reorderable        = true;
            packageSourcesTreeView.DragEnd           += PackageSourcesTreeViewDragEnded;
        }
Пример #9
0
        public override AppResult Model(string column)
        {
            TreeModel model = ModelFromWidget(resultWidget);

            if (model == null)
            {
                return(null);
            }

            if (column == null)
            {
                return(new GtkTreeModelResult(resultWidget, model, 0)
                {
                    SourceQuery = this.SourceQuery
                });
            }

            // Check if the class has the SemanticModelAttribute
            Type modelType = model.GetType();
            SemanticModelAttribute attr = modelType.GetCustomAttribute <SemanticModelAttribute> ();

            if (attr == null)
            {
                // Check if the instance has the attributes
                AttributeCollection attrs = TypeDescriptor.GetAttributes(model);
                attr = (SemanticModelAttribute)attrs [typeof(SemanticModelAttribute)];

                if (attr == null)
                {
                    return(null);
                }
            }

            int columnNumber = Array.IndexOf(attr.ColumnNames, column);

            if (columnNumber == -1)
            {
                return(null);
            }

            return(new GtkTreeModelResult(resultWidget, model, columnNumber)
            {
                SourceQuery = this.SourceQuery
            });
        }
Пример #10
0
        public EditBranchDialog(GitRepository repo, string name, string tracking)
        {
            this.Build();
            this.repo       = repo;
            oldName         = name;
            currentTracking = tracking;

            this.UseNativeContextMenus();

            comboStore         = new ListStore(typeof(string), typeof(Xwt.Drawing.Image), typeof(string), typeof(string));
            comboSources.Model = comboStore;
            var crp = new CellRendererImage();

            comboSources.PackStart(crp, false);
            comboSources.AddAttribute(crp, "image", 1);
            var crt = new CellRendererText();

            comboSources.PackStart(crt, true);
            comboSources.AddAttribute(crt, "text", 2);

            SemanticModelAttribute modelAttr = new SemanticModelAttribute("comboStore__Branch", "comboStore__Icon", "comboStore__Name", "comboStore__Tracking");

            TypeDescriptor.AddAttributes(comboStore, modelAttr);

            foreach (Branch b in repo.GetBranches())
            {
                AddValues(b.FriendlyName, ImageService.GetIcon("vc-branch", IconSize.Menu), "refs/heads/");
            }

            foreach (Remote r in repo.GetRemotes())
            {
                foreach (string b in repo.GetRemoteBranches(r.Name))
                {
                    AddValues(r.Name + "/" + b, ImageService.GetIcon("vc-repository", IconSize.Menu), "refs/remotes/");
                }
            }

            entryName.Text    = name;
            checkTrack.Active = !string.IsNullOrEmpty(tracking);

            UpdateStatus();

            WidthRequest = 400;
        }
Пример #11
0
        public override AppResult Model(string column)
        {
            TreeView tv = resultWidget as TreeView;

            if (tv == null)
            {
                return(null);
            }

            TreeModel model = (TreeModel)AutoTestService.CurrentSession.UnsafeSync(() => tv.Model);

            if (model == null)
            {
                return(null);
            }

            // Check if the class has the SemanticModelAttribute
            Type modelType = model.GetType();
            SemanticModelAttribute attr = modelType.GetCustomAttribute <SemanticModelAttribute> ();

            if (attr == null)
            {
                // Check if the instance has the attributes
                AttributeCollection attrs = TypeDescriptor.GetAttributes(model);
                attr = (SemanticModelAttribute)attrs [typeof(SemanticModelAttribute)];

                if (attr == null)
                {
                    return(null);
                }
            }

            //AutoTestService.CurrentSession.SessionDebug.SendDebugMessage ("{0} has {1} column names: {2}", resultWidget, attr.ColumnNames.Length, string.Join (", ", attr.ColumnNames));
            int columnNumber = Array.IndexOf(attr.ColumnNames, column);

            if (columnNumber == -1)
            {
                return(null);
            }

            //AutoTestService.CurrentSession.SessionDebug.SendDebugMessage ("{0} has {1} at column {2}", resultWidget, column, columnNumber);
            return(new GtkTreeModelResult(tv, model, columnNumber));
        }
Пример #12
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;
        }
Пример #13
0
        public TestResultsPad()
        {
            UnitTestService.TestSuiteChanged     += new EventHandler(OnTestSuiteChanged);
            IdeApp.Workspace.WorkspaceItemClosed += OnWorkspaceItemClosed;

            panel = new VBox {
                Name = "testResultBox"
            };

            // Results notebook

            book = new HPaned();
            panel.PackStart(book, true, true, 0);
            panel.FocusChain = new Gtk.Widget [] { book };

            // Failures tree
            failuresTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView {
                Name = "testResultsTree"
            };
            failuresTreeView.HeadersVisible = false;
            failuresStore = new TreeStore(typeof(Xwt.Drawing.Image), typeof(string), typeof(object), typeof(string), typeof(int), typeof(int));
            SemanticModelAttribute modelAttr = new SemanticModelAttribute("store__Image", "store__Message", "store__RootTest",
                                                                          "store__FileName", "store__FileNumber", "store__ErrorOrStackTrace");

            TypeDescriptor.AddAttributes(failuresStore, modelAttr);

            var pr = new CellRendererImage();
            CellRendererText tr  = new CellRendererText();
            TreeViewColumn   col = new TreeViewColumn();

            col.PackStart(pr, false);
            col.AddAttribute(pr, "image", 0);
            col.PackStart(tr, false);
            col.AddAttribute(tr, "markup", 1);
            failuresTreeView.AppendColumn(col);
            failuresTreeView.Model = failuresStore;

            var sw = new MonoDevelop.Components.CompactScrolledWindow();

            sw.ShadowType = ShadowType.None;
            sw.Add(failuresTreeView);
            book.Pack1(sw, true, true);

            outputView = new MonoDevelop.Ide.Gui.Components.LogView.LogTextView {
                Name = "testResultOutput"
            };
            outputView.ModifyFont(IdeServices.FontService.MonospaceFont);
            outputView.Editable = false;
            bold        = new TextTag("bold");
            bold.Weight = Pango.Weight.Bold;
            outputView.Buffer.TagTable.Add(bold);
            sw            = new MonoDevelop.Components.CompactScrolledWindow();
            sw.ShadowType = ShadowType.None;
            sw.Add(outputView);
            book.Pack2(sw, true, true);
            outputViewScrolled = sw;

            failuresTreeView.RowActivated      += OnRowActivated;
            failuresTreeView.Selection.Changed += OnRowSelected;
            failuresTreeView.DoPopupMenu        = delegate(EventButton evt) {
                IdeApp.CommandService.ShowContextMenu(failuresTreeView, evt,
                                                      "/MonoDevelop/UnitTesting/ContextMenu/TestResultsPad");
            };

            panel.ShowAll();

            outputViewScrolled.Hide();
        }
Пример #14
0
        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();
        }
Пример #15
0
        public override void Initialize(NodeBuilder[] builders, TreePadOption[] options, string menuPath)
        {
            base.Initialize(builders, options, menuPath);

            UnitTestService.TestSuiteChanged += OnTestSuiteChanged;
            paned = new VPaned();

            VBox            vbox       = new VBox();
            DockItemToolbar topToolbar = Window.GetToolbar(DockPositionType.Top);

            var hbox = new HBox {
                Spacing = 6
            };

            hbox.PackStart(new ImageView(ImageService.GetIcon("md-execute-all", IconSize.Menu)), false, false, 0);
            hbox.PackStart(new Label(GettextCatalog.GetString("Run All")), false, false, 0);
            buttonRunAll             = new Button(hbox);
            buttonRunAll.Clicked    += new EventHandler(OnRunAllClicked);
            buttonRunAll.Sensitive   = true;
            buttonRunAll.TooltipText = GettextCatalog.GetString("Run all tests");
            topToolbar.Add(buttonRunAll);

            buttonStop             = new Button(new ImageView(Ide.Gui.Stock.Stop, IconSize.Menu));
            buttonStop.Clicked    += new EventHandler(OnStopClicked);
            buttonStop.Sensitive   = false;
            buttonStop.TooltipText = GettextCatalog.GetString("Cancel running test");
            topToolbar.Add(buttonStop);
            topToolbar.ShowAll();

            vbox.PackEnd(base.Control, true, true, 0);
            vbox.FocusChain = new Gtk.Widget [] { base.Control };

            paned.Pack1(vbox, true, true);

            detailsPad = new VBox();

            EventBox eb     = new EventBox();
            HBox     header = new HBox();

            eb.Add(header);

            detailLabel         = new HeaderLabel();
            detailLabel.Padding = 6;

            Button hb = new Button(new ImageView("gtk-close", IconSize.SmallToolbar));

            hb.Relief   = ReliefStyle.None;
            hb.Clicked += new EventHandler(OnCloseDetails);
            header.PackEnd(hb, false, false, 0);

            hb          = new Button(new ImageView("gtk-go-back", IconSize.SmallToolbar));
            hb.Relief   = ReliefStyle.None;
            hb.Clicked += new EventHandler(OnGoBackTest);
            header.PackEnd(hb, false, false, 0);

            header.Add(detailLabel);
            Gdk.Color hcol = eb.Style.Background(StateType.Normal);
            hcol.Red   = (ushort)(((double)hcol.Red) * 0.9);
            hcol.Green = (ushort)(((double)hcol.Green) * 0.9);
            hcol.Blue  = (ushort)(((double)hcol.Blue) * 0.9);
            //	eb.ModifyBg (StateType.Normal, hcol);

            detailsPad.PackStart(eb, false, false, 0);

            VPaned panedDetails = new VPaned();

            panedDetails.BorderWidth = 3;
            VBox boxPaned1 = new VBox();

            chart = new TestChart();
            chart.SelectionChanged += new EventHandler(OnChartDateChanged);

            var chartWidget = chart.GetNativeWidget <Widget> ();

            chartWidget.ButtonPressEvent += OnChartButtonPress;
            chartWidget.HeightRequest     = 50;

            Toolbar toolbar = new Toolbar();

            toolbar.IconSize     = IconSize.SmallToolbar;
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.ShowArrow    = false;
            ToolButton but = new ToolButton("gtk-zoom-in");

            but.Clicked += new EventHandler(OnZoomIn);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-zoom-out");
            but.Clicked += new EventHandler(OnZoomOut);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-go-back");
            but.Clicked += new EventHandler(OnChartBack);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-go-forward");
            but.Clicked += new EventHandler(OnChartForward);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-goto-last");
            but.Clicked += new EventHandler(OnChartLast);
            toolbar.Insert(but, -1);

            boxPaned1.PackStart(toolbar, false, false, 0);
            boxPaned1.PackStart(chart, true, true, 0);

            panedDetails.Pack1(boxPaned1, false, false);

            // Detailed test information --------

            infoBook = new ButtonNotebook();
            infoBook.PageLoadRequired += new EventHandler(OnPageLoadRequired);

            // Info - Group summary

            Frame          tf = new Frame();
            ScrolledWindow sw = new ScrolledWindow();

            detailsTree = new TreeView {
                Name = "testPadDetailsTree"
            };

            detailsTree.HeadersVisible = true;
            detailsTree.RulesHint      = true;
            detailsStore = new ListStore(typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));
            SemanticModelAttribute modelAttr = new SemanticModelAttribute("store__UnitTest", "store__Name", "store__Passed",
                                                                          "store__ErrorsAndFailures", "store__Ignored");

            SCM.TypeDescriptor.AddAttributes(detailsStore, modelAttr);

            CellRendererText trtest = new CellRendererText();
            CellRendererText tr;

            TreeViewColumn col3 = new TreeViewColumn();

            col3.Expand = false;
//			col3.Alignment = 0.5f;
            col3.Widget = new ImageView(TestStatusIcon.Success);
            col3.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col3.PackStart(tr, false);
            col3.AddAttribute(tr, "markup", 2);
            detailsTree.AppendColumn(col3);

            TreeViewColumn col4 = new TreeViewColumn();

            col4.Expand = false;
//			col4.Alignment = 0.5f;
            col4.Widget = new ImageView(TestStatusIcon.Failure);
            col4.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col4.PackStart(tr, false);
            col4.AddAttribute(tr, "markup", 3);
            detailsTree.AppendColumn(col4);

            TreeViewColumn col5 = new TreeViewColumn();

            col5.Expand = false;
//			col5.Alignment = 0.5f;
            col5.Widget = new ImageView(TestStatusIcon.NotRun);
            col5.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col5.PackStart(tr, false);
            col5.AddAttribute(tr, "markup", 4);
            detailsTree.AppendColumn(col5);

            TreeViewColumn col1 = new TreeViewColumn();

//			col1.Resizable = true;
//			col1.Expand = true;
            col1.Title = "Test";
            col1.PackStart(trtest, true);
            col1.AddAttribute(trtest, "markup", 1);
            detailsTree.AppendColumn(col1);

            detailsTree.Model = detailsStore;

            sw.Add(detailsTree);
            tf.Add(sw);
            tf.ShowAll();

            TestSummaryPage = infoBook.AddPage(GettextCatalog.GetString("Summary"), tf);

            // Info - Regressions list

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            regressionTree = new TreeView {
                Name = "testPadRegressionTree"
            };
            regressionTree.HeadersVisible = false;
            regressionTree.RulesHint      = true;
            regressionStore = new ListStore(typeof(object), typeof(string), typeof(Xwt.Drawing.Image));
            SemanticModelAttribute regressionModelAttr = new SemanticModelAttribute("store__UnitTest", "store__Name", "store__Icon");

            SCM.TypeDescriptor.AddAttributes(detailsStore, regressionModelAttr);

            CellRendererText trtest2 = new CellRendererText();
            var pr = new CellRendererImage();

            TreeViewColumn col = new TreeViewColumn();

            col.PackStart(pr, false);
            col.AddAttribute(pr, "image", 2);
            col.PackStart(trtest2, false);
            col.AddAttribute(trtest2, "markup", 1);
            regressionTree.AppendColumn(col);
            regressionTree.Model = regressionStore;
            sw.Add(regressionTree);
            tf.ShowAll();

            TestRegressionsPage = infoBook.AddPage(GettextCatalog.GetString("Regressions"), tf);

            // Info - Failed tests list

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            failedTree = new TreeView();
            failedTree.HeadersVisible = false;
            failedTree.RulesHint      = true;
            failedStore = new ListStore(typeof(object), typeof(string), typeof(Xwt.Drawing.Image));
            SemanticModelAttribute failedModelAttr = new SemanticModelAttribute("store__UnitTest", "store__Name", "store__Icon");

            SCM.TypeDescriptor.AddAttributes(failedStore, failedModelAttr);

            trtest2 = new CellRendererText();
            pr      = new CellRendererImage();

            col = new TreeViewColumn();
            col.PackStart(pr, false);
            col.AddAttribute(pr, "image", 2);
            col.PackStart(trtest2, false);
            col.AddAttribute(trtest2, "markup", 1);
            failedTree.AppendColumn(col);
            failedTree.Model = failedStore;
            sw.Add(failedTree);
            tf.ShowAll();

            TestFailuresPage = infoBook.AddPage(GettextCatalog.GetString("Failed tests"), tf);

            // Info - results

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            resultView          = new TextView();
            resultView.Editable = false;
            sw.Add(resultView);
            tf.ShowAll();
            TestResultPage = infoBook.AddPage(GettextCatalog.GetString("Result"), tf);

            // Info - Output

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            outputView          = new TextView();
            outputView.Editable = false;
            sw.Add(outputView);
            tf.ShowAll();
            TestOutputPage = infoBook.AddPage(GettextCatalog.GetString("Output"), tf);

            panedDetails.Pack2(infoBook, true, true);
            detailsPad.PackStart(panedDetails, true, true, 0);
            paned.Pack2(detailsPad, true, true);

            paned.ShowAll();

            infoBook.HidePage(TestResultPage);
            infoBook.HidePage(TestOutputPage);
            infoBook.HidePage(TestSummaryPage);
            infoBook.HidePage(TestRegressionsPage);
            infoBook.HidePage(TestFailuresPage);

            detailsPad.Sensitive = false;
            detailsPad.Hide();

            detailsTree.RowActivated    += new Gtk.RowActivatedHandler(OnTestActivated);
            regressionTree.RowActivated += new Gtk.RowActivatedHandler(OnRegressionTestActivated);
            failedTree.RowActivated     += new Gtk.RowActivatedHandler(OnFailedTestActivated);

            foreach (UnitTest t in UnitTestService.RootTests)
            {
                TreeView.AddChild(t);
            }

            base.TreeView.Tree.Name = "unitTestBrowserTree";
        }
Пример #16
0
        Control IOptionsPanel.CreatePanelWidget()
        {
            Gtk.VBox cbox      = new Gtk.VBox(false, 6);
            Gtk.HBox combosBox = new Gtk.HBox(false, 6)
            {
                Name = "panelWidgetCombosBox"
            };
            cbox.PackStart(combosBox, false, false, 0);
            var configurationLabel = new Gtk.Label(GettextCatalog.GetString("Configuration:"));

            combosBox.PackStart(configurationLabel, false, false, 0);
            configListStore = new Gtk.ListStore(typeof(string), typeof(string));
            configCombo     = new Gtk.ComboBox(configListStore)
            {
                Name = "panelWidgetConfigurationCombo"
            };
            SemanticModelAttribute modelAttr = new SemanticModelAttribute("configListStore__DisplayName", "configListStore__ConfigName");

            TypeDescriptor.AddAttributes(configListStore, modelAttr);
            var cell = new Gtk.CellRendererText();

            configCombo.PackStart(cell, true);
            configCombo.AddAttribute(cell, "text", 0);
            combosBox.PackStart(configCombo, false, false, 0);
            var platformLabel = new Gtk.Label(GettextCatalog.GetString("Platform:"));

            combosBox.PackStart(platformLabel, false, false, 0);
            platformCombo      = Gtk.ComboBox.NewText();
            platformCombo.Name = "panelWidgetPlatformCombo";
            combosBox.PackStart(platformCombo, false, false, 0);
            cbox.PackStart(new Gtk.HSeparator(), false, false, 0);
            cbox.ShowAll();

            configCombo.SetCommonAccessibilityAttributes(
                configCombo.Name,
                configurationLabel,
                GettextCatalog.GetString("Select a configuration"));

            platformCombo.SetCommonAccessibilityAttributes(
                platformCombo.Name,
                platformLabel,
                GettextCatalog.GetString("Select a platform"));

            cbox.Hidden += OnPageHidden;
            cbox.Shown  += OnPageShown;

            lastConfigSelection   = -1;
            lastPlatformSelection = -1;

            FillConfigurations();
            UpdateSelection();

            configCombo.Changed   += OnConfigChanged;
            platformCombo.Changed += OnConfigChanged;

            bool oldMixed = allowMixedConfigurations;

            Gtk.Widget child = CreatePanelWidget();

            //HACK: work around bug 469427 - broken themes match on widget names
            if (child.Name.IndexOf("Panel") > 0)
            {
                child.Name = child.Name.Replace("Panel", "_");
            }

            cbox.PackStart(child, true, true, 0);

            if (allowMixedConfigurations != oldMixed)
            {
                // If mixed mode has changed, update the configuration list
                FillConfigurations();
                UpdateSelection();
            }
            widgetCreated = true;
            panelWidget   = child;

            if (currentConfigs.Count > 0)
            {
                panelWidget.Sensitive = true;
                LoadConfigData();
            }
            else
            {
                panelWidget.Sensitive = false;
            }

            return(cbox);
        }
Пример #17
0
        void CreateControl()
        {
            control = new HPaned();

            store = new Gtk.TreeStore(typeof(Xwt.Drawing.Image),               // image - type
                                      typeof(bool),                            // read?
                                      typeof(TaskListEntry),                   // read? -- use Pango weight
                                      typeof(string));
            SemanticModelAttribute modelAttr = new SemanticModelAttribute("store__Type", "store__Read", "store__Task", "store__Description");

            TypeDescriptor.AddAttributes(store, modelAttr);

            TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc(FilterTasks);

            filter             = new TreeModelFilter(store, null);
            filter.VisibleFunc = filterFunct;

            sort = new TreeModelSort(filter);
            sort.SetSortFunc(VisibleColumns.Type, SeverityIterSort);
            sort.SetSortFunc(VisibleColumns.Project, ProjectIterSort);
            sort.SetSortFunc(VisibleColumns.File, FileIterSort);
            sort.SetSortFunc(VisibleColumns.Category, CategoryIterSort);

            view = new PadTreeView(sort);
            view.Selection.Mode = SelectionMode.Multiple;
            view.ShowExpanders  = true;
            view.RulesHint      = true;

            view.DoPopupMenu += ShowPopup;

            AddColumns();
            LoadColumnsVisibility();
            view.Columns [VisibleColumns.Type].SortColumnId     = VisibleColumns.Type;
            view.Columns [VisibleColumns.Project].SortColumnId  = VisibleColumns.Project;
            view.Columns [VisibleColumns.File].SortColumnId     = VisibleColumns.File;
            view.Columns [VisibleColumns.Category].SortColumnId = VisibleColumns.Category;

            sw            = new MonoDevelop.Components.CompactScrolledWindow();
            sw.ShadowType = ShadowType.None;
            sw.Add(view);
            TaskService.Errors.TasksRemoved += ShowResults;
            TaskService.Errors.TasksAdded   += TaskAdded;
            TaskService.Errors.TasksChanged += TaskChanged;
            TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged;

            IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen;
            IdeApp.Workspace.LastWorkspaceItemClosed  += OnCombineClosed;

            view.RowActivated += new RowActivatedHandler(OnRowActivated);

            iconWarning = ImageService.GetIcon(Ide.Gui.Stock.Warning, Gtk.IconSize.Menu);
            iconError   = ImageService.GetIcon(Ide.Gui.Stock.Error, Gtk.IconSize.Menu);
            iconInfo    = ImageService.GetIcon(Ide.Gui.Stock.Information, Gtk.IconSize.Menu);
            iconEmpty   = ImageService.GetIcon(Ide.Gui.Stock.Empty, Gtk.IconSize.Menu);

            control.Add1(sw);

            control.ShowAll();

            // Load existing tasks
            foreach (TaskListEntry t in TaskService.Errors)
            {
                AddTask(t);
            }
        }
Пример #18
0
        public GitConfigurationDialog(GitRepository repo)
        {
            this.Build();
            this.repo         = repo;
            this.HasSeparator = false;

            this.UseNativeContextMenus();

            // Branches list

            storeBranches               = new ListStore(typeof(Branch), typeof(string), typeof(string), typeof(string));
            listBranches.Model          = storeBranches;
            listBranches.HeadersVisible = true;

            SemanticModelAttribute modelAttr = new SemanticModelAttribute("storeBranches__Branch", "storeBranches__DisplayName", "storeBranches__Tracking", "storeBranches__Name");

            TypeDescriptor.AddAttributes(storeBranches, modelAttr);

            listBranches.AppendColumn(GettextCatalog.GetString("Branch"), new CellRendererText(), "markup", 1);
            listBranches.AppendColumn(GettextCatalog.GetString("Tracking"), new CellRendererText(), "text", 2);

            listBranches.Selection.Changed += delegate {
                TreeIter it;
                bool     anythingSelected =
                    buttonRemoveBranch.Sensitive = buttonEditBranch.Sensitive = buttonSetDefaultBranch.Sensitive = listBranches.Selection.GetSelected(out it);
                if (!anythingSelected)
                {
                    return;
                }

                string currentBranch = repo.GetCurrentBranch();
                var    b             = (Branch)storeBranches.GetValue(it, 0);
                buttonRemoveBranch.Sensitive = b.FriendlyName != currentBranch;
            };
            buttonRemoveBranch.Sensitive = buttonEditBranch.Sensitive = buttonSetDefaultBranch.Sensitive = false;

            // Sources tree

            storeRemotes               = new TreeStore(typeof(Remote), typeof(string), typeof(string), typeof(string), typeof(string));
            treeRemotes.Model          = storeRemotes;
            treeRemotes.HeadersVisible = true;

            SemanticModelAttribute remotesModelAttr = new SemanticModelAttribute("storeRemotes__Remote", "storeRemotes__Name", "storeRemotes__Url", "storeRemotes__BranchName", "storeRemotes__FullName");

            TypeDescriptor.AddAttributes(storeRemotes, remotesModelAttr);

            treeRemotes.AppendColumn("Remote Source / Branch", new CellRendererText(), "markup", 1);
            treeRemotes.AppendColumn("Url", new CellRendererText(), "text", 2);

            treeRemotes.Selection.Changed += delegate {
                TreeIter it;
                bool     anythingSelected = treeRemotes.Selection.GetSelected(out it);
                buttonTrackRemote.Sensitive = false;
                buttonFetch.Sensitive       = buttonEditRemote.Sensitive = buttonRemoveRemote.Sensitive = anythingSelected;
                if (!anythingSelected)
                {
                    return;
                }
                string branchName = (string)storeRemotes.GetValue(it, 3);
                if (branchName != null)
                {
                    buttonTrackRemote.Sensitive = true;
                }
            };
            buttonTrackRemote.Sensitive = buttonFetch.Sensitive = buttonEditRemote.Sensitive = buttonRemoveRemote.Sensitive = false;

            // Tags list

            storeTags               = new ListStore(typeof(string));
            listTags.Model          = storeTags;
            listTags.HeadersVisible = true;

            listTags.AppendColumn(GettextCatalog.GetString("Tag"), new CellRendererText(), "text", 0);

            listTags.Selection.Changed += delegate {
                TreeIter it;
                buttonRemoveTag.Sensitive = buttonPushTag.Sensitive = listTags.Selection.GetSelected(out it);
            };
            buttonRemoveTag.Sensitive = buttonPushTag.Sensitive = false;

            // Fill data

            FillBranches();
            FillRemotes();
            FillTags();
        }