AppendValues() public method

public AppendValues ( ) : Gtk.TreeIter
return Gtk.TreeIter
示例#1
0
        public ApplicationWidget(Project project,Gtk.Window parent)
        {
            parentWindow =parent;
            this.Build();
            this.project = project;

            cbType = new ComboBox();

            ListStore projectModel = new ListStore(typeof(string), typeof(string));
            CellRendererText textRenderer = new CellRendererText();
            cbType.PackStart(textRenderer, true);
            cbType.AddAttribute(textRenderer, "text", 0);

            cbType.Model= projectModel;

            TreeIter ti = new TreeIter();
            foreach(SettingValue ds in MainClass.Settings.ApplicationType){// MainClass.Settings.InstallLocations){
                if(ds.Value == this.project.ApplicationType){
                    ti = projectModel.AppendValues(ds.Display,ds.Value);
                    cbType.SetActiveIter(ti);
                } else  projectModel.AppendValues(ds.Display,ds.Value);
            }
            if(cbType.Active <0)
                cbType.Active =0;

            tblGlobal.Attach(cbType, 1, 2, 0,1, AttachOptions.Fill|AttachOptions.Expand, AttachOptions.Fill|AttachOptions.Expand, 0, 0);

            afc = new ApplicationFileControl(project.AppFile,ApplicationFileControl.Mode.EditNoSaveButton,parentWindow);
            vbox2.PackEnd(afc, true, true, 0);
        }
示例#2
0
		public PythonOptionsWidget ()
		{
			this.Build();
			
			// Python paths
			m_PathsListStore = new ListStore (typeof (string));
			m_PathsTreeView.Model = this.m_PathsListStore;
			m_PathsTreeView.HeadersVisible = false;
			TreeViewColumn column = new TreeViewColumn ();
			CellRendererText ctext = new CellRendererText ();
			column.PackStart (ctext, true);
			column.AddAttribute (ctext, "text", 0);
			m_PathsTreeView.AppendColumn (column);
			m_PathsTreeView.Selection.Changed += delegate {
				this.m_RemovePathButton.Sensitive = m_PathsTreeView.Selection.CountSelectedRows () == 1;
			};
			
			// Setup Python Runtime Version
			m_RuntimeListStore = new ListStore (typeof (string), typeof (Type));
			m_RuntimeCombo.Model = this.m_RuntimeListStore;
			m_RuntimeListStore.AppendValues ("Python 2.5", typeof (Python25Runtime));
			m_RuntimeListStore.AppendValues ("Python 2.6", typeof (Python26Runtime));
			m_RuntimeListStore.AppendValues ("Python 2.7", typeof (Python27Runtime));
			m_RuntimeListStore.AppendValues ("IronPython", typeof (IronPythonRuntime));
			
			m_RuntimeCombo.Changed += delegate {
				m_RuntimeFileEntry.Path = String.Empty;
			};
		}
示例#3
0
        public ComboBoxHelper(
			ComboBox comboBox, 
			IDbConnection dbConnection, 
			string keyFieldName, 
			string valueFieldName, 
			string tableName, 
			int id)
        {
            this.comboBox = comboBox;

            CellRendererText cellRendererText = new CellRendererText();
            comboBox.PackStart (cellRendererText, true);
            comboBox.AddAttribute (cellRendererText, "text", 1);

            listStore = new ListStore(typeof(int), typeof(string));
            TreeIter initialTreeIter = listStore.AppendValues(0, "<sin asignar>");
            IDbCommand dbCommand = dbConnection.CreateCommand ();
            dbCommand.CommandText = string.Format(selectFormat, keyFieldName, valueFieldName, tableName);
            IDataReader dataReader = dbCommand.ExecuteReader ();
            while (dataReader.Read ()) {
                int key = (int)dataReader[keyFieldName];
                string value = (string)dataReader[valueFieldName];
                TreeIter treeIter = listStore.AppendValues (key, value);
                if (key == id)
                    initialTreeIter = treeIter;
            }
            dataReader.Close ();

            comboBox.Model = listStore;
            comboBox.SetActiveIter (initialTreeIter);
        }
示例#4
0
        public ComboBoxHelper(IDbConnection dbConnection,ComboBox comboBox,string nombre, string id,int elementoInicial,string tabla)
        {
            this.comboBox=comboBox;

            IDbCommand dbCommand= dbConnection.CreateCommand();
            dbCommand.CommandText = string.Format(selectFormat,id,nombre,tabla);

            IDataReader dbDataReader= dbCommand.ExecuteReader();

            //			CellRendererText cell1=new CellRendererText();
            //			comboBox.PackStart(cell1,false);
            //			comboBox.AddAttribute(cell1,"text",0);

            CellRendererText cell2=new CellRendererText();
            comboBox.PackStart(cell2,false);
            comboBox.AddAttribute(cell2,"text",1);//añadimos columnas
            liststore=new ListStore(typeof(int),typeof(string));

            TreeIter initialIter= liststore.AppendValues(0,"<sin asignar>");//si el elemento inicial no existe se selecciona esta opcion
            while(dbDataReader.Read()){
                int id2=(int)dbDataReader[id];
                string nombre2=dbDataReader[nombre].ToString();
                TreeIter iter=liststore.AppendValues(id2,nombre2);
                if(elementoInicial==id2)
                    initialIter=iter;
            }
            dbDataReader.Close();
            comboBox.Model=liststore;
            comboBox.SetActiveIter(initialIter);
        }
        public CompilerOptionsPanelWidget(DotNetProject project)
        {
            this.Build();
            this.project = project;
            DotNetProjectConfiguration configuration = (DotNetProjectConfiguration) project.GetActiveConfiguration (IdeApp.Workspace.ActiveConfiguration);
            FSharpCompilerParameters compilerParameters = (FSharpCompilerParameters) configuration.CompilationParameters;

            ListStore store = new ListStore (typeof (string));
            store.AppendValues (GettextCatalog.GetString ("Executable"));
            store.AppendValues (GettextCatalog.GetString ("Library"));
            store.AppendValues (GettextCatalog.GetString ("Executable with GUI"));
            store.AppendValues (GettextCatalog.GetString ("Module"));
            compileTargetCombo.Model = store;
            CellRendererText cr = new CellRendererText ();
            compileTargetCombo.PackStart (cr, true);
            compileTargetCombo.AddAttribute (cr, "text", 0);
            compileTargetCombo.Active = (int) configuration.CompileTarget;
            compileTargetCombo.Changed += new EventHandler (OnTargetChanged);

            // Load the codepage. If it matches any of the supported encodigs, use the encoding name
            string foundEncoding = null;
            foreach (TextEncoding e in TextEncoding.SupportedEncodings) {
                if (e.CodePage == -1)
                    continue;
                if (e.CodePage == compilerParameters.CodePage)
                    foundEncoding = e.Id;
                codepageEntry.AppendText (e.Id);
            }
            if (foundEncoding != null)
                codepageEntry.Entry.Text = foundEncoding;
            else if (compilerParameters.CodePage != 0)
                codepageEntry.Entry.Text = compilerParameters.CodePage.ToString ();
        }
示例#6
0
        public static void Fill(ComboBox comboBox, QueryResult queryResult)
        {
            CellRendererText cellRenderText = new CellRendererText ();

            comboBox.PackStart (cellRenderText, false);
            comboBox.SetCellDataFunc(cellRenderText,
                delegate(CellLayout Cell_layout, CellRenderer CellView, TreeModel tree_model, TreeIter iter) {
                IList row = (IList)tree_model.GetValue(iter, 0);
                cellRenderText.Text = row[1].ToString();

                //Vamos a ver el uso de los parámetros para acceder a SQL

            });

            ListStore listStore = new ListStore (typeof(IList));

            //TODO localización de "Sin Asignar".
            IList first = new object[] { null, "<sin asignar>" };
            TreeIter treeIterFirst = listStore.AppendValues (first);
            //TreeIter treeIterFirst = ListStore.AppendValues(first);
            foreach (IList row in queryResult.Rows)
                listStore.AppendValues (row);
            comboBox.Model = listStore;
            //Por defecto vale -1 (para el indice de categoría)
            comboBox.Active = 0;
            comboBox.SetActiveIter(treeIterFirst);
        }
示例#7
0
        public AddObjectClassDialog(Connection conn)
        {
            objectClasses = new List<string> ();

            ui = new Glade.XML (null, "lat.glade", "addObjectClassDialog", null);
            ui.Autoconnect (this);

            store = new ListStore (typeof (bool), typeof (string));

            CellRendererToggle crt = new CellRendererToggle();
            crt.Activatable = true;
            crt.Toggled += OnClassToggled;

            objClassTreeView.AppendColumn ("Enabled", crt, "active", 0);
            objClassTreeView.AppendColumn ("Name", new CellRendererText (), "text", 1);

            objClassTreeView.Model = store;

            try {

                foreach (string n in conn.Data.ObjectClasses)
                    store.AppendValues (false, n);

            } catch (Exception e) {

                store.AppendValues (false, "Error getting object classes");
                Log.Debug (e);
            }

            addObjectClassDialog.Icon = Global.latIcon;
            addObjectClassDialog.Resize (300, 400);
            addObjectClassDialog.Run ();
            addObjectClassDialog.Destroy ();
        }
示例#8
0
        public ComboBoxHelper(ComboBox comboBox, object id, string selectSql)
        {
            CellRendererText cellRendererText = new CellRendererText ();
            comboBox.PackStart (cellRendererText, false);
            comboBox.SetCellDataFunc (cellRendererText, new CellLayoutDataFunc (delegate(CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter) {
                cellRendererText.Text = ((object[])tree_model.GetValue(iter, 0))[1].ToString();
            }));

            ListStore listStore = new ListStore (typeof(object));
            object[] initial = new object[] { null, "<sin asignar>" };
            TreeIter initialTreeIter = listStore.AppendValues ((object)initial);

            IDbCommand dbCommand = App.Instance.DbConnection.CreateCommand ();
            dbCommand.CommandText = selectSql;
            IDataReader dataReader = dbCommand.ExecuteReader ();
            while (dataReader.Read()) {
                object currentId = dataReader [0];
                object currentName = dataReader [1];
                object[] values = new object[] { currentId, currentName };
                TreeIter treeIter = listStore.AppendValues ((object)values);
                if (currentId.Equals (id))
                    initialTreeIter = treeIter;
            }
            dataReader.Close ();
            comboBox.Model = listStore;
            comboBox.SetActiveIter (initialTreeIter);
        }
示例#9
0
文件: MainWindow.cs 项目: sai1080/AD
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        treeView.Selection.Mode = SelectionMode.Multiple;//seleccion multiple de item

        treeView.AppendColumn("Columna uno",new CellRendererText(),"text",0);
        treeView.AppendColumn("Columna dos",new CellRendererText(),"text",1);
        treeView.AppendColumn("Columna tres",new CellRendererText(),"text",2);

        ListStore listStore = new ListStore(typeof(string), typeof(string), typeof(string));

        treeView.Model = listStore;

        listStore.AppendValues("clave uno", "valor uno", "uno");
        listStore.AppendValues("clave dos", "valor dos", "dos");
        listStore.AppendValues("clave tres", "valor tres", "tres");
        listStore.AppendValues("clave cuatro", "valor cuatro", "cuatro");

        treeView.Selection.Changed += delegate {//añade la ocurrencia del metodo al evento
            int count = treeView.Selection.CountSelectedRows();
            Console.WriteLine("treeView.Selection.Changed CountSelectedRows={0}", count);

            treeView.Selection.SelectedForeach(delegate(TreeModel model, TreePath path, TreeIter iter)
            {
                object value = listStore.GetValue(iter, 0);
                Console.WriteLine("value={0}", value);
            });
          	};
    }
示例#10
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        //comboBox.Active = 0; -> Para establecer como predeterminado un item del combo
        CellRenderer  cellRenderer = new CellRendererText();
        comboBox.PackStart(cellRenderer, false); //expand = false
        comboBox.AddAttribute(cellRenderer, "text", 0);

        CellRenderer  cellRenderer2 = new CellRendererText();
        comboBox.PackStart(cellRenderer2, false); //expand = false
        comboBox.AddAttribute(cellRenderer2, "text", 1);

        listStore = new ListStore(typeof(string), typeof(string));
        comboBox.Model = listStore;

        listStore.AppendValues("1", "uno");
        listStore.AppendValues("2", "dos");

        comboBox.Changed += comboBoxChanged;

        comboBox.Changed += delegate {showItemSelected(listStore);};

        comboBox.Changed += delegate {
            Console.WriteLine("Evento activado");
            TreeIter treeIter;
            if (comboBox.GetActiveIter(out treeIter) ){ // item seleccionado.
                object value =listStore.GetValue(treeIter, 0);
                Console.WriteLine("ComboBox.changed id={0}", value);
            }
        };
    }
示例#11
0
		public ArticuloView () : 
				base(Gtk.WindowType.Toplevel)
		{
			this.Build ();

			List<Articulo> articulos = new List<Articulo> ();

			int categoriaId = 2;

			CellRendererText cellRendererText = new CellRendererText ();
			comboBoxCategoria.PackStart (cellRendererText, false);
			comboBoxCategoria.AddAttribute (cellRendererText, "text", 1);

			ListStore listStore = new ListStore (typeof(int),typeof(string));
			TreeIter initialTreeIter=listStore.AppendValues (0, "<sin asignar>");

			foreach (Articulo articulo in articulos) {
				TreeIter currentTreeIter=listStore.AppendValues (articulo.Id, articulo.Nombre);
				if (articulo.Id == categoriaId)
					initialTreeIter = currentTreeIter;

		}

			comboBoxCategoria.Model = listStore;

			comboBoxCategoria.SetActiveIter (initialTreeIter);

	}
		public MonoRuntimePanelWidget()
		{
			this.Build();
			
			labelRunning.Markup = GettextCatalog.GetString ("MonoDevelop is currently running on <b>{0}</b>.", Runtime.SystemAssemblyService.CurrentRuntime.DisplayName);
			store = new ListStore (typeof(string), typeof(object));
			tree.Model = store;
			
			CellRendererText crt = new CellRendererText ();
			tree.AppendColumn ("Runtime", crt, "markup", 0);
			TargetRuntime defRuntime = IdeApp.Preferences.DefaultTargetRuntime;
			
			foreach (TargetRuntime tr in Runtime.SystemAssemblyService.GetTargetRuntimes ()) {
				string name = tr.DisplayName;
				TreeIter it;
				if (tr == defRuntime) {
					name = "<b>" + name + " (Default)</b>";
					defaultIter = it = store.AppendValues (name, tr);
				} else
					it = store.AppendValues (name, tr);
				if (tr.IsRunning)
					runningIter = it;
			}
			
			tree.Selection.Changed += HandleChanged;
			UpdateButtons ();
		}
		public CompilerOptionsPanelWidget (DotNetProject project)
		{
			this.Build();
			this.project = project;
			DotNetProjectConfiguration configuration = (DotNetProjectConfiguration) project.GetConfiguration (IdeApp.Workspace.ActiveConfiguration);
			CSharpCompilerParameters compilerParameters = (CSharpCompilerParameters) configuration.CompilationParameters;
			CSharpProjectParameters projectParameters = (CSharpProjectParameters) configuration.ProjectParameters;
			
			ListStore store = new ListStore (typeof (string));
			store.AppendValues (GettextCatalog.GetString ("Executable"));
			store.AppendValues (GettextCatalog.GetString ("Library"));
			store.AppendValues (GettextCatalog.GetString ("Executable with GUI"));
			store.AppendValues (GettextCatalog.GetString ("Module"));
			compileTargetCombo.Model = store;
			CellRendererText cr = new CellRendererText ();
			compileTargetCombo.PackStart (cr, true);
			compileTargetCombo.AddAttribute (cr, "text", 0);
			compileTargetCombo.Active = (int) configuration.CompileTarget;
			compileTargetCombo.Changed += new EventHandler (OnTargetChanged);
			
			if (project.IsLibraryBasedProjectType) {
				//fixme: should we totally hide these?
				compileTargetCombo.Sensitive = false;
				mainClassEntry.Sensitive = false;
			} else {
				classListStore = new ListStore (typeof(string));
				mainClassEntry.Model = classListStore;
				mainClassEntry.TextColumn = 0;
				((Entry)mainClassEntry.Child).Text = projectParameters.MainClass ?? string.Empty;
			
				UpdateTarget ();
			}
			
			// Load the codepage. If it matches any of the supported encodigs, use the encoding name 			
			string foundEncoding = null;
			foreach (TextEncoding e in TextEncoding.SupportedEncodings) {
				if (e.CodePage == -1)
					continue;
				if (e.CodePage == projectParameters.CodePage)
					foundEncoding = e.Id;
				codepageEntry.AppendText (e.Id);
			}
			if (foundEncoding != null)
				codepageEntry.Entry.Text = foundEncoding;
			else if (projectParameters.CodePage != 0)
				codepageEntry.Entry.Text = projectParameters.CodePage.ToString ();
			
			iconEntry.Path = projectParameters.Win32Icon;
			iconEntry.DefaultPath = project.BaseDirectory;
			allowUnsafeCodeCheckButton.Active = compilerParameters.UnsafeCode;
			noStdLibCheckButton.Active = compilerParameters.NoStdLib;

			ListStore langVerStore = new ListStore (typeof (string));
			langVerStore.AppendValues (GettextCatalog.GetString ("Default"));
			langVerStore.AppendValues ("ISO-1");
			langVerStore.AppendValues ("ISO-2");
			langVerCombo.Model = langVerStore;
			langVerCombo.Active = (int) compilerParameters.LangVersion;
		}
示例#14
0
		public ScrapeViewModel()
		{
			m_exploredLinks = new ListStore(typeof(string));
			m_queue = new ConcurrentQueue<ScrapePair>();
			m_tokenSource = new CancellationTokenSource();
			m_exploredLinks.AppendValues("Test1");
			m_exploredLinks.AppendValues("Test2");
		}
		TreeModel CreateCompletionModel ()
		{
			ListStore store = new ListStore (typeof (string));

			store.AppendValues ("GNOME");
			store.AppendValues ("total");
			store.AppendValues ("totally");

			return store;
		}
示例#16
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        //		MyFunction f;
        //
        //		MyFunction[] functions = new MyFunction[]{suma, resta, multiplica};
        //
        //		int random = new Random().Next(3);
        //		f= functions[random];
        //
        //		Console.WriteLine("f={0}", f(5,3));

        treeView.Selection.Mode=SelectionMode.Multiple;

        treeView.AppendColumn("Columna uno", new CellRendererText(), "text",0);
        treeView.AppendColumn("Columna dos", new CellRendererText(), "text",1);

        CellRenderer cellRenderer = new CellRendererText();
        comboBox.PackStart(cellRenderer, false); //expand = false
        comboBox.AddAttribute (cellRenderer, "text", 0);

        CellRenderer cellRenderer2 = new CellRendererText();
        comboBox.PackStart(cellRenderer2, false); //expand = false
        comboBox.AddAttribute (cellRenderer2, "text", 1);

        listStore = new ListStore (typeof(string), typeof(string));
        comboBox.Model = listStore;
        treeView.Model = listStore;

        listStore.AppendValues("1", "Uno");
        listStore.AppendValues("2", "Dos");

        treeView.Selection.Changed+=delegate{
            int count = treeView.Selection.CountSelectedRows();
            Console.WriteLine("treeView.Selection.Changed CountSelectedRows={0}" + count);

            treeView.Selection.SelectedForeach(delegate(TreeModel model, TreePath path, TreeIter iter){
                object value = listStore.GetValue(iter, 0);
                Console.WriteLine("value={0}", value);
        });
        };

        //		comboBox.Changed += delegate {
        //			TreeIter treeIter;
        //			if(comboBox.GetActiveIter(out treeIter)){ //Item seleccionado
        //				object value = listStore.GetValue (treeIter, 0);
        //				Console.WriteLine("comboBoxChanged value={0}", value);
        //			}
        //		};
        comboBox.Changed += comboBoxChanged;

        //comboBox.Changed += delegate {showActiveItem (listStore); };
    }
示例#17
0
        /// <summary>
        /// New connection gtk dialog
        /// </summary>
        public Connection()
        {
            this.Build ();
            this.LC("ConnectionWindow");
            messages.Localize(this);
            this.entry4.Visibility = false;
            this.DeleteEvent += new DeleteEventHandler(Unshow);
            entry3.Text = "6667";
            entry2.Text = Configuration.UserData.ident;
            entry1.Text = Configuration.UserData.nick;
            combobox1.Clear();
            CellRendererText cell = new CellRendererText();
            combobox1.PackStart(cell, false);
            combobox1.AddAttribute(cell, "text", 0);
            ListStore store = new ListStore(typeof(string));
            combobox1.Model = store;
            ListStore store2 = new ListStore(typeof(string));
            TreeIter iter = store.AppendValues("irc");
            store.AppendValues("pidgeon services");

            if (Configuration.Kernel.Debugging)
            {
                store.AppendValues("quassel");
                store.AppendValues("dcc");
            }

            comboboxentry1.Model = store2;
            combobox1.SetActiveIter(iter);
            button1.Clicked += new EventHandler(bConnect_Click);
            checkbutton1.Active = Configuration.UserData.LastSSL;
            if (!string.IsNullOrEmpty(Configuration.UserData.LastPort))
            {
                entry3.Text = Configuration.UserData.LastPort;
            }
            if (!string.IsNullOrEmpty(Configuration.UserData.LastNick))
            {
                entry1.Text = Configuration.UserData.LastNick;
            }
            if (!string.IsNullOrEmpty(Configuration.UserData.LastHost))
            {
                TreeIter iter2 = store2.AppendValues(Configuration.UserData.LastHost);
                this.comboboxentry1.SetActiveIter(iter2);
            }
            lock (Configuration.UserData.History)
            {
                foreach (string nw in Configuration.UserData.History)
                {
                    store2.AppendValues(nw);
                }
                if (!Configuration.UserData.History.Contains(comboboxentry1.ActiveText.ToLower()))
                {
                    Configuration.UserData.History.Add(comboboxentry1.ActiveText);
                }
            }
        }
示例#18
0
    private TreeModel SetupTreeViewModel()
    {
        var model = new ListStore(typeof(string), typeof(string), typeof(string));

        model.AppendValues("1", "Bert", "Sanders");
        model.AppendValues("2", "Ryan", "Nieves");
        model.AppendValues("3", "Cruz", "Strong");
        model.AppendValues("4", "Basia", "Dunlap");
        model.AppendValues("5", "Madaline", "Durham");

        return model;
    }
        public CategoriaListView(IDbConnection dbConnection)
            : base(dbConnection)
        {
            TreeView.AppendColumn("id", new CellRendererText(),"text",0);
            TreeView.AppendColumn("nombre", new CellRendererText(),"text",1);
            ListStore listStore =  new ListStore(typeof(int),typeof(string));
            TreeView.Model = listStore;

            listStore.AppendValues(1,"Cat. 1");
            listStore.AppendValues(2,"Cat. 2");
            listStore.AppendValues(3,"Cat. 3");
        }
		public CompilerParametersPanelWidget()
		{
			this.Build();
			
			var store = new ListStore (typeof (string));
			store.AppendValues (GettextCatalog.GetString ("Executable"));
			store.AppendValues (GettextCatalog.GetString ("Library"));
			compileTargetCombo.Model = store;
			var cr = new CellRendererText ();
			compileTargetCombo.PackStart (cr, true);
			compileTargetCombo.AddAttribute (cr, "text", 0);
		}
示例#21
0
文件: MainWindow.cs 项目: sai1080/AD
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();
        treeView.AppendColumn ("Columna 1", new CellRendererText (), "text", 0);
        treeView.AppendColumn ("Columna 2", new CellRendererText (), "text", 1);

        ListStore listStore = new ListStore(typeof(string), typeof(string));
        treeView.Model = listStore;
        listStore.AppendValues("clave uno","valor uno");
                listStore.AppendValues("clave dos","valor dos");
    }
        public ArticuloListView(IDbConnection dbConnection)
            : base(dbConnection)
        {
            TreeView.AppendColumn("id", new CellRendererText(),"text",0);
            TreeView.AppendColumn("nombre", new CellRendererText(),"text",1);
            TreeView.AppendColumn("categoria", new CellRendererText(),"text",2);
            TreeView.AppendColumn("precio", new CellRendererText(),"text",3);
            ListStore listStore = new ListStore(typeof(int),typeof(string),typeof(string),typeof(string));
            TreeView.Model = listStore;

            listStore.AppendValues(1,"Articulo1","Cat. 1","1");
            listStore.AppendValues(2,"Articulo2","Cat. 2","2");
        }
示例#23
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();
        }
示例#24
0
        public WorkerWidget()
        {
            this.Build ();

            #region areaComboBox - Fill areas

            List<String> areaList = SelectWidget.connection.readAreas();
            ListStore ls = new ListStore(typeof(string));
            areaCombobox.Model = ls;

            foreach(string s in areaList)
                ls.AppendValues(s);

            ls.AppendValues ("");
            #endregion

            #region typComboBox - Fill Typ
            List<String> typList = SelectWidget.connection.readTyp();
            ListStore typLS = new ListStore(typeof(string));
            typCombobox.Model = typLS;

            foreach(string s in typList)
                typLS.AppendValues(s);

            typLS.AppendValues("");
            #endregion

            #region taskComboBox - Fill Tasks
            int readAreaID = SelectWidget.connection.readAreaID(areaCombobox.ActiveText);
            if(readAreaID != 0)
            {
                List<String> taskList = SelectWidget.connection.readTasks(readAreaID);
                ListStore taskLS = new ListStore(typeof(string));
                taskCombobox.Model = taskLS;

                foreach(string s in taskList)
                    taskLS.AppendValues(s);

                taskLS.AppendValues("");
            }
            #endregion

            #region timesComboBox - Fill Times
            List<String> timeList = SelectWidget.connection.readTime();
            ListStore timeLS = new ListStore(typeof(string));
            timesCombobox.Model = timeLS;

            foreach(string s in timeList)
                timeLS.AppendValues(s);
            #endregion
        }
		public CodeGenerationPanelWidget ()
		{	
			Build ();
			
			ListStore store = new ListStore (typeof (string));
			store.AppendValues (GettextCatalog.GetString ("Executable"));
			store.AppendValues (GettextCatalog.GetString ("Library"));
			compileTargetCombo.Model = store;
			CellRendererText cr = new CellRendererText ();
			compileTargetCombo.PackStart (cr, true);
			compileTargetCombo.AddAttribute (cr, "text", 0);
				
			compilerJavacButton.Toggled += new EventHandler (OnCompilerToggled);
			compilerGcjButton.Toggled += new EventHandler (OnCompilerToggled);
		}
示例#26
0
        public void loadVersion()
        {
            cmbVersion.Clear();
            CellRendererText cell = new CellRendererText();
            cmbVersion.PackStart(cell, false);
            cmbVersion.AddAttribute(cell, "text", 0);

            ListStore store = new ListStore(typeof (string));

            cmbVersion.Model = store;

            store.AppendValues ("1");
            store.AppendValues ("2");
            store.AppendValues ("3");
        }
示例#27
0
        public PageComboBox (IList<Page> pages, Notebook notebook)
        {
            this.pages = pages;
            this.notebook = notebook;

            // icon, name, order, Page object itself
            model = new ListStore (typeof(Gdk.Pixbuf), typeof(string), typeof(int), typeof(Page));
            model.SetSortColumnId (2, SortType.Ascending);
            Model = model;

            CellRendererPixbuf icon = new CellRendererPixbuf ();
            PackStart (icon, false);
            AddAttribute (icon, "pixbuf", 0);

            CellRendererText name = new CellRendererText ();
            PackStart (name, true);
            AddAttribute (name, "markup", 1);

            foreach (Page page in pages) {
                model.AppendValues (
                    Banshee.Gui.IconThemeUtils.LoadIcon (page.IconName, 22),
                    String.Format ("<b>{0}</b>", page.Name),
                    page.Order,
                    page
                );
            }

            Active = 0;
            Show ();
        }
		/// <summary>
		/// <c>SymbolLabelInfoConfigDialog</c>'s constructor.
		/// </summary>
		/// <param name="parent">
		/// The dialog's parent window.
		/// </param>
		public SymbolLabelDialog(Window parent)
		{
			XML gxml = new XML(null, "gui.glade","symbolLabelDialog",null);
			
			gxml.Autoconnect(this);
			
			symbolLabelDialog.Modal = true;
			symbolLabelDialog.Resizable = false;
			symbolLabelDialog.TransientFor = parent;
			
			CellRendererText cellRenderer = new CellRendererText();			
			
			cellRenderer.Xalign = 0.5f;
			symbolLabelsTV.AppendColumn("Símbolo", cellRenderer,"text",0);
			symbolLabelsTV.AppendColumn("Etiqueta", new CellRendererText(),"text",1);
			
			symbolLabelsModel = new ListStore(typeof(string), 
			                                  typeof(string));
			
			symbolLabelsTV.Model = symbolLabelsModel;
			
			symbolLabelsTV.Selection.Changed += OnSymbolLabelsTVSelectionChanged;
			
			foreach (SymbolLabelInfo info in LibraryConfig.Instance.Symbols)
			{				
				symbolLabelsModel.AppendValues(info.Symbol, info.Label);
			}
			
			changes = false;
		}
示例#29
0
文件: MainWindow.cs 项目: omixcrac/AD
    private void fillComboBox()
    {
        CellRenderer cellRenderer = new CellRendererText();
        comboBox.PackStart(cellRenderer, false); //expand=false
        comboBox.AddAttribute (cellRenderer, "text", 1);

        ListStore listStore = new ListStore(typeof(string), typeof(string));

        comboBox.Model = listStore;

        string connectionString = "Server=localhost;Database=PruebaBD;User Id=ximo;Password=admin";
        IDbConnection dbConnection = new NpgsqlConnection(connectionString);
        dbConnection.Open ();

        IDbCommand dbCommand = dbConnection.CreateCommand();
        dbCommand.CommandText = "select id, nombre from categoria";

        IDataReader dataReader = dbCommand.ExecuteReader();

        while (dataReader.Read ())
            listStore.AppendValues (dataReader["id"].ToString (), dataReader["nombre"].ToString () );

        dataReader.Close ();

        dbConnection.Close ();
    }
		public SelectEncodingsDialog ()
		{
			Build ();
			try {
				storeAvail = new ListStore (typeof(string), typeof(string));
				listAvail.Model = storeAvail;
				listAvail.AppendColumn ("Name", new Gtk.CellRendererText (), "text", 0);
				listAvail.AppendColumn ("Encoding", new Gtk.CellRendererText (), "text", 1);
				
				storeSelected = new ListStore (typeof(string), typeof(string));
				listSelected.Model = storeSelected;
				listSelected.AppendColumn ("Name", new Gtk.CellRendererText (), "text", 0);
				listSelected.AppendColumn ("Encoding", new Gtk.CellRendererText (), "text", 1);
				
				foreach (TextEncoding e in TextEncoding.SupportedEncodings) {
					if (!((IList)TextEncoding.ConversionEncodings).Contains (e))
						storeAvail.AppendValues (e.Name, e.Id);
				}
				
				foreach (TextEncoding e in TextEncoding.ConversionEncodings)
					storeSelected.AppendValues (e.Name, e.Id);
			} catch (Exception  ex) {
				LoggingService.LogError (ex.ToString ());
			}
		}
示例#31
0
        public void ReloadCompilerList()
        {
            compilerStore.Clear();

            defaultCompilerVendor = DCompilerService.Instance.DefaultCompiler;

            foreach (var cmp in DCompilerService.Instance.Compilers)
            {
                var virtCopy = new DCompilerConfiguration();
                virtCopy.AssignFrom(cmp);
                var iter = compilerStore.AppendValues(cmp.Vendor, virtCopy);
                if (cmp.Vendor == defaultCompilerVendor)
                {
                    cmbCompilers.SetActiveIter(iter);
                }
            }
        }
        void UpdateMembers()
        {
            _listStore = new Gtk.ListStore(typeof(string), typeof(string), typeof(string));
            var entities   = MemberExtensionsHelper.Instance.GetEntities();            //TODO filter
            var filterText = _searchView.Text;

            if (string.IsNullOrEmpty(filterText))
            {
                _filteredEntities = entities;
            }
            else
            {
                var filteredEntities = entities.Where(e => MemberMatchingHelper.GetMatchWithSearchText(filterText, e.Name)).ToList();
                _filteredEntities = new Collection <IUnresolvedEntity> (filteredEntities);
            }

            foreach (var entity in _filteredEntities)
            {
                string parameters = GetParameters(entity);

                var name = entity.Name;
                if (name == ".ctor")
                {
                    name = "* " + entity.DeclaringTypeDefinition.Name;
                }

                string returnType = GetFormattedReturnType(entity);

                var iconName = entity.GetStockIcon();

                _listStore.AppendValues(iconName, name + parameters + returnType);
            }
            _treeView.Model = _listStore;

            if (SelectedEntity != null)
            {
                var newIndex = _filteredEntities.IndexOf(s => s.FullName.Equals(SelectedEntity.FullName));
                SelectRowIndex(newIndex == -1 ? 0 : newIndex);
            }
            else
            {
                SelectRowIndex(0);
            }
            UpdateSrollPosition();
        }
示例#33
0
/*
 *              /// <summary>
 *              /// Build a new taskList list setting from all the taskLists
 *              /// </summary>
 *              /// <param name="?">
 *              /// A <see cref="System.String"/>
 *              /// </param>
 *              List<string> BuildNewTaskListList ()
 *              {
 *                      List<string> list = new List<string> ();
 *                      TreeModel model;
 *                      IBackend backend = Application.Backend;
 *                      if (backend == null)
 *                              return list;
 *
 *                      model = backend.TaskLists;
 *                      Gtk.TreeIter iter;
 *                      if (model.GetIterFirst (out iter) == false)
 *                              return list;
 *
 *                      do {
 *                              ITaskList cat = model.GetValue (iter, 0) as ITaskList;
 *                              if (cat == null || cat is AllTaskList)
 *                                      continue;
 *
 *                              list.Add (cat.Name);
 *                      } while (model.IterNext (ref iter) == true);
 *
 *                      return list;
 *              }
 */

        void RebuildTaskListTree()
        {
            if (!backendComboMap.ContainsKey(selectedBackend))
            {
                taskListsTree.Model = null;
                return;
            }

            filteredTaskLists = new ListStore(typeof(ITaskList));
            foreach (var item in application.BackendManager.TaskLists)
            {
                if (!(item == null || item.ListType == TaskListType.Smart))
                {
                    filteredTaskLists.AppendValues(item);
                }
            }
            taskListsTree.Model = filteredTaskLists;
        }
示例#34
0
        private void addPluginButton_Clicked(object sender, EventArgs args)
        {
            FileSelector selector = new FileSelector("Select plugin to load");

            selector.Show();
            int result = selector.Run();

            if (result == (int)Gtk.ResponseType.Ok)
            {
                try {
                    PluginInfo info = new PluginInfo(selector.Filename);
                    pluginsListStore.AppendValues(info);
                } catch (Exception ex) {
                    Core.LoggingService.LogError(ex);
                }
            }
            selector.Destroy();
        }
示例#35
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);
    }
示例#36
0
        /// <summary>
        /// Populates the data from a selected table.
        /// </summary>
        /// <param name="table">Table.</param>
        private void populateGrid(Model.Table table)
        {
            Gtk.ListStore store = treeView.Model as Gtk.ListStore;

            // Empty the store on every new table-selection.
            if (store != null)
            {
                foreach (Gtk.TreeViewColumn col in treeView.Columns)
                {
                    treeView.RemoveColumn(col);
                }
                store.Clear();
            }

            // Construct the array of types which is the size of the columns.
            Type[] types = new Type[table.Columns.Count];
            for (int i = 0, e = table.Columns.Count; i < e; ++i)
            {
                types[i] = typeof(string);
            }

            // The list store must take array of types which it will hold.
            store          = new Gtk.ListStore(types);
            treeView.Model = store;

            // Put columns and cell renderers in the ListStore. There we will put the actual values.
            for (int i = 0, e = table.Columns.Count; i < e; ++i)
            {
                Model.Column         dcol = table.Columns[i];
                Gtk.TreeViewColumn   col  = new Gtk.TreeViewColumn();
                Gtk.CellRendererText cell = new Gtk.CellRendererText();
                col.PackStart(cell, true);
                col.AddAttribute(cell, "text", i);
                col.Title = dcol.Meta.Name;
                treeView.AppendColumn(col);
            }

            // Now fill in the rows.
            foreach (Model.Row r in table.GetAsRows())
            {
                store.AppendValues(r.GetAsStringArray());
            }
            treeView.ShowAll();
        }
示例#37
0
    private void PopulateComments(string photoid)
    {
        _comments.Clear();
        ListStore store = new Gtk.ListStore(typeof(string));

        foreach (Comment comment in
                 PersistentInformation.GetInstance().GetCommentsForPhoto(photoid))
        {
            string username    = comment.UserName;
            string safecomment = Utils.EscapeForPango(comment.CommentHtml);
            string text        = String.Format(
                "<span weight='bold'>{0}:</span> {1}",
                username, safecomment);
            store.AppendValues(text);
            _comments.Add(comment);
        }
        treeview3.Model = store;
        treeview3.ShowAll();
    }
示例#38
0
        private void SetRecentExperimentList()
        {
            Gtk.ListStore recentExperimentsStore = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(RecentExperimentReference));
            this.recentExperimentNodeView.Model = recentExperimentsStore;

            this.recentExperimentNodeView.AppendColumn("Icon", new Gtk.CellRendererPixbuf(), "pixbuf", 0);

            CellRendererText fileNameRenderer = new CellRendererText();
            TreeViewColumn   nameColumn       = this.recentExperimentNodeView.AppendColumn("Filename", fileNameRenderer);

            nameColumn.SetCellDataFunc(fileNameRenderer, new TreeCellDataFunc(RenderFileName));

            foreach (RecentExperimentReference expRef in m_applicationContext.Application.RecentExperiments)
            {
                recentExperimentsStore.AppendValues(s_traceLabIcon, expRef);
            }

            this.recentExperimentNodeView.RowActivated += OpenExperimentOnRowActivated;
        }
        void FillLists()
        {
            foreach (Pad pad in IdeApp.Workbench.Pads)
            {
                if (!pad.Visible)
                {
                    continue;
                }
                padListStore.AppendValues(ImageService.GetPixbuf(!String.IsNullOrEmpty(pad.Icon) ? pad.Icon : MonoDevelop.Ide.Gui.Stock.MiscFiles, IconSize.Menu),
                                          pad.Title,
                                          pad);
            }

            foreach (Document doc in documents)
            {
                documentListStore.AppendValues(GetIconForDocument(doc, IconSize.Menu),
                                               doc.Window.Title,
                                               doc);
            }
        }
示例#40
0
    public void Refresh()
    {
        //Sort lists
        SortLists();

        //outList
        outListStore.Clear();
        foreach (var outItem in listBoxOut)
        {
            outListStore.AppendValues(outItem.Value);
        }

        //inList
        inListStore.Clear();
        IntersectLists();
        foreach (var inItem in listBoxIn)
        {
            inListStore.AppendValues(inItem.Value);
        }
    }
示例#41
0
            public void Add(TemplateItem templateItem)
            {
                string name = GLib.Markup.EscapeText(templateItem.Name);
                string desc = null;

                if (templateItem.DisplayCategory)
                {
                    desc = templateItem.Template.Category;
                }
                else if (!string.IsNullOrEmpty(templateItem.Template.LanguageName))
                {
                    desc = templateItem.Template.LanguageName;
                }

                if (desc != null)
                {
                    name += "\n<span foreground='darkgrey'><small>" + desc + "</small></span>";
                }
                templateStore.AppendValues(templateItem.Template.Icon.IsNull ? "md-project" : templateItem.Template.Icon.ToString(), name, templateItem.Template);
            }
示例#42
0
        void UpdateUsers()
        {
            if (!QSMain.TestConnection())
            {
                return;
            }
            QSMain.CheckConnectionAlive();
            logger.Info("Получаем таблицу пользователей...");

            string sql = "SELECT * FROM users ";

            if (!chkShowInactive.Active)
            {
                sql += " WHERE deactivated = 0";
            }
            MySqlCommand cmd = new MySqlCommand(sql, QSMain.connectionDB);

            MySqlDataReader rdr = cmd.ExecuteReader();

            UsersListStore.Clear();
            while (rdr.Read())
            {
                bool deactivated = false;
                try {
                    deactivated = DBWorks.GetBoolean(rdr, "deactivated", false);
                } catch {
                    logger.Warn("В базе отсутствует поле deactivated!");
                }
                UsersListStore.AppendValues(int.Parse(rdr ["id"].ToString()),
                                            rdr ["login"].ToString(),
                                            rdr ["name"].ToString(),
                                            (bool)rdr ["admin"],
                                            deactivated,
                                            deactivated ? "grey" : "black");
            }
            rdr.Close();

            logger.Info("Ok");

            OnTreeviewUsersCursorChanged(null, null);
        }
示例#43
0
        protected void UpdateList()
        {
            logger.Info("Получаем таблицу справочника " + nameRef + "...");
            entryFilter.Text = "";
            QSMain.CheckConnectionAlive();
            try
            {
                string    sql = SqlSelect.Replace("@tablename", TableRef);
                DbCommand cmd = QSMain.ConnectionDB.CreateCommand();
                cmd.CommandText = sql;

                using (DbDataReader rdr = cmd.ExecuteReader())
                {
                    RefListStore.Clear();
                    object[] Values = new object[RefListStore.NColumns];
                    while (rdr.Read())
                    {
                        Values[0] = rdr.GetInt32(0);
                        object[] Fields = new object[rdr.FieldCount];
                        rdr.GetValues(Fields);
                        for (int i = 1; i < Columns.Count; i++)
                        {
                            Values[i] = String.Format(Columns[i].DisplayFormat, Fields);
                        }
                        if (_OrdinalField != "")
                        {
                            Values[OrdinalColumn] = rdr.GetInt32(rdr.GetOrdinal(_OrdinalField));
                        }
                        RefListStore.AppendValues(Values);
                    }
                }
                logger.Info("Ok");
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Ошибка получения таблицы!");
                QSMain.ErrorMessage(this, ex);
            }
            OnTreeviewrefCursorChanged((object)treeviewref, EventArgs.Empty);
            TestOrdinalChanged();
        }
示例#44
0
        public Gtk.ListStore  CreateTreeViewListStore()
        {
            var tps = new Type[Columns.Count];

            for (var i = 0; i < Columns.Count; i++)
            {
                tps[i] = (Type)Columns[i].Data["cellTypeOf"];
            }

            var listStore = new Gtk.ListStore(tps);

            TreeIters = new Dictionary <int, TreeIter>();

            foreach (var row in Data.Keys)
            {
                var treeIter = listStore.AppendValues(Data[row].ToArray());
                TreeIters.Add(row, treeIter);
            }

            return(listStore);
        }
示例#45
0
        private void on_BookDruidPageStandard_next(object o, Gnome.NextClickedArgs args)
        {
            // skip next page if active
            if (EvolutionRadioButton.Active)
            {
                NewPhoneBookDruid.Page = druidpagestandard12;

                EdsPhoneBooks eds    = new EdsPhoneBooks();
                ArrayList     ebooks = new ArrayList();
                ebooks = eds.GetPhoneBooks();

                Gtk.TreeIter iter = new Gtk.TreeIter();

                IEnumerator enu = ebooks.GetEnumerator();
                while (enu.MoveNext())
                {
                    iter = store.AppendValues(false, enu.Current);
                    EvolutionTreeView.Model = store;
                }
            }
        }
示例#46
0
        private void ResetBirdWidgetsAndRefreshBirdsList()
        {
            birdNameEntry.Text      = "";
            birdBreedEntry.Text     = "";
            birdColorEntry.Text     = "";
            birdAgeSpinButton.Value = 0.0f;
            birdGenderMaleRadioButton.Activate();
            birdNotesTextView.Buffer.Clear();

            BirdsListStore.Clear();

            for (int idx = 0; idx < Birds.Count; idx++)
            {
                Bird bird = Birds[idx];

                if (!bird.Deleted)
                {
                    BirdsListStore.AppendValues(idx, bird.Name, bird.Breed, bird.Color, bird.Age, bird.Gender.ToString(), bird.Notes);
                }
            }
        }
示例#47
0
        private void manager_NewFileTransfer(object sender, FileTransferEventArgs e)
        {
            try {
                // Add transfer to list
                transferListStore.AppendValues(e.Transfer);

                // Watch a few other events
                e.Transfer.PeerAdded += (EventHandler <FileTransferPeerEventArgs>)DispatchService.GuiDispatch(
                    new EventHandler <FileTransferPeerEventArgs>(transfer_PeerAdded)
                    );

                e.Transfer.Error += (EventHandler <ErrorEventArgs>)DispatchService.GuiDispatch(
                    new EventHandler <ErrorEventArgs>(transfer_Error)
                    );

                Gui.MainWindow.RefreshCounts();
            } catch (Exception ex) {
                Core.LoggingService.LogError(ex);
                Gui.ShowErrorDialog(ex.ToString(), Gui.MainWindow.Window);
            }
        }
    public TreeViewExample()
    {
        songs = new ArrayList();

        songs.Add(new Song("Dancing DJs vs. Roxette", "Fading Like a Flower"));
        songs.Add(new Song("Xaiver", "Give me the night"));
        songs.Add(new Song("Daft Punk", "Technologic"));

        Gtk.Window window = new Gtk.Window("TreeView Example");
        window.SetSizeRequest(500, 200);

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

        Gtk.TreeViewColumn artistColumn = new Gtk.TreeViewColumn();
        artistColumn.Title = "Artist";
        Gtk.CellRendererText artistNameCell = new Gtk.CellRendererText();
        artistColumn.PackStart(artistNameCell, true);

        Gtk.TreeViewColumn songColumn = new Gtk.TreeViewColumn();
        songColumn.Title = "Song Title";
        Gtk.CellRendererText songTitleCell = new Gtk.CellRendererText();
        songColumn.PackStart(songTitleCell, true);

        Gtk.ListStore musicListStore = new Gtk.ListStore(typeof(Song));
        foreach (Song song in songs)
        {
            musicListStore.AppendValues(song);
        }

        artistColumn.SetCellDataFunc(artistNameCell, new Gtk.TreeCellDataFunc(RenderArtistName));
        songColumn.SetCellDataFunc(songTitleCell, new Gtk.TreeCellDataFunc(RenderSongTitle));

        tree.Model = musicListStore;

        tree.AppendColumn(artistColumn);
        tree.AppendColumn(songColumn);

        window.ShowAll();
    }
示例#49
0
        void UpdateDocuments()
        {
            _listStore = new Gtk.ListStore(typeof(string));
            var documents  = FileHistoryHelper.Instance.GetRecentDocuments();             //TODO filter
            var filterText = _searchView.Text;

            if (string.IsNullOrEmpty(filterText))
            {
                _filteredDocuments = new Collection <FileOpenInformation> (documents);
            }
            else
            {
                var filteredDocuments = documents.Where(e => {
                    return(MemberMatchingHelper.GetMatchWithSearchText(filterText, e.FileName.FileName));
                }).ToList();
                _filteredDocuments = new Collection <FileOpenInformation> (filteredDocuments);
            }
            foreach (var document in _filteredDocuments)
            {
                //TODO improve this
                var name = document.FileName.FileName;
                _listStore.AppendValues(name);
            }

            _treeView.Model = _listStore;

            if (_filteredDocuments.Count > 0)
            {
                if (_selectedDocument != null)
                {
                    var newIndex = _filteredDocuments.IndexOf(_selectedDocument);
                    SelectRowIndex(newIndex == -1 ? 0 : newIndex);
                }
                else
                {
                    SelectRowIndex(0);
                }
            }
            UpdateSrollPosition();
        }
示例#50
0
        void fillStore()
        {
            int      count    = 0;
            TreeIter lastIter = TreeIter.Zero;

            foreach (WebDeployTarget target in project.WebDeployTargets)
            {
                if (target.ValidForDeployment)
                {
                    lastIter = targetStore.AppendValues(target.GetMarkup(), target, false);
                    count++;
                }
            }

            //select some targets by default if appropriate
            if (count == 1)
            {
                targetStore.SetValue(lastIter, LISTCOL_Checked, true);
            }
            //FIXME: store/load other selections in .userprefs file
            UpdateButtonState();
        }
示例#51
0
        public LoadedPlugins(PluginServiceContainer plugins)
        {
            this.Build();

            this.treeView = treeview1;
            Gtk.TreeViewColumn column = new Gtk.TreeViewColumn();
            column.Title = "Loaded plugins";
            treeview1.AppendColumn(column);

            Gtk.ListStore        loadedPlugins = new Gtk.ListStore(typeof(string));
            Gtk.CellRendererText cell          = new Gtk.CellRendererText();

            column.PackStart(cell, true);
            column.AddAttribute(cell, "text", 0);

            for (int i = 0; i < plugins.Plugins.Count; i++)
            {
                loadedPlugins.AppendValues(System.IO.Path.GetFileName(plugins.Plugins[i].codeBase));
            }

            treeview1.Model = loadedPlugins;
        }
示例#52
0
        protected ProjectOpenDialog(Builder builder, IntPtr handle, IRepository <Project> reppsitory) : base(handle)
        {
            projectList.Data[1] = 5;
            _reposiory          = _reposiory;
            _builder            = builder;
            builder.Autoconnect(this);

            TreeViewColumn nameColumn = new TreeViewColumn();

            nameColumn.Title = "Name";

            TreeViewColumn startdateColumn = new TreeViewColumn();

            startdateColumn.Title = "Startdatum";
            projectList.AppendColumn(nameColumn);
            projectList.AppendColumn(startdateColumn);

            CellRendererText nameCell = new CellRendererText();

            nameColumn.PackStart(nameCell, true);

            CellRendererText startdateCell = new CellRendererText();

            startdateColumn.PackStart(startdateCell, true);

            nameColumn.AddAttribute(nameCell, "text", 0);
            startdateColumn.AddAttribute(startdateCell, "text", 1);

            Gtk.ListStore projectStore = new Gtk.ListStore(typeof(string), typeof(string), typeof(Project));

            foreach (var p in reppsitory.GetAll())
            {
                // Add some data to the store
                TreeIter iter = projectStore.AppendValues(p.Name, p.Startdate.ToDateTime().ToShortDateString(), p);
            }

            // Assign the model to the TreeView
            projectList.Model = projectStore;
        }
        private ListStore CreateModel()
        {
            ListStore store = new Gtk.ListStore(typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));

            string[] stockIds = Gtk.Stock.ListIds();
            Array.Sort(stockIds);

            // Use reflection to get the list of C# names
            Hashtable idToName = new Hashtable();

            foreach (PropertyInfo info in typeof(Gtk.Stock).GetProperties(BindingFlags.Public | BindingFlags.Static))
            {
                if (info.PropertyType == typeof(string))
                {
                    idToName[info.GetValue(null, null)] = "Gtk.Stock." + info.Name;
                }
            }

            foreach (string id in stockIds)
            {
                Gtk.StockItem si;
                string        accel;

                si = Gtk.Stock.Lookup(id);
                if (si.Keyval != 0)
                {
                    accel = Accelerator.Name(si.Keyval, si.Modifier);
                }
                else
                {
                    accel = "";
                }

                store.AppendValues(id, idToName[id], si.Label, accel);
            }

            return(store);
        }
示例#54
0
        private void InitializeConfigListView()
        {
            m_configStore = new Gtk.ListStore(typeof(ConfigItemSetting), typeof(ConfigItemSetting),
                                              typeof(ConfigItemSetting), typeof(ConfigItemSetting));

            this.configView.Model = m_configStore;

            //create columns with associated cell renderings
            CellRendererText nameRenderer = new CellRendererText();
            TreeViewColumn   nameColumn   = this.configView.AppendColumn("Config Parameter", nameRenderer);

            nameColumn.SetCellDataFunc(nameRenderer, new TreeCellDataFunc(RenderName));

            CellRendererText aliasRenderer = new CellRendererText();
            TreeViewColumn   aliasColumn   = this.configView.AppendColumn("Alias", aliasRenderer);

            aliasColumn.SetCellDataFunc(aliasRenderer, new TreeCellDataFunc(RenderAlias));
            aliasRenderer.Editable = true;
            aliasRenderer.Edited  += AliasEdited;

            CellRendererText typeRenderer = new CellRendererText();
            TreeViewColumn   typeColumn   = this.configView.AppendColumn("Type", typeRenderer);

            typeColumn.SetCellDataFunc(typeRenderer, new TreeCellDataFunc(RenderType));

            CellRendererToggle includeCheckBoxRenderer = new CellRendererToggle();
            TreeViewColumn     includeColumn           = this.configView.AppendColumn("Include", includeCheckBoxRenderer);

            includeColumn.SetCellDataFunc(includeCheckBoxRenderer, new TreeCellDataFunc(RenderIncludeCheckBox));
            includeCheckBoxRenderer.Activatable = true;
            includeCheckBoxRenderer.Toggled    += IncludeCheckBoxToggled;

            //fill store with data
            foreach (ItemSetting item in m_setup.ConfigSettings.Values)
            {
                m_configStore.AppendValues(item, item, item, item);
            }
        }
示例#55
0
        void RefreshTree()
        {
            keyStore.Clear();
            if (scheme != null)
            {
                var sortedKeys = new List <PListScheme.Key> (scheme.Keys);
                sortedKeys.Sort((x, y) => x.Description.CompareTo(y.Description));
                foreach (var key in sortedKeys)
                {
                    keyStore.AppendValues(key.Description, key);
                }
            }

            treeStore.Clear();
            if (nsDictionary is PDictionary)
            {
                AddToTree(treeStore, Gtk.TreeIter.Zero, (PDictionary)nsDictionary);
            }
            if (nsDictionary is PArray)
            {
                AddToTree(treeStore, Gtk.TreeIter.Zero, (PArray)nsDictionary);
            }
        }
示例#56
0
        protected void OnButton2Clicked(object sender, System.EventArgs e)
        {
            int Datahora = Val();

            var DATA_OUT_CALC = Cl.Empresa(Nom_Entry.Text, Code_Entry.Text, Datahora);

            foreach (var DT_IN in DATA_OUT_CALC)
            {
                if (DT_IN.e == true)
                {
                    MessageDialog em = new MessageDialog(this, DialogFlags.DestroyWithParent, MessageType.Warning, ButtonsType.Close, "Las horas no pueden ser meno a una hora");
                }
                else
                {
                    DATA_LIST_EMPLE.AppendValues(DT_IN.CODE_EMPLE1, DT_IN.NOM_EMPLE1, DT_IN.HORA_EMPLE1, DT_IN.AFP1, DT_IN.ISS1, DT_IN.RENTA1, DT_IN.SAL_LIQUIDO1, DT_IN.SAL_NETO1);

                    TEMP.Add(new TemList {
                        NOM_TM = DT_IN.NOM_EMPLE1, SAL_TM = DT_IN.SAL_NETO1
                    });
                    ShowAll();
                }
            }
        }
示例#57
0
    void HandleTreeview2KeyPressEvent(object o, KeyPressEventArgs args)
    {
        Gtk.TreeSelection selection = (o as Gtk.TreeView).Selection;
        Gtk.TreeIter      iter;
        Gtk.TreeModel     model;

        if (selection.GetSelected(out model, out iter))
        {
            userLine line = (userLine)model.GetValue(iter, 0);
            if (args.Event.HardwareKeycode == 119)            // DEL
            {
                Console.WriteLine("Removing " + line.m_name);
                user_lines.Remove((userLine)model.GetValue(iter, 0));
                treeview_lines_store.Remove(ref iter);
            }
        }
        if (args.Event.HardwareKeycode == 57)        // n
        {
            userLine line = new userLine("", false, "", "", user_lines.Count + 1, false, 0);
            treeview_lines_store.AppendValues(line);
            user_lines.Add(line);
        }
    }
示例#58
0
        public void UpdatePath(VersionControlServer vcs, string path)
        {
            if (String.IsNullOrEmpty(path))
            {
                return;
            }
            currentVcs = vcs;
            store.Clear();

            ExtendedItem[] items = vcs.GetExtendedItems(path, DeletedState.NonDeleted, ItemType.Any);

            foreach (ExtendedItem item in items)
            {
                if (item.TargetServerItem == path)
                {
                    continue;
                }

                string shortPath = item.TargetServerItem.Substring(item.TargetServerItem.LastIndexOf('/') + 1);
                string latest    = item.IsLatest ? "Yes" : "No";

                string status = item.LockStatus.ToString();
                if (status == "None")
                {
                    status = String.Empty;
                }

                Gdk.Pixbuf pixbuf = Images.File;
                if (item.ItemType == ItemType.Folder)
                {
                    pixbuf = Images.Folder;
                }

                store.AppendValues(pixbuf, shortPath, status, item.LockOwner,
                                   latest, item.TargetServerItem, item.ItemType);
            }
        }
示例#59
0
        private static void dataBaseData()
        {
            store.Clear();
            MySqlDataReader data = DataBase.CallSp("pa_get_AutoConnectPorts");

            if (data != null)
            {
                while (data.Read())
                {
                    store.AppendValues(data ["portname"].ToString(),
                                       data ["alias"].ToString(),
                                       data ["description"].ToString(),
                                       data ["baudrate"].ToString(),
                                       data ["parity"].ToString(),
                                       data ["dataBits"].ToString(),
                                       data ["stopBits"].ToString(),
                                       data ["id"].ToString());
                }
                if (!data.IsClosed)
                {
                    data.Close();
                }
            }
        }
示例#60
0
        private void ConfigureList()
        {
            listPortfolio.Model = listStore;

            listPortfolio.Selection.Mode = SelectionMode.None;
            listPortfolio.BorderWidth    = 0;
            listPortfolio.HeadersVisible = false;
            listPortfolio.ModifyBase(Gtk.StateType.Active, Constants.Colors.Base.Gdk);
            listPortfolio.ModifyBase(Gtk.StateType.Selected, Constants.Colors.Base.Gdk);
            listPortfolio.ModifyBase(Gtk.StateType.Normal, Constants.Colors.ButtonSelected.Gdk);

            var col         = new Gtk.TreeViewColumn();
            var rowRenderer = new PortfolioEntryRenderer();

            col.PackStart(rowRenderer, true);
            col.SetCellDataFunc(rowRenderer, new Gtk.TreeCellDataFunc(RenderCell));
            listPortfolio.AppendColumn(col);

            var headersStore = new Gtk.ListStore(typeof(object));

            headersStore.AppendValues(new object());
            listHeaders.Selection.Mode = SelectionMode.None;
            listHeaders.Model          = headersStore;
            listHeaders.RulesHint      = true;        //alternating colors
            listHeaders.BorderWidth    = 0;
            listHeaders.HeadersVisible = false;
            listHeaders.ModifyBase(Gtk.StateType.Active, Constants.Colors.Base.Gdk);
            listHeaders.ModifyBase(Gtk.StateType.Selected, Constants.Colors.Base.Gdk);
            listHeaders.ModifyBase(Gtk.StateType.Normal, Constants.Colors.ButtonSelected.Gdk);

            var colHeaders         = new Gtk.TreeViewColumn();
            var rowRendererHeaders = new PortfolioHeaderRenderer();

            colHeaders.PackStart(rowRendererHeaders, true);
            listHeaders.AppendColumn(colHeaders);
        }