Esempio n. 1
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 ();
    }
Esempio n. 2
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 ();
		}
Esempio n. 3
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);
		}
Esempio n. 4
0
    public TreeViewDemo()
    {
        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.EnableSearch = true;
        tv.HeadersVisible = true;
        tv.HeadersClickable = true;

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

        sw.Add (tv);

        dialog.Destroy ();
        dialog = null;

        win.ShowAll ();

        Application.Run ();
    }
Esempio n. 5
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);
        }
Esempio n. 6
0
        public Dialog(Drawable drawable, VariableSet variables = null)
            : base("CountTool", variables)
        {
            var hbox = new HBox(false, 12) {BorderWidth = 12};
              VBox.PackStart(hbox, true, true, 0);

              var preview = new Preview(drawable, _coordinates);
              hbox.PackStart(preview, true, true, 0);

              var sw = new ScrolledWindow();
              hbox.Add(sw);

              var store = new TreeStore(typeof(Coordinate<int>));
              for (int i = 0; i < 10; i++)
            {
              var coordinate = new Coordinate<int>(10 * i, 10 * i);
              _coordinates.Add(coordinate);
              store.AppendValues(coordinate);
            }

              var view = new TreeView(store);
              sw.Add(view);

              var textRenderer = new CellRendererText();
              view.AppendColumn("X", textRenderer, new TreeCellDataFunc(RenderX));
              view.AppendColumn("Y", textRenderer, new TreeCellDataFunc(RenderY));
        }
Esempio n. 7
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 ();
		}
Esempio n. 8
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();
        }
        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;
        }
Esempio n. 10
0
	public ImageInfo () : base (null, null)
	{
		store = new TreeStore ((int)TypeFundamentals.TypeString,
				       (int)TypeFundamentals.TypeString);
		
		tv = new TreeView (store);
		tv.HeadersVisible = true;

		TreeViewColumn NameCol = new TreeViewColumn ();
		CellRenderer NameRenderer = new CellRendererText ();

		NameCol.Title = "Name";
		NameCol.PackStart (NameRenderer, true);
		NameCol.AddAttribute (NameRenderer, "markup", 0);
		tv.AppendColumn (NameCol);

		TreeViewColumn ValueCol = new TreeViewColumn ();
		CellRenderer ValueRenderer = new CellRendererText ();
		ValueCol.Title = "Value";
		ValueCol.PackStart (ValueRenderer, false);
		ValueCol.AddAttribute (ValueRenderer, "text", 1);
		tv.AppendColumn (ValueCol);

		//
		// Populate tree
		//

		TreeIter iter = new TreeIter ();
		PopulateGeneral (out iter);
		PopulateDetails (out iter);
		Add (tv);
	}
Esempio n. 11
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 ();
		}
Esempio n. 12
0
    public Tree(string[] args)
    {
        Application.Init ();

        store = new TreeStore (typeof (string), typeof (string));

        Glade.XML gxml = new Glade.XML(null, "tree.glade", "window", null );
        gxml.Autoconnect( this );

        window.Resize(500, 400 );
        // eventos
        window.DeleteEvent += new DeleteEventHandler( Salir );
        b_agregar.Clicked += new EventHandler( Agregar );
        b_eliminar.Clicked += new EventHandler( Borrar );
        b_limpiar.Clicked += new EventHandler( Limpiar );
        b_salir.Clicked += new EventHandler( Cerrar );

        // crear arbol

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

        tv.AppendColumn ("Nombre", new CellRendererText (), "text", 0);
        tv.AppendColumn ("Apellidos", new CellRendererText (), "text", 1);

        scrolledwindow1.Add (tv);
        window.ShowAll ();
        Application.Run ();
    }
Esempio n. 13
0
        public TSharedFiles(Gtk.TreeView tv, CInterfaceGateway in_krnGateway)
        {
            tvSharedFiles = tv;
            krnGateway = in_krnGateway;
            store = new TreeStore (typeof (string), typeof (string), typeof (string),
               	                     typeof (string));
               	   tvSharedFiles.Model = store;
            Gtk.TreeViewColumn tvc = new TreeViewColumn ("File name", new CellRendererText(),"text",0);
            tvSharedFiles.AppendColumn (tvc);
            tvc.SortColumnId = 0;

            tvc = new TreeViewColumn ("Size", new CellRendererText(),"text",1);
               	   tvSharedFiles.AppendColumn (tvc);
               	   tvc.SortColumnId = 1;

               	   tvc = new TreeViewColumn ("Priority", new CellRendererText(),"text",2);
               	   tvSharedFiles.AppendColumn (tvc);
               	   tvc.SortColumnId = 2;

               	   tvc = new TreeViewColumn ("Progress", new CellRendererText(),"text",3);
               	   tvSharedFiles.AppendColumn (tvc);
               	   tvc.SortColumnId = 3;

               	   loadSharedFiles();
               	   //krnGateway.OnNewSharedFile+=new FileEvent(prueba);
        }
        private void InitializeListView(TreeView treeView, ListStore store, String nameColumnTitle, 
                                      IEnumerable<ItemSetting> data, ToggledHandler includeToggleHandler) 
        {
            treeView.Model = store;

            //create columns with associated cell renderings
            CellRendererText nameRenderer = new CellRendererText();
            TreeViewColumn nameColumn = treeView.AppendColumn(nameColumnTitle, nameRenderer);
            nameColumn.SetCellDataFunc(nameRenderer, new TreeCellDataFunc(RenderName));            

            CellRendererText typeRenderer = new CellRendererText();
            TreeViewColumn typeColumn = treeView.AppendColumn("Type", typeRenderer);
            typeColumn.SetCellDataFunc(typeRenderer, new TreeCellDataFunc(RenderType));   

            CellRendererToggle includeCheckBoxRenderer = new CellRendererToggle();
            TreeViewColumn includeColumn = treeView.AppendColumn("Include", includeCheckBoxRenderer);
            includeColumn.SetCellDataFunc(includeCheckBoxRenderer, new TreeCellDataFunc(RenderIncludeCheckBox));
            includeCheckBoxRenderer.Activatable = true;
            includeCheckBoxRenderer.Toggled += includeToggleHandler;

            //fill store with data
            foreach (ItemSetting item in data) 
            {
                store.AppendValues(item, item, item);
            }
        }
Esempio n. 15
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();
        }
Esempio n. 16
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);
		}
Esempio n. 17
0
    public void Run(string[] args)
    {
        Application.Init ();
        PopulateStore ();
        store.SetSortColumnId(2, SortType.Ascending);

        Window win = new Window ("Gtk Widget Attributes");
        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.AppendColumn ("Name", new CellRendererText (), "markup", 0);
        tv.AppendColumn ("Type", new CellRendererText (), "text", 1);

        foreach(TreeViewColumn col in tv.Columns)
            col.Resizable = true;

        tv.SearchColumn = 2;

        sw.Add (tv);

        dialog.Destroy ();
        dialog = null;

        win.ShowAll ();

        Application.Run ();
    }
        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 ();
        }
        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;
        }
Esempio n. 20
0
        public ThreadPad()
        {
            thread_rows = new Hashtable ();

            this.ShadowType = ShadowType.In;

            store = new TreeStore (typeof (int),
                           typeof (int),
                           typeof (string),
                           typeof (string));

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

            TreeViewColumn Col;
            CellRenderer ThreadRenderer;

            Col = new TreeViewColumn ();
            ThreadRenderer = new CellRendererText ();
            Col.Title = "Id";
            Col.PackStart (ThreadRenderer, true);
            Col.AddAttribute (ThreadRenderer, "text", 0);
            Col.Resizable = true;
            Col.Alignment = 0.0f;
            tree.AppendColumn (Col);

            Col = new TreeViewColumn ();
            ThreadRenderer = new CellRendererText ();
            Col.Title = "PID";
            Col.PackStart (ThreadRenderer, true);
            Col.AddAttribute (ThreadRenderer, "text", 1);
            Col.Resizable = true;
            Col.Alignment = 0.0f;
            tree.AppendColumn (Col);

            Col = new TreeViewColumn ();
            ThreadRenderer = new CellRendererText ();
            Col.Title = "State";
            Col.PackStart (ThreadRenderer, true);
            Col.AddAttribute (ThreadRenderer, "text", 2);
            Col.Resizable = true;
            Col.Alignment = 0.0f;
            tree.AppendColumn (Col);

            Col = new TreeViewColumn ();
            ThreadRenderer = new CellRendererText ();
            Col.Title = "Current Location";
            Col.PackStart (ThreadRenderer, true);
            Col.AddAttribute (ThreadRenderer, "text", 3);
            Col.Resizable = true;
            Col.Alignment = 0.0f;
            tree.AppendColumn (Col);

            Add (tree);
            ShowAll ();

            ((DebuggingService)Runtime.DebuggingService).ThreadStateEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnThreadEvent));
        }
Esempio n. 21
0
        public LocalsPad()
        {
            this.ShadowType = ShadowType.In;

            variable_rows = new Hashtable();
            iters = new Hashtable();

            store = new TreeStore (typeof (string),
                            typeof (string),
                            typeof (string),
                            typeof (bool),
                            typeof (Gdk.Pixbuf));

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

            TreeViewColumn NameCol = new TreeViewColumn ();
            CellRenderer NameRenderer = new CellRendererText ();
            CellRenderer IconRenderer = new CellRendererPixbuf ();
            NameCol.Title = "Name";
            NameCol.PackStart (IconRenderer, false);
            NameCol.PackStart (NameRenderer, true);
            NameCol.AddAttribute (IconRenderer, "pixbuf", PIXBUF_COL);
            NameCol.AddAttribute (NameRenderer, "text", NAME_COL);
            NameCol.Resizable = true;
            NameCol.Alignment = 0.0f;
            tree.AppendColumn (NameCol);

            TreeViewColumn ValueCol = new TreeViewColumn ();
            CellRenderer ValueRenderer = new CellRendererText ();
            ValueCol.Title = "Value";
            ValueCol.PackStart (ValueRenderer, true);
            ValueCol.AddAttribute (ValueRenderer, "text", VALUE_COL);
            ValueCol.Resizable = true;
            NameCol.Alignment = 0.0f;
            tree.AppendColumn (ValueCol);

            TreeViewColumn TypeCol = new TreeViewColumn ();
            CellRenderer TypeRenderer = new CellRendererText ();
            TypeCol.Title = "Type";
            TypeCol.PackStart (TypeRenderer, true);
            TypeCol.AddAttribute (TypeRenderer, "text", TYPE_COL);
            TypeCol.Resizable = true;
            NameCol.Alignment = 0.0f;
            tree.AppendColumn (TypeCol);

            tree.TestExpandRow += new TestExpandRowHandler (TestExpandRow);

            #if NET_2_0
            tree.PopupMenu += new PopupMenuHandler (TreePopup);
            #endif

            Add (tree);
            ShowAll ();

            Runtime.DebuggingService.PausedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnPausedEvent));
            Runtime.DebuggingService.StoppedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnStoppedEvent));
        }
Esempio n. 22
0
		public DemoStockBrowser () : base ("Stock Icons and Items")
		{
			SetDefaultSize (-1, 500);
			BorderWidth = 8;

			HBox hbox = new HBox (false, 8);
			Add (hbox);

			ScrolledWindow sw = new ScrolledWindow ();
			sw.SetPolicy (PolicyType.Never, PolicyType.Automatic);
			hbox.PackStart (sw, false, false, 0);

			ListStore model = CreateModel ();

			TreeView treeview = new TreeView (model);
			sw.Add (treeview);

			TreeViewColumn column = new TreeViewColumn ();
			column.Title = "Name";
			CellRenderer renderer = new CellRendererPixbuf ();
			column.PackStart (renderer, false);
			column.SetAttributes (renderer, "stock_id", Column.Id);
			renderer = new CellRendererText ();
			column.PackStart (renderer, true);
			column.SetAttributes (renderer, "text", Column.Name);

			treeview.AppendColumn (column);
			treeview.AppendColumn ("Label", new CellRendererText (), "text", Column.Label);
			treeview.AppendColumn ("Accel", new CellRendererText (), "text", Column.Accel);
			treeview.AppendColumn ("ID", new CellRendererText (), "text", Column.Id);

			Alignment align = new Alignment (0.5f, 0.0f, 0.0f, 0.0f);
			hbox.PackEnd (align, false, false, 0);

			Frame frame = new Frame ("Selected Item");
			align.Add (frame);

			VBox vbox = new VBox (false, 8);
			vbox.BorderWidth = 8;
			frame.Add (vbox);

			typeLabel = new Label ();
			vbox.PackStart (typeLabel, false, false, 0);
			iconImage = new Gtk.Image ();
			vbox.PackStart (iconImage, false, false, 0);
			accelLabel = new Label ();
			vbox.PackStart (accelLabel, false, false, 0);
			nameLabel = new Label ();
			vbox.PackStart (nameLabel, false, false, 0);
			idLabel = new Label ();
			vbox.PackStart (idLabel, false, false, 0);

			treeview.Selection.Mode = Gtk.SelectionMode.Single;
			treeview.Selection.Changed += new EventHandler (SelectionChanged);

			ShowAll ();
		}
Esempio n. 23
0
        private ChatsPage()
        {
            base.FocusGrabbed += base_FocusGrabbed;

            closePixbuf = new Gdk.Pixbuf(null, "FileFind.Meshwork.GtkClient.smallclose.png");

            tabLabelPages = new Dictionary<Widget, ChatSubpageBase>();

            notebook = new Notebook();
            notebook.TabPos = PositionType.Bottom;
            notebook.SwitchPage += notebook_SwitchPage;
            notebook.PageReordered += notebook_PageReordered;

            ScrolledWindow swindow = new ScrolledWindow();
            swindow.HscrollbarPolicy = PolicyType.Automatic;
            swindow.VscrollbarPolicy = PolicyType.Automatic;
            chatList = new TreeView ();
            swindow.Add(chatList);

            chatTreeStore = new NetworkGroupedTreeStore<ChatRoom>(chatList);
            chatList.Model = chatTreeStore;

            TreeViewColumn column;

            column = chatList.AppendColumn("Room Name", new CellRendererText(), new TreeCellDataFunc (NameDataFunc));
            column.Expand = true;
            column.Sizing = TreeViewColumnSizing.Autosize;

            var pixbufCell = new CellRendererPixbuf();
            column.PackStart(pixbufCell, false);
            column.SetCellDataFunc(pixbufCell, new TreeCellDataFunc(RoomSecureDataFunc));

            column = chatList.AppendColumn("Users", new CellRendererText(), new TreeCellDataFunc (RoomUsersDataFunc));
            column.Sizing = TreeViewColumnSizing.Autosize;

            chatList.RowActivated += chatList_RowActivated;
            chatList.ButtonPressEvent += chatList_ButtonPressEvent;

            EventBox box = new EventBox();
            box.Add(new Label("Chatroom List"));
            box.ButtonPressEvent += HandleTabButtonPressEvent;
            box.ShowAll();
            notebook.AppendPage(swindow, box);

            this.PackStart(notebook, true, true, 0);
            notebook.ShowAll();

            foreach (Network network in Core.Networks) {
                Core_NetworkAdded (network);
            }

            Core.NetworkAdded +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkAdded)
                );
        }
Esempio n. 24
0
			public PageView () : base ()
			{
				view = new TreeView ();
				view.AppendColumn ("Count", new CellRendererText (), "text", 1);
				TreeViewColumn col = new TreeViewColumn ("Method", new CellRendererText (), "text", 0);
				view.AppendColumn (col);
				view.ExpanderColumn = col;
				view.Show ();
				Add (view);
			}
Esempio n. 25
0
		public AllocationsView (ProfilerEventHandler data, DisplayOptions options) : base ()
		{
			TreeView view = new TreeView (new TreeModelAdapter (new AllocationsStore (data, options)));
			view.AppendColumn ("Cost", new CellRendererText (), "text", 1);
			TreeViewColumn col = new TreeViewColumn ("Class/Allocator", new CellRendererText (), "text", 0);
			view.AppendColumn (col);
			view.ExpanderColumn = col;
			view.Show ();
			Add (view);
		}
Esempio n. 26
0
		public CallsView (ProfilerEventHandler data, DisplayOptions options) : base ()
		{
			TreeView view = new TreeView (new TreeModelAdapter (new CallsStore (data, options)));
			view.AppendColumn ("Cost", new CellRendererText (), "text", 1);
			TreeViewColumn col = new TreeViewColumn ("Method", new CellRendererText (), "text", 0);
			view.AppendColumn (col);
			view.ExpanderColumn = col;
			view.Show ();
			options.Changed += delegate { view.Model = new TreeModelAdapter (new CallsStore (data, options)); };
			Add (view);
		}
Esempio n. 27
0
		public TreeModelDemo () : base ("TreeModel demo")
		{
			DefaultSize = new Gdk.Size (640,480);
			ScrolledWindow sw = new ScrolledWindow ();
			TreeView view = new TreeView (new TreeModelAdapter (new MyTreeModel ()));
			view.HeadersVisible = true;
			view.AppendColumn ("Name", new CellRendererText (), "text", 0);
			view.AppendColumn ("Type", new CellRendererText (), "text", 1);
			sw.Add (view);
			sw.ShowAll ();
			Add (sw);
		}
        public VersionInformationTabPage()
        {
            TreeView listView = new TreeView ();
            listView.RulesHint = true;
            listView.AppendColumn (GettextCatalog.GetString ("Name"), new CellRendererText (), "text", 0);
            listView.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "text", 1);
            listView.AppendColumn (GettextCatalog.GetString ("Path"), new CellRendererText (), "text", 2);

            listView.Model = FillListView ();
            ScrolledWindow sw = new ScrolledWindow ();
            sw.Add (listView);
            this.PackStart (sw, true, true, 0);
        }
Esempio n. 29
0
        private MemosPage()
        {
            ScrolledWindow swindow = new ScrolledWindow();

            memoList = new TreeView ();
            swindow.Add(memoList);

            memoTreeStore = new NetworkGroupedTreeStore<Memo>(memoList);
            memoList.Model = memoTreeStore;

            TreeViewColumn column;

            column = memoList.AppendColumn("Subject",
                                           new CellRendererText(),
                                   new TreeCellDataFunc(MemoSubjectDataFunc));
            column.Expand = true;
            column.Resizable = true;

            column = memoList.AppendColumn(String.Empty,
                                           new CellRendererPixbuf(),
                               new TreeCellDataFunc(MemoAttachmentFunc));
            column.Widget = new Gtk.Image(new Gdk.Pixbuf(null, "FileFind.Meshwork.GtkClient.attachment-col-small.png"));
            column.Widget.Show();

            column = memoList.AppendColumn("Posted By",
                                   new CellRendererText (),
                                   new TreeCellDataFunc (MemoByDataFunc));

            column.Resizable = true;

            column = memoList.AppendColumn("Date",
                                   new CellRendererText (),
                                   new TreeCellDataFunc (MemoDateDataFunc));

            column.Resizable = true;

            memoList.RowActivated += memoList_RowActivated;
            memoList.ButtonPressEvent += memoList_ButtonPressEvent;

            this.PackStart(swindow, true, true, 0);
            swindow.ShowAll();

            foreach (Network network in Core.Networks) {
                Core_NetworkAdded (network);
            }

            Core.NetworkAdded +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkAdded)
                );
        }
Esempio n. 30
0
        private void InitializeComponent()
        {
            this.Title = "Search Errors";
             this.Modal = false;
             this.WindowPosition = Gtk.WindowPosition.CenterOnParent;
             this.Resizable = true;
             this.SetDefaultSize(480, 320);
             this.IconName = Stock.DialogError;
             this.AddButton(Stock.Close, Gtk.ResponseType.Close);

             Gtk.Frame treeFrame = new Gtk.Frame();
             treeFrame.Shadow = ShadowType.In;
             Gtk.ScrolledWindow treeWin = new Gtk.ScrolledWindow();
             tvErrors = new Gtk.TreeView ();
             tvErrors.SetSizeRequest(480,200);
             tvErrors.Selection.Mode = SelectionMode.Single;

             tvErrors.AppendColumn(CreateTreeViewColumn("Name", 60, 0));
             tvErrors.AppendColumn(CreateTreeViewColumn("Located In", 200, 1));

             lsErrors = new Gtk.ListStore(typeof (string), typeof (string), typeof(string));
             tvErrors.Model = lsErrors;
             tvErrors.Selection.Changed += new EventHandler(tvErrors_Selection_Changed);

             treeWin.Add(tvErrors);
             treeFrame.BorderWidth = 0;
             treeFrame.Add(treeWin);

             for (int i=0; i< alErrors.Count; i++)
             {
            MessageEventArgs args = (MessageEventArgs)alErrors[i];
            if (args.ErrorFile == null)
               lsErrors.AppendValues("General Error", string.Empty, args.Message);
            else
               lsErrors.AppendValues(args.ErrorFile.Name, args.ErrorFile.DirectoryName, args.Message);
             }

             Gtk.Frame txtFrame = new Gtk.Frame();
             txtFrame.Shadow = ShadowType.In;
             Gtk.ScrolledWindow txtScrollWin = new Gtk.ScrolledWindow();
             txtErrorDetails = new TextView();
             txtErrorDetails.WrapMode = Gtk.WrapMode.WordChar;
             txtErrorDetails.Editable = false;
             txtScrollWin.Add(txtErrorDetails);
             txtFrame.BorderWidth = 0;
             txtFrame.Add(txtScrollWin);

             this.VBox.PackStart(treeFrame, true, true, 3);
             this.VBox.PackEnd(txtFrame, true, true, 3);
             this.VBox.ShowAll();
        }
Esempio n. 31
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;
        }
    }
Esempio n. 32
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);
        }
Esempio n. 33
0
        public TComments(Gtk.TreeView tvComments, CInterfaceGateway in_krnGateway)
        {
            krnGateway = in_krnGateway;

            Gtk.TreeViewColumn tvc = new TreeViewColumn("Name", new CellRendererText(), "text", 0);
            tvComments.AppendColumn(tvc);
            tvc.SortColumnId = 0;

            tvc = new TreeViewColumn("Rating", new CellRendererText(), "text", 1);
            tvComments.AppendColumn(tvc);
            tvc.SortColumnId = 1;

            tvc = new TreeViewColumn("Comment", new CellRendererText(), "text", 2);
            tvComments.AppendColumn(tvc);
            tvc.SortColumnId = 2;
        }
Esempio n. 34
0
        /// <summary>
        /// Construtor
        /// </summary>
        public LegendView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.LegendView.glade");

            hbox1           = (HBox)builder.GetObject("hbox1");
            combobox1       = (ComboBox)builder.GetObject("combobox1");
            listview        = (Gtk.TreeView)builder.GetObject("listview");
            _mainWidget     = hbox1;
            combobox1.Model = comboModel;
            combobox1.PackStart(comboRender, false);
            combobox1.AddAttribute(comboRender, "text", 0);
            combobox1.Changed += OnPositionComboChanged;
            combobox1.Focused += OnTitleTextBoxEnter;

            listview.Model = listModel;
            TreeViewColumn column = new TreeViewColumn();

            column.Title = "Series name";
            column.PackStart(listToggle, false);
            listRender.Editable = false;
            column.PackStart(listRender, true);
            column.SetAttributes(listToggle, "active", 0);
            column.SetAttributes(listRender, "text", 1);
            listview.AppendColumn(column);
            listToggle.Activatable = true;
            listToggle.Toggled    += OnItemChecked;
            _mainWidget.Destroyed += _mainWidget_Destroyed;
        }
Esempio n. 35
0
        /// <summary>Add a column to the list view.</summary>
        /// <param name="columnName">The column heading.</param>
        public void AddColumn(string columnName)
        {
            columnTypes.Add(typeof(string));
            var cell = new CellRendererText();

            cells.Add(cell);
            var colIndex = -1;

            if (SortColumn != null)
            {
                colIndex = columns.Count;
            }
            var newColumn = new TreeViewColumn
            {
                Title        = columnName,
                Resizable    = true,
                SortColumnId = colIndex,
                Sizing       = TreeViewColumnSizing.GrowOnly
            };

            newColumn.PackStart(cell, false);
            newColumn.AddAttribute(cell, "text", columns.Count);
            newColumn.AddNotification("width", OnColumnWidthChange);
            newColumn.SetCellDataFunc(cell, OnFormatColumn);
            columns.Add(newColumn);
            tree.AppendColumn(newColumn);
        }
Esempio n. 36
0
        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);
            }
        }
Esempio n. 37
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 (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;
        }
Esempio n. 38
0
        /// <summary>Default constructor for ExplorerView</summary>
        public PropertyTreeView(ViewBase owner) : base(owner)
        {
            Builder builder = ViewBase.BuilderFromResource("ApsimNG.Resources.Glade.ExplorerView.glade");

            vbox1                    = (VBox)builder.GetObject("vbox1");
            treeview1                = (Gtk.TreeView)builder.GetObject("treeview1");
            RightHandView            = (Viewport)builder.GetObject("RightHandView");
            _mainWidget              = vbox1;
            RightHandView.ShadowType = ShadowType.EtchedOut;

            treeview1.Model = treemodel;
            TreeViewColumn     column     = new TreeViewColumn();
            CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();

            column.PackStart(iconRender, false);
            textRender          = new Gtk.CellRendererText();
            textRender.Editable = false;

            column.PackStart(textRender, true);
            column.SetAttributes(iconRender, "pixbuf", 1);
            column.SetAttributes(textRender, "text", 0);
            treeview1.AppendColumn(column);
            treeview1.TooltipColumn = 2;

            treeview1.CursorChanged      += OnAfterSelect;
            treeview1.ButtonReleaseEvent += OnButtonUp;
            treeview1.ButtonPressEvent   += OnButtonPress;
            treeview1.RowActivated       += OnRowActivated;

            _mainWidget.Destroyed += _mainWidget_Destroyed;
        }
Esempio n. 39
0
        /// <summary>Default constructor for ExplorerView</summary>
        public PropertyCategorisedView(ViewBase owner) : base(owner)
        {
            Builder builder = ViewBase.BuilderFromResource("ApsimNG.Resources.Glade.PropertyCategoryView.glade");

            Gtk.HPaned hpaned = (Gtk.HPaned)builder.GetObject("hpaned1");
            treeview1                 = (Gtk.TreeView)builder.GetObject("treeview1");
            rightHandView             = (Viewport)builder.GetObject("RightHandView");
            mainWidget                = hpaned;
            rightHandView.BorderWidth = 7;



            treeview1.Model = treemodel;
            TreeViewColumn     column     = new TreeViewColumn();
            CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();

            column.PackStart(iconRender, false);
            textRender          = new Gtk.CellRendererText();
            textRender.Editable = false;

            column.PackStart(textRender, true);
            column.SetAttributes(iconRender, "pixbuf", 1);
            column.SetAttributes(textRender, "text", 0);
            treeview1.AppendColumn(column);
            treeview1.TooltipColumn = 2;

            treeview1.CursorChanged      += OnAfterSelect;
            treeview1.ButtonReleaseEvent += OnButtonUp;
            treeview1.ButtonPressEvent   += OnButtonPress;
            treeview1.RowActivated       += OnRowActivated;

            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
Esempio n. 40
0
        void Init()
        {
            ui = new Glade.XML(null, "dialogs.glade", "groupDialog", null);
            ui.Autoconnect(this);

            viewDialog = groupDialog;

            TreeViewColumn col;

            allUserStore                    = new ListStore(typeof(string));
            allUsersTreeview.Model          = allUserStore;
            allUsersTreeview.Selection.Mode = SelectionMode.Multiple;

            col = allUsersTreeview.AppendColumn("Name", new CellRendererText(), "text", 0);
            col.SortColumnId = 0;

            allUserStore.SetSortColumnId(0, SortType.Ascending);

            currentMemberStore                    = new ListStore(typeof(string));
            currentMembersTreeview.Model          = currentMemberStore;
            currentMembersTreeview.Selection.Mode = SelectionMode.Multiple;

            col = currentMembersTreeview.AppendColumn("Name", new CellRendererText(), "text", 0);
            col.SortColumnId = 0;

            currentMemberStore.SetSortColumnId(0, SortType.Ascending);

            groupDialog.Resize(350, 400);
        }
Esempio n. 41
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();
        guiThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId;
        // Create our TreeView
        treeview1 = new Gtk.TreeView();
        Gtk.ScrolledWindow scrolledWindow = new ScrolledWindow();
        scrolledWindow.Add(treeview1);
        Gtk.VBox vBox = new VBox();
        vBox.Add(scrolledWindow);
        this.Add(vBox);
        CellRendererCombo cellRendererCombo = new CellRendererCombo();

        Gtk.TreeViewColumn treeViewColumn = new TreeViewColumn();
        treeViewColumn.Title = "TYPE";
        treeViewColumn.PackStart(cellRendererCombo, false);
        treeViewColumn.AddAttribute(cellRendererCombo, "text", 0);
        cellRendererCombo.Editable        = true;
        cellRendererCombo.Model           = new Gtk.ListStore(typeof(string));
        cellRendererCombo.Mode            = CellRendererMode.Editable;
        cellRendererCombo.TextColumn      = 0;
        cellRendererCombo.HasEntry        = false;
        cellRendererCombo.WidthChars      = 20;
        cellRendererCombo.Style           = Pango.Style.Normal;
        cellRendererCombo.Edited         += OnActionChanged;
        cellRendererCombo.EditingStarted += CellEditingStartedHandler;
        treeview1.AppendColumn(treeViewColumn);
        Gtk.ListStore listStore = new ListStore(typeof(string));
        listStore.AppendValues("A");
        listStore.AppendValues("B");
    }
Esempio n. 42
0
        /// <summary>
        /// Construtor
        /// </summary>
        public LegendView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.LegendView.glade");

            hbox1 = (HBox)builder.GetObject("hbox1");
            ComboBox combobox1        = (ComboBox)builder.GetObject("combobox1");
            ComboBox orientationCombo = (ComboBox)builder.GetObject("combobox2");

            listview   = (Gtk.TreeView)builder.GetObject("listview");
            mainWidget = hbox1;

            OrientationDropDown = new DropDownView(this, orientationCombo);
            PositionDropDown    = new DropDownView(this, combobox1);

            chkLegendInsideGraph          = (CheckButton)builder.GetObject("chkLegendInsideGraph");
            chkLegendInsideGraph.Toggled += OnToggleLegendInsideGraph;

            listview.Model = listModel;
            TreeViewColumn column = new TreeViewColumn();

            column.Title = "Series name";
            column.PackStart(listToggle, false);
            listRender.Editable = false;
            column.PackStart(listRender, true);
            column.SetAttributes(listToggle, "active", 0);
            column.SetAttributes(listRender, "text", 1);
            listview.AppendColumn(column);
            listToggle.Activatable = true;
            listToggle.Toggled    += OnItemChecked;
            mainWidget.Destroyed  += _mainWidget_Destroyed;
        }
Esempio n. 43
0
    public ChangesetDetailView(Driver driver)
    {
        this.driver     = driver;
        changesetDetail = new Gtk.TreeView();

        changesetDetail.AppendColumn("Type", new Gtk.CellRendererText(), "text", 0);
        changesetDetail.AppendColumn("File", new Gtk.CellRendererText(), "text", 1);

        changesetDetailStore  = new Gtk.ListStore(typeof(string), typeof(string));
        changesetDetail.Model = changesetDetailStore;

#if HAVE_ATLEAST_GTK_210
        changesetDetail.EnableGridLines = TreeViewGridLines.Horizontal;
#endif

        Add(changesetDetail);
    }
Esempio n. 44
0
 public void AddColumnIcon(string iconname, int col)
 {
     column             = new TreeViewColumn();
     iconrenderer       = new Gtk.CellRendererPixbuf();
     column.Expand      = false;
     column.Resizable   = false;
     column.Clickable   = false;
     column.Reorderable = false;
     column.Alignment   = 0.5f;
     column.Widget      = new Gtk.Image(
         Gtk.IconTheme.Default.LoadIcon(iconname, 16, 0)
         );
     column.Widget.Show();
     column.PackStart(iconrenderer, true);
     column.AddAttribute(iconrenderer, "pixbuf", col);
     tree.AppendColumn(column);
 }
        public DocumentSwitcher(Gtk.Window parent, bool startWithNext) : base(Gtk.WindowType.Popup)
        {
            this.documents         = new List <Document> (IdeApp.Workbench.Documents.OrderByDescending(d => d.LastTimeActive));
            this.TransientFor      = parent;
            this.CanFocus          = true;
            this.Decorated         = false;
            this.DestroyWithParent = true;
            //the following are specified using stetic, but documenting them here too
            //this.Modal = true;
            //this.WindowPosition = Gtk.WindowPosition.CenterOnParent;
            //this.TypeHint = WindowTypeHint.Menu;

            this.Build();

            treeviewPads          = new MyTreeView();
            scrolledwindow1.Child = treeviewPads;

            treeviewDocuments     = new MyTreeView();
            scrolledwindow2.Child = treeviewDocuments;

            padListStore       = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(Pad));
            treeviewPads.Model = padListStore;
            treeviewPads.AppendColumn("icon", new Gtk.CellRendererPixbuf(), "pixbuf", 0);
            treeviewPads.AppendColumn("text", new Gtk.CellRendererText(), "text", 1);
            treeviewPads.HeadersVisible = false;

            treeviewPads.Selection.Changed += TreeviewPadsSelectionChanged;
            documentListStore       = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(Document));
            treeviewDocuments.Model = documentListStore;
            treeviewDocuments.AppendColumn("icon", new Gtk.CellRendererPixbuf(), "pixbuf", 0);
            treeviewDocuments.AppendColumn("text", new Gtk.CellRendererText(), "text", 1);
            treeviewDocuments.HeadersVisible     = false;
            treeviewDocuments.Selection.Changed += TreeviewDocumentsSelectionChanged;

            FillLists();
            this.labelFileName.Ellipsize = Pango.EllipsizeMode.Start;
            if (IdeApp.Workbench.ActiveDocument != null)
            {
                SwitchToDocument();
                SelectDocument(startWithNext ? GetNextDocument(IdeApp.Workbench.ActiveDocument) : GetPrevDocument(IdeApp.Workbench.ActiveDocument));
            }
            else
            {
                SwitchToPad();
            }
        }
Esempio n. 46
0
    private void createTreeView(Gtk.TreeView myTreeView)
    {
        myTreeView.HeadersVisible = true;
        int count = 0;

        myTreeView.AppendColumn(Catalog.GetString("Count"), new CellRendererText(), "text", count++);
        //myTreeView.AppendColumn ( Catalog.GetString ("Time"), new CellRendererText(), "text", count++);

        Gtk.TreeViewColumn timeColumn = new Gtk.TreeViewColumn();
        timeColumn.Title = Catalog.GetString("Time");
        Gtk.CellRendererText timeCell = new Gtk.CellRendererText();
        timeCell.Editable = true;
        timeCell.Edited  += timeCellEdited;
        timeColumn.PackStart(timeCell, true);
        timeColumn.AddAttribute(timeCell, "text", count++);
        myTreeView.AppendColumn(timeColumn);
    }
        void CreateTree()
        {
            _treeView = new Gtk.TreeView();
            _treeView.SetSizeRequest(500, 600);

            //type
            var typeColumn = new Gtk.TreeViewColumn();

            typeColumn.Title    = "Type";
            typeColumn.MaxWidth = 50;
            // Do the same for the song title column
            var typeCell = new CellRendererImage();

            typeColumn.PackStart(typeCell, true);
            typeColumn.SetCellDataFunc(typeCell, ResultTypeIconFunc);


            //name
            var nameColumn = new Gtk.TreeViewColumn();

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

            nameColumn.PackStart(nameCell, true);

            // Add the columns to the TreeView
            _treeView.AppendColumn(typeColumn);
            _treeView.AppendColumn(nameColumn);

            typeColumn.AddAttribute(typeCell, "stock-id", 0);
            nameColumn.AddAttribute(nameCell, "text", 1);

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

            _treeView.KeyPressEvent      += HandleKeyPressEvent;
            _treeView.KeyReleaseEvent    += HandleKeyReleaseEvent;
            _treeView.ButtonReleaseEvent += (o, args) => {
                if (SelectedEntity != null)
                {
                    CloseWindow(true);
                }
            };
        }
Esempio n. 48
0
    /*
     *
     * TREEVIEW
     *
     */


    public static void CreateCols(Gtk.TreeView tv, Gtk.TreeStore store,
                                  string name, int verticalPos, bool visible)
    {
        Gtk.TreeViewColumn myCol = new Gtk.TreeViewColumn(name, new CellRendererText(), "text", verticalPos);
        myCol.SortColumnId  = verticalPos;
        myCol.SortIndicator = true;
        myCol.Visible       = visible;
        tv.AppendColumn(myCol);
    }
Esempio n. 49
0
    private TreeView InitTreeViewWithIcon()
    {
        // Model:
        Gtk.ListStore musicListStore = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string));

        // View:
        Gtk.TreeView tree = new Gtk.TreeView();
        tree.AppendColumn("Icon", new Gtk.CellRendererPixbuf(), "pixbuf", 0);
        tree.AppendColumn("Artist", new Gtk.CellRendererText(), "text", 1);
        tree.AppendColumn("Title", new Gtk.CellRendererText(), "text", 2);

        // Controller:
        musicListStore.AppendValues(anotherIcon, "Pixies", "Gigantic");

        // --> MVP:
        tree.Model = musicListStore;
        return(tree);
    }
Esempio n. 50
0
        public MainWindow() : base(Gtk.WindowType.Toplevel)
        {
            this.SetSizeRequest(this.Screen.Width / 2, this.Screen.Height - 100);
            this.Build();
            this.SetIconFromFile(Functions.logoFile);

            scrolledwindow1.Add(tree);

            Gtk.TreeViewColumn   arrowColumn = new Gtk.TreeViewColumn();
            Gtk.CellRendererText arrowCell   = new Gtk.CellRendererText();
            arrowColumn.PackStart(arrowCell, true);

            Gtk.TreeViewColumn inputColumn = new Gtk.TreeViewColumn();
            inputColumn.Title = "";
            Gtk.CellRendererText inputCell = new Gtk.CellRendererText();
            inputColumn.PackStart(inputCell, true);

            Gtk.TreeViewColumn   analysis1Column = new Gtk.TreeViewColumn();
            Gtk.CellRendererText analysis1Cell   = new Gtk.CellRendererText();
            analysis1Column.PackStart(analysis1Cell, true);

            Gtk.TreeViewColumn   analysis2Column = new Gtk.TreeViewColumn();
            Gtk.CellRendererText analysis2Cell   = new Gtk.CellRendererText();
            analysis2Column.PackStart(analysis2Cell, true);

            arrowColumn.SetCellDataFunc(arrowCell, new Gtk.TreeCellDataFunc(RenderArrowCell));
            inputColumn.SetCellDataFunc(inputCell, new Gtk.TreeCellDataFunc(RenderInputCell));
            analysis1Column.SetCellDataFunc(analysis1Cell, new Gtk.TreeCellDataFunc(RenderAnalysis1Cell));
            analysis2Column.SetCellDataFunc(analysis2Cell, new Gtk.TreeCellDataFunc(RenderAnalysis2Cell));

            tree.Model = treeStore;

            tree.AppendColumn(arrowColumn);
            tree.AppendColumn(inputColumn);
            tree.AppendColumn(analysis1Column);
            tree.AppendColumn(analysis2Column);

            tree.ExpanderColumn = analysis1Column;

            scrolledwindow1.ShowAll();

            Start.Clicked    += OnGo;
            entry1.Activated += OnGo;
        }
Esempio n. 51
0
    private void createTreeView(Gtk.TreeView tv)
    {
        tv.HeadersVisible = true;
        int count = 0;

        tv.AppendColumn(Catalog.GetString("Type"), new CellRendererText(), "text", count++);
        tv.AppendColumn(Catalog.GetString("Subtype"), new CellRendererText(), "text", count++);
        tv.AppendColumn(Catalog.GetString("Apply to"), new CellRendererText(), "text", count++);
        tv.AppendColumn(Catalog.GetString("Session/s"), new CellRendererText(), "text", count++);
        tv.AppendColumn(Catalog.GetString("Show jumps"), new CellRendererText(), "text", count++);
        tv.AppendColumn(Catalog.GetString("Show sex"), new CellRendererText(), "text", count++);
        tv.AppendColumn(Catalog.GetString("Checked rows"), new CellRendererText(), "text", count++);
        tv.AppendColumn(Catalog.GetString("Graph Options"), new CellRendererText(), "text", count++);
        tv.AppendColumn(Catalog.GetString("Comment"), new CellRendererText(), "text", count++);
    }
Esempio n. 52
0
        public void ShowWindow()
        {
            Application.Init();

            gxml = new Glade.XML("contactviewer.glade", "MainWindow");
            gxml.Autoconnect(this);

            ActionEntry[] entries = new ActionEntry [] {
                new ActionEntry("FileMenuAction", null, "_File", null, null, null),
                new ActionEntry("OpenAction", Gtk.Stock.Open,
                                "_Open", "<control>O", Catalog.GetString("Open..."), new EventHandler(OnOpenDatabase)),
                new ActionEntry("QuitAction", Gtk.Stock.Quit,
                                "_Quit", "<control>Q", Catalog.GetString("Quit"), new EventHandler(OnQuit)),
                new ActionEntry("HelpMenuAction", null, "_Help", null, null, null),
                new ActionEntry("AboutAction", Gnome.Stock.About,
                                "_About", null, Catalog.GetString("About"), new EventHandler(OnAbout))
            };

            ActionGroup grp = new ActionGroup("MainGroup");

            grp.Add(entries);

            ui_manager = new UIManager();
            ui_manager.InsertActionGroup(grp, 0);
            ui_manager.AddUiFromResource("menu.xml");
            MenubarHolder.Add(ui_manager.GetWidget("/MainMenu"));

            // Fix the TreeView that will contain all contacts
            contact_store = new ListStore(typeof(string), typeof(string));

            ContactList.Model     = contact_store;
            ContactList.RulesHint = true;
            ContactList.AppendColumn(Catalog.GetString("Contacts"), new CellRendererText(), "text", 1);
            ContactList.ButtonReleaseEvent += OnContactSelected;

            // This ListStore will let the user choose what to see in the contact list
            contact_show_type_store = new ListStore(typeof(string), typeof(string));
            contact_show_type_store.AppendValues("DisplayName", Catalog.GetString("Display name"));
            contact_show_type_store.AppendValues("PrimaryEmail", Catalog.GetString("Primary E-mail"));
            contact_show_type_store.AppendValues("SecondEmail", Catalog.GetString("Secondary E-mail"));
            contact_show_type_store.AppendValues("NickName", Catalog.GetString("Nickname"));

            CellRendererText cell = new CellRendererText();

            ListIdentifier.PackStart(cell, false);
            ListIdentifier.AddAttribute(cell, "text", 1);
            ListIdentifier.Model    = contact_show_type_store;
            ListIdentifier.Active   = 0;
            ListIdentifier.Changed += OnContactListTypeChanged;

            MainWindow.Icon         = Beagle.Images.GetPixbuf("contact-icon.png");
            MainWindow.DeleteEvent += OnDeleteEvent;

            LoadDatabase();
            Application.Run();
        }
Esempio n. 53
0
        private void AddColumnText(string name, int index)
        {
            CellRenderer   textRenderer = new CellRendererText();
            TreeViewColumn column       = new TreeViewColumn(name, textRenderer);

            column.AddAttribute(textRenderer, "text", index);
            column.Resizable = true;
            TagTreeView.AppendColumn(column);
            MakeColumnSortable(column, index);
        }
Esempio n. 54
0
        private void renderColumns()
        {
            Gtk.TreeViewColumn requestIDCol = new Gtk.TreeViewColumn();
            requestIDCol.Title = "Title";
            RequestTreeView.AppendColumn(requestIDCol);

            Gtk.TreeViewColumn titleCol = new Gtk.TreeViewColumn();
            titleCol.Title = "User";
            RequestTreeView.AppendColumn(titleCol);


            Gtk.CellRendererText requestIDCell = new Gtk.CellRendererText();
            requestIDCol.PackStart(requestIDCell, true);
            requestIDCol.AddAttribute(requestIDCell, "text", 0);

            Gtk.CellRendererText titleCell = new Gtk.CellRendererText();
            titleCol.PackStart(titleCell, true);
            titleCol.AddAttribute(titleCell, "text", 2);
        }
Esempio n. 55
0
    protected virtual void prepareHeaders(string [] columnsString)
    {
        treeview.HeadersVisible = true;
        int i = 0;

        foreach (string myCol in columnsString)
        {
            treeview.AppendColumn(myCol, new CellRendererText(), "text", i++);
        }
    }
Esempio n. 56
0
    private TreeViewColumn AppendColumn(string name, int indx)
    {
        TreeViewColumn column = directoryList.AppendColumn(name, new Gtk.CellRendererText(), "text", indx);

        column.Clickable    = true;
        column.Resizable    = true;
        column.SortColumnId = indx;
        column.Clicked     += new EventHandler(sortableColumns.OnColumnClick);

        return(column);
    }
Esempio n. 57
0
    private void createTreeView(Gtk.TreeView tv, String [] cols, int existsPos)
    {
        int count = 0;

        foreach (string col in cols)
        {
            //paint in red the non uploaded cols
            if (count >= existsPos)
            {
                CellRendererText crt1 = new CellRendererText();
                crt1.Foreground = "red";
                //crt1.Background = "blue";
                tv.AppendColumn(col, crt1, "text", count++);
            }
            else
            {
                tv.AppendColumn(col, new CellRendererText(), "text", count++);
            }
        }
    }
Esempio n. 58
0
        ///////////////SE CREA LA LISTA DE LOS PRODUCTOS APLICADOS  //////
        void crea_treeview_productos()
        {
            treeViewEngineServicio            = new TreeStore(typeof(string), typeof(string), typeof(string), typeof(string));
            lista_de_productos_apli.Model     = treeViewEngineServicio;
            lista_de_productos_apli.RulesHint = true;

            TreeViewColumn   col_servicio = new TreeViewColumn();
            CellRendererText cellr0       = new CellRendererText();

            col_servicio.Title = "Servicio/Productos aplicados";             // titulo de la cabecera de la columna, si está visible
            col_servicio.PackStart(cellr0, true);
            col_servicio.AddAttribute(cellr0, "text", 0);
            //cellr0.Editable = true;   // Permite edita este campo

            TreeViewColumn   col_cantidad = new TreeViewColumn();
            CellRendererText cellr1       = new CellRendererText();

            col_cantidad.Title = "Cantidad";             // titulo de la cabecera de la columna, si está visible
            col_cantidad.PackStart(cellr1, true);
            col_cantidad.AddAttribute(cellr1, "text", 1);

            TreeViewColumn   col_quien_cargo = new TreeViewColumn();
            CellRendererText cellr2          = new CellRendererText();

            col_quien_cargo.Title = "Quien cargo";             // titulo de la cabecera de la columna, si está visible
            col_quien_cargo.PackStart(cellr2, true);
            col_quien_cargo.AddAttribute(cellr2, "text", 2);

            TreeViewColumn   col_fecha_hora = new TreeViewColumn();
            CellRendererText cellr3         = new CellRendererText();

            col_fecha_hora.Title = "Fecha/Hora";             // titulo de la cabecera de la columna, si está visible
            col_fecha_hora.PackStart(cellr3, true);
            col_fecha_hora.AddAttribute(cellr3, "text", 3);

            lista_de_productos_apli.AppendColumn(col_servicio);
            lista_de_productos_apli.AppendColumn(col_cantidad);
            lista_de_productos_apli.AppendColumn(col_quien_cargo);
            lista_de_productos_apli.AppendColumn(col_fecha_hora);
            //lista_de_productos_apli.RowExpanded += on_expandrows_RowExpanded;
        }
Esempio n. 59
0
        public LibraryManagerDialog()
        {
            Glade.XML xml = new Glade.XML(null, "stetic.glade", "LibraryManagerDialog", null);
            xml.Autoconnect(this);

            store = new Gtk.ListStore(typeof(string));
            libraryList.HeadersVisible = false;
            libraryList.Model          = store;
            libraryList.AppendColumn("Assembly", new Gtk.CellRendererText(), "text", 0);

            LoadList();
        }
Esempio n. 60
0
        private void setupTreeViews()
        {
            _store = new ListStore(typeof(string));
            templateTreeView.Model = _store;

            TreeViewColumn col;

            col = templateTreeView.AppendColumn("Name", new CellRendererText(), "text", 0);
            col.SortColumnId = 0;

            _store.SetSortColumnId(0, SortType.Ascending);
        }