예제 #1
0
        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;
        }
예제 #2
0
        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;
        }
예제 #3
0
		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 ();
		}
예제 #4
0
		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 ();
		}
예제 #5
0
        public OpenImagesListWidget()
        {
            CanFocus = false;
            SetSizeRequest (200, 200);
            SetPolicy (PolicyType.Automatic, PolicyType.Automatic);

            tree = new TreeView ();
            tree.HeadersVisible = false;
            tree.EnableGridLines = TreeViewGridLines.None;
            tree.Selection.Mode = SelectionMode.Single;
            tree.Selection.SelectFunction = HandleDocumentSelected;

            file_name_column = new TreeViewColumn ();
            CellRendererText file_name_cell = new CellRendererText ();
            file_name_column.PackStart (file_name_cell, true);
            file_name_column.AddAttribute (file_name_cell, "text", 0);

            file_close_cell = new CellRendererPixbuf ();
            file_name_column.PackStart (file_close_cell, false);
            file_name_column.AddAttribute (file_close_cell, "pixbuf", 1);

            tree.AppendColumn (file_name_column);

            store = new ListStore (typeof (string), typeof (Gdk.Pixbuf));
            tree.Model = store;
            tree.ButtonPressEvent += HandleTreeButtonPressEvent;

            Add (tree);
            ShowAll ();

            PintaCore.Workspace.DocumentOpened += HandleDocumentOpenedOrClosed;
            PintaCore.Workspace.DocumentClosed += HandleDocumentOpenedOrClosed;
            PintaCore.Workspace.DocumentCreated += HandleDocumentOpenedOrClosed;
            PintaCore.Workspace.ActiveDocumentChanged += HandleActiveDocumentChanged;
        }
		public CounterSelectorDialog ()
		{
			this.Build ();
			
			HasSeparator = false;
			store = new TreeStore (typeof(bool), typeof(string), typeof(CounterCategory), typeof(Counter), typeof(bool));
			treeCounters.Model = store;
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRendererToggle crt = new CellRendererToggle ();
			col.PackStart (crt, false);
			col.AddAttribute (crt, "active", 0);
			col.AddAttribute (crt, "visible", 4);
			
			CellRendererText crx = new CellRendererText ();
			col.PackStart (crx, true);
			col.AddAttribute (crx, "text", 1);
			treeCounters.AppendColumn (col);
			
			foreach (CounterCategory cat in App.Service.GetCategories ())
				AppendCategory (TreeIter.Zero, cat);
			
			UpdateSelectedCounters ();
			treeCounters.ExpandAll ();
			
			crt.Toggled += CrtToggled;
		}
예제 #7
0
        public ProjectView ()
        {
            Build();
            basename = "base";

            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;
            treeview1.Selection.Mode = SelectionMode.Multiple;

            treeview1.ButtonPressEvent += OnTreeview1ButtonPressEvent;
            treeview1.KeyReleaseEvent += HandleKeyReleaseEvent;
            treeview1.ButtonReleaseEvent += OnTreeview1ButtonReleaseEvent;
            treeview1.CursorChanged += OnTreeview1CursorChanged;
        }
예제 #8
0
        public SharingConfigDialog ()
        {
            this.Build ();
            categoriesTreeView.Model = model;

            var complete_column = new TreeViewColumn ();

            var toggle_render = new CellRendererToggle ();
            toggle_render.Toggled += CellRendererToggle_Toggled;
            complete_column.PackStart (toggle_render, false);
            complete_column.SetCellDataFunc (toggle_render, new TreeCellDataFunc (ToggleDataFunc));

            var pix_render = new CellRendererPixbuf () { Mode = CellRendererMode.Inert };
            complete_column.PackStart (pix_render, false);
            complete_column.SetCellDataFunc (pix_render, new TreeCellDataFunc (IconDataFunc));

            var text_render = new CellRendererText () { Mode = CellRendererMode.Inert };
            complete_column.PackStart (text_render, true);
            complete_column.SetCellDataFunc (text_render, new TreeCellDataFunc (NameDataFunc));
    
            categoriesTreeView.AppendColumn (complete_column);

            empty_pixbuf.Fill(0xffffff00);

            Update ();

            LoadPreferences ();
        }
		public ContextActionPanelWidget (string mimeType)
		{
			this.mimeType = mimeType;
			this.Build ();
			
			var col = new TreeViewColumn ();
			
			var togRender = new CellRendererToggle ();
			togRender.Toggled += delegate(object o, ToggledArgs args) {
				TreeIter iter;
				if (!treeStore.GetIterFromString (out iter, args.Path)) 
					return;
				bool enabled = (bool)treeStore.GetValue (iter, 1);
				treeStore.SetValue (iter, 1, !enabled);
			};
			col.PackStart (togRender, false);
			col.AddAttribute (togRender, "active", 1);
			
			var textRender = new CellRendererText ();
			col.PackStart (textRender, true);
			col.AddAttribute (textRender, "text", 0);
			
			treeviewContextActions.AppendColumn (col);
			treeviewContextActions.HeadersVisible = false;
			treeviewContextActions.Model = treeStore;
			
			FillTreeStore ();
			treeviewContextActions.Selection.Changed += HandleTreeviewContextActionsSelectionChanged;
		}
예제 #10
0
        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;
        }
예제 #11
0
		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 (object obj in GetValidMembers ()) {
				var member = obj as IEntity;
				if (member != null) {
					Store.AppendValues (false, ImageService.GetPixbuf (member.GetStockIcon (), IconSize.Menu), ambience.GetString (member, OutputFlags.ClassBrowserEntries), member);
					continue;
				}
				
				var variable = obj as IVariable;
				if (variable != null)
					Store.AppendValues (false, ImageService.GetPixbuf (variable.GetStockIcon (), IconSize.Menu), variable.Name, variable);
				
			}
			
			treeView.Model = store;
		}
		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 == MonoDevelop.Projects.Dom.MemberType.Parameter ? OutputFlags.IncludeParameterName : OutputFlags.ClassBrowserEntries), member);
			}
			
			treeView.Model = store;
		}
		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;
		}
예제 #14
0
        public PeopleTreeView()
        {
            Selection.Mode = SelectionMode.Single;
            HeadersVisible = false;

            peopleTreeStore = new TreeStore(typeof(uint),typeof(string),typeof(Tag));
            this.Model = peopleTreeStore;

            TagStore.ItemsAdded += TagStoreItemsAdded;
            TagStore.ItemsChanged += TagStoreItemsChanged;
            TagStore.ItemsRemoved += TagStoreItemsRemoved;

            complete_column = new TreeViewColumn();

            pix_render = new CellRendererPixbuf();
            complete_column.PackStart(pix_render,false);
            complete_column.SetCellDataFunc(pix_render, new TreeCellDataFunc(IconDataFunc));

            text_render = new CellRendererText();
            complete_column.PackStart( text_render, true);
            complete_column.SetCellDataFunc( text_render, new TreeCellDataFunc( NameDataFunc));

            AppendColumn(complete_column);

            RefreshPeopleTreeStore ();

            //TODO If have time - add people search.
        }
        public GacReferencePanel(SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

            store = new TreeStore (typeof (string), typeof (string), typeof(string), typeof(bool), typeof(string));
            treeView = new TreeView (store);

            TreeViewColumn firstColumn = new TreeViewColumn ();
            firstColumn.Title = GettextCatalog.GetString ("Reference Name");
            CellRendererToggle tog_render = new CellRendererToggle ();
            tog_render.Toggled += new Gtk.ToggledHandler (AddReference);
            firstColumn.PackStart (tog_render, false);
            firstColumn.AddAttribute (tog_render, "active", 3);

            CellRendererText text_render = new CellRendererText ();
            firstColumn.PackStart (text_render, true);
            firstColumn.AddAttribute (text_render, "text", 0);

            treeView.AppendColumn (firstColumn);
            treeView.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "text", 1);
            // FIXME: this seems useless
            //treeView.AppendColumn (GettextCatalog.GetString ("Path"), new CellRendererText (), "text", 2);

            store.SetSortColumnId (0, SortType.Ascending);
            store.SetSortFunc (0, new TreeIterCompareFunc (SortTree));

            PrintCache();
            ScrolledWindow sc = new ScrolledWindow ();
            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add (treeView);
            this.PackStart (sc, true, true, 0);
            ShowAll ();
            BorderWidth = 6;
        }
예제 #16
0
		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);
		}
		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;
		}
예제 #18
0
파일: MainWindow.cs 프로젝트: Netring/ILSpy
		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.scrolledwindow1.Child = editor;
			this.scrolledwindow1.Child.ShowAll ();
			this.editor.Document.MimeType = "text/x-csharp";
			this.editor.Options.FontName = "Mono 14";
			this.editor.Caret.PositionChanged += HandlePositionChanged;
			string path = System.IO.Path.Combine (System.IO.Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "CSharpDemo.cs");
			this.editor.Text = File.ReadAllText (path);
			buttonParse.Clicked += HandleClicked;
			buttonGenerate.Clicked += CSharpGenerateCodeButtonClick;
			HandleClicked (this, EventArgs.Empty);
		}
		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;
		}
		public SelectRenamedClassDialog (IEnumerable<IType> classes)
		{
			XML glade = new XML (null, "gui.glade", "SelectRenamedClassDialog", null);
			glade.Autoconnect (this);
			
			store = new ListStore (typeof(Pixbuf), typeof(string));
			treeClasses.Model = store;
			
			TreeViewColumn column = new TreeViewColumn ();
		
			var pr = new CellRendererPixbuf ();
			column.PackStart (pr, false);
			column.AddAttribute (pr, "pixbuf", 0);
			
			CellRendererText crt = new CellRendererText ();
			column.PackStart (crt, true);
			column.AddAttribute (crt, "text", 1);
			
			treeClasses.AppendColumn (column);
			
			foreach (IType cls in classes) {
				Pixbuf pic = ImageService.GetPixbuf (cls.StockIcon);
				store.AppendValues (pic, cls.FullName);
			}
		}
예제 #21
0
        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++;
            }
        }
		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 MergeDialog(MercurialRepository 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");
            }

            checkStage.Active = true;

            Fill ();
        }
예제 #24
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 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 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 ());
			}
		}
예제 #27
0
		public TableMappingWidget (bool showCheckBoxes)
		{
			store = new ListStore (typeof (bool), typeof (TableContainer));
			list = new TreeView (store);
			
			TreeViewColumn colName = new TreeViewColumn ();
			colName.Title = AddinCatalog.GetString ("Name");

			CellRendererToggle toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Activatable = true;
			toggleRenderer.Toggled += new ToggledHandler (SelectToggled);
			colName.PackStart (toggleRenderer, false);
			CellRendererText nameRenderer = new CellRendererText ();
			colName.PackStart (nameRenderer, true);

			TreeViewColumn colClassName = new TreeViewColumn ();
			colClassName.Title = AddinCatalog.GetString ("Class Name");
			CellRendererText propNameRenderer = new CellRendererText ();
			propNameRenderer.Editable = true;
			propNameRenderer.Edited += new EditedHandler (ClassNameEdited);
			colClassName.PackStart (propNameRenderer, true);
			
			colName.SetCellDataFunc (nameRenderer, new CellLayoutDataFunc (NameDataFunc));
			colClassName.SetCellDataFunc (propNameRenderer, new CellLayoutDataFunc (ClassNameDataFunc));

			list.AppendColumn (colName);
			list.AppendColumn (colClassName);
			list.HeadersVisible = true;
			
			this.Add (list);
		}
예제 #28
0
		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;
		}
        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);
        }
예제 #30
0
		public BacktracesView ()
		{
			window = new ScrolledWindow ();
			tree = new TreeView ();
			tree.RulesHint = true;
			
			//                               icon            type            count            #bytes         avg size         avg age
			store = new TreeStore (typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (object));
			tree.Model = store;

			CellRendererPixbuf pixbufRenderer = new CellRendererPixbuf ();
			CellRendererText typeRenderer = new CellRendererText ();
			CellRendererText countRenderer = new CellRendererText ();
			CellRendererText totalSizeRenderer = new CellRendererText ();
			CellRendererText avgSizeRenderer = new CellRendererText ();
			CellRendererText avgAgeRenderer = new CellRendererText ();
			
			TreeViewColumn columnType = new TreeViewColumn ();
			TreeViewColumn columnCount = new TreeViewColumn ();
			TreeViewColumn columnTotalSize = new TreeViewColumn ();
			TreeViewColumn columnAvgSize = new TreeViewColumn ();
			TreeViewColumn columnAvgAge = new TreeViewColumn ();
			
			columnType.Title = GettextCatalog.GetString ("Type");
			columnCount.Title = GettextCatalog.GetString ("Count");
			columnTotalSize.Title = GettextCatalog.GetString ("Total Size");
			columnAvgSize.Title = GettextCatalog.GetString ("Avg Size");
			columnAvgAge.Title = GettextCatalog.GetString ("Avg Age");
			
			columnType.PackStart (pixbufRenderer, false);
			columnType.PackStart (typeRenderer, true);
			columnCount.PackStart (countRenderer, true);
			columnTotalSize.PackStart (totalSizeRenderer, true);
			columnAvgSize.PackStart (avgSizeRenderer, true);
			columnAvgAge.PackStart (avgAgeRenderer, true);
			
			columnType.AddAttribute (pixbufRenderer, "stock-id", 0);
			columnType.AddAttribute (typeRenderer, "text", 1);
			columnCount.AddAttribute (countRenderer, "text", 2);
			columnTotalSize.AddAttribute (totalSizeRenderer, "text", 3);
			columnAvgSize.AddAttribute (avgSizeRenderer, "text", 4);
			columnAvgAge.AddAttribute (avgAgeRenderer, "text", 5);
			
			tree.AppendColumn (columnType);
			tree.AppendColumn (columnCount);
			tree.AppendColumn (columnTotalSize);
			tree.AppendColumn (columnAvgSize);
			tree.AppendColumn (columnAvgAge);
			
			int nc = 0;
			foreach (TreeViewColumn c in tree.Columns) {
				store.SetSortFunc (nc, CompareNodes);
				c.SortColumnId = nc++;
			}
			store.SetSortColumnId (1, SortType.Descending);
			
			window.Add (tree);
			window.ShowAll ();
		}
        void PopulateTree()
        {
            Gtk.ListStore subjectListStore = new Gtk.ListStore(typeof(bool), typeof(string));
            treeview.Model = subjectListStore;

            Gtk.TreeViewColumn includeColumn = new Gtk.TreeViewColumn();
            Gtk.TreeViewColumn subjectColumn = new Gtk.TreeViewColumn();
            includeColumn.Title = "Include";
            subjectColumn.Title = "Subject";
            treeview.AppendColumn(includeColumn);
            treeview.AppendColumn(subjectColumn);

            for (int i = 0; i < categories.Count; i++)
            {
                var t = new Gtk.ToggleButton(i.ToString());
                subjectListStore.AppendValues(t, categories[i].ToString());
            }

            Gtk.CellRendererToggle toggleCell = new Gtk.CellRendererToggle();
            Gtk.CellRendererText   textCell   = new Gtk.CellRendererText();

            includeColumn.PackStart(toggleCell, true);
            subjectColumn.PackStart(textCell, true);

            includeColumn.AddAttribute(toggleCell, "active", 0);
            subjectColumn.AddAttribute(textCell, "text", 1);

            toggleCell.Active   = true;
            toggleCell.Toggled += ToggleHandler;

            SetAllToTrue();
        }
예제 #32
0
    public ImageInfoTreeView()
        : base()
    {
        Gtk.TreeViewColumn   NameCol      = new Gtk.TreeViewColumn();
        Gtk.CellRendererText NameRenderer = new Gtk.CellRendererText();
        NameRenderer.Background = "#eeeeee";
        NameCol.Title           = "Name";
        NameCol.Resizable       = true;
        NameCol.FixedWidth      = 200;
        NameCol.PackStart(NameRenderer, true);
        NameCol.AddAttribute(NameRenderer, "markup", 0);
        this.AppendColumn(NameCol);

        Gtk.TreeViewColumn   ValueCol      = new Gtk.TreeViewColumn();
        Gtk.CellRendererText ValueRenderer = new Gtk.CellRendererText();
        ValueCol.Title     = "Value";
        ValueCol.Resizable = true;
        ValueCol.PackStart(ValueRenderer, false);
        ValueCol.AddAttribute(ValueRenderer, "text", 1);
        this.AppendColumn(ValueCol);

        store          = new ImageInfoTreeStore();
        store.TreeView = this;          // so that we can get expanded when new data is written

        this.Model          = store;
        this.Selection.Mode = Gtk.SelectionMode.None;
    }
예제 #33
0
        public void PrepareTreeView()
        {
            // Create a column for the artist name
            Gtk.TreeViewColumn dbName = new Gtk.TreeViewColumn();
            dbName.Title = "Database Name";

            // Create a column for the song title
            Gtk.TreeViewColumn dbLocation = new Gtk.TreeViewColumn();
            dbLocation.Title = "Location";

            // Add the columns to the TreeView
            recentDbList.AppendColumn(dbName);
            recentDbList.AppendColumn(dbLocation);

            // Create the text cell that will display the artist name
            Gtk.CellRendererText artistNameCell = new Gtk.CellRendererText();

            // Add the cell to the column
            dbName.PackStart(artistNameCell, true);

            // Do the same for the song title column
            Gtk.CellRendererText songTitleCell = new Gtk.CellRendererText();
            dbLocation.PackStart(songTitleCell, true);

            // Tell the Cell Renderers which items in the model to display
            dbName.AddAttribute(artistNameCell, "text", 0);
            dbLocation.AddAttribute(songTitleCell, "text", 1);
        }
예제 #34
0
        private TreeView TreeView()
        {
            IPathedDocument padDoc = IdeApp.Workbench.ActiveDocument.GetContent <IPathedDocument>();

            Gtk.TreeView tree = new Gtk.TreeView();

            Gtk.TreeViewColumn objectColumn = new Gtk.TreeViewColumn();
            objectColumn.Title = "object";
            Gtk.TreeViewColumn metrixColumn = new Gtk.TreeViewColumn();
            metrixColumn.Title = "metrix";

            // Add the columns to the TreeView
            tree.AppendColumn(objectColumn);
            tree.AppendColumn(metrixColumn);

            Gtk.ListStore listStore = new Gtk.ListStore(typeof(string), typeof(string));
            foreach (var item in padDoc.CurrentPath)
            {
                listStore.AppendValues(item.Markup, "0");
            }

            tree.Model = listStore;
            Gtk.CellRendererText artistNameCell = new Gtk.CellRendererText();
            objectColumn.PackStart(artistNameCell, true);
            Gtk.CellRendererText songTitleCell = new Gtk.CellRendererText();
            metrixColumn.PackStart(songTitleCell, true);
            objectColumn.AddAttribute(artistNameCell, "text", 0);
            metrixColumn.AddAttribute(songTitleCell, "text", 1);
            return(tree);
        }
예제 #35
0
        private void BuildTableColumns(List <String> columns)
        {
            foreach (TreeViewColumn col in treeview1.Columns)
            {
                treeview1.RemoveColumn(col);
            }

            // columns
            // Create a column for the artist name
            for (int i = 0; i < columns.Count; i++)
            {
                Gtk.TreeViewColumn artistColumn = new Gtk.TreeViewColumn();
                artistColumn.Title = columns [i];

                // Create the text cell that will display the artist name
                Gtk.CellRendererText artistNameCell = new Gtk.CellRendererText();

                // Add the cell to the column
                artistColumn.PackStart(artistNameCell, true);

                // Create a column for the song title
                treeview1.AppendColumn(artistColumn);

                artistColumn.AddAttribute(artistNameCell, "text", i);
            }
        }
예제 #36
0
        public void PrepareTreeView()
        {
            // Create a column
            Gtk.TreeViewColumn acName = new Gtk.TreeViewColumn();
            acName.Title  = "Account";
            acName.Expand = true;

            // Create a column
            Gtk.TreeViewColumn acBalance = new Gtk.TreeViewColumn();
            acBalance.Title = "Balance";

            accountList.AppendColumn(acName);
            accountList.AppendColumn(acBalance);

            // Create the text cell that will display the artist name
            CellRendererText acNameCell = new CellRendererText();

            acName.PackStart(acNameCell, true);

            // Do the same for the song title column
            CellRendererText acBalanceCell = new CellRendererText();

            acBalance.PackStart(acBalanceCell, true);

            // Tell the Cell Renderers which items in the model to display
            acName.AddAttribute(acNameCell, "text", 0);
            acBalance.AddAttribute(acBalanceCell, "text", 1);
        }
예제 #37
0
    protected void OnEjecutarAction1Activated(object sender, EventArgs e)
    {
        erroresSintactico = "";
        iterator          = 0;
        if (listaTokens.Count <= 0)
        {
            return;
        }

        removeAllColumns(treeview1);

        nodo nodo = new nodo(); //Aqui se ejecuta el analizador SINTACTICO

        nodo = nodo.programa();

        textview6.Buffer.Text = erroresSintactico;


        Gtk.TreeViewColumn columna = new Gtk.TreeViewColumn();
        columna.Title = "Arbol";


        Gtk.CellRendererText celda = new Gtk.CellRendererText();
        columna.PackStart(celda, true);


        treeview1.AppendColumn(columna);
        columna.AddAttribute(celda, "text", 0);
        Gtk.TreeStore lista = new Gtk.TreeStore(typeof(string));
        verArbol(nodo, lista);
        treeview1.ExpandAll();  //Propiedad para expandir el arbol

        arbolCompilador = nodo; //Asignamos el arbol del analizador sintactico a nuestra variable estatica
    }
예제 #38
0
    public void initChat()
    {
        Gtk.TreeView chatTree = new Gtk.TreeView();
        messagesPanel.Add(chatTree);

        Gtk.TreeViewColumn userColumn = new Gtk.TreeViewColumn();
        userColumn.Title = "User";

        Gtk.CellRendererText userCell = new Gtk.CellRendererText();
        userColumn.PackStart(userCell, true);

        Gtk.TreeViewColumn messageColumn = new Gtk.TreeViewColumn();
        messageColumn.Title = "Message";

        Gtk.CellRendererText messageCell = new Gtk.CellRendererText();
        messageColumn.PackStart(messageCell, true);

        chatTree.AppendColumn(userColumn);
        chatTree.AppendColumn(messageColumn);

        userColumn.AddAttribute(userCell, "text", 0);
        messageColumn.AddAttribute(messageCell, "text", 1);

        messagesListStore = new Gtk.ListStore(typeof(string), typeof(string));

        //messageListStore.AppendValues ("Username", "Hello World");

        chatTree.Model = messagesListStore;
        messagesPanel.ShowAll();
    }
예제 #39
0
        /// <summary>
        /// Creates the components tree view.
        /// </summary>
        /// <returns>
        /// The components tree view.
        /// </returns>
        private Gtk.Widget CreateComponentsTreeView()
        {
            ScrolledWindow scroller = new ScrolledWindow();

            m_treeView = new Gtk.TreeView();
            m_treeView.HeadersVisible = false;

            //init model with two columns (label and hidden column for metadatadefinition)
            //note, that currently second column does not have renderer - it is there to allow quick lookup into
            //metadatadefinition (see HandleDragDataGet)
            //possibly custom renderer for metadatadefinition to pring out label would be nice
            //then one column would be enough.
            m_componentsListModel = new Gtk.ListStore(typeof(string), typeof(MetadataDefinition));
            m_treeView.Model      = m_componentsListModel;

            // Create a column for the component name
            Gtk.TreeViewColumn componentColumn = new Gtk.TreeViewColumn();
            m_treeView.AppendColumn(componentColumn);

            // Create the text cell that will display the artist name
            Gtk.CellRendererText componentNameCell = new Gtk.CellRendererText();

            // Add the cell to the column
            componentColumn.PackStart(componentNameCell, true);

            // Tell the Cell Renderers which items in the model to display
            componentColumn.AddAttribute(componentNameCell, "text", 0);

            scroller.Add(m_treeView);
            scroller.ShowAll();

            return(scroller);
        }
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();
        IPAddress[] a = Dns.GetHostEntry(Dns.GetHostName()).AddressList;

        // visualizing clients
        txtIp.Text = a[0].ToString();
        for (int i = 0; i < a.Length; i++)
        {
            log(string.Format("IpAddr[{0}]={1}", i, a[i]), null);
        }
        Gtk.TreeViewColumn tvColName = new Gtk.TreeViewColumn();
        tvColName.Title = "Address";
        tvConnections.AppendColumn(tvColName);
        tvConnections.Model = tvConnectionsModel;
        Gtk.CellRendererText adr = new Gtk.CellRendererText();
        tvColName.PackStart(adr, true);
        tvColName.AddAttribute(adr, "text", 0);

        // establishing the drink list
        tvDrinks.AppendColumn("Drink", new Gtk.CellRendererText(), "text", 0);
        tvDrinks.AppendColumn("Count", new Gtk.CellRendererText(), "text", 1);
        tvDrinks.AppendColumn("Price Min", new Gtk.CellRendererText(), "text", 2);
        tvDrinks.AppendColumn("Price Max", new Gtk.CellRendererText(), "text", 3);
        tvDrinks.AppendColumn("Price", new Gtk.CellRendererText(), "text", 4);

        tvDrinks.ShowAll();
        tvDrinks.NodeStore = DrinkStore;

        readDrinks();
    }
예제 #41
0
        void CreateTree()
        {
            _treeView = new Gtk.TreeView();
            _treeView.SetSizeRequest(500, 600);
            //name
            var nameColumn = new Gtk.TreeViewColumn();

            nameColumn.Title    = "Name";
            nameColumn.MaxWidth = 500;
            var nameCell = new Gtk.CellRendererText();

            nameColumn.PackStart(nameCell, true);

            _treeView.AppendColumn(nameColumn);

            nameColumn.AddAttribute(nameCell, "text", 0);

            _treeView.Selection.Mode     = Gtk.SelectionMode.Single;
            _treeView.Selection.Changed += _treeView_Selection_Changed;


            _treeView.KeyPressEvent      += HandleKeyPressEvent;
            _treeView.KeyReleaseEvent    += HandleKeyReleaseEvent;
            _treeView.ButtonReleaseEvent += (o, args) => {
                if (_selectedDocument != null)
                {
                    CloseWindow(true);
                }
            };
        }
예제 #42
0
    private void FillTreeviewKategori()
    {
        try
        {
            var lista = ListMaker.KategoriList;

            Gtk.TreeViewColumn kategoriColumn = new Gtk.TreeViewColumn();
            kategoriColumn.Title = "Kategorier:";
            Gtk.CellRendererText kategoriNameCell = new Gtk.CellRendererText();
            kategoriColumn.PackStart(kategoriNameCell, true);
            treeviewKategorier.AppendColumn(kategoriColumn);
            kategoriColumn.AddAttribute(kategoriNameCell, "text", 0);
            Gtk.ListStore kategoriListStore = new Gtk.ListStore(typeof(string));

            foreach (var k in lista)
            {
                kategoriListStore.AppendValues(k.Namn);
            }
            treeviewKategorier.Model = kategoriListStore;
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }
    }
예제 #43
0
    public CollectionsTreeView()
        : base()
    {
        Gtk.TreeViewColumn   NameCol      = new Gtk.TreeViewColumn();
        Gtk.CellRendererText NameRenderer = new Gtk.CellRendererText();
        NameRenderer.Editable = true;
        NameRenderer.Edited  += new Gtk.EditedHandler(CollectionNameEditedHandler);
        NameCol.Title         = "Name";
        NameCol.PackStart(NameRenderer, true);
        NameCol.AddAttribute(NameRenderer, "markup", 0);
        NameCol.SortColumnId = 0;
        NameCol.Resizable    = true;
        NameCol.FixedWidth   = 150;
        NameCol.Sizing       = Gtk.TreeViewColumnSizing.Autosize;
        this.AppendColumn(NameCol);

        Gtk.TreeViewColumn   CountCol      = new Gtk.TreeViewColumn();
        Gtk.CellRendererText CountRenderer = new Gtk.CellRendererText();
        CountCol.Title = "Images";
        CountCol.PackStart(CountRenderer, true);
        CountCol.AddAttribute(CountRenderer, "text", 1);
        CountCol.SortColumnId = 1;
        CountCol.Resizable    = true;
        CountCol.Sizing       = Gtk.TreeViewColumnSizing.Autosize;
        this.AppendColumn(CountCol);

        store      = new CollectionsTreeStore();
        this.Model = store;
    }
예제 #44
0
    private void PrepareUI()
    {
        this.msg_view = new Tny.Ui.GTK.MsgView();
        ((Gtk.Widget) this.msg_view).Show();
        this.msg_scrolledwindow.AddWithViewport((Gtk.Widget) this.msg_view);

        Gtk.TreeViewColumn   FolderColumn   = new Gtk.TreeViewColumn();
        Gtk.CellRendererText FolderNameCell = new Gtk.CellRendererText();
        FolderColumn.PackStart(FolderNameCell, true);
        FolderColumn.AddAttribute(FolderNameCell, "text", (int)Tny.Ui.GTK.FolderStoreTreeModelColumn.NameColumn);
        FolderColumn.Title = "Folder";
        this.folders_treeview.AppendColumn(FolderColumn);

        Gtk.TreeViewColumn   FromColumn   = new Gtk.TreeViewColumn();
        Gtk.CellRendererText FromNameCell = new Gtk.CellRendererText();
        FromColumn.PackStart(FromNameCell, true);
        FromColumn.AddAttribute(FromNameCell, "text", (int)Tny.Ui.GTK.HeaderListModelColumn.FromColumn);
        FromColumn.Title = "From";
        this.headers_treeview.AppendColumn(FromColumn);

        Gtk.TreeViewColumn   SubjectColumn   = new Gtk.TreeViewColumn();
        Gtk.CellRendererText SubjectNameCell = new Gtk.CellRendererText();
        SubjectColumn.PackStart(SubjectNameCell, true);
        SubjectColumn.AddAttribute(SubjectNameCell, "text", (int)Tny.Ui.GTK.HeaderListModelColumn.SubjectColumn);
        SubjectColumn.Title = "Subject";
        this.headers_treeview.AppendColumn(SubjectColumn);

        this.headers_treeview.Selection.Changed += OnMailSelected;
        this.folders_treeview.Selection.Changed += OnFolderChanged;
    }
예제 #45
0
        private void BuildCardTypeTable()
        {
            // columns
            // Create a column for the artist name
            //for (int i = 0; i < columns.Length; i++)
            {
                Gtk.TreeViewColumn artistColumn = new Gtk.TreeViewColumn();
                artistColumn.Title = "Card Type Name";

                // Create the text cell that will display the artist name
                Gtk.CellRendererText artistNameCell = new Gtk.CellRendererText();

                // Add the cell to the column
                artistColumn.PackStart(artistNameCell, true);

                // Create a column for the song title
                treeviewCardType.AppendColumn(artistColumn);

                artistColumn.AddAttribute(artistNameCell, "text", 0);
            }


            System.Type[] types = new System.Type[1];
            types [0] = typeof(String);

            treeviewCardType.Model = new Gtk.ListStore(types);

            RebuildCardTypeTable();
        }
예제 #46
0
        private void FonstSizesListViewPrepare()
        {
            //--------------------------------------------------------------
            List <int> fontsizes = this.FontSizes();

            // Create a column for the artist name
            Gtk.TreeViewColumn fontsize_column = new Gtk.TreeViewColumn();
            this.treeviewFontSizes.HeadersVisible = false;
            // fontsize_column.Title = "Fonts Size";
            this.treeviewFontSizes.AppendColumn(fontsize_column);
            // Create a model - 1 string - Font Name
            Gtk.ListStore fontsizes_list_store = new Gtk.ListStore(typeof(int));
            // Assign the model to the TreeView
            this.treeviewFontSizes.Model = fontsizes_list_store;
            foreach (int s in fontsizes)
            {
                fontsizes_list_store.AppendValues(s);
            }
            // Create the text cell that will display the font name
            Gtk.CellRendererText fontize_name_cell = new Gtk.CellRendererText();

            // Add the cell to the column
            fontsize_column.PackStart(fontize_name_cell, true);

            // Tell the Cell Renderers which items in the model to display
            fontsize_column.AddAttribute(fontize_name_cell, "text", 0);

            this.treeviewFontSizes.CursorChanged += treeViewFontSizes_SelectionChanged;
            //--------------------------------------------------------------

            return;
        }
예제 #47
0
        /// <summary>
        /// Init ListView widget.
        /// </summary>
        private void InitListView(ref ListStore lStore,
                                  ref TreeView tvObject,
                                  string[] tvColumns)
        {
            TreeViewColumn   tvColumn = null;
            CellRendererText tvCell   = null;

            tvObject.Selection.Mode = SelectionMode.Multiple;
            System.Type[] lsParam = new System.Type[tvColumns.Length];

            // Add Columns to TreeView
            for (int j = 0; j < tvColumns.Length; j++)
            {
                tvColumn           = new Gtk.TreeViewColumn();
                tvColumn.MinWidth  = 150;
                tvColumn.Title     = tvColumns[j];
                tvColumn.Resizable = true;

                tvCell = new Gtk.CellRendererText();
                tvColumn.PackStart(tvCell, true);
                tvColumn.AddAttribute(tvCell, "text", j);

                tvObject.RulesHint = true;
                tvObject.AppendColumn(tvColumn);
                lsParam[j] = typeof(string);
            }


            lStore         = new Gtk.ListStore(lsParam);
            tvObject.Model = lStore;
            tvObject.ShowAll();
        }
예제 #48
0
        public PlayListTreeView()
        {
            this.HeadersVisible = false;

            ls         = new ListStore(typeof(PlayListPlay));
            this.Model = ls;

            menu = new Menu();
            MenuItem title = new MenuItem(Catalog.GetString("Edit Title"));

            title.Activated += new EventHandler(OnTitle);
            title.Show();
            MenuItem delete = new MenuItem(Catalog.GetString("Delete"));

            delete.Activated += new EventHandler(OnDelete);
            delete.Show();
            menu.Append(title);
            menu.Append(delete);


            Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn();
            nameColumn.Title = Catalog.GetString("Name");
            Gtk.CellRendererText nameCell = new Gtk.CellRendererText();
            nameColumn.PackStart(nameCell, true);
            nameColumn.SetCellDataFunc(nameCell, new Gtk.TreeCellDataFunc(RenderName));
            this.AppendColumn(nameColumn);
        }
예제 #49
0
    protected void prepareHeaders(string [] columnsString)
    {
        treeview.HeadersVisible = true;
        int  i       = 0;
        bool visible = false;

        foreach (string myCol in columnsString)
        {
            if (i < 2)
            {
                UtilGtk.CreateCols(treeview, store, Catalog.GetString(myCol), i++, visible);
            }
            else
            {
                //do it here to use a custom colored Renderer
                Gtk.TreeViewColumn aColumn = new Gtk.TreeViewColumn();
                CellRendererText   aCell   = new CellRendererText();
                aColumn.Title = Catalog.GetString(myCol);
                aColumn.PackStart(aCell, true);
                aColumn.SetCellDataFunc(aCell, new Gtk.TreeCellDataFunc(RenderRestTime));

                aColumn.SortColumnId  = i;
                aColumn.SortIndicator = true;
                aColumn.Visible       = visible;
                treeview.AppendColumn(aColumn);
            }

            if (i == 1)
            {
                store.SetSortFunc(0, UtilGtk.IdColumnCompare);
            }

            visible = true;
        }
    }
예제 #50
0
        public DPAPPageWidget()
        {
            Console.WriteLine("DPAP Page widget ctor!");
            tree = new TreeView();
            Add(tree);
            TreeViewColumn albumColumn = new Gtk.TreeViewColumn();

            //albumColumn.Title = "album";

            Gtk.CellRendererText albumNameCell = new Gtk.CellRendererText();
            albumNameCell.Visible = true;
            albumColumn.PackStart(albumNameCell, false);
            tree.AppendColumn(albumColumn);

            list       = new TreeStore(typeof(string));
            tree.Model = list;

            albumColumn.AddAttribute(albumNameCell, "text", 0);

            tree.Selection.Changed += OnSelectionChanged;
            sd          = new DPAP.ServiceDiscovery();
            sd.Found   += OnServiceFound;
            sd.Removed += OnServiceRemoved;
            sd.Start();
        }
예제 #51
0
    private void PopulateTreeView()
    {
        Gtk.TreeViewColumn idColumn = new Gtk.TreeViewColumn();
        idColumn.Title = Mono.Unix.Catalog.GetString("Id");
        Gtk.CellRendererText idCell = new Gtk.CellRendererText();
        idColumn.PackStart(idCell, true);

        Gtk.TreeViewColumn dateColumn = new Gtk.TreeViewColumn();
        dateColumn.Title = Mono.Unix.Catalog.GetString("Date");
        Gtk.CellRendererText dateCell = new Gtk.CellRendererText();
        dateColumn.PackStart(dateCell, true);

        Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn();
        nameColumn.Title = Mono.Unix.Catalog.GetString("Name");
        Gtk.CellRendererText nameCell = new Gtk.CellRendererText();
        nameColumn.PackStart(nameCell, true);

        DocumentTreeView.AppendColumn(idColumn);
        DocumentTreeView.AppendColumn(dateColumn);
        DocumentTreeView.AppendColumn(nameColumn);

        idColumn.AddAttribute(idCell, "text", 0);
        dateColumn.AddAttribute(dateCell, "text", 1);
        nameColumn.AddAttribute(nameCell, "text", 2);
    }
예제 #52
0
    private void FillTreeviewAvsnitt()
    {
        try
        {
            ListMaker.UpdateAvsnitt();
            var podcast     = gtkPodcast;
            var podcastList = ListMaker.PodcastList;

            Gtk.TreeViewColumn avsnittColumn = new Gtk.TreeViewColumn();
            avsnittColumn.Title = "Avsnitt:";
            Gtk.CellRendererText avsnittNameCell = new Gtk.CellRendererText();
            avsnittColumn.PackStart(avsnittNameCell, true);
            treeviewAvsnitt.AppendColumn(avsnittColumn);
            avsnittColumn.AddAttribute(avsnittNameCell, "text", 0);
            Gtk.ListStore avsnittListStore = new Gtk.ListStore(typeof(string));

            foreach (Podcast p in podcastList)
            {
                if (podcast.Equals(p.Namn))
                {
                    var avsnittsList = p.AvsnittsLista;

                    foreach (Avsnitt a in avsnittsList)
                    {
                        avsnittListStore.AppendValues(a.Namn);
                    }
                }
            }
            treeviewAvsnitt.Model = avsnittListStore;
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }
    }
예제 #53
0
        /// <summary>
        /// Experimental function
        /// </summary>
        /// <returns>
        /// The combo column.
        /// </returns>
        /// <param name='name'>
        /// Name.
        /// </param>
        /// <param name='editable'>
        /// Editable.
        /// </param>
        public Gtk.TreeViewColumn AppendComboColumn(string name, EditedHandler EditedHandler, bool editable, string[] comboValues)
        {
            var listStore = new Gtk.ListStore(typeof(string));

            foreach (var value in comboValues)
            {
                listStore.AppendValues(value);
            }

            var cellRenderer = new Gtk.CellRendererCombo();

            cellRenderer.Editable            = editable;
            cellRenderer.TextColumn          = 0;
            cellRenderer.HasEntry            = false;
            cellRenderer.Model               = listStore;
            cellRenderer.Data["colPosition"] = Columns.Count;
            if (EditedHandler != null)
            {
                cellRenderer.Edited += EditedHandler;
            }

            var newColumn = new Gtk.TreeViewColumn();

            newColumn.Title = name;

            newColumn.PackStart(cellRenderer, true);
            Columns.Add(newColumn);

            newColumn.Data["cellRenderer"] = cellRenderer;
            newColumn.Data["cellType"]     = "text";
            newColumn.Data["cellTypeOf"]   = typeof(string);

            return(newColumn);
        }
예제 #54
0
        public Gtk.TreeViewColumn AppendStringColumn(string name, EditedHandler EditedHandler, bool editable = false)
        {
            var newColumn = new Gtk.TreeViewColumn();

            newColumn.Title = name;

            var cellRenderer = new Gtk.CellRendererText();

            cellRenderer.Editable = editable;
            cellRenderer.Data.Add("colName", name);
            cellRenderer.Data.Add("colPosition", Columns.Count);

            if (EditedHandler != null)
            {
                cellRenderer.Edited += EditedHandler;
            }

            newColumn.PackStart(cellRenderer, true);

            Columns.Add(newColumn);

            newColumn.Data["cellRenderer"] = cellRenderer;
            newColumn.Data["cellType"]     = "text";
            newColumn.Data["cellTypeOf"]   = typeof(string);

            return(newColumn);
        }
예제 #55
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        Gtk.TreeViewColumn romFileColumn = new Gtk.TreeViewColumn();
        romFileColumn.Title = "File";
        Gtk.CellRendererText romFileCell = new Gtk.CellRendererText();
        romFileColumn.PackStart(romFileCell, true);

        Gtk.TreeViewColumn romTitleColumn = new Gtk.TreeViewColumn();
        romTitleColumn.Title = "Title";
        Gtk.CellRendererText romTitleCell = new Gtk.CellRendererText();
        romTitleColumn.PackStart(romTitleCell, true);

        romFileColumn.AddAttribute(romFileCell, "text", 0);
        romTitleColumn.AddAttribute(romTitleCell, "text", 1);

        // Add the columns to the TreeView
        tvRoms.AppendColumn(romFileColumn);
        tvRoms.AppendColumn(romTitleColumn);
        // Assign the model to the TreeView
        tvRoms.Model = romsListStore;

        LoadConfig();
        LoadRomsList();
    }
예제 #56
0
        public ReferenceTreeViewer()
        {
            Build();
            store                     = new Gtk.TreeStore(typeof(object), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
            treeview.Model            = store;
            treeview.HeadersClickable = true;

            Gtk.TreeViewColumn complete_column = new Gtk.TreeViewColumn();
            complete_column.Title     = "Type";
            complete_column.Resizable = true;

            Gtk.CellRendererPixbuf pix_render = new Gtk.CellRendererPixbuf();
            complete_column.PackStart(pix_render, false);
            complete_column.AddAttribute(pix_render, "stock-id", ImageCol);

            Gtk.CellRendererText text_render = new Gtk.CellRendererText();
            complete_column.PackStart(text_render, true);

            complete_column.AddAttribute(text_render, "text", TypeCol);
            complete_column.Clickable = true;

            treeview.AppendColumn(complete_column);

            AddColumn("Instances", InstancesCol, "Number of instances of a type. Only instances that contain references are included.");
            TreeColRefs = treeview.Columns.Length;
            AddColumn("References", RefsCol, "Number of references to the parent type.");
            AddColumn("Root Refs", RootRefsCol, "Number of indirect references to instances of the tree root type.");
            AddColumn("Root Mem", RootMemCol, "Amount of memory of the root instances indirectly referenced.");
            AddColumn("Memory Size", SizeCol, "Memory allocated by instances of the type.");
            AddColumn("Avg. Size", AvgSizeCol, "Average size of the instances.");

            treeview.TestExpandRow += new Gtk.TestExpandRowHandler(OnTestExpandRow);
            treeview.RowActivated  += new Gtk.RowActivatedHandler(OnNodeActivated);
//			treeview.AppendColumn (new Gtk.TreeViewColumn());

            int nc = 0;

            foreach (TreeViewColumn c in treeview.Columns)
            {
                store.SetSortFunc(nc, CompareNodes);
                c.SortColumnId = nc++;
            }
            store.SetSortColumnId(1, Gtk.SortType.Descending);
            treeview.RulesHint = true;
            tips.Enable();
        }
예제 #57
0
        public DevicesSettingsWindow(MainWindow parent) :
            base(Gtk.WindowType.Toplevel)
        {
            this.Build();
            this.Main = parent;


            deviceColumn       = new Gtk.TreeViewColumn();
            deviceColumn.Title = "Device Name";

            ipColumn       = new Gtk.TreeViewColumn();
            ipColumn.Title = "URI";

            statusColumn       = new Gtk.TreeViewColumn();
            statusColumn.Title = "Driver";

            deviceListsBox.AppendColumn(deviceColumn);
            deviceListsBox.AppendColumn(ipColumn);
            deviceListsBox.AppendColumn(statusColumn);

            devicelistStore      = new Gtk.ListStore(typeof(string), typeof(string), typeof(string), typeof(IDevice));
            deviceListsBox.Model = devicelistStore;

            Gtk.CellRendererText nameCell = new Gtk.CellRendererText();
            deviceColumn.PackStart(nameCell, true);

            Gtk.CellRendererText uriCell = new Gtk.CellRendererText();
            ipColumn.PackStart(uriCell, true);

            Gtk.CellRendererText statusCell = new Gtk.CellRendererText();
            statusColumn.PackStart(statusCell, true);

            deviceColumn.AddAttribute(nameCell, "text", 0);
            ipColumn.AddAttribute(uriCell, "text", 1);
            statusColumn.AddAttribute(statusCell, "text", 2);

            //Driver combo box


            driverlistStore = new Gtk.ListStore(typeof(string), typeof(ICameraDriver));
            CellRendererText ct = new CellRendererText();

            driverListBox.PackStart(ct, false);
            driverListBox.AddAttribute(ct, "text", 0);
            driverListBox.Model = driverlistStore;



            //Autodiscover combo box


            hardwarelistStore = new Gtk.ListStore(typeof(string), typeof(string));
            CellRendererText ct1 = new CellRendererText();

            hardwareListBox.PackStart(ct1, false);
            hardwareListBox.AddAttribute(ct1, "text", 0);
            hardwareListBox.Model = hardwarelistStore;
        }
예제 #58
0
        public MovieListGui()
        {
            this.Build();
            store = new TreeStore(typeof(object));

            treeview.Model          = store;
            treeview.Selection.Mode = SelectionMode.Multiple;
            treeview.BorderWidth    = 0;
            treeview.RowActivated  += HandleTreeviewRowActivated;

            string[] titles = new string[] { "Title", "Year", "Set", "Rating", "Filename" };
            for (int i = 0; i < titles.Length; i++)
            {
                if (i == 0)
                {
                    TreeViewColumn       col  = new Gtk.TreeViewColumn();
                    TreeItemCellRenderer cell = new TreeItemCellRenderer();
                    col.PackStart(cell, true);
                    col.SortColumnId  = i;
                    col.Title         = titles[i];
                    col.MinWidth      = 300;
                    col.MaxWidth      = 400;
                    col.SortIndicator = false;
                    col.SetCellDataFunc(cell, new Gtk.TreeCellDataFunc(RenderTreeCell));
                    treeview.AppendColumn(col);
                }
                else if (i == 3)
                {
                    TreeViewColumn     col  = new TreeViewColumn();
                    CellRendererPixbuf cell = new CellRendererPixbuf();
                    col.PackStart(cell, true);
                    col.SortColumnId  = i;
                    col.Title         = titles[i];
                    col.SortIndicator = false;
                    col.SetCellDataFunc(cell, new TreeCellDataFunc(RenderTreeCell));
                    treeview.AppendColumn(col);
                }
                else
                {
                    TreeViewColumn   col  = new Gtk.TreeViewColumn();
                    CellRendererText cell = new Gtk.CellRendererText();
                    col.PackStart(cell, true);
                    col.SortColumnId  = i;
                    col.SortIndicator = false;
                    if (i == 1)
                    {
                        col.MinWidth = 80;
                    }
                    else if (i == 2)
                    {
                        col.MinWidth = 200;
                    }
                    col.Title = titles[i];
                    col.SetCellDataFunc(cell, new Gtk.TreeCellDataFunc(RenderTreeCell));
                    treeview.AppendColumn(col);
                }
            }
        }
예제 #59
0
        public TvShowGui()
        {
            this.Build();

            store                = new TreeStore(typeof(object));
            treeview.Model       = store;
            treeview.BorderWidth = 0;

            string[] titles = new string[] { "Episodes", "Title", "Rating", "Filename" };
            for (int i = 0; i < titles.Length; i++)
            {
                if (i == 0)
                {
                    TreeViewColumn       col  = new Gtk.TreeViewColumn();
                    TreeItemCellRenderer cell = new TreeItemCellRenderer();
                    col.PackStart(cell, true);
                    col.SortColumnId = i;
                    col.Title        = titles[i];
                    col.MinWidth     = 85;
                    col.MaxWidth     = 85;
                    col.SetCellDataFunc(cell, new Gtk.TreeCellDataFunc(RenderTreeCell));
                    treeview.AppendColumn(col);
                }
                else if (i == 2)
                {
                    TreeViewColumn     col  = new TreeViewColumn();
                    CellRendererPixbuf cell = new CellRendererPixbuf();
                    col.PackStart(cell, true);
                    col.SortColumnId = i;
                    col.Title        = titles[i];
                    col.SetCellDataFunc(cell, new TreeCellDataFunc(RenderTreeCell));
                    treeview.AppendColumn(col);
                }
                else
                {
                    TreeViewColumn   col  = new Gtk.TreeViewColumn();
                    CellRendererText cell = new Gtk.CellRendererText();
                    col.PackStart(cell, true);
                    col.SortColumnId = i;

                    /*
                     * if(i == 1)
                     *      col.MinWidth = 80;
                     * else if(i == 2)
                     *      col.MinWidth = 200;
                     */
                    col.Title = titles[i];
                    col.SetCellDataFunc(cell, new Gtk.TreeCellDataFunc(RenderTreeCell));
                    treeview.AppendColumn(col);
                }
            }

            treeview.RowActivated += HandleNodeview1RowActivated;

            this.ExposeEvent += delegate(object o, ExposeEventArgs args) {
                //ExposeIt();
            };
        }
예제 #60
0
    private void FillTreeviewPodcast()
    {
        try
        {
            String clear = "";
            entryNamn.Text = clear;
            treeviewAvsnitt.RemoveColumn(treeviewAvsnitt.GetColumn(0));
            var lista = ListMaker.PodcastList;

            Gtk.TreeViewColumn avsnittColumn = new Gtk.TreeViewColumn();
            avsnittColumn.Title = "Avsnitt:";
            Gtk.TreeViewColumn namnColumn = new Gtk.TreeViewColumn();
            namnColumn.Title = "Namn:";
            Gtk.TreeViewColumn frekvensColumn = new Gtk.TreeViewColumn();
            frekvensColumn.Title = "Frekvens:";
            Gtk.TreeViewColumn kategoriColumn = new Gtk.TreeViewColumn();
            kategoriColumn.Title = "Kategori:";

            Gtk.CellRendererText avsnittNameCell = new Gtk.CellRendererText();
            avsnittColumn.PackStart(avsnittNameCell, true);
            Gtk.CellRendererText namnNameCell = new Gtk.CellRendererText();
            namnColumn.PackStart(namnNameCell, true);
            Gtk.CellRendererText frekvensNameCell = new Gtk.CellRendererText();
            frekvensColumn.PackStart(frekvensNameCell, true);
            Gtk.CellRendererText kategoriNameCell = new Gtk.CellRendererText();
            kategoriColumn.PackStart(kategoriNameCell, true);

            treeviewPodcast.AppendColumn(avsnittColumn);
            treeviewPodcast.AppendColumn(namnColumn);
            treeviewPodcast.AppendColumn(frekvensColumn);
            treeviewPodcast.AppendColumn(kategoriColumn);

            avsnittColumn.AddAttribute(avsnittNameCell, "text", 0);
            namnColumn.AddAttribute(namnNameCell, "text", 1);
            frekvensColumn.AddAttribute(frekvensNameCell, "text", 2);
            kategoriColumn.AddAttribute(kategoriNameCell, "text", 3);

            Gtk.ListStore podcastListStore = new ListStore(typeof(string), typeof(string), typeof(string), typeof(string));


            foreach (var p in lista)
            {
                var namn     = p.Namn;
                var frekvens = p.Frekvensen.ToString();
                var kategori = p.Kategorin.Namn;
                var avsnitt  = p.AvsnittsLista.Count.ToString();
                podcastListStore.AppendValues(avsnitt, namn, frekvens, kategori);
            }


            treeviewPodcast.Model = podcastListStore;
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }
    }