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;
        }
        public ErrorsSource(string name, Source source)
            : base(name, 50)
        {
            this.source = source;
            this.source.AddChildSource (this);

            scrolled_window = new ScrolledWindow();
            scrolled_window.ShadowType = ShadowType.In;
            scrolled_window.VscrollbarPolicy = PolicyType.Automatic;
            scrolled_window.HscrollbarPolicy = PolicyType.Automatic;

            view = new TreeView();

            scrolled_window.Add(view);
            scrolled_window.ShowAll();

            TreeViewColumn message_col = view.AppendColumn(Catalog.GetString("Message"),
                new CellRendererText(), "text", 0);
            TreeViewColumn file_col = view.AppendColumn(Catalog.GetString("File Name"),
                new CellRendererText(), "text", 1);

            message_col.Resizable = true;
            file_col.Resizable = true;

            store = new ListStore(typeof(string), typeof(string), typeof(Exception));
            view.Model = store;
        }
예제 #3
0
 public TreeIter GetIter(TreeView view, TreePath path)
 {
     TreeIter iter;
     if(!GetIter(out iter, path))
         throw new InvalidOperationException("Cesta ve stromu není platná");
     return iter;
 }
예제 #4
0
        public ContentDirectoryInfo (RemoteContentDirectory contentDirectory)
        {
            if (contentDirectory == null) {
                throw new ArgumentNullException ("contentDirectory");
            }

            this.content_directry = contentDirectory;
            this.store = new TreeStore (typeof (ObjectRow));
            var objects = new TreeView ();
            var column = new TreeViewColumn ();
            var cell = new CellRendererText ();
            column.PackStart (cell, true);
            column.SetCellDataFunc (cell, RenderObject);
            column.Title = "Objects";
            objects.AppendColumn (column);
            objects.Selection.Changed += HandleObjectsSelectionChanged;
            objects.RowExpanded += HandleObjectsRowExpanded;
            objects.Model = store;

            var root = contentDirectory.GetRootObject ();
            store.AppendValues (new ObjectRow (root));
            TreeIter iter;
            store.GetIterFirst (out iter);
            store.AppendValues (iter, loading);

            Add (objects);
        }
예제 #5
0
		public DemoMain ()
		{
			SetupDefaultIcon ();
		   	window = new Gtk.Window ("Gtk# Code Demos");
		   	window.SetDefaultSize (600, 400);
			window.DeleteEvent += new DeleteEventHandler (WindowDelete);

			HBox hbox = new HBox (false, 0);
			window.Add (hbox);

			treeView = CreateTree ();
			hbox.PackStart (treeView, false, false, 0);

			Notebook notebook = new Notebook ();
			hbox.PackStart (notebook, true, true, 0);

			notebook.AppendPage (CreateText (infoBuffer, false), new Label ("_Info"));
			TextTag heading = new TextTag ("heading");
			heading.Font = "Sans 18";
			infoBuffer.TagTable.Add (heading);

			notebook.AppendPage (CreateText (sourceBuffer, true), new Label ("_Source"));

			window.ShowAll ();
		}
예제 #6
0
        public MultiChooserDialog(IList options, IList banned)
        {
            base.Modal = true;
            base.HeightRequest = 400;
            base.WidthRequest = 250;
            //TODO: i18n
            base.Title = GettextCatalog.GetString ("Choose elements");
            base.AddButton(GettextCatalog.GetString ("_Cancel"), Gtk.ResponseType.Cancel);
            base.AddButton(GettextCatalog.GetString ("_Accept"), Gtk.ResponseType.Accept);
            base.Response += new Gtk.ResponseHandler(OnResponse);

            TreeView treeView = new TreeView();
            treeView.HeadersVisible = false;
            _store = new ListStore(typeof(bool), typeof(string));
            treeView.Model = _store;
            CellRendererToggle crtgl = new CellRendererToggle();
            crtgl.Activatable = true;
            crtgl.Toggled += new ToggledHandler(CheckboxToggledHandler);
            TreeViewColumn column = new TreeViewColumn ();
            column.PackStart(crtgl, false);
            column.AddAttribute(crtgl, "active", 0);
            treeView.AppendColumn(column);
            CellRendererText crtxt = new CellRendererText ();
            column = new TreeViewColumn ();
            column.PackStart(crtxt, false);
            column.AddAttribute(crtxt, "text", 1);
            treeView.AppendColumn(column);
            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            sw.ShadowType = Gtk.ShadowType.In;
            sw.Add(treeView);
            treeView.Show();
            base.VBox.Add(sw);
            ShowList(options, banned);
            sw.Show();
        }
예제 #7
0
		public DemoTreeStore () : base ("Card planning sheet")
		{
			VBox vbox = new VBox (false, 8);
			vbox.BorderWidth = 8;
			Add (vbox);

			vbox.PackStart (new Label ("Jonathan's Holiday Card Planning Sheet"),
					false, false, 0);

			ScrolledWindow sw = new ScrolledWindow ();
			sw.ShadowType = ShadowType.EtchedIn;
			sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
			vbox.PackStart (sw, true, true, 0);

			// create model
			CreateModel ();

			// create tree view
			TreeView treeView = new TreeView (store);
			treeView.RulesHint = true;
			treeView.Selection.Mode = SelectionMode.Multiple;
			AddColumns (treeView);

			sw.Add (treeView);

			// expand all rows after the treeview widget has been realized
			treeView.Realized += new EventHandler (ExpandRows);

			SetDefaultSize (650, 400);
			ShowAll ();
		}
예제 #8
0
		public EnvVarList()
		{
			list = new TreeView ();
			store = new ListStore (typeof(string), typeof(string), typeof(bool), typeof(string));
			list.Model = store;
			Add (list);
			
			CellRendererText crt = new CellRendererText ();
			crt.Editable = true;
			TreeViewColumn col = list.AppendColumn (GettextCatalog.GetString ("Variable"), crt, "text", 0, "foreground", 3);
			col.Resizable = true;
			
			CellRendererText crv = new CellRendererText ();
			col = list.AppendColumn (GettextCatalog.GetString ("Value"), crv, "text", 1, "editable", 2);
			col.Resizable = true;
			
			crt.Edited += OnExpEdited;
			crt.EditingStarted += OnExpEditing;
			crv.Edited += OnValEdited;
			
			createMsg = GettextCatalog.GetString ("Click here to add a new variable");
			AppendInserter ();
			
			ShowAll ();
		}
        public HelpTree()
            : base(GettextCatalog.GetString ("Help"), Gtk.Stock.Help)
        {
            tree_view = new TreeView ();

            tree_view.AppendColumn ("name_col", new CellRendererText (), "text", 0);
            tree_view.RowExpanded += new Gtk.RowExpandedHandler (RowExpanded);
            tree_view.Selection.Changed += new EventHandler (RowActivated);

            store = new TreeStore (typeof (string), typeof (Node));
            root_iter = store.AppendValues (GettextCatalog.GetString ("Mono Documentation"), Runtime.Documentation.HelpTree);

            PopulateNode (root_iter);

            tree_view.Model = store;
            tree_view.HeadersVisible = false;

            scroller = new ScrolledWindow ();
            scroller.ShadowType = Gtk.ShadowType.In;
            scroller.Add (tree_view);

            tree_view.ExpandRow (new TreePath ("0"), false);
            TreeIter child_iter;
            start:
            store.IterChildren (out child_iter, root_iter);
            do {
                if (!store.IterHasChild (child_iter)) {
                    store.Remove (ref child_iter);
                    goto start;
                }
            } while (store.IterNext (ref child_iter));

            Control.ShowAll ();
        }
예제 #10
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);
		}
		public SortFuncListViewDialog ()
		{
			Title = "Gtk Sort Func List View Box Dialog";
			WidthRequest = 500;
			HeightRequest = 400;

			var vbox = new HBox ();
			VBox.PackStart (vbox);

			listView = new TreeView ();
			listView.HeadersVisible = false;
			vbox.PackStart (listView);

			listStore = new ListStore (typeof(SortedListViewItem));
			listView.Model = listStore;

//			listStore.SetSortFunc (0,
//				(model, a, b) => string.Compare (GetItem (a).Id, GetItem (b).Id, StringComparison.Ordinal));
			listStore.SetSortFunc (0, SortListItems);

			listStore.SetSortColumnId (0, SortType.Ascending);

//			var textRenderer = new CellRendererText ();
//			listView.AppendColumn ("id", textRenderer,
//				(TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) => {
//					((CellRendererText)cell).Text = GetItem (iter).Id;
//				}
//			);

			AddItems ();

			ShowAll ();
		}
예제 #12
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;
        }
예제 #13
0
 private static void removeAllColumns(TreeView treeView)
 {
     //vaciar el array
     TreeViewColumn[] treeViewColumns = treeView.Columns;
     foreach (TreeViewColumn treeViewColumn in treeViewColumns)
         treeView.RemoveColumn (treeViewColumn);
 }
예제 #14
0
        public void AppendColumns(TreeView treeView, IDataReader dataReader)
        {
            for (int index = 0; index < dataReader.FieldCount; index++)
            {
                //Console.WriteLine("el indice es: {0}", index);
                treeView.AppendColumn (dataReader.GetName (index), new CellRendererText(), "text", index);

                //treeView.AppendColumn ("columna1", new CellRendererText(), "text",index);
            }

            //Añadimos la columna de la cantidad porque en la BBDD no tenemos este campo.
            TreeViewColumn cantidad = new TreeViewColumn();
            cantidad.Title = "Cantidad";
            CellRendererText cant = new CellRendererText();
            cantidad.PackStart(cant, true);
            cantidad.AddAttribute(cant,"text",4);

            //para mostrar las imágenes
            //CellRendererPixbuf cellRendererPixbuf = new CellRendererPixbuf();

            //prueba para cambiar tamaño letra
            cantidad.Sizing = TreeViewColumnSizing.Fixed;
               	cantidad.FixedWidth = 200;

            treeView.AppendColumn(cantidad);
        }
예제 #15
0
		public TreeViewDemo ()
		{
			DateTime start = DateTime.Now;

			Application.Init ();
			
			PopulateStore ();

			Window win = new Window ("TreeView demo");
			win.DeleteEvent += new DeleteEventHandler (DeleteCB);
			win.SetDefaultSize (640,480);

			ScrolledWindow sw = new ScrolledWindow ();
			win.Add (sw);

			TreeView tv = new TreeView (store);
			tv.HeadersVisible = true;
			tv.EnableSearch = false;

			tv.AppendColumn ("Name", new CellRendererText (), "text", 0);
			tv.AppendColumn ("Type", new CellRendererText (), "text", 1);

			sw.Add (tv);
			
			dialog.Destroy ();
			dialog = null;

			win.ShowAll ();
			
			Console.WriteLine (count + " nodes added.");
			Console.WriteLine ("Startup time: " + DateTime.Now.Subtract (start));
			Application.Run ();
		}
예제 #16
0
 public ObjectWindow(RuntimeThread runtimeThread, object root)
     : base(GetTitle(root))
 {
     SetDefaultSize(250, 300);
     SkipPagerHint = true;
     SkipTaskbarHint = true;
     
     scroller = new ScrolledWindow();
     scroller.BorderWidth = 5;
     scroller.ShadowType = ShadowType.In;
     Add(scroller);
     
     store = new TreeStore(typeof(string), typeof(object), typeof(bool));
     
     //TreeModelSort storeSort = new TreeModelSort(store);
     //storeSort.SetSortColumnId(0, SortType.Ascending);
     
     view = new TreeView(store);
     view.AppendColumn(null, new CellRendererText(), "text", VALUE_TEXT);
     view.HeadersVisible = false;
     view.RowExpanded += OnTreeRowExpanded;
     view.RowCollapsed += OnTreeRowCollapsed;
     scroller.Add(view);
     
     Add(false, new TreeIter(), "", root, false, false);
     
     TreeIter first;
     store.GetIterFirst(out first);
     view.ExpandRow(store.GetPath(first), false);
 }
예제 #17
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);
		}
예제 #18
0
        public BookmarkOutput()
        {
            this.ShadowType = ShadowType.Out;
            treeView = new TreeView();
            treeView.Selection.Mode = Gtk.SelectionMode.Single;

            treeView.Model = outputModel;

            FontDescription customFont =  Pango.FontDescription.FromString(MainClass.Settings.ConsoleTaskFont);
            treeView.ModifyFont(customFont);

            TreeViewColumn tvcState = new TreeViewColumn (MainClass.Languages.Translate("Line"),  new CellRendererText(), "text", 1);
            tvcState.MinWidth = 25;
            treeView.AppendColumn(tvcState);

            TreeViewColumn tvcName = new TreeViewColumn (MainClass.Languages.Translate("file"),  new CellRendererText(), "text", 0);
            tvcName.MinWidth = 100;
            treeView.AppendColumn(tvcName);

            TreeViewColumn tvcText = new TreeViewColumn (MainClass.Languages.Translate("name"),  new CellRendererText(), "text", 2);
            tvcText.MinWidth = 100;
            treeView.AppendColumn(tvcText);

            treeView.HeadersVisible = true;
            treeView.EnableTreeLines = true;

            treeView.RowActivated += new RowActivatedHandler(OnRowActivate);
            treeView.EnableSearch =false;
            treeView.HasFocus = false;

            this.Add(treeView);

            this.ShowAll();
        }
예제 #19
0
 public GrammarWindow(RuntimeThread runtimeThread) : base("Grammar")
 {
     runtimeThread.Runtime.Grammar.Trace.PatternDefinedEvent += OnGrammarPatternDefined;
     runtimeThread.Runtime.Grammar.Trace.PatternChangedEvent += OnGrammarPatternChanged;
     
     SetDefaultSize(250, 300);
     SkipPagerHint = true;
     SkipTaskbarHint = true;
     
     scroller = new ScrolledWindow();
     scroller.BorderWidth = 5;
     scroller.ShadowType = ShadowType.In;
     Add(scroller);
     
     store = new TreeStore(typeof(string), typeof(Source));
     
     // FIXME - only want to sort top level
     
     //TreeModelSort storeSort = new TreeModelSort(store);
     //storeSort.SetSortColumnId(0, SortType.Ascending);
     
     view = new TreeView(store);
     
     view.AppendColumn(null, new CellRendererText(), "text", VALUE_TEXT);
     view.HeadersVisible = false;
     view.RowActivated += OnTreeRowActivated;
     view.ButtonPressEvent += OnTreeButtonPress;
     scroller.Add(view);
     
     MenuBuilder menuBuilder = new MenuBuilder();
     menu = menuBuilder.StartMenu();
     menuBuilder.Add("Show source", OnMenuShowSource);
     menuBuilder.Add("Show object", OnMenuShowObject);
     menu.ShowAll();
 }
예제 #20
0
        private void BuildView ()
        {
            VBox box = new VBox ();
            Add (box);

            ScrolledWindow sw = new ScrolledWindow ();
            sw.HscrollbarPolicy = PolicyType.Never;

            TreeView view = new TreeView ();
            view.RowActivated += delegate (object o, RowActivatedArgs args) {
                TreeIter iter;
                if (store.GetIter (out iter, args.Path)) {
                    Type type = (Type)store.GetValue (iter, 1);
                    Window window = (Window)Activator.CreateInstance (type);
                    window.WindowPosition = WindowPosition.Center;
                    window.DeleteEvent += delegate { window.Destroy (); };
                    window.Show ();
                }
            };
            view.Model = store;
            view.AppendColumn ("Module", new CellRendererText (), "text", 0);

            sw.Add (view);
            box.PackStart (sw, true, true, 0);
            sw.ShowAll ();

            Button button = new Button (Stock.Quit);
            button.Clicked += delegate { Destroy (); Application.Quit (); };
            box.PackStart (button, false, false, 0);

            box.ShowAll ();
        }
        public StackTracePad()
        {
            this.ShadowType = ShadowType.In;

            store = new TreeStore (typeof (string));

            tree = new TreeView (store);
            tree.RulesHint = true;
            tree.HeadersVisible = true;

            TreeViewColumn FrameCol = new TreeViewColumn ();
            CellRenderer FrameRenderer = new CellRendererText ();
            FrameCol.Title = "Frame";
            FrameCol.PackStart (FrameRenderer, true);
            FrameCol.AddAttribute (FrameRenderer, "text", 0);
            FrameCol.Resizable = true;
            FrameCol.Alignment = 0.0f;
            tree.AppendColumn (FrameCol);

            Add (tree);
            ShowAll ();

            Runtime.DebuggingService.PausedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnPausedEvent));
            Runtime.DebuggingService.ResumedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnResumedEvent));
            Runtime.DebuggingService.StoppedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnStoppedEvent));
        }
예제 #22
0
 public static bool IsSelected(TreeView treeView)
 {
     TreeIter treeIter;
     return treeView.Selection.GetSelected (out treeIter);
     //o bien
     //return treeView.Selection.CountSelectedRows() != 0;
 }
		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;
		}
예제 #24
0
		public DemoListStore () : base ("ListStore Demo")
		{
			BorderWidth = 8;

			VBox vbox = new VBox (false, 8);
			Add (vbox);

			Label label = new Label ("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though).");
			vbox.PackStart (label, false, false, 0);

			ScrolledWindow sw = new ScrolledWindow ();
			sw.ShadowType = ShadowType.EtchedIn;
			sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
			vbox.PackStart (sw, true, true, 0);

                        // create model
			store = CreateModel ();

			// create tree view
			TreeView treeView = new TreeView (store);
			treeView.RulesHint = true;
			treeView.SearchColumn = (int) Column.Description;
			sw.Add (treeView);

			AddColumns (treeView);

			// finish & show
			SetDefaultSize (280, 250);
			ShowAll ();
		}
예제 #25
0
		public static void Main20 (string[] args)
		{
			Application.Init ();

			PopulateStore ();

			Window win = new Window ("TreeView demo");
			win.DeleteEvent += new DeleteEventHandler (DeleteCB);
			win.DefaultWidth = 320;
			win.DefaultHeight = 480;

			ScrolledWindow sw = new ScrolledWindow ();
			win.Add (sw);

			TreeView tv = new TreeView (store);
			tv.HeadersVisible = true;

			tv.AppendColumn ("One", new CellRendererText (), new TreeCellDataFunc (CellDataA));
			tv.AppendColumn ("Two", new CellRendererText (), new TreeCellDataFunc (CellDataB));

			sw.Add (tv);
			win.ShowAll ();

			Application.Run ();
		}
예제 #26
0
		private void AddColumns (TreeView treeView)
		{
			// column for fixed toggles
			CellRendererToggle rendererToggle = new CellRendererToggle ();
			rendererToggle.Toggled += new ToggledHandler (FixedToggled);
			TreeViewColumn column =  new TreeViewColumn ("Fixed?", rendererToggle, "active", Column.Fixed);

			// set this column to a fixed sizing (of 50 pixels)
			column.Sizing = TreeViewColumnSizing.Fixed;
			column.FixedWidth = 50;
			treeView.AppendColumn (column);

			// column for bug numbers
			CellRendererText rendererText = new CellRendererText ();
			column = new TreeViewColumn ("Bug number", rendererText, "text", Column.Number);
			column.SortColumnId = (int) Column.Number;
			treeView.AppendColumn (column);

			// column for severities
			rendererText = new CellRendererText ();
			column = new TreeViewColumn ("Severity", rendererText, "text", Column.Severity);
			column.SortColumnId = (int) Column.Severity;
			treeView.AppendColumn(column);

			// column for description
			rendererText = new CellRendererText ();
			column = new TreeViewColumn ("Description", rendererText, "text", Column.Description);
			column.SortColumnId = (int) Column.Description;
			treeView.AppendColumn (column);
		}
        public AddInManagerDialog()
        {
            this.BorderWidth = 12;
            this.Title = GettextCatalog.GetString ("AddInManager");
            this.TransientFor = (Window) WorkbenchSingleton.Workbench;
            this.SetDefaultSize (400, 350);

            ScrolledWindow sw = new ScrolledWindow ();
            sw.ShadowType = ShadowType.In;
            TreeView tv = new TreeView ();
            tv.Selection.Changed += new EventHandler (OnSelectionChanged);
            tv.RowActivated += new RowActivatedHandler (OnRowActivated);

            CellRendererToggle toggle = new CellRendererToggle ();
            toggle.Toggled += OnCellToggled;
            tv.AppendColumn (GettextCatalog.GetString ("Enabled"), toggle, "active", 0);
            tv.AppendColumn (GettextCatalog.GetString ("AddIn Name"), new CellRendererText (), "text", 1);
            tv.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "text", 2);
            sw.Add (tv);

            this.AddButton (Gtk.Stock.Close, ResponseType.Close);

            LoadAddIns ();
            tv.Model = store;
            this.VBox.Add (sw);

            addinDetails = new AddInDetailsFrame ();
            this.VBox.Add (addinDetails);
            this.ShowAll ();
        }
예제 #28
0
        public EntityListView()
        {
            SizeRequested += delegate(object o, SizeRequestedArgs args) {
                if (Child != null)
                    args.Requisition = Child.SizeRequest ();
            };

            SizeAllocated += delegate(object o, SizeAllocatedArgs args) {
                if (Child != null)
                    Child.Allocation = args.Allocation;
            };

            VBox vBox = new VBox();
            ScrolledWindow scrolledWindow = new ScrolledWindow();
            scrolledWindow.ShadowType = ShadowType.In;
            treeView = new TreeView();

            scrolledWindow.Add (treeView);
            vBox.Add (scrolledWindow);
            Add (vBox);

            ShowAll ();

            actionGroup = new ActionGroup("entityListView");
        }
예제 #29
0
파일: Theatre.cs 프로젝트: gsterjov/fusemc
        // create the main theatre widget
        public Theatre()
        {
            video_widget = new VideoWidget (true);
            video_widget_fullscreen = new VideoWidget (false);
            fullscreen = new Fullscreen (video_widget_fullscreen);

            media_tree = new TreeView (media_store);

            media_tree.AppendColumn (null, new CellRendererText (), new TreeCellDataFunc (renderMedia));
            media_tree.HeadersVisible = false;

            ScrolledWindow scrolled_tree = new ScrolledWindow ();
            scrolled_tree.Add (media_tree);
            scrolled_tree.ShadowType = ShadowType.In;

            main_splitter.Add1 (scrolled_tree);
            main_splitter.Add2 (video_widget);

            media_tree.RowActivated += tree_activated;

            video_widget.ButtonPressEvent += video_button_press;
            video_widget_fullscreen.ButtonPressEvent += video_button_press;

            video_widget.ButtonReleaseEvent += video_button_release;
            video_widget_fullscreen.ButtonReleaseEvent += video_button_release;

            Global.Core.Fuse.MediaControls.MediaEngine.FoundVideoInfo += found_video_info;
        }
예제 #30
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 ();
    }