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); }
public SelectSchemaWidget () { store = new ListStore (typeof (bool), typeof (ISchemaContainer)); list = new TreeView (store); TreeViewColumn col = new TreeViewColumn (); CellRendererToggle toggleRenderer = new CellRendererToggle (); toggleRenderer.Activatable = true; toggleRenderer.Toggled += new ToggledHandler (ItemToggled); col.PackStart (toggleRenderer, false); var pixbufRenderer = new CellRendererImage (); col.PackStart (pixbufRenderer, false); CellRendererText textRenderer = new CellRendererText (); col.PackStart (textRenderer, true); col.SetCellDataFunc (textRenderer, new CellLayoutDataFunc (TextDataFunc)); col.SetCellDataFunc (pixbufRenderer, new CellLayoutDataFunc (PixbufDataFunc)); list.AppendColumn (col); list.HeadersVisible = false; this.Add (list); }
TreeViewColumn CreateTreeViewColumn () { var column = new TreeViewColumn (); column.Spacing = 0; var dummyRenderer = new CellRendererImage (); dummyRenderer.Width = 1; dummyRenderer.Xpad = 0; column.PackStart (dummyRenderer, false); var checkBoxRenderer = new CellRendererToggle (); checkBoxRenderer.Toggled += PackageSourceCheckBoxToggled; checkBoxRenderer.Xpad = 7; checkBoxRenderer.Ypad = 12; checkBoxRenderer.Xalign = 0; checkBoxRenderer.Yalign = 0; column.PackStart (checkBoxRenderer, false); column.AddAttribute (checkBoxRenderer, "active", IsEnabledCheckBoxColumn); var iconRenderer = new CellRendererImage (); iconRenderer.StockSize = IconSize.Dnd; iconRenderer.Xalign = 0; iconRenderer.Xpad = 0; column.PackStart (iconRenderer, false); column.AddAttribute (iconRenderer, "icon-id", PackageSourceIconColumn); var packageSourceRenderer = new PackageSourceCellRenderer (); packageSourceRenderer.Mode = CellRendererMode.Activatable; column.PackStart (packageSourceRenderer, true); column.AddAttribute (packageSourceRenderer, "package-source", PackageSourceViewModelColumn); return column; }
public ProjectFileSelectorDialog (Project project, string defaultFilterName, string defaultFilterPattern, string [] buildActions) { this.project = project; this.defaultFilter = new SelectFileDialogFilter (defaultFilterName, defaultFilterPattern ?? "*"); this.buildActions = buildActions; this.Build(); projBuf = ImageService.GetIcon (project.StockIcon, IconSize.Menu); dirClosedBuf = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.ClosedFolder, IconSize.Menu); dirOpenBuf = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.OpenFolder, IconSize.Menu); TreeViewColumn projectCol = new TreeViewColumn (); projectCol.Title = GettextCatalog.GetString ("Project Folders"); var pixRenderer = new CellRendererImage (); CellRendererText txtRenderer = new CellRendererText (); projectCol.PackStart (pixRenderer, false); projectCol.PackStart (txtRenderer, true); projectCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (PixDataFunc)); projectCol.SetCellDataFunc (txtRenderer, new TreeCellDataFunc (TxtDataFunc)); projectTree.Model = dirStore; projectTree.AppendColumn (projectCol); TreeIter projectIter = dirStore.AppendValues ("", FilePath.Empty); InitDirs (projectIter); projectTree.ExpandAll (); projectTree.RowActivated += delegate { fileList.GrabFocus (); }; projectTree.KeyPressEvent += ProjectListKeyPressEvent; TreeViewColumn fileCol = new TreeViewColumn (); var filePixRenderer = new CellRendererImage (); fileCol.Title = GettextCatalog.GetString ("Files"); fileCol.PackStart (filePixRenderer, false); fileCol.PackStart (txtRenderer, true); fileCol.AddAttribute (filePixRenderer, "image", 1); fileCol.SetCellDataFunc (txtRenderer, new TreeCellDataFunc (TxtFileDataFunc)); fileList.Model = fileStore; fileList.AppendColumn (fileCol); fileList.RowActivated += delegate { TreeIter iter; if (fileList.Selection.GetSelected (out iter)) Respond (ResponseType.Ok); }; fileList.KeyPressEvent += FileListKeyPressEvent; fileList.KeyReleaseEvent += FileListKeyReleaseEvent; TreeIter root; if (dirStore.GetIterFirst (out root)) projectTree.Selection.SelectIter (root); UpdateFileList (null, null); projectTree.Selection.Changed += UpdateFileList; fileList.Selection.Changed += UpdateSensitivity; this.DefaultResponse = ResponseType.Cancel; this.Modal = true; }
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 (); }
public IncludeNewFilesDialog (string title, FilePath baseDirectory) { this.Build (); this.Title = title; this.baseDirectory = baseDirectory; treeviewFiles.Model = store; treeviewFiles.HeadersVisible = false; // Headers are untranslated because they're hidden as default TreeViewColumn textColumn = new TreeViewColumn (); CellRendererToggle toggleRender = new CellRendererToggle (); toggleRender.Toggled += ToggleRenderToggled; textColumn.PackStart (toggleRender, false); textColumn.AddAttribute (toggleRender, "active", Columns.IsToggled); textColumn.Title = "Name"; var pixbufRenderer = new CellRendererImage (); textColumn.PackStart (pixbufRenderer, false); textColumn.AddAttribute (pixbufRenderer, "image", Columns.IconOpened); textColumn.AddAttribute (pixbufRenderer, "image-expander-open", Columns.IconOpened); textColumn.AddAttribute (pixbufRenderer, "image-expander-closed", Columns.IconClosed); CellRendererText textRenderer = new CellRendererText (); textColumn.PackStart (textRenderer, false); textColumn.AddAttribute (textRenderer, "text", Columns.Text); treeviewFiles.AppendColumn (textColumn); buttonExcludeAll.Clicked += ButtonExcludeAllClicked; buttonIncludeAll.Clicked += ButtonIncludeAllClicked; buttonOk.Clicked += ButtonOkClicked; }
public ProjectSelectorWidget() { this.Build(); store = new TreeStore (typeof(string), typeof(string), typeof(object), typeof(bool), typeof(bool)); tree.Model = store; tree.HeadersVisible = false; TreeViewColumn col = new TreeViewColumn (); Gtk.CellRendererToggle ctog = new CellRendererToggle (); ctog.Toggled += OnToggled; col.PackStart (ctog, false); var cr = new CellRendererImage (); col.PackStart (cr, false); Gtk.CellRendererText crt = new Gtk.CellRendererText(); crt.Mode &= ~CellRendererMode.Activatable; col.PackStart (crt, true); col.AddAttribute (cr, "stock-id", 0); col.AddAttribute (crt, "markup", 1); col.AddAttribute (ctog, "active", 3); col.AddAttribute (ctog, "visible", 4); tree.AppendColumn (col); tree.Selection.Changed += HandleTreeSelectionChanged; }
public MergeDialog (GitRepository repo, bool rebasing) { this.Build (); this.UseNativeContextMenus (); this.repo = repo; this.rebasing = rebasing; store = new TreeStore (typeof(string), typeof(Xwt.Drawing.Image), typeof (string), typeof(string)); tree.Model = store; var crp = new CellRendererImage (); var col = new TreeViewColumn (); col.PackStart (crp, false); col.AddAttribute (crp, "image", 1); var crt = new CellRendererText (); col.PackStart (crt, true); col.AddAttribute (crt, "text", 2); tree.AppendColumn (col); tree.Selection.Changed += HandleTreeSelectionChanged; if (rebasing) { labelHeader.Text = GettextCatalog.GetString ("Select the branch to which to rebase:"); checkStage.Label = GettextCatalog.GetString ("Stash/unstash local changes before/after rebasing"); buttonOk.Label = GettextCatalog.GetString ("Rebase"); } checkStage.Active = true; Fill (); }
public void Initialize (TreeView treeView) { var column = new TreeViewColumn (); var toggleRenderer = new CellRendererToggle (); toggleRenderer.Toggled += ToggleRendererToggled; column.PackStart (toggleRenderer, false); column.AddAttribute (toggleRenderer, "active", 0); var pixbufRenderer = new CellRendererImage (); column.PackStart (pixbufRenderer, false); column.AddAttribute (pixbufRenderer, "image", 1); var textRenderer = new CellRendererText (); column.PackStart (textRenderer, true); column.AddAttribute (textRenderer, "text", 2); column.Expand = true; treeView.AppendColumn (column); foreach (object obj in GetValidMembers ()) { var member = obj as ISymbol; if (member != null) { Store.AppendValues (false, ImageService.GetIcon (member.GetStockIcon (), IconSize.Menu), member.ToDisplayString (Ambience.LabelFormat), member); continue; } var tuple = obj as Tuple<ISymbol, bool>; if (tuple != null) { Store.AppendValues (false, ImageService.GetIcon (tuple.Item1.GetStockIcon (), IconSize.Menu), tuple.Item1.ToDisplayString (Ambience.LabelFormat), tuple); continue; } } treeView.Model = store; }
public DeployDialog (SolutionFolderItem defaultEntry, bool createBuilderOnly) { this.Build(); notebook.ShowTabs = false; this.defaultEntry = defaultEntry; if (createBuilderOnly) { vboxSaveProject.Hide (); checkSave.Active = true; checkSave.Hide (); saveSeparator.Hide (); } else { pageSave.Hide (); FillProjectSelectors (); } store = new ListStore (typeof(Xwt.Drawing.Image), typeof(string), typeof(object)); targetsTree.Model = store; targetsTree.HeadersVisible = false; CellRendererImage cr = new CellRendererImage(); cr.Yalign = 0; targetsTree.AppendColumn ("", cr, "image", 0); targetsTree.AppendColumn ("", new Gtk.CellRendererText(), "markup", 1); targetsTree.Selection.Changed += delegate (object s, EventArgs a) { UpdateButtons (); }; FillBuilders (); UpdateButtons (); }
public SelectRenamedClassDialog (IEnumerable<INamedTypeSymbol> classes) { XML glade = new XML (null, "gui.glade", "SelectRenamedClassDialog", null); glade.Autoconnect (this); store = new ListStore (typeof(Xwt.Drawing.Image), typeof(string)); treeClasses.Model = store; TreeViewColumn column = new TreeViewColumn (); var pr = new CellRendererImage (); column.PackStart (pr, false); column.AddAttribute (pr, "image", 0); CellRendererText crt = new CellRendererText (); column.PackStart (crt, true); column.AddAttribute (crt, "text", 1); treeClasses.AppendColumn (column); foreach (var cls in classes) { var pic = ImageService.GetIcon (cls.GetStockIcon ()); store.AppendValues (pic, cls.GetFullName ()); } }
OpenLayoutWindow(MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext, Action<string> onSubmitted) : base(Gtk.WindowType.Toplevel) { _onSubmitted = onSubmitted; this.Build (); scrolledwindow1.Child = treeviewGenerateActions; scrolledwindow1.ShowAll (); treeviewGenerateActions.Cancel += delegate { Destroy (); }; treeviewGenerateActions.Submit += delegate { if (String.IsNullOrEmpty(_selectedItem) == false) { _onSubmitted(_selectedItem); } Destroy (); }; WindowTransparencyDecorator.Attach (this); treeviewGenerateActions.HeadersVisible = false; treeviewGenerateActions.Model = optionsStore; TreeViewColumn column = new TreeViewColumn (); var pixbufRenderer = new CellRendererImage (); column.PackStart (pixbufRenderer, false); column.AddAttribute (pixbufRenderer, "image", 0); CellRendererText textRenderer = new CellRendererText (); column.PackStart (textRenderer, true); column.AddAttribute (textRenderer, "text", 1); column.Expand = true; treeviewGenerateActions.AppendColumn (column); treeviewGenerateActions.Selection.Changed += TreeviewGenerateActionsSelectionChanged; this.Remove (this.vbox1); BorderBox messageArea = new BorderBox (); messageArea.Add (vbox1); this.Add (messageArea); this.ShowAll (); int x = completionContext.TriggerXCoord; int y = completionContext.TriggerYCoord; int w, h; GetSize (out w, out h); int myMonitor = Screen.GetMonitorAtPoint (x, y); Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, myMonitor); if (x + w > geometry.Right) x = geometry.Right - w; if (y + h > geometry.Bottom) y = y - completionContext.TriggerTextHeight - h; Move (x, y); }
public TranslationProjectOptionsDialog (TranslationProject project) { this.project = project; this.Build(); entryPackageName.Text = project.PackageName; entryRelPath.Text = project.RelPath; radiobuttonRelPath.Active = project.OutputType == TranslationOutputType.RelativeToOutput; radiobuttonSystemPath.Active = project.OutputType == TranslationOutputType.SystemPath; entryPackageName.Changed += new EventHandler (UpdateInitString); entryRelPath.Changed += new EventHandler (UpdateInitString); radiobuttonRelPath.Activated += new EventHandler (UpdateInitString); radiobuttonSystemPath.Activated += new EventHandler (UpdateInitString); UpdateInitString (this, EventArgs.Empty); this.buttonOk.Clicked += delegate { project.PackageName = entryPackageName.Text; project.RelPath = entryRelPath.Text; if (radiobuttonRelPath.Active) { project.OutputType = TranslationOutputType.RelativeToOutput; } else { project.OutputType = TranslationOutputType.SystemPath; } this.Destroy (); }; this.buttonCancel.Clicked += delegate { this.Destroy (); }; store = new TreeStore (typeof(string), typeof(bool), typeof(string), typeof(SolutionFolderItem), typeof(bool)); treeviewProjectList.Model = store; treeviewProjectList.HeadersVisible = false; TreeViewColumn col = new TreeViewColumn (); CellRendererToggle cellRendererToggle = new CellRendererToggle (); cellRendererToggle.Toggled += new ToggledHandler (ActiveToggled); cellRendererToggle.Activatable = true; col.PackStart (cellRendererToggle, false); col.AddAttribute (cellRendererToggle, "active", 1); col.AddAttribute (cellRendererToggle, "visible", 4); CellRendererImage crp = new CellRendererImage (); col.PackStart (crp, false); col.AddAttribute (crp, "stock_id", 0); CellRendererText crt = new CellRendererText (); col.PackStart (crt, true); col.AddAttribute (crt, "text", 2); treeviewProjectList.AppendColumn (col); FillTree (TreeIter.Zero, project.ParentSolution.RootFolder); }
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; }
public ComponentSelectorDialog () { this.ApplyTheme (); this.Build(); store = new TreeStore (typeof(bool), typeof(string), typeof(string), typeof(string), typeof(string), typeof(Xwt.Drawing.Image), typeof(ItemToolboxNode), typeof(bool), typeof(int)); TreeViewColumn col; col = new TreeViewColumn (); Gtk.CellRendererToggle crt = new CellRendererToggle (); col.PackStart (crt, false); col.AddAttribute (crt, "active", ColChecked); col.AddAttribute (crt, "visible", ColShowCheck); crt.Toggled += OnToggleItem; col.SortColumnId = ColChecked; listView.AppendColumn (col); col = new TreeViewColumn (); col.Spacing = 3; col.Title = GettextCatalog.GetString ("Name"); var crp = new CellRendererImage (); CellRendererText crx = new CellRendererText (); crx.Width = 150; col.PackStart (crp, false); col.PackStart (crx, false); col.AddAttribute (crp, "image", ColIcon); col.AddAttribute (crp, "visible", ColShowCheck); col.AddAttribute (crx, "text", ColName); col.AddAttribute (crx, "weight", ColBold); listView.AppendColumn (col); col.Resizable = true; col.SortColumnId = ColName; col = listView.AppendColumn (GettextCatalog.GetString ("Library"), new CellRendererText (), "text", ColLibrary); col.Resizable = true; col.SortColumnId = ColLibrary; col = listView.AppendColumn (GettextCatalog.GetString ("Location"), new CellRendererText (), "text", ColPath); col.Resizable = true; col.SortColumnId = ColPath; store.SetSortColumnId (ColName, SortType.Ascending); listView.SearchColumn = ColName; listView.Model = store; listView.SearchColumn = -1; // disable the interactive search foreach (ItemToolboxNode it in DesignerSupport.Service.ToolboxService.UserItems) currentItems [it] = it; comboType.AppendText (GettextCatalog.GetString ("All")); comboType.Active = 0; }
// IWorkbenchWindow workbenchWindow; // RegexToolkitWidget regexWidget; public ElementHelpWidget (IWorkbenchWindow workbenchWindow, RegexToolkitWidget regexWidget) { // this.workbenchWindow = workbenchWindow; // this.regexWidget = regexWidget; this.Build (); elementsStore = new Gtk.TreeStore (typeof(string), typeof(string), typeof(string), typeof(string)); this.elementsTreeview.Model = this.elementsStore; this.elementsTreeview.HeadersVisible = false; this.elementsTreeview.Selection.Mode = SelectionMode.Browse; var col = new TreeViewColumn (); this.elementsTreeview.AppendColumn (col); var pix = new CellRendererImage (); var cellRendText = new CellRendererText (); col.PackStart (pix, false); col.AddAttribute (pix, "stock_id", 0); col.PackStart (cellRendText, false); col.AddAttribute (cellRendText, "text", 1); var cellRendText2 = new CellRendererText (); col.PackStart (cellRendText2, true); col.SetCellDataFunc (cellRendText2, ElementDescriptionFunc); // this.elementsTreeview.Selection.Changed += delegate { // ShowTooltipForSelectedEntry (); // }; // this.elementsTreeview.MotionNotifyEvent += HandleMotionNotifyEvent; this.elementsTreeview.RowActivated += delegate (object sender, RowActivatedArgs e) { Gtk.TreeIter iter; if (elementsStore.GetIter (out iter, e.Path)) { string text = elementsStore.GetValue (iter, 3) as string; if (!System.String.IsNullOrEmpty (text)) { regexWidget.InsertText (text); workbenchWindow.SwitchView (0); } } }; this.LeaveNotifyEvent += delegate { this.HideTooltipWindow (); }; FillElementsBox (); Show (); }
public ProjectDirectoryComboBox () { store = new TreeStore (typeof (Xwt.Drawing.Image), typeof (string), typeof (Project), typeof (string)); var pixbuf = new CellRendererImage (); CellRendererText text = new CellRendererText (); this.PackStart (pixbuf, false); this.PackStart (text, false); this.AddAttribute (pixbuf, "image", 0); this.AddAttribute (text, "markup", 1); this.Model = store; PopulateCombo (); }
public RefactoringPreviewDialog (IList<Change> changes) { this.Build (); this.changes = changes; treeviewPreview.Model = store; treeviewPreview.SearchColumn = -1; // disable the interactive search TreeViewColumn column = new TreeViewColumn (); // pixbuf column var pixbufCellRenderer = new CellRendererImage (); column.PackStart (pixbufCellRenderer, false); column.SetAttributes (pixbufCellRenderer, "image", pixbufColumn); column.AddAttribute (pixbufCellRenderer, "visible", statusVisibleColumn); // text column CellRendererText cellRendererText = new CellRendererText (); column.PackStart (cellRendererText, false); column.SetAttributes (cellRendererText, "text", textColumn); column.AddAttribute (cellRendererText, "visible", statusVisibleColumn); // location column CellRendererText cellRendererText2 = new CellRendererText (); column.PackStart (cellRendererText2, false); column.SetCellDataFunc (cellRendererText2, new TreeCellDataFunc (SetLocationTextData)); CellRendererDiff cellRendererDiff = new CellRendererDiff (); column.PackStart (cellRendererDiff, true); column.SetCellDataFunc (cellRendererDiff, new TreeCellDataFunc (SetDiffCellData)); treeviewPreview.AppendColumn (column); treeviewPreview.HeadersVisible = false; buttonCancel.Clicked += delegate { Destroy (); }; buttonOk.Clicked += delegate { ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor (this.Title, null); RefactoringService.AcceptChanges (monitor, changes); Destroy (); }; FillChanges (); }
Widget IOutlinedDocument.GetOutlineWidget() { if (outlineTreeView != null) return outlineTreeView; outlineTreeStore = new TreeStore (typeof(object)); outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore); var pixRenderer = new CellRendererImage (); pixRenderer.Xpad = 0; pixRenderer.Ypad = 0; outlineTreeView.TextRenderer.Xpad = 0; outlineTreeView.TextRenderer.Ypad = 0; TreeViewColumn treeCol = new TreeViewColumn (); treeCol.PackStart (pixRenderer, false); treeCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (OutlineTreeIconFunc)); treeCol.PackStart (outlineTreeView.TextRenderer, true); treeCol.SetCellDataFunc (outlineTreeView.TextRenderer, new TreeCellDataFunc (OutlineTreeTextFunc)); outlineTreeView.AppendColumn (treeCol); outlineTreeView.HeadersVisible = false; outlineTreeView.Selection.Changed += delegate { JumpToDeclaration (false); }; outlineTreeView.RowActivated += delegate { JumpToDeclaration (true); }; this.lastCU = Document.ParsedDocument; outlineTreeView.Realized += delegate { RefillOutlineStore (); }; UpdateSorting (); var sw = new CompactScrolledWindow (); sw.Add (outlineTreeView); sw.ShowAll (); return sw; }
public PackageReferencePanel (SelectReferenceDialog selectDialog, bool showAll) { this.selectDialog = selectDialog; this.showAll = showAll; store = new ListStore (typeof (string), typeof (string), typeof (SystemAssembly), typeof (bool), typeof (string), typeof (string), typeof(IconId), typeof(int), typeof(ReferenceType)); treeView = new TreeView (store); TreeViewColumn firstColumn = new TreeViewColumn (); CellRendererToggle tog_render = new CellRendererToggle (); tog_render.Toggled += new Gtk.ToggledHandler (AddReference); firstColumn.PackStart (tog_render, false); firstColumn.AddAttribute (tog_render, "active", ColSelected); treeView.AppendColumn (firstColumn); TreeViewColumn secondColumn = new TreeViewColumn (); secondColumn.Title = GettextCatalog.GetString ("Assembly"); CellRendererImage crp = new CellRendererImage (); secondColumn.PackStart (crp, false); secondColumn.AddAttribute (crp, "icon-id", ColIcon); CellRendererText text_render = new CellRendererText (); secondColumn.PackStart (text_render, true); secondColumn.AddAttribute (text_render, "markup", ColName); treeView.AppendColumn (secondColumn); treeView.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "markup", ColVersion); treeView.AppendColumn (GettextCatalog.GetString ("Package"), new CellRendererText (), "text", ColPackage); treeView.Columns[1].Resizable = true; store.SetSortColumnId (0, SortType.Ascending); store.SetSortFunc (0, new TreeIterCompareFunc (Sort)); ScrolledWindow sc = new ScrolledWindow (); sc.ShadowType = Gtk.ShadowType.In; sc.Add (treeView); this.PackStart (sc, true, true, 0); ShowAll (); BorderWidth = 6; }
public SelectRepositoryDialog (SelectRepositoryMode mode) { Build (); foreach (VersionControlSystem vcs in VersionControlService.GetVersionControlSystems ()) { if (vcs.IsInstalled) { repCombo.AppendText (vcs.Name); systems.Add (vcs); } } repCombo.Active = 0; this.mode = mode; store = new Gtk.TreeStore (typeof(object), typeof(string), typeof(string), typeof(bool), typeof(string)); repoTree.Model = store; TreeViewColumn col = new TreeViewColumn (); col.Title = GettextCatalog.GetString ("Repository"); CellRendererText crt = new CellRendererText (); CellRendererImage crp = new CellRendererImage (); col.PackStart (crp, false); col.PackStart (crt, true); col.AddAttribute (crp, "stock-id", IconCol); col.AddAttribute (crt, "text", RepoNameCol); repoTree.AppendColumn (col); repoTree.AppendColumn (GettextCatalog.GetString ("Type"), new CellRendererText (), "text", VcsName); repoTree.TestExpandRow += new Gtk.TestExpandRowHandler (OnTestExpandRow); LoadRepositories (); if (mode == SelectRepositoryMode.Checkout) { labelName.Visible = false; entryName.Visible = false; boxMessage.Visible = false; labelMessage.Visible = false; defaultPath = VersionControlDefaultPath; entryFolder.Text = defaultPath; buttonOk.Label = GettextCatalog.GetString ("_Checkout"); } else { labelTargetDir.Visible = false; boxFolder.Visible = false; } repoContainer.SetFlag (WidgetFlags.NoWindow); }
public CodeTemplatePanelWidget (OptionsDialog parent) { this.Build(); scrolledwindow1.Add (textEditor); textEditor.ShowAll (); templateStore = new TreeStore (typeof (CodeTemplate), typeof (string), typeof (string)); TreeViewColumn column = new TreeViewColumn (); column.Title = GettextCatalog.GetString ("Key"); pixbufCellRenderer = new CellRendererImage (); column.PackStart (pixbufCellRenderer, false); column.SetCellDataFunc (pixbufCellRenderer, new Gtk.TreeCellDataFunc (RenderIcon)); templateCellRenderer = new CellRendererText (); column.PackStart (templateCellRenderer, true); column.SetCellDataFunc (templateCellRenderer, new Gtk.TreeCellDataFunc (RenderTemplateName)); treeviewCodeTemplates.AppendColumn (column); treeviewCodeTemplates.Model = templateStore; templates = new List<CodeTemplate> (CodeTemplateService.Templates); templates.ForEach (t => InsertTemplate (t)); treeviewCodeTemplates.ExpandAll (); treeviewCodeTemplates.Selection.Changed += HandleChanged; options = new MonoDevelop.Ide.Gui.CommonTextEditorOptions (); options.ShowLineNumberMargin = false; options.ShowFoldMargin = false; options.ShowIconMargin = false; textEditor.Options = options; textEditor.Document.ReadOnly = true; this.buttonAdd.Clicked += ButtonAddClicked; this.buttonEdit.Clicked += ButtonEditClicked; this.buttonRemove.Clicked += ButtonRemoveClicked; this.treeviewCodeTemplates.Selection.Changed += SelectionChanged; SelectionChanged (null, null); checkbuttonWhiteSpaces.Hide (); }
public ProjectReferencePanel (SelectReferenceDialog selectDialog) : base (false, 6) { this.selectDialog = selectDialog; store = new ListStore (typeof (string), typeof (string), typeof(Project), typeof(bool), typeof(Xwt.Drawing.Image), typeof(bool), typeof(string)); store.SetSortFunc (0, CompareNodes); treeView = new TreeView (store); TreeViewColumn firstColumn = new TreeViewColumn (); TreeViewColumn secondColumn = new TreeViewColumn (); CellRendererToggle tog_render = new CellRendererToggle (); tog_render.Xalign = 0; tog_render.Toggled += new Gtk.ToggledHandler (AddReference); firstColumn.PackStart (tog_render, false); firstColumn.AddAttribute (tog_render, "active", ColSelected); firstColumn.AddAttribute (tog_render, "visible", ColVisible); secondColumn.Title = GettextCatalog.GetString ("Project"); CellRendererImage pix_render = new CellRendererImage (); secondColumn.PackStart (pix_render, false); secondColumn.AddAttribute (pix_render, "image", ColPixbuf); CellRendererText text_render = new CellRendererText (); secondColumn.PackStart (text_render, true); secondColumn.AddAttribute (text_render, "markup", ColName); secondColumn.AddAttribute (text_render, "foreground", ColColor); treeView.AppendColumn (firstColumn); treeView.AppendColumn (secondColumn); treeView.AppendColumn (GettextCatalog.GetString ("Directory"), new CellRendererText (), "markup", ColPath); ScrolledWindow sc = new ScrolledWindow (); sc.ShadowType = Gtk.ShadowType.In; sc.Add (treeView); PackStart (sc, true, true, 0); store.SetSortColumnId (0, SortType.Ascending); ShowAll (); BorderWidth = 6; }
void CreateFolderTreeViewColumns () { folderTreeStore = new TreeStore (typeof(string), typeof(string)); folderTreeView.Model = folderTreeStore; folderTreeView.ShowExpanders = false; folderTreeView.LevelIndentation = 10; folderTreeView.CanFocus = false; var column = new TreeViewColumn (); var iconRenderer = new CellRendererImage (); column.PackStart (iconRenderer, false); column.AddAttribute (iconRenderer, "stock-id", column: 0); var textRenderer = new CellRendererText (); textRenderer.Ellipsize = Pango.EllipsizeMode.Middle; column.PackStart (textRenderer, true); column.AddAttribute (textRenderer, "markup", TextColumn); folderTreeView.AppendColumn (column); }
public CodeTemplatePanelWidget (OptionsDialog parent) { this.Build(); Gtk.Widget control = textEditor; scrolledwindow1.Add (control); control.ShowAll (); templateStore = new TreeStore (typeof (CodeTemplate), typeof (string), typeof (string)); TreeViewColumn column = new TreeViewColumn (); column.Title = GettextCatalog.GetString ("Key"); pixbufCellRenderer = new CellRendererImage (); column.PackStart (pixbufCellRenderer, false); column.SetCellDataFunc (pixbufCellRenderer, new Gtk.TreeCellDataFunc (RenderIcon)); templateCellRenderer = new CellRendererText (); column.PackStart (templateCellRenderer, true); column.SetCellDataFunc (templateCellRenderer, new Gtk.TreeCellDataFunc (RenderTemplateName)); treeviewCodeTemplates.AppendColumn (column); treeviewCodeTemplates.Model = templateStore; treeviewCodeTemplates.SearchColumn = -1; // disable the interactive search templates = new List<CodeTemplate> (CodeTemplateService.Templates); templates.ForEach (t => InsertTemplate (t)); treeviewCodeTemplates.ExpandAll (); treeviewCodeTemplates.Selection.Changed += HandleChanged; textEditor.Options = DefaultSourceEditorOptions.PlainEditor; textEditor.IsReadOnly = true; this.buttonAdd.Clicked += ButtonAddClicked; this.buttonEdit.Clicked += ButtonEditClicked; this.buttonRemove.Clicked += ButtonRemoveClicked; this.treeviewCodeTemplates.Selection.Changed += SelectionChanged; SelectionChanged (null, null); checkbuttonWhiteSpaces.Hide (); }
public void Initialize (TreeView treeView) { var column = new TreeViewColumn (); var toggleRenderer = new CellRendererToggle (); toggleRenderer.Toggled += ToggleRendererToggled; column.PackStart (toggleRenderer, false); column.AddAttribute (toggleRenderer, "active", 0); var pixbufRenderer = new CellRendererImage (); column.PackStart (pixbufRenderer, false); column.AddAttribute (pixbufRenderer, "image", 1); var textRenderer = new CellRendererText (); column.PackStart (textRenderer, true); column.AddAttribute (textRenderer, "text", 2); column.Expand = true; treeView.AppendColumn (column); Ambience ambience = AmbienceService.GetAmbienceForFile (options.Document.FileName); foreach (object obj in GetValidMembers ()) { var member = obj as IEntity; if (member != null) { Store.AppendValues (false, ImageService.GetIcon (member.GetStockIcon (), IconSize.Menu), ambience.GetString (member, OutputFlags.ClassBrowserEntries), member); continue; } var tuple = obj as Tuple<IMember, bool>; if (tuple != null) { Store.AppendValues (false, ImageService.GetIcon (tuple.Item1.GetStockIcon (), IconSize.Menu), ambience.GetString (tuple.Item1, OutputFlags.ClassBrowserEntries), tuple); continue; } var variable = obj as IVariable; if (variable != null) Store.AppendValues (false, ImageService.GetIcon (variable.GetStockIcon (), IconSize.Menu), variable.Name, variable); } treeView.Model = store; }
public EntrySelectionTree () { this.Build(); store = new TreeStore (typeof(string), typeof(string), typeof(object), typeof(bool), typeof(bool)); tree.Model = store; tree.HeadersVisible = false; TreeViewColumn col = new TreeViewColumn (); Gtk.CellRendererToggle ctog = new CellRendererToggle (); ctog.Toggled += OnToggled; col.PackStart (ctog, false); CellRendererImage cr = new CellRendererImage(); col.PackStart (cr, false); Gtk.CellRendererText crt = new Gtk.CellRendererText(); col.PackStart (crt, true); col.AddAttribute (cr, "stock-id", 0); col.AddAttribute (crt, "markup", 1); col.AddAttribute (ctog, "active", 3); col.AddAttribute (ctog, "visible", 4); tree.AppendColumn (col); }
public EditBranchDialog (GitRepository repo, Branch branch, bool isNew) { this.Build (); this.repo = repo; comboStore = new ListStore (typeof(string), typeof(Xwt.Drawing.Image), 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); if (branch != null) { if (!isNew) oldName = branch.Name; currentTracking = branch.Tracking; entryName.Text = branch.Name; checkTrack.Active = currentTracking != null; } foreach (Branch b in repo.GetBranches ()) { AddValues (b.Name, ImageService.GetIcon ("vc-branch", IconSize.Menu)); } foreach (string t in repo.GetTags ()) AddValues (t, ImageService.GetIcon ("vc-tag", IconSize.Menu)); foreach (RemoteSource r in repo.GetRemotes ()) { foreach (string b in repo.GetRemoteBranches (r.Name)) AddValues (r.Name + "/" + b, ImageService.GetIcon ("vc-repository", IconSize.Menu)); } UpdateStatus (); }
public TestResultsPad () { testService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged); panel = new VBox (); // 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 (); failuresTreeView.HeadersVisible = false; failuresStore = new TreeStore (typeof(Xwt.Drawing.Image), typeof(string), typeof(object), typeof(string), typeof(int)); 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 (); 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/NUnit/ContextMenu/TestResultsPad"); }; Control.ShowAll (); outputViewScrolled.Hide (); }
public RegexToolkitWidget () { this.Build (); optionsStore = new ListStore (typeof(bool), typeof(string), typeof(Options)); resultStore = new Gtk.TreeStore (typeof(string), typeof(string), typeof(int), typeof(int)); FillOptionsBox (); this.entryRegEx.Changed += UpdateStartButtonSensitivity; this.inputTextview.Buffer.Changed += UpdateStartButtonSensitivity; SetFindMode (true); var cellRendText = new CellRendererText (); cellRendText.Ellipsize = Pango.EllipsizeMode.End; this.optionsTreeview.Model = this.optionsStore; this.optionsTreeview.HeadersVisible = false; CellRendererToggle cellRendToggle = new CellRendererToggle (); cellRendToggle.Toggled += new ToggledHandler (OptionToggled); cellRendToggle.Activatable = true; this.optionsTreeview.AppendColumn ("", cellRendToggle, "active", 0); this.optionsTreeview.AppendColumn ("", cellRendText, "text", 1); this.resultsTreeview.Model = this.resultStore; this.resultsTreeview.HeadersVisible = false; var col = new TreeViewColumn (); this.resultsTreeview.AppendColumn (col); var pix = new CellRendererImage (); col.PackStart (pix, false); col.AddAttribute (pix, "stock_id", 0); col.PackStart (cellRendText, true); col.AddAttribute (cellRendText, "text", 1); this.resultsTreeview.RowActivated += delegate(object sender, RowActivatedArgs e) { Gtk.TreeIter iter; if (resultStore.GetIter (out iter, e.Path)) { int index = (int)resultStore.GetValue (iter, 2); int length = (int)resultStore.GetValue (iter, 3); if (index >= 0) { this.inputTextview.Buffer.SelectRange (this.inputTextview.Buffer.GetIterAtOffset (index), this.inputTextview.Buffer.GetIterAtOffset (index + length)); } else { this.inputTextview.Buffer.SelectRange (this.inputTextview.Buffer.GetIterAtOffset (0), this.inputTextview.Buffer.GetIterAtOffset (0)); } } }; this.entryReplace.Sensitive = this.checkbuttonReplace.Active = false; this.entryReplace.Changed += delegate { UpdateRegex (); }; this.checkbuttonReplace.Toggled += delegate { this.entryReplace.Sensitive = this.checkbuttonReplace.Active; UpdateRegex (); }; this.expandMatches.Toggled += delegate { UpdateRegex (); }; this.vbox4.WidthRequest = 380; this.scrolledwindow5.HeightRequest = 150; this.scrolledwindow1.HeightRequest = 150; Show (); }