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); CellRendererPixbuf pixbufRenderer = new CellRendererPixbuf(); 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); }
public WidgetTreePopup(Stetic.IProject project) : base(WindowType.Popup) { this.project = project; Gtk.Frame frame = new Frame(); frame.ShadowType = Gtk.ShadowType.Out; Add(frame); Gtk.ScrolledWindow sc = new ScrolledWindow(); sc.VscrollbarPolicy = PolicyType.Automatic; sc.HscrollbarPolicy = PolicyType.Automatic; frame.Add(sc); tree = new TreeView(); store = new TreeStore(typeof(Gdk.Pixbuf), typeof(string), typeof(Widget)); tree.Model = store; tree.HeadersVisible = false; TreeViewColumn col = new TreeViewColumn(); CellRendererPixbuf cr = new CellRendererPixbuf(); col.PackStart(cr, false); col.AddAttribute(cr, "pixbuf", 0); CellRendererText tr = new CellRendererText(); col.PackStart(tr, true); col.AddAttribute(tr, "markup", 1); tree.AppendColumn(col); tree.ButtonReleaseEvent += OnButtonRelease; tree.RowActivated += OnButtonRelease; sc.Add(tree); tree.GrabFocus(); }
// Constructor. public TagSelectionWidget(TagStore tag_store) : base(new TreeStore(typeof(uint), typeof(string))) { database = App.Instance.Database; HeadersVisible = false; complete_column = new TreeViewColumn(); pix_render = new CellRendererPixbuf(); complete_column.PackStart(pix_render, false); complete_column.SetCellDataFunc(pix_render, new TreeCellDataFunc(IconDataFunc)); //complete_column.AddAttribute (pix_render, "pixbuf", OpenIconColumn); //icon_column = AppendColumn ("icon", //, new TreeCellDataFunc (IconDataFunc)); //icon_column = AppendColumn ("icon", new CellRendererPixbuf (), new TreeCellDataFunc (IconDataFunc)); text_render = new CellRendererText(); complete_column.PackStart(text_render, true); complete_column.SetCellDataFunc(text_render, new TreeCellDataFunc(NameDataFunc)); AppendColumn(complete_column); this.tag_store = tag_store; Update(); ExpandDefaults(); tag_store.ItemsAdded += HandleTagsAdded; tag_store.ItemsRemoved += HandleTagsRemoved; tag_store.ItemsChanged += HandleTagsChanged; // TODO make the search find tags that are not currently expanded EnableSearch = true; SearchColumn = NameColumn; // Transparent white empty_pixbuf.Fill(0xffffff00); /* set up drag and drop */ DragDataGet += HandleDragDataGet; DragDrop += HandleDragDrop; DragBegin += HandleDragBegin; Gtk.Drag.SourceSet(this, Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask, (TargetEntry[])tagSourceTargetList, DragAction.Copy | DragAction.Move); DragDataReceived += HandleDragDataReceived; DragMotion += HandleDragMotion; Gtk.Drag.DestSet(this, DestDefaults.All, (TargetEntry[])tagDestTargetList, DragAction.Copy | DragAction.Move); }
private void RenderViewerIcon(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) { WorkspaceUnit workspaceUnit = (WorkspaceUnit)model.GetValue(iter, 2); if (!workspaceUnit.Type.IsPrimitive && workspaceUnit.Type != String.Empty.GetType()) { bool success = false; CellRendererPixbuf renderer = (CellRendererPixbuf)cell; renderer.Visible = true; try { success = WorkspaceViewerLoader.CheckIfEditorExists(workspaceUnit.Type); } catch (Exception) {} if (success) { renderer.Pixbuf = s_workspaceViewerIcon; } else { renderer.Pixbuf = s_noViewerIcon; } } else { cell.Visible = false; } }
// FIXME: We might want to change some names in this folder... // Component, ComponentFolder and ComponentView should maybe reflect // that they are actually not the actual "components" but only a // GUI model of them. But because we don't have the real implementation // of the components we really don't know how we want to structure it // so these classes might as well become the "real" ones in the end. Who knows... public HierarchyView(HierarchyComponent hierarchy) { TreeView = new TreeView(); TreeView.HeadersVisible = false; Column = new TreeViewColumn(); Column.Title = "Hierarchy"; var text = new CellRendererText(); var pix = new CellRendererPixbuf(); try { pix.Icon = IconTheme.Default.LoadIcon("x-office-document", 16, 0); } catch (GLib.GException gex) { Console.WriteLine(gex); } Column.PackStart(pix, false); Column.PackStart(text, false); Column.SetCellDataFunc(text, GetTextCellData); Column.SetCellDataFunc(pix, GetIconCellData); Column.Expand = true; TreeView.AppendColumn(Column); TreeView.Model = BuildStore(hierarchy); }
private ChatsPage() { base.FocusGrabbed += base_FocusGrabbed; closePixbuf = new Gdk.Pixbuf(null, "Meshwork.Client.GtkClient.smallclose.png"); tabLabelPages = new Dictionary <Widget, ChatSubpageBase>(); notebook = new Notebook(); notebook.TabPos = PositionType.Bottom; notebook.SwitchPage += notebook_SwitchPage; notebook.PageReordered += notebook_PageReordered; ScrolledWindow swindow = new ScrolledWindow(); swindow.HscrollbarPolicy = PolicyType.Automatic; swindow.VscrollbarPolicy = PolicyType.Automatic; chatList = new TreeView(); swindow.Add(chatList); chatTreeStore = new NetworkGroupedTreeStore <ChatRoom>(chatList); chatList.Model = chatTreeStore; TreeViewColumn column; column = chatList.AppendColumn("Room Name", new CellRendererText(), new TreeCellDataFunc(NameDataFunc)); column.Expand = true; column.Sizing = TreeViewColumnSizing.Autosize; var pixbufCell = new CellRendererPixbuf(); column.PackStart(pixbufCell, false); column.SetCellDataFunc(pixbufCell, new TreeCellDataFunc(RoomSecureDataFunc)); column = chatList.AppendColumn("Users", new CellRendererText(), new TreeCellDataFunc(RoomUsersDataFunc)); column.Sizing = TreeViewColumnSizing.Autosize; chatList.RowActivated += chatList_RowActivated; chatList.ButtonPressEvent += chatList_ButtonPressEvent; EventBox box = new EventBox(); box.Add(new Label("Chatroom List")); box.ButtonPressEvent += HandleTabButtonPressEvent; box.ShowAll(); notebook.AppendPage(swindow, box); this.PackStart(notebook, true, true, 0); notebook.ShowAll(); foreach (Network network in Runtime.Core.Networks) { Core_NetworkAdded(network); } Runtime.Core.NetworkAdded += (NetworkEventHandler)DispatchService.GuiDispatch( new NetworkEventHandler(Core_NetworkAdded) ); }
public MergeDialog(GitRepository repo, bool rebasing) { this.Build(); this.repo = repo; this.rebasing = rebasing; store = new TreeStore(typeof(string), typeof(Gdk.Pixbuf), typeof(string), typeof(string)); tree.Model = store; CellRendererPixbuf crp = new CellRendererPixbuf(); TreeViewColumn col = new TreeViewColumn(); col.PackStart(crp, false); col.AddAttribute(crp, "pixbuf", 1); CellRendererText 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 Construir(TreeView tvArvore) { TreeStore storeArvore; TreeViewColumn tvColuna; CellRendererPixbuf pixbufRender; CellRendererText tvcolunaCell; tvColuna = new TreeViewColumn(); tvColuna.Title = "coluna"; pixbufRender = new CellRendererPixbuf(); tvColuna.PackStart(pixbufRender, false); tvColuna.AddAttribute(pixbufRender, "pixbuf", 0); tvcolunaCell = new CellRendererText(); tvColuna.PackStart(tvcolunaCell, true); tvColuna.AddAttribute(tvcolunaCell, "text", 1); tvArvore.AppendColumn(tvColuna); tvArvore.HeadersVisible = false; tvArvore.Selection.Mode = SelectionMode.Single; storeArvore = new TreeStore(typeof(Gdk.Pixbuf), typeof(string)); tvArvore.Model = storeArvore; }
public Widget GetOutlineWidget() { if (TreeView != null) { return(TreeView); } TreeStore = new TreeStore(typeof(object)); /* * settings = ClassOutlineSettings.Load(); * comparer = new ClassOutlineNodeComparer(GetAmbience(), settings, outlineTreeModelSort); * * outlineTreeModelSort.SetSortFunc(0, comparer.CompareNodes); * outlineTreeModelSort.SetSortColumnId(0, SortType.Ascending); */ TreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView(TreeStore); var pixRenderer = new CellRendererPixbuf(); pixRenderer.Xpad = 0; pixRenderer.Ypad = 0; TreeView.TextRenderer.Xpad = 0; TreeView.TextRenderer.Ypad = 0; TreeViewColumn treeCol = new TreeViewColumn(); treeCol.PackStart(pixRenderer, false); treeCol.SetCellDataFunc(pixRenderer, new TreeCellDataFunc(OutlineTreeIconFunc)); treeCol.PackStart(TreeView.TextRenderer, true); treeCol.SetCellDataFunc(TreeView.TextRenderer, new TreeCellDataFunc(OutlineTreeTextFunc)); TreeView.AppendColumn(treeCol); TreeView.TextRenderer.Editable = false; TreeView.HeadersVisible = false; TreeView.Selection.Changed += delegate { if (dontJumpToDeclaration || !outlineReady) { return; } clickedOnOutlineItem = true; JumpToDeclaration(true); clickedOnOutlineItem = false; }; TreeView.Realized += delegate { RefillOutlineStore(); }; //UpdateSorting(); var sw = new CompactScrolledWindow(); sw.Add(TreeView); sw.ShowAll(); return(sw); }
private void CreateUserList() { userList = new TreeView(); userListStore = new TreeStore(typeof(object)); userList.Model = userListStore; userList.RowActivated += OnUserListRowActivated; userList.ButtonPressEvent += userList_ButtonPressEvent; userList.HeadersVisible = false; TreeViewColumn column = new TreeViewColumn(); CellRendererPixbuf imageCell = new CellRendererPixbuf(); column.PackStart(imageCell, false); column.SetCellDataFunc(imageCell, new TreeCellDataFunc(UserListIconFunc)); CellRendererText textCell = new CellRendererText(); column.PackStart(textCell, true); column.SetCellDataFunc(textCell, new TreeCellDataFunc(UserListTextFunc)); userList.AppendColumn(column); Runtime.BuiltinActions["ToggleMainUsers"].Activated += ToggleMainUsers_Activated; }
void Init() { // index, (start, end, size, tableSum), icon, calcSum store = new ListStore(typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(Gdk.Pixbuf), typeof(int)); treeviewCSums.RulesHint = true; treeviewCSums.Model = store; var fontDesc = new Pango.FontDescription(); fontDesc.Family = MainClass.MonospaceFont; cellRendererText = new CellRendererText(); cellRendererText.FontDesc = fontDesc; cellRendererPixbuf = new CellRendererPixbuf(); AddTextColumn("#", ColNr.Index); AddTextColumn("Start", ColNr.Start); AddTextColumn("Last", ColNr.End); AddTextColumn("Size (dec)", ColNr.Size); AddTextColumn("Checksum", ColNr.SumTable); AddColumn(new TreeViewColumn(null, cellRendererPixbuf, "pixbuf", ColNr.Icon), ColNr.Icon); AddTextColumn("Calculated", ColNr.SumCalc); InitIcons(); }
public ProjectViewBackendNodeView(ProjectViewFrontend frontend) { this.frontend = frontend; HeadersVisible = false; store = new TreeStore(typeof(Gdk.Pixbuf), typeof(string), typeof(ObjectWrapper), typeof(bool)); Model = store; TreeViewColumn col; CellRenderer renderer; col = new TreeViewColumn(); renderer = new CellRendererPixbuf(); col.PackStart(renderer, false); col.AddAttribute(renderer, "pixbuf", 0); renderer = new CellRendererText(); col.PackStart(renderer, true); col.AddAttribute(renderer, "text", 1); AppendColumn(col); Selection.Mode = SelectionMode.Single; Selection.Changed += RowSelected; TestExpandRow += OnTestExpandRow; ShowAll(); }
public void Initialize(Gtk.TreeView treeView) { TreeViewColumn column = new TreeViewColumn(); CellRendererToggle toggleRenderer = new CellRendererToggle(); toggleRenderer.Toggled += ToggleRendererToggled; column.PackStart(toggleRenderer, false); column.AddAttribute(toggleRenderer, "active", 0); var pixbufRenderer = new CellRendererPixbuf(); column.PackStart(pixbufRenderer, false); column.AddAttribute(pixbufRenderer, "pixbuf", 1); CellRendererText 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 (IBaseMember member in GetValidMembers()) { Store.AppendValues(false, ImageService.GetPixbuf(member.StockIcon, IconSize.Menu), ambience.GetString(member, member.MemberType == MemberType.Parameter ? OutputFlags.IncludeParameterName : OutputFlags.ClassBrowserEntries), member); } treeView.Model = store; }
private void BuildColumns() { priorityColumn = new TreeViewColumn(); filenameColumn = new TreeViewColumn(); progressColumn = new TreeViewColumn(); filenameColumn.Resizable = true; priorityColumn.Title = ""; filenameColumn.Title = _("Filename"); progressColumn.Title = _("Progress"); Gtk.CellRendererPixbuf priorityCell = new CellRendererPixbuf(); Gtk.CellRendererText filenameCell = new CellRendererText(); Gtk.CellRendererProgress progressCell = new CellRendererProgress(); priorityColumn.PackStart(priorityCell, true); priorityColumn.SetAttributes(priorityCell, "pixbuf", 2); filenameColumn.PackStart(filenameCell, true); filenameColumn.SetAttributes(filenameCell, "text", 3); progressColumn.PackStart(progressCell, true); progressColumn.SetCellDataFunc(progressCell, new Gtk.TreeCellDataFunc(RenderProgress)); AppendColumn(priorityColumn); AppendColumn(filenameColumn); AppendColumn(progressColumn); }
private void VisibilityDataFunc(TreeViewColumn Column, CellRenderer Renderer, TreeModel Model, TreeIter Iter) { CellRendererPixbuf PixbufRenderer = (CellRendererPixbuf)Renderer; object o = Model.GetValue(Iter, 0); if (o is ILayer && !(o is IDrawableLayer)) //no visibility for objects that we can't currently display { PixbufRenderer.StockId = null; return; } float vis = visibility[o]; if (vis <= 0) { PixbufRenderer.StockId = null; } else if (vis <= 0.5f) { PixbufRenderer.StockId = EditorStock.EyeHalf; } else { PixbufRenderer.StockId = EditorStock.Eye; } }
public NewTemplateDialog(IEnumerator <ContentItemTemplate> enums) { Build(); Title = "New Item"; var column = new TreeViewColumn(); var iconCell = new CellRendererPixbuf(); var textCell = new CellRendererText(); var textCell2 = new CellRendererText(); column.PackStart(iconCell, false); column.PackStart(textCell, false); column.PackStart(textCell2, false); treeview1.AppendColumn(column); column.AddAttribute(iconCell, "pixbuf", 0); column.AddAttribute(textCell, "text", 1); column.AddAttribute(textCell, "text", 2); listStore = new TreeStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string)); treeview1.Model = listStore; items = new List <ContentItemTemplate> (); int i = 0; while (enums.MoveNext()) { listStore.AppendValues(new Gdk.Pixbuf(System.IO.Path.GetDirectoryName(enums.Current.TemplateFile) + "/" + enums.Current.Icon), enums.Current.Label, i.ToString()); items.Add(enums.Current); i++; } }
public DirectoryView(ExploreView exploreView) { this.exploreView = exploreView; menu = new DirectoryMenu(exploreView); store = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(ItemType)); Model = store; sortableColumns = new SortableColumns(this, store); #if HAVE_ATLEAST_GTK_210 EnableGridLines = TreeViewGridLines.Vertical; #endif // setup main column with image/text data TreeViewColumn column = new TreeViewColumn(); CellRendererText crt = new CellRendererText(); CellRendererPixbuf crp = new CellRendererPixbuf(); column.Title = "Name"; column.PackStart(crp, false); column.PackStart(crt, true); column.AddAttribute(crp, "pixbuf", 0); column.AddAttribute(crt, "text", 1); AppendColumn(column); AppendColumn("Status", ColumnIndex.Status); AppendColumn("Owner", ColumnIndex.Owner); AppendColumn("Latest", ColumnIndex.Latest); Selection.Mode = SelectionMode.Multiple; KeyReleaseEvent += MyKeyReleaseEventHandler; ButtonPressEvent += MyButtonPressEventHandler; }
private void BuildColumns() { priorityColumn = new TreeViewColumn(); filenameColumn = new TreeViewColumn(); progressColumn = new TreeViewColumn(); filenameColumn.Resizable = true; priorityColumn.Title = ""; filenameColumn.Title = "Filename"; progressColumn.Title = "Progress"; Gtk.CellRendererPixbuf priorityCell = new CellRendererPixbuf(); Gtk.CellRendererText filenameCell = new CellRendererText(); Gtk.CellRendererProgress progressCell = new CellRendererProgress(); priorityColumn.PackStart(priorityCell, true); filenameColumn.PackStart(filenameCell, true); progressColumn.PackStart(progressCell, true); priorityColumn.SetCellDataFunc(priorityCell, new Gtk.TreeCellDataFunc(RenderPriority)); filenameColumn.SetCellDataFunc(filenameCell, new Gtk.TreeCellDataFunc(RenderFilename)); progressColumn.SetCellDataFunc(progressCell, new Gtk.TreeCellDataFunc(RenderProgress)); AppendColumn(priorityColumn); AppendColumn(filenameColumn); AppendColumn(progressColumn); }
private void PopulateCategoryOptionMenu() { categories = new List <Tag> (); categories.Add(tag_store.RootCategory); PopulateCategories(categories, tag_store.RootCategory); ListStore category_store = new ListStore(typeof(Pixbuf), typeof(string)); foreach (Category category in categories) { category_store.AppendValues(category.SizedIcon, Indentation(category) + category.Name); } category_option_menu.Sensitive = true; category_option_menu.Model = category_store; var icon_renderer = new CellRendererPixbuf(); icon_renderer.Width = (int)Tag.TagIconSize; category_option_menu.PackStart(icon_renderer, true); var text_renderer = new CellRendererText(); text_renderer.Alignment = Pango.Alignment.Left; text_renderer.Width = 150; category_option_menu.PackStart(text_renderer, true); category_option_menu.AddAttribute(icon_renderer, "pixbuf", 0); category_option_menu.AddAttribute(text_renderer, "text", 1); category_option_menu.ShowAll(); }
void AuthorIconFunc(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { CellRendererPixbuf renderer = (CellRendererPixbuf)cell; var rev = (Revision)model.GetValue(iter, 0); if (string.IsNullOrEmpty(rev.Email)) { return; } ImageLoader img = ImageService.GetUserIcon(rev.Email, 16); if (img.LoadOperation.IsCompleted) { renderer.Pixbuf = img.Pixbuf; } else { renderer.Pixbuf = null; img.LoadOperation.Completed += delegate { Gtk.Application.Invoke(delegate { if (logstore.IterIsValid(iter)) { model.EmitRowChanged(model.GetPath(iter), iter); } }); }; } }
public BuildOutput() { Build(); outputParser = new OutputParser(); var column = new TreeViewColumn(); var iconCell = new CellRendererPixbuf(); var textCell = new CellRendererText(); var idCell = new CellRendererText(); idCell.Visible = false; column.PackStart(iconCell, false); column.PackStart(textCell, false); column.PackStart(idCell, false); treeview1.AppendColumn(column); column.AddAttribute(iconCell, "pixbuf", 0); column.AddAttribute(textCell, "text", 1); column.AddAttribute(idCell, "text", 2); listStore = new TreeStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string)); treeview1.Model = listStore; textView1.SizeAllocated += TextView1_SizeAllocated; }
public ExtensionEditorWidget() { this.Build(); pixAddin = ImageService.GetPixbuf(MonoDevelop.Ide.Gui.Stock.Addin, IconSize.Menu); pixLocalAddin = ImageService.GetPixbuf("md-addinauthoring-current-addin", IconSize.Menu); pixExtensionPoint = ImageService.GetPixbuf("md-extension-point", IconSize.Menu); pixExtensionNode = ImageService.GetPixbuf("md-extension-node", IconSize.Menu); store = new TreeStore(typeof(string), typeof(string), typeof(Extension), typeof(ExtensionNodeDescription), typeof(Gdk.Pixbuf), typeof(bool), typeof(ExtensionPoint)); state = new TreeViewState(tree, 0); TreeViewColumn col = new TreeViewColumn(); CellRendererPixbuf cpix = new CellRendererPixbuf(); col.PackStart(cpix, false); col.AddAttribute(cpix, "pixbuf", ColIcon); col.AddAttribute(cpix, "visible", ColShowIcon); CellRendererExtension crt = new CellRendererExtension(); crt.Yalign = 0; col.PackStart(crt, true); col.AddAttribute(crt, "markup", ColLabel); tree.AppendColumn(col); tree.Model = store; tree.HeadersVisible = false; tree.Selection.Changed += OnSelectionChanged; IdeApp.ProjectOperations.EndBuild += OnEndBuild; }
private Widget CreateAppList() { var scroll = new ScrolledWindow(); appListStore = new ListStore(typeof(string), typeof(Pixbuf)); appTv = new TreeView(); scroll.Add(appTv); appTv.HeadersVisible = false; var col = new TreeViewColumn(); col.Title = "Name"; var colRender2 = new CellRendererPixbuf(); col.PackStart(colRender2, false); col.AddAttribute(colRender2, "pixbuf", 1); var colRender = new CellRendererText(); colRender.Ellipsize = Pango.EllipsizeMode.End; col.PackStart(colRender, true); col.AddAttribute(colRender, "markup", 0); appTv.AppendColumn(col); var frame = new Frame(); frame.Add(scroll); frame.SetSizeRequest(300, 200); return(frame); }
void ScanSources() { // Populates the source combo box Sources = new TreeStore(typeof(IImportSource), typeof(string), typeof(string), typeof(bool)); sources_combo.Model = Sources; sources_combo.RowSeparatorFunc = (m, i) => (m.GetValue(i, 1) as string) == String.Empty; var render = new CellRendererPixbuf(); sources_combo.PackStart(render, false); sources_combo.SetAttributes(render, "icon-name", 2, "sensitive", 3); var render2 = new CellRendererText(); sources_combo.PackStart(render2, true); sources_combo.SetAttributes(render2, "text", 1, "sensitive", 3); GLib.Idle.Add(() => { try { PopulateSourceCombo(null); QueueDraw(); } catch (Exception e) { // Swallow the exception if the import was cancelled / dialog was closed. if (Controller != null) { throw e; } } return(false); }); }
private void GenerateTree() { store = new TreeStore(typeof(SettingPanel), typeof(string), typeof(string), typeof(bool), typeof(bool), typeof(int)); tvCategory.Model = store; tvCategory.HeadersVisible = false; TreeViewColumn col = new TreeViewColumn(); CellRendererPixbuf crp = new CellRendererPixbuf(); crp.StockSize = (uint)IconSize.LargeToolbar; col.PackStart(crp, false); col.AddAttribute(crp, "stock-id", 1); col.AddAttribute(crp, "visible", 3); col.AddAttribute(crp, "sensitive", 4); CellRendererText crt = new CellRendererText(); col.PackStart(crt, true); col.AddAttribute(crt, "markup", 2); col.AddAttribute(crt, "sensitive", 4); tvCategory.AppendColumn(col); tvCategory.Selection.Changed += OnSelectionChanged; FillTree(); TreeIter it; if (store.GetIterFirst(out it)) { tvCategory.Selection.SelectIter(it); } }
private void PixbufDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter) { CellRendererPixbuf pixbufRenderer = cell as CellRendererPixbuf; ISchemaContainer schema = model.GetValue(iter, columnObj) as ISchemaContainer; string iconString = null; switch (schema.SchemaContainerType) { case SchemaContainerType.Table: iconString = "md-db-table"; break; case SchemaContainerType.View: iconString = "md-db-view"; break; case SchemaContainerType.Procedure: iconString = "md-db-procedure"; break; case SchemaContainerType.Query: //TODO: iconString = Stock.Execute; break; } if (iconString != null) { pixbufRenderer.Pixbuf = MonoDevelop.Core.Gui.Services.Resources.GetIcon(iconString); } }
protected virtual void CreateColumns() { TreeViewColumn col = new TreeViewColumn(); col.Title = Catalog.GetString("Add-in"); CellRendererToggle crtog = new CellRendererToggle(); crtog.Activatable = true; crtog.Toggled += new ToggledHandler(OnAddinToggled); col.PackStart(crtog, false); CellRendererPixbuf pr = new CellRendererPixbuf(); col.PackStart(pr, false); col.AddAttribute(pr, "pixbuf", ColImage); col.AddAttribute(pr, "visible", ColShowImage); CellRendererText crt = new CellRendererText(); col.PackStart(crt, true); col.AddAttribute(crt, "markup", ColName); col.AddAttribute(crtog, "visible", ColAllowSelection); col.AddAttribute(crtog, "active", ColSelected); treeView.AppendColumn(col); col = new TreeViewColumn(); col.Title = Catalog.GetString("Version"); col.PackStart(crt, true); col.AddAttribute(crt, "markup", ColVersion); treeView.AppendColumn(col); }
public ListBoxView(ViewBase owner) : base(owner) { Listview = new IkonView(listmodel); mainWidget = Listview; // It appears that the gtkiconview has changed considerably // between gtk2 and gtk3. In the gtk3 world, use of the // set_text_column API is not recommended and in fact it appears // to behave differently to the way it did in gtk2 anyway. // https://bugzilla.gnome.org/show_bug.cgi?id=680953 CellRendererPixbuf imageCell = new CellRendererPixbuf(); Listview.PackStart(imageCell, false); Listview.AddAttribute(imageCell, "pixbuf", 1); CellRenderer cell = new CellRendererText() { WrapMode = Pango.WrapMode.Word }; Listview.PackStart(cell, true); Listview.AddAttribute(cell, "markup", 0); Listview.TooltipColumn = 2; Listview.SelectionMode = SelectionMode.Browse; Listview.ItemOrientation = Gtk.Orientation.Horizontal; Listview.RowSpacing = 0; Listview.ColumnSpacing = 0; Listview.ItemPadding = 0; Listview.SelectionChanged += OnSelectionChanged; Listview.ButtonPressEvent += OnDoubleClick; mainWidget.Destroyed += _mainWidget_Destroyed; }
/// <summary> /// Removes all grid columns, and cleans up any associated event handlers /// </summary> private void ClearGridColumns() { while (gridview.Columns.Length > 0) { TreeViewColumn col = gridview.GetColumn(0); foreach (CellRenderer render in col.CellRenderers) { if (render is CellRendererText) { CellRendererText textRender = render as CellRendererText; col.SetCellDataFunc(textRender, (CellLayoutDataFunc)null); } else if (render is CellRendererPixbuf) { CellRendererPixbuf pixRender = render as CellRendererPixbuf; col.SetCellDataFunc(pixRender, (CellLayoutDataFunc)null); } render.Destroy(); } gridview.RemoveColumn(gridview.GetColumn(0)); } while (fixedcolview.Columns.Length > 0) { TreeViewColumn col = fixedcolview.GetColumn(0); foreach (CellRenderer render in col.CellRenderers) { if (render is CellRendererText) { CellRendererText textRender = render as CellRendererText; col.SetCellDataFunc(textRender, (CellLayoutDataFunc)null); } } fixedcolview.RemoveColumn(fixedcolview.GetColumn(0)); } }
public MainWindow() : base(Gtk.WindowType.Toplevel) { this.Build(); this.BorderWidth = 12; this.treeviewNodes.Model = store; var col = new TreeViewColumn(); col.Title = "Node"; var pb = new CellRendererPixbuf(); col.PackStart(pb, false); col.AddAttribute(pb, "pixbuf", 3); var text = new CellRendererText(); col.PackStart(text, true); col.AddAttribute(text, "text", 0); this.treeviewNodes.AppendColumn(col); this.treeviewNodes.AppendColumn("ResolveResult", new CellRendererText(), "text", 1); this.treeviewNodes.Selection.Changed += SelectionChanged; // this.treeviewNodes.HeadersVisible = false; this.textview1.ModifyFont(Pango.FontDescription.FromString("Mono 14")); this.textview1.MoveCursor += HandleMoveCursor; string path = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "CSharpDemo.cs"); this.textview1.Buffer.Text = File.ReadAllText(path); buttonParse.Clicked += HandleClicked; buttonGenerate.Clicked += CSharpGenerateCodeButtonClick; HandleClicked(this, EventArgs.Empty); }
public TimerColumn() { timeoutTargets = new ConcurrentDictionary<ITask, TaskCompleteTimer> (); TreeViewColumn = new TreeViewColumn { Title = Catalog.GetString ("Timer"), Sizing = TreeViewColumnSizing.Fixed, FixedWidth = 20, Resizable = false }; var renderer = new CellRendererPixbuf { Xalign = 0.5f }; TreeViewColumn.PackStart (renderer, false); TreeViewColumn.SetCellDataFunc (renderer, TaskTimerCellDataFunc); }