Наследование: GLib.Object, Gtk.ITreeModel, Gtk.ITreeDragSource, Gtk.ITreeDragDest, Gtk.ITreeSortable
Пример #1
0
        public void on_open1_activate(object o, EventArgs args)
        {
            FileSelection fs = new FileSelection("Select a PDF file...");

            // TODO: This doesn't filter the file list...
            fs.Complete("*.pdf");
            fs.Run();
            fs.Hide();

            appbar1.Push("Opening document...");
            m_doc = new Pdf(fs.Filename);
            appbar1.Push(m_doc.PageCount + " page document");

            // Populate the pages list
            Gtk.ListStore model = new Gtk.ListStore(typeof(string));
            Gtk.TreeIter  iter  = new Gtk.TreeIter();
            Console.WriteLine("List has " + model.NColumns + " columns");
            for (int i = 0; i < m_doc.PageCount; i++)
            {
                iter = model.Append();
                GLib.Value v = new GLib.Value((i + 1).ToString());
                model.SetValue(iter, 0, v);
            }
            pages.Model = model;
            pages.Show();
        }
Пример #2
0
        public void Clear()
        {
            if (store != null)
            {
                store.Clear();
                store = null;
                //store = new ListStore ((int)TypeFundamentals.TypeString);
                store = new ListStore(GType.String);
            }
            else
            {
                //store = new ListStore ((int)TypeFundamentals.TypeString);
                store = new ListStore(GType.String);
            }

            if (gridColumns != null)
            {
                for (int c = 0; c < gridColumns.Length; c++)
                {
                    if (gridColumns[c] != null)
                    {
                        if (gridColumns[c].TreeViewColumn != null)
                        {
                            treeView.RemoveColumn(gridColumns[c].TreeViewColumn);
                            gridColumns[c].TreeViewColumn = null;
                        }
                        gridColumns[c] = null;
                    }
                }
                gridColumns = null;
            }
        }
Пример #3
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);
        }
Пример #4
0
        public DirectoryView(ExploreView exploreView)
        {
            this.exploreView = exploreView;
            menu             = new DirectoryMenu(exploreView);

            store = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(ItemType));
            Model = store;

            sortableColumns = new SortableColumns(this, store);

#if HAVE_ATLEAST_GTK_210
            EnableGridLines = TreeViewGridLines.Vertical;
#endif
            // setup main column with image/text data
            TreeViewColumn     column = new TreeViewColumn();
            CellRendererText   crt    = new CellRendererText();
            CellRendererPixbuf crp    = new CellRendererPixbuf();
            column.Title = "Name";
            column.PackStart(crp, false);
            column.PackStart(crt, true);
            column.AddAttribute(crp, "pixbuf", 0);
            column.AddAttribute(crt, "text", 1);
            AppendColumn(column);
            AppendColumn("Status", ColumnIndex.Status);
            AppendColumn("Owner", ColumnIndex.Owner);
            AppendColumn("Latest", ColumnIndex.Latest);

            Selection.Mode    = SelectionMode.Multiple;
            KeyReleaseEvent  += MyKeyReleaseEventHandler;
            ButtonPressEvent += MyButtonPressEventHandler;
        }
Пример #5
0
        private void FonstSizesListViewPrepare()
        {
            //--------------------------------------------------------------
            List <int> fontsizes = this.FontSizes();

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

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

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

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

            return;
        }
Пример #6
0
        public lista_de_precios(string _nombrebd_, object treeview_Engine_grupos_, object treeview_Engine_grupos1_, object treeview_Engine_grupos2_,
                                object lista_grupo_, object lista_grupo1_, object lista_grupo2_,
                                bool checkbutton_especiales_, bool checkbutton_tarjeta_,
                                int id_tipopaciente_, int id_empresa_, int id_aseguradora_, bool radiobutton_desglosado_,
                                bool radiobutton_con_iva_, bool radiobutton_sin_iva_, object entry_empresa_aseguradora_)

        {
            treeViewEnginegrupos = treeview_Engine_grupos_ as Gtk.ListStore;
            lista_grupo          = lista_grupo_ as Gtk.TreeView;

            treeViewEnginegrupos1 = treeview_Engine_grupos1_ as Gtk.ListStore;
            lista_grupo1          = lista_grupo1_ as Gtk.TreeView;

            treeViewEnginegrupos2 = treeview_Engine_grupos2_ as Gtk.ListStore;
            lista_grupo2          = lista_grupo2_ as Gtk.TreeView;

            connectionString          = conexion_a_DB._url_servidor + conexion_a_DB._port_DB + conexion_a_DB._usuario_DB + conexion_a_DB._passwrd_user_DB;
            nombrebd                  = conexion_a_DB._nombrebd;
            checkbutton_especiales    = checkbutton_especiales_;
            checkbutton_tarjeta       = checkbutton_tarjeta_;
            id_tipopaciente           = id_tipopaciente_;
            id_empresa                = id_empresa_;
            id_aseguradora            = id_aseguradora_;
            radiobutton_desglosado    = radiobutton_desglosado_;
            radiobutton_con_iva       = radiobutton_con_iva_;
            radiobutton_sin_iva       = radiobutton_sin_iva_;
            entry_empresa_aseguradora = entry_empresa_aseguradora_ as Gtk.Entry;
            escala_en_linux_windows   = classpublic.escala_linux_windows;
            print             = new PrintOperation();
            print.JobName     = "Listas de Precios";            // Name of the report
            print.BeginPrint += new BeginPrintHandler(OnBeginPrint);
            print.DrawPage   += new DrawPageHandler(OnDrawPage);
            print.EndPrint   += new EndPrintHandler(OnEndPrint);
            print.Run(PrintOperationAction.PrintDialog, null);
        }
Пример #7
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();
    }
        void PopulateTree()
        {
            Gtk.ListStore subjectListStore = new Gtk.ListStore(typeof(bool), typeof(string));
            treeview.Model = subjectListStore;

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

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

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

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

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

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

            SetAllToTrue();
        }
Пример #9
0
        public override TreeModel InitializeModel(Type[] columnTypes)
        {
            this.columnTypes = columnTypes;
            var store = new Gtk.ListStore(columnTypes);

            store.RowInserted += (o, args) => {
                if (RowInserted != null)
                {
                    RowInserted(this, new ListRowEventArgs(args.Path.Indices[0]));
                }
            };
            store.RowDeleted += (o, args) => {
                if (RowDeleted != null)
                {
                    RowDeleted(this, new ListRowEventArgs(args.Path.Indices[0]));
                }
            };
            store.RowChanged += (o, args) => {
                if (RowChanged != null)
                {
                    RowChanged(this, new ListRowEventArgs(args.Path.Indices[0]));
                }
            };
            return(store);
        }
Пример #10
0
        /// <summary>
        /// Init ListView widget.
        /// </summary>
        private void InitListView(ref ListStore lStore,
                                  ref TreeView tvObject,
                                  string[] tvColumns)
        {
            TreeViewColumn   tvColumn = null;
            CellRendererText tvCell   = null;

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

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

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

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


            lStore         = new Gtk.ListStore(lsParam);
            tvObject.Model = lStore;
            tvObject.ShowAll();
        }
Пример #11
0
        public override TreeModel InitializeModel(Type[] columnTypes)
        {
            var store = new Gtk.ListStore(columnTypes);

            store.RowInserted += (o, args) => {
                if (RowInserted != null)
                {
                    RowInserted(this, new ListRowEventArgs(args.Path.Indices[0]));
                }
            };
            store.RowDeleted += (o, args) => {
                if (RowDeleted != null)
                {
                    RowDeleted(this, new ListRowEventArgs(args.Path.Indices[0]));
                }
            };
            store.RowChanged += (o, args) => {
                if (RowChanged != null)
                {
                    RowChanged(this, new ListRowEventArgs(args.Path.Indices[0]));
                }
            };
            store.RowsReordered += (o, args) => {
                if (RowsReordered != null)
                {
                    System.Diagnostics.Debug.WriteLine($"No support for {nameof (RowsReordered)} events from {nameof (ListStoreBackend)}, sorry.");
                }
            };
            return(store);
        }
Пример #12
0
        private void BuildTable(List <String> columns, List <Dictionary <String, String> > data)
        {
            // Fill the table out from here

            // add data
            System.Type[] types = new System.Type[columns.Count];
            for (int i = 0; i < columns.Count; i++)
            {
                types [i] = columns [i].GetType();
            }

            Gtk.ListStore listStore = new Gtk.ListStore(types);

            treeview1.Model = listStore;

            // Add some data to the store
            foreach (Dictionary <String, String> entry in data)
            {
                String[] row = new String[columns.Count];
                for (int i = 0; i < columns.Count; i++)
                {
                    row [i] = entry [columns [i]];
                }
                listStore.AppendValues(row);
            }
        }
Пример #13
0
        /// <summary>
        /// Creates the output view.
        /// </summary>
        /// <returns>
        /// The output view.
        /// </returns>
        private Gtk.Widget CreateOutputView()
        {
            ScrolledWindow sw = new ScrolledWindow();

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

            //init log view model with four columns (icon, severity, source, and message)
            m_logStore     = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string));
            treeView.Model = m_logStore;

            CellRendererText   textRenderer         = new CellRendererText();
            CellRendererPixbuf iconRenderer         = new CellRendererPixbuf();
            CellRendererText   wrappingTextRenderer = new CellRendererText();

            wrappingTextRenderer.WrapMode = Pango.WrapMode.Word;

            //create columns with associated cell renderings
            treeView.AppendColumn("!", iconRenderer, "pixbuf", 0);
            treeView.AppendColumn("Severity", textRenderer, "text", 1);
            treeView.AppendColumn("Source", textRenderer, "text", 2);
            treeView.AppendColumn("Message", wrappingTextRenderer, "text", 3);

            foreach (TreeViewColumn col in treeView.Columns)
            {
                col.Alignment = 0.5f;
            }

            sw.Add(treeView);
            sw.ShowAll();
            return(sw);
        }
Пример #14
0
    public static Gtk.ListStore TreeStoreGenerator()
    {
        Gtk.ListStore packageListStore = new Gtk.ListStore
                                             (typeof(string),
                                             typeof(string),
                                             typeof(string),
                                             typeof(string),
                                             typeof(string),
                                             typeof(string),
                                             typeof(string),
                                             typeof(string),
                                             typeof(string),
                                             typeof(string),
                                             typeof(string),
                                             typeof(string));

        packagelist.ForEach(
            wow => packageListStore.AppendValues(
                wow.packageid,
                wow.version,
                wow.content,
                wow.published.ToString(),
                wow.licenseurl,
                wow.licensenames,
                wow.latestversion.ToString(),
                wow.packagehash,
                wow.packagehashalgorithm,
                wow.packagesize,
                wow.summary,
                wow.versiondownloadcount.ToString())
            );
        return(packageListStore);
    }
Пример #15
0
    private void FillTreeviewKategori()
    {
        try
        {
            var lista = ListMaker.KategoriList;

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

            foreach (var k in lista)
            {
                kategoriListStore.AppendValues(k.Namn);
            }
            treeviewKategorier.Model = kategoriListStore;
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }
    }
Пример #16
0
        public void InitializeChangesetList()
        {
            store = new Gtk.ListStore(typeof(int), typeof(string), typeof(string), typeof(string));
            Model = store;

            sortableColumns = new SortableColumns(this, store);

            TreeViewColumn id = AppendColumn("Id", 0);

            id.SortIndicator = true;
            id.SortOrder     = SortType.Descending;

            AppendColumn("Owner", 1);
            AppendColumn("Date", 2);
            AppendColumn("Comment", 3);

            Selection.Mode     = SelectionMode.Multiple;
            Selection.Changed += OnSelectionChanged;
            KeyReleaseEvent   += MyKeyReleaseEventHandler;
            ButtonPressEvent  += MyButtonPressEventHandler;

#if HAVE_ATLEAST_GTK_210
            EnableGridLines = TreeViewGridLines.Vertical;
#endif
        }
Пример #17
0
    private void FillTreeviewAvsnitt()
    {
        try
        {
            ListMaker.UpdateAvsnitt();
            var podcast     = gtkPodcast;
            var podcastList = ListMaker.PodcastList;

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

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

                    foreach (Avsnitt a in avsnittsList)
                    {
                        avsnittListStore.AppendValues(a.Namn);
                    }
                }
            }
            treeviewAvsnitt.Model = avsnittListStore;
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }
    }
Пример #18
0
        /// <summary>
        /// Initialize Widgets
        /// </summary>
        private void InitializeWidgets()
        {
            this.Spacing     = Util.SectionSpacing;
            this.BorderWidth = Util.DefaultBorderWidth;

            ScrolledWindow sw = new ScrolledWindow();

            sw.ShadowType = Gtk.ShadowType.None;

            // Model for Tree View. Enabled & Description
            PolicyTreeStore = new ListStore(typeof(bool), typeof(string), typeof(notificationTypes));

            //TreeView with Two columns
            PolicyTreeView = new TreeView(PolicyTreeStore);
            PolicyTreeView.Selection.Mode = SelectionMode.Single;
            PolicyTreeView.HeadersVisible = true;
            sw.Add(PolicyTreeView);

            //Toggle column - Whether notification is enabled or not
            CellRendererToggle toggleCell = new CellRendererToggle();

            toggleCell.Activatable = true;
            toggleCell.Mode        = CellRendererMode.Activatable;
            toggleCell.Toggled    += preferenceToggled;
            PolicyTreeView.AppendColumn(Util.GS("Enabled"), toggleCell, "active", 0);

            //Description of the notification event
            CellRendererText textCell = new CellRendererText();

            PolicyTreeView.AppendColumn(Util.GS("Notification"), textCell, "text", 1);

            this.PackStart(sw, true, true, 0);
        }
Пример #19
0
    public static void TreeviewScrollToLastRow(Gtk.TreeView tv, Gtk.ListStore store, int nrows)
    {
        TreeIter iter   = new TreeIter();
        bool     iterOk = store.GetIterFirst(out iter);

        if (!iterOk)
        {
            return;
        }

        for (int i = 0; i < (nrows - 1); i++)
        {
            iterOk = tv.Model.IterNext(ref iter);
        }

        if (!iterOk)
        {
            return;
        }

        TreePath path = store.GetPath(iter);

        LogB.Debug(path.ToString());
        tv.ScrollToCell(path, tv.Columns[0], true, 0, 0);
    }
Пример #20
0
        private void CreateTable()
        {
            //Создаем таблицу "Справочника"
            //Первая колонка всегда ID
            int count = _OrdinalField != "" ? Columns.Count + 1 : Columns.Count;

            System.Type[] Types = new System.Type[count];
            Types[0] = typeof(int);

            for (int i = 1; i < Columns.Count; i++)
            {
                Types[i] = typeof(string);
            }

            if (_OrdinalField != "")
            {
                OrdinalColumn        = count - 1;
                Types[OrdinalColumn] = typeof(int);
            }

            RefListStore = new Gtk.ListStore(Types);

            for (int i = 0; i < Columns.Count; i++)
            {
                if (Columns[i].Name != "")
                {
                    treeviewref.AppendColumn(Columns[i].Name, new Gtk.CellRendererText(), "text", i);
                }
            }

            filter             = new Gtk.TreeModelFilter(RefListStore, null);
            filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterTree);
            treeviewref.Model  = filter;
            treeviewref.ShowAll();
        }
Пример #21
0
        public UserView()
        {
            Store = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(string));
            Model = Store;

            InsertColumn(-1, "Pix", new Gtk.CellRendererPixbuf(), "pixbuf", 0);
            InsertColumn(-1, "Name", new Gtk.CellRendererText(), "text", 1);
            HeadersVisible = false;

            string[] users = new string[10];
            users[0] = "Bob";
            users[1] = "Bill";
            users[2] = "Norma Jean";
            users[3] = "Susie";
            users[4] = "Katie";
            users[5] = "Mbutu";
            users[6] = "KoolKat74383u";

            foreach (string user in users)
            {
                Gtk.TreeIter iter = Store.Append();
                Model.SetValue(iter, 0, null);
                Model.SetValue(iter, 1, user);
            }
        }
Пример #22
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;
			};
		}
Пример #23
0
        /// <summary>
        /// Experimental function
        /// </summary>
        /// <returns>
        /// The combo column.
        /// </returns>
        /// <param name='name'>
        /// Name.
        /// </param>
        /// <param name='editable'>
        /// Editable.
        /// </param>
        public Gtk.TreeViewColumn AppendComboColumn(string name, EditedHandler EditedHandler, bool editable, string[] comboValues)
        {
            var listStore = new Gtk.ListStore(typeof(string));

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

            var cellRenderer = new Gtk.CellRendererCombo();

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

            var newColumn = new Gtk.TreeViewColumn();

            newColumn.Title = name;

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

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

            return(newColumn);
        }
Пример #24
0
		public GitConfigurationDialog (GitRepository repo)
		{
			this.Build ();
			this.repo = repo;
			this.HasSeparator = false;
			
			// Branches list
			
			storeBranches = new ListStore (typeof(Branch), typeof(string), typeof(string), typeof(string));
			listBranches.Model = storeBranches;
			listBranches.HeadersVisible = true;
			
			listBranches.AppendColumn (GettextCatalog.GetString ("Branch"), new CellRendererText (), "markup", 1);
			listBranches.AppendColumn (GettextCatalog.GetString ("Tracking"), new CellRendererText (), "text", 2);
			
			// Sources tree
			
			storeRemotes = new TreeStore (typeof(RemoteSource), typeof(string), typeof(string), typeof(string), typeof(string));
			treeRemotes.Model = storeRemotes;
			treeRemotes.HeadersVisible = true;
			
			treeRemotes.AppendColumn ("Remote Source / Branch", new CellRendererText (), "markup", 1);
			treeRemotes.AppendColumn ("Url", new CellRendererText (), "text", 2);
			
			// Fill data
			
			FillBranches ();
			FillRemotes ();
		}
Пример #25
0
            public TemplateTreeView()
            {
                HeadersVisible = false;
                templateStore  = new ListStore(typeof(string), typeof(string), typeof(TemplateItem));
                Model          = templateStore;
                SearchColumn   = -1;               // disable the interactive search

                SemanticModelAttribute modelAttr = new SemanticModelAttribute("templateStore__Icon", "templateStore__Name", "templateStore__Template");

                TypeDescriptor.AddAttributes(templateStore, modelAttr);

                TreeViewColumn    col = new TreeViewColumn();
                CellRendererImage crp = new CellRendererImage();

                crp.StockSize = Gtk.IconSize.Dnd;
                crp.Ypad      = 2;
                col.PackStart(crp, false);
                col.AddAttribute(crp, "stock-id", 0);

                CellRendererText crt = new CellRendererText();

                col.PackStart(crt, false);
                col.AddAttribute(crt, "markup", 1);

                AppendColumn(col);
                ShowAll();
            }
            public TemplateTreeView()
            {
                HeadersVisible          = false;
                templateStore           = new ListStore(typeof(TemplateItem));
                Model                   = filterModel = new TreeModelFilter(templateStore, null);
                filterModel.VisibleFunc = FilterFuncWrapper;

                var col = new TreeViewColumn();
                var crp = new CellRendererIcon()
                {
                    StockSize = (uint)Gtk.IconSize.Dnd,
                    Ypad      = 2,
                };

                col.PackStart(crp, false);
                col.SetCellDataFunc(crp, CellDataFuncIcon);

                var crt = new CellRendererText();

                col.PackStart(crt, false);
                col.SetCellDataFunc(crt, CellDataFuncText);

                AppendColumn(col);
                ShowAll();
            }
Пример #27
0
        public BebidasCalientesView(Label labelTotalMainWindow,Button botonNP)
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build ();

            labelBebidasCalientes.Markup = "<span size='xx-large' weight='bold'>Bebidas Calientes</span>";
            botonNuevoPedidoMainWindow = botonNP;
            totalMainWindow = labelTotalMainWindow;

            dbConnection = ApplicationContext.Instance.DbConnection;

            //hacer la consulta bd
            IDbCommand dbCommand = dbConnection.CreateCommand ();
            dbCommand.CommandText =
                "select * from bebidascalientes ";

            IDataReader dataReader = dbCommand.ExecuteReader ();

            //Aquí creamos un objeto de la clase RellenarTreeView y le pasamos a la clase el treeView y el dataReader
            RellenarTreeView rellenar =new RellenarTreeView();
            rellenar.llenarTreeView(treeView, dataReader);

            //recogemos el listStore que usamos en la clase RellenarTreeView, para ser usada en los los métodos en esa clase
            listStore = rellenar.get_ListStore();

            dataReader.Close ();
        }
Пример #28
0
        public ImportSymbolSelectionDlg(INode[] nodes)
        {
            this.Build ();

            SetResponseSensitive(ResponseType.Ok, true);
            SetResponseSensitive(ResponseType.Cancel, true);

            buttonOk.GrabFocus();
            Modal = true;
            WindowPosition = Gtk.WindowPosition.CenterOnParent;

            // Init name column
            var nameCol = new TreeViewColumn();
            var textRenderer = new CellRendererText();
            nameCol.PackStart(textRenderer, true);
            nameCol.AddAttribute(textRenderer, "text", 0);
            list.AppendColumn(nameCol);

            // Init list model
            var nodeStore = new ListStore(typeof(string),typeof(INode));
            list.Model = nodeStore;

            // Fill list
            foreach (var n in nodes)
                if(n!=null)
                    nodeStore.AppendValues(n.ToString(), n);

            // Select first result
            TreeIter iter;
            if(nodeStore.GetIterFirst(out iter))
                list.Selection.SelectIter(iter);
        }
Пример #29
0
        public void EnviroTreeSetup()
        {
            LS_EnvironTree = new Gtk.ListStore(typeof(string), typeof(string));

            Gtk.CellRendererText Data1_cell = new Gtk.CellRendererText();
            TVC_EnvironTree_Col1            = new Gtk.TreeViewColumn("Full Name", Data1_cell, 0);
            TVC_EnvironTree_Col1.FixedWidth = 150;
            TVC_EnvironTree_Col1.Expand     = true;

            Gtk.CellRendererText Data2_cell = new Gtk.CellRendererText();
            TVC_EnvironTree_Col2            = new Gtk.TreeViewColumn("Short Name", Data2_cell, 0);
            TVC_EnvironTree_Col2.FixedWidth = 150;
            TVC_EnvironTree_Col2.Expand     = true;

            EnvironTree_Main.AppendColumn(TVC_EnvironTree_Col1);
            EnvironTree_Main.AppendColumn(TVC_EnvironTree_Col2);

            TVC_EnvironTree_Col1.AddAttribute(Data1_cell, "text", 0);
            TVC_EnvironTree_Col2.AddAttribute(Data2_cell, "text", 1);

            //LS_EnvironTree.AppendValues("SomeText", "SomeOtherText");

            EnvironTree_Main.Model = LS_EnvironTree;
            return;
        }
Пример #30
0
        /// <summary>
        /// Updates the pins combobox.
        /// </summary>
        private void UpdateCBPins()
        {
            var store = new Gtk.ListStore(typeof(string));

            foreach (APin pin in APins)
            {
                if (!Combination_.Pins.Contains(pin))
                {
                    // Analysis disable once CompareOfFloatsByEqualityOperator
                    store.AppendValues(new object[] { pin.DisplayName });
                }
            }
            cbPins.Model = store;
            if (cbPins.Cells.Length > 0)
            {
                cbPins.Active = 0;
            }

            if (!Combination_.CheckPinIntervalEquality())
            {
                lblWarning.Visible          = true;
                sbMeanValuesCount.Sensitive = false;
                sbMeanValuesCount.Value     = 1;
            }
            else
            {
                lblWarning.Visible          = false;
                sbMeanValuesCount.Sensitive = true;
            }

            cbPins.ShowAll();
        }
		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 ());
			}
		}
		public CombineConfigurationPanelWidget (MultiConfigItemOptionsDialog parentDialog)
		{
			Build ();
			
			this.parentDialog = parentDialog;
			store = new ListStore (typeof(object), typeof(string), typeof(bool));
			configsList.Model = store;
			configsList.HeadersVisible = true;
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRendererText sr = new CellRendererText ();
			col.PackStart (sr, true);
			col.Expand = true;
			col.AddAttribute (sr, "text", 1);
			col.Title = GettextCatalog.GetString ("Solution Item");
			configsList.AppendColumn (col);
			col.SortColumnId = 1;
			
			CellRendererToggle tt = new CellRendererToggle ();
			tt.Activatable = true;
			tt.Toggled += new ToggledHandler (OnBuildToggled);
			configsList.AppendColumn (GettextCatalog.GetString ("Build"), tt, "active", 2);
			
			CellRendererComboBox comboCell = new CellRendererComboBox ();
			comboCell.Changed += new ComboSelectionChangedHandler (OnConfigSelectionChanged);
			configsList.AppendColumn (GettextCatalog.GetString ("Configuration"), comboCell, new TreeCellDataFunc (OnSetConfigurationsData));
			store.SetSortColumnId (1, SortType.Ascending);
		}
Пример #33
0
		public ComboBoxDialog()
		{
			Title = "Gtk Combo Box Dialog";
			WidthRequest = 500;
			HeightRequest = 400;

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

			comboBox = new ComboBox ();
			vbox.PackStart (comboBox, false, false, 0);

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

			var cell = new CellRendererText ();
			comboBox.PackStart (cell, true);
			comboBox.AddAttribute (cell, "text", 0);

			AddItems ();

			Child.ShowAll ();

			Show ();
		}
Пример #34
0
        protected void InvestigatorChanged(object sender, EventArgs e)
        {
            string rootfolder = MainClass.win.settings.DATADIR;

            string[] investigators = Directory.GetDirectories(rootfolder);
            int      i             = combobox_investigators.Active;

            if (i > -1 & i < investigators.Length)
            {
                string[] studies = Directory.GetDirectories(investigators[i]);

                Gtk.ListStore ClearList = new Gtk.ListStore(typeof(string));
                combobox_studies.Model = ClearList;
                if (studies.Length > 0)
                {
                    //this.investigatorlist.Clear ();
                    foreach (string s in studies)
                    {
                        string[] s2 = s.Split(System.IO.Path.DirectorySeparatorChar);
                        combobox_studies.AppendText(s2[s2.Length - 1]);
                    }
                    combobox_studies.Active = 0;
                }
            }
            ShowAll();
        }
Пример #35
0
 public void UpdateCaceheInfo()
 {
     m_model = new ListStore(typeof(Pixbuf), typeof(string), typeof(string));
     if (m_monitor.SelectedCache == null)
     {
         this.Sensitive = false;
         return;
     }
     this.Sensitive = true;
     string imagesFolder = GetImagesFolder ();
     fileLabel.Text = String.Format(Catalog.GetString("Images Folder: {0}"), imagesFolder);
     if(Directory.Exists(imagesFolder))
     {
         string[] files = Directory.GetFiles(imagesFolder);
         foreach(string file in files)
         {
             Pixbuf buf = new Pixbuf(file,256, 256);
             string[] filePath = file.Split('/');
             m_model.AppendValues(buf, filePath[filePath.Length -1],file);
         }
     }
     imagesView.Model = m_model;
     imagesView.PixbufColumn = 0;
     imagesView.TextColumn = 1;
     imagesView.SelectionMode = SelectionMode.Single;
 }
Пример #36
0
        public SelectGroupsDialog(string[] allGroups)
        {
            ui = new Glade.XML (null, "lat.glade", "selectGroupsDialog", null);
            ui.Autoconnect (this);

            groups = new List<string> ();

            TreeViewColumn col;

            store = new ListStore (typeof (string));
            allGroupsTreeview.Model = store;
            allGroupsTreeview.Selection.Mode = SelectionMode.Multiple;

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

            store.SetSortColumnId (0, SortType.Ascending);

            foreach (string s in allGroups)
                store.AppendValues (s);

            selectGroupsDialog.Icon = Global.latIcon;
            selectGroupsDialog.Resize (320, 200);
            selectGroupsDialog.Run ();
            selectGroupsDialog.Destroy ();
        }
		/// <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;
		}
Пример #38
0
		public RegexLibraryWindow () : base(Gtk.WindowType.Toplevel)
		{
			this.Build ();
			this.TransientFor = IdeApp.Workbench.RootWindow;
			
			this.buttonCancel.Clicked += delegate {
				Destroy ();
			};
			this.buttonUpdate.Clicked += delegate {
				if (updateThread != null && updateThread.IsAlive) {
					updateThread.Abort ();
					updateThread.Join ();
					SetButtonUpdate (GettextCatalog.GetString ("Update Library"), "gtk-refresh");
					updateThread = null;
					return;
				}
				SetButtonUpdate (GettextCatalog.GetString ("_Abort update"), "gtk-media-stop");
				SynchronizeExpressions ();
			};
			
			store = new ListStore (typeof (string), typeof (string), typeof (Expression));
			expressionsTreeview.Model = store;
			
			this.expressionsTreeview.AppendColumn (GettextCatalog.GetString ("Title"), new CellRendererText (), "text", 0);
			this.expressionsTreeview.AppendColumn (GettextCatalog.GetString ("Rating"), new CellRendererText (), "text", 1);
			
			this.expressionsTreeview.Selection.Changed += delegate {
				ShowSelectedEntry ();
			};
			this.searchEntry.Changed += delegate {
				FilterItems (searchEntry.Text);
			};
			LoadRegexes ();
			UpdateExpressions ();
		}
Пример #39
0
		public DeployDialog (SolutionFolderItem defaultEntry, bool createBuilderOnly)
		{
			this.Build();
			notebook.ShowTabs = false;
			this.defaultEntry = defaultEntry;
			
			if (createBuilderOnly) {
				vboxSaveProject.Hide ();
				checkSave.Active = true;
				checkSave.Hide ();
				saveSeparator.Hide ();
			}
			else {
				pageSave.Hide ();
				FillProjectSelectors ();
			}
			
			store = new ListStore (typeof(Xwt.Drawing.Image), typeof(string), typeof(object));
			targetsTree.Model = store;
			
			targetsTree.HeadersVisible = false;
			CellRendererImage cr = new CellRendererImage();
			cr.Yalign = 0;
			targetsTree.AppendColumn ("", cr, "image", 0);
			targetsTree.AppendColumn ("", new Gtk.CellRendererText(), "markup", 1);
			
			targetsTree.Selection.Changed += delegate (object s, EventArgs a) {
				UpdateButtons ();
			};
			
			FillBuilders ();
			
			UpdateButtons ();
		}
Пример #40
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();
        }
        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);
            }
        }
		public UniqueConstraintEditorWidget (ISchemaProvider schemaProvider, SchemaActions action)
		{
			if (schemaProvider == null)
				throw new ArgumentNullException ("schemaProvider");
			
			this.schemaProvider = schemaProvider;
			this.action = action;
			
			this.Build();
			
			store = new ListStore (typeof (string), typeof (bool), typeof (string), typeof (object));
			listUnique.Model = store;
			listUnique.Selection.Changed += new EventHandler (SelectionChanged);
			columnSelecter.ColumnToggled += new EventHandler (ColumnToggled);
			
			TreeViewColumn colName = new TreeViewColumn ();

			colName.Title = AddinCatalog.GetString ("Name");
			
			CellRendererText nameRenderer = new CellRendererText ();
			
			nameRenderer.Editable = true;
			nameRenderer.Edited += new EditedHandler (NameEdited);
			
			colName.PackStart (nameRenderer, true);
			colName.AddAttribute (nameRenderer, "text", colNameIndex);
			
			listUnique.AppendColumn (colName);
			
			ShowAll ();
		}
Пример #43
0
        public NewPhoneBook()
        {
            booknames = new ArrayList();

            Glade.XML xml = new Glade.XML(null, "gfax.glade", "NewPhoneBookDialog", null);
            xml.Autoconnect(this);

            GfaxRadioButton.Active = true;

            EvolutionRadioButton.Sensitive = true;
            // turn these off until somewhere near supported
            DatabaseRadioButton.Visible = false;
            LDAPRadioButton.Visible     = false;

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

            view = new G_ListView(EvolutionTreeView, store);

            view.AddColumnTitleToggle(Catalog.GetString("Use"), 0, COLUMN_0);
            view.AddColumnTitle(Catalog.GetString("Phone Book"), 0, COLUMN_1);

            EvolutionTreeView.HeadersVisible = true;

            NewPhoneBookDruid.ShowAll();
        }
Пример #44
0
        public DocsType()
        {
            this.Build ();

            //Создаем таблицу "Полей"
            FieldsListStore = new Gtk.ListStore (typeof (int), //0 - ID
                                                 typeof (string), // 1 - Name
                                                 typeof (string) // 2 - DB_name
                                                 );
            treeviewFields.AppendColumn ("Имя", new Gtk.CellRendererText (), "text", 1);
            treeviewFields.AppendColumn ("Имя в БД", new Gtk.CellRendererText (), "text", 2);

            treeviewFields.Model = FieldsListStore;
            treeviewFields.ShowAll();

            //Устанавливаем права
            bool UserRight = QSMain.User.Permissions["edit_db"];
            buttonAdd.Sensitive = UserRight;
            buttonDelete.Sensitive = UserRight;
            entryDBTable.Sensitive = UserRight;
            toolbarTemplate.Sensitive = UserRight;

            //FIXME Убрать только для теста
            System.Data.DataTable schema = QSMain.connectionDB.GetSchema("Columns", new string[4] { null, QSMain.connectionDB.Database, "docs", "number"});
            foreach (System.Data.DataRow row in schema.Rows)
            {
                foreach (System.Data.DataColumn col in schema.Columns)
                {
                    logger.Debug("{0} = {1}", col.ColumnName, row[col]);
                }
                logger.Debug("============================");
            }
        }
Пример #45
0
        public SessionDisplayWidget()
        {
            this.Build ();

            TreeViewColumn startColumn = new TreeViewColumn ();
            CellRendererText startRenderer = new CellRendererText ();
            startColumn.Title = "Start";
            startColumn.PackStart (startRenderer, true);

            TreeViewColumn stopColumn = new TreeViewColumn ();
            CellRendererText stopRenderer = new CellRendererText ();
            stopColumn.Title = "Stop";
            stopColumn.PackStart (stopRenderer, true);

            TreeViewColumn durationColumn = new TreeViewColumn ();
            CellRenderer durationRenderer = new CellRendererText ();
            durationColumn.Title = "Duration";
            durationColumn.PackStart (durationRenderer, true);

            this.sessionView1.AppendColumn (startColumn);
            this.sessionView1.AppendColumn (stopColumn);
            this.sessionView1.AppendColumn (durationColumn);

            startColumn.AddAttribute (startRenderer, "text", 0);
            stopColumn.AddAttribute (stopRenderer, "text", 1);
            durationColumn.AddAttribute (durationRenderer, "text", 2);

            sessionStore = new Gtk.ListStore (typeof(string), typeof(string), typeof(string));
            sessionView1.Model = sessionStore;
        }
Пример #46
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);
        }
		public int Run ()
		{
			this.CreateDialog ("camera_selection_dialog");
			int return_value = -1;
			
			
			cameraList.Selection.Mode = SelectionMode.Single;
			cameraList.AppendColumn (Catalog.GetString ("Camera"), new CellRendererText (), "text", 0);
			cameraList.AppendColumn (Catalog.GetString ("Port"), new CellRendererText (), "text", 1);
			
			ListStore tstore = new ListStore (typeof (string), typeof (string));
			for (int i = 0; i < camlist.Count (); i++) {
				tstore.AppendValues (camlist.GetName (i), camlist.GetValue (i));
			}
			
			cameraList.Model = tstore;
			ResponseType response = (ResponseType) this.Dialog.Run ();
			
			if (response == ResponseType.Ok && cameraList.Selection.CountSelectedRows () == 1) {
				TreeIter selected_camera;
				TreeModel model;
				
				cameraList.Selection.GetSelected (out model, out selected_camera);
				return_value = camlist.GetPosition ((string)model.GetValue (selected_camera, 0), 
								    (string)model.GetValue (selected_camera, 1));
			}
		
			this.Dialog.Destroy ();
			
			return return_value;
		}
Пример #48
0
        public lessee()
        {
            this.Build ();

            GoodsNull = true;
            grup = new AccelGroup ();
            this.AddAccelGroup(grup);

            //Создаем таблицу "Договора"
            ContractsListStore = new Gtk.ListStore (typeof(int), typeof (bool), typeof (string), typeof (string), typeof (string),
                                                 typeof (int), typeof (string), typeof (string), typeof (string),
                                                 typeof (int), typeof (string), typeof (string));

            treeviewContracts.AppendColumn("Акт.", new Gtk.CellRendererToggle (), "active", 1);
            treeviewContracts.AppendColumn ("с", new Gtk.CellRendererText (), "text", 2);
            treeviewContracts.AppendColumn ("по", new Gtk.CellRendererText (), "text", 3);
            treeviewContracts.AppendColumn ("Договор", new Gtk.CellRendererText (), "text", 4);
            treeviewContracts.AppendColumn ("Место", new Gtk.CellRendererText (), "text", 7);
            treeviewContracts.AppendColumn ("Площадь", new Gtk.CellRendererText (), "text", 8);
            treeviewContracts.AppendColumn ("Контактное лицо", new Gtk.CellRendererText (), "text", 10);
            treeviewContracts.AppendColumn ("Расторгнут", new Gtk.CellRendererText (), "text", 11);

            treeviewContracts.Model = ContractsListStore;
            treeviewContracts.ShowAll();
        }
Пример #49
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 ();
        }
Пример #50
0
        public static void fillTreeView()
        {
            CellRendererText cellRendererText = new CellRendererText ();

            for (int i= 0; i<queryResult.ColumNames.Length; i++) {
                int column = i;
                treeView.AppendColumn (queryResult.ColumNames.GetValue (i).ToString (), cellRendererText,
                                       delegate(TreeViewColumn treeColumn, CellRenderer cell, TreeModel treeModel, TreeIter iter) {

                    IList row = (IList)treeModel.GetValue (iter, 0);
                    cellRendererText.Text = row [column].ToString ();
                });

            }

            listStore = new ListStore (typeof(IList));

            IEnumerable<IList> values = queryResult.Rows;

            foreach (IList k in values) {
                listStore.AppendValues (k);

            }

            treeView.Model = listStore;
        }
        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;
        }
Пример #52
0
        public DirectoryView(ExploreView exploreView)
        {
            this.exploreView = exploreView;
                menu = new DirectoryMenu(exploreView);

                store = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(ItemType));
                Model = store;

                sortableColumns = new SortableColumns(this, store);

            #if HAVE_ATLEAST_GTK_210
                EnableGridLines = TreeViewGridLines.Vertical;
            #endif
                // setup main column with image/text data
                TreeViewColumn column = new TreeViewColumn ();
                CellRendererText crt = new CellRendererText();
                CellRendererPixbuf crp = new CellRendererPixbuf();
                column.Title = "Name";
                column.PackStart(crp, false);
                column.PackStart(crt, true);
                column.AddAttribute(crp, "pixbuf", 0);
                column.AddAttribute(crt, "text", 1);
                AppendColumn(column);
                AppendColumn("Status", ColumnIndex.Status);
                AppendColumn("Owner", ColumnIndex.Owner);
                AppendColumn("Latest", ColumnIndex.Latest);

                Selection.Mode = SelectionMode.Multiple;
                KeyReleaseEvent += MyKeyReleaseEventHandler;
                ButtonPressEvent += MyButtonPressEventHandler;
        }
Пример #53
0
		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 ();
		}
Пример #54
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);

	}
Пример #55
0
		public ExceptionsDialog()
		{
			this.Build();

			storeExceptions = new ListStore (typeof(String));
			treeExceptions.Selection.Mode = SelectionMode.Multiple;
			treeExceptions.Model = storeExceptions;
			treeExceptions.AppendColumn ("", new CellRendererText (), "text", 0);
			tstateExc = new TreeViewState (treeExceptions, 0);
			storeExceptions.SetSortColumnId (0, SortType.Ascending);

			storeSelection = new ListStore (typeof(String));
			treeSelected.Selection.Mode = SelectionMode.Multiple;
			treeSelected.Model = storeSelection;
			treeSelected.AppendColumn ("", new CellRendererText (), "text", 0);
			tstateSel = new TreeViewState (treeSelected, 0);
			storeSelection.SetSortColumnId (0, SortType.Ascending);
			
			foreach (Catchpoint cp in DebuggingService.Breakpoints.GetCatchpoints ())
				selectedClasses.Add (cp.ExceptionName);
			
			LoadExceptions ();

			FillSelection ();
			FillExceptions ();
		}
Пример #56
0
		public ListCategoriaView ()
		{
			this.Build ();

			deleteAction.Sensitive = false;
			editAction.Sensitive = false;

			dbConnection = App.Instance.DbConnection;


			treeView.AppendColumn ("id", new CellRendererText (), "text", 0);
			treeView.AppendColumn ("nombre", new CellRendererText (), "text", 1);
			listStore = new ListStore (typeof(ulong), typeof(string));
			treeView.Model = listStore;

			fillListStore ();

			treeView.Selection.Changed += selectionChanged;

			refreshAction.Activated += delegate {
				listStore.Clear();
				fillListStore();
			};

		}
Пример #57
0
    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 ();
    }
		private void CreateInterface ()
		{
			this.CreateDialog ("camera_file_selection_dialog");
			
			file_tree.Selection.Mode = SelectionMode.Multiple;
			file_tree.AppendColumn (Catalog.GetString ("Preview"), 
						new CellRendererPixbuf (), "pixbuf", PreviewColumn);
			file_tree.AppendColumn (Catalog.GetString ("Path"), 
						new CellRendererText (), "text", DirectoryColumn);
			file_tree.AppendColumn (Catalog.GetString ("File"), 
						new CellRendererText (), "text", FileColumn);
			file_tree.AppendColumn (Catalog.GetString ("Index"),
						new CellRendererText (), "text", IndexColumn).Visible = false;
			
			preview_list_store = new ListStore (typeof (string), typeof (string), 
							    typeof (Pixbuf), typeof (int));
			
			file_tree.Model = preview_list_store;

			CreateTagMenu ();
			attach_check.Toggled += HandleTagToggled;
			HandleTagToggled (null, null);
			
			GetPreviews ();
		}
Пример #59
0
        private TreeView TreeView()
        {
            IPathedDocument padDoc = IdeApp.Workbench.ActiveDocument.GetContent <IPathedDocument>();

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

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

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

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

            tree.Model = listStore;
            Gtk.CellRendererText artistNameCell = new Gtk.CellRendererText();
            objectColumn.PackStart(artistNameCell, true);
            Gtk.CellRendererText songTitleCell = new Gtk.CellRendererText();
            metrixColumn.PackStart(songTitleCell, true);
            objectColumn.AddAttribute(artistNameCell, "text", 0);
            metrixColumn.AddAttribute(songTitleCell, "text", 1);
            return(tree);
        }
Пример #60
0
        private TransfersPage()
        {
            ScrolledWindow swindow = new ScrolledWindow();

            transferListStore  = new ListStore(typeof(IFileTransfer));
            transferList       = new TreeView();
            transferList.Model = transferListStore;

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

            TreeViewColumn column = transferList.AppendColumn("", new CellRendererPixbuf(), new TreeCellDataFunc(TransferIconFunc));

            column.MinWidth = 25;

            column           = transferList.AppendColumn("Name", new CellRendererText(), new TreeCellDataFunc(TransferNameFunc));
            column.Expand    = true;
            column.Resizable = true;

            column           = transferList.AppendColumn("Progress", new CellRendererProgress(), new TreeCellDataFunc(TransferProgressFunc));
            column.Resizable = true;
            column.MinWidth  = 100;

            column           = transferList.AppendColumn("Up Speed", new CellRendererText(), new TreeCellDataFunc(TransferUpSpeedFunc));
            column.Resizable = true;

            column           = transferList.AppendColumn("Down Speed", new CellRendererText(), new TreeCellDataFunc(TransferDownSpeedFunc));
            column.Resizable = true;

            column           = transferList.AppendColumn("Status", new CellRendererText(), new TreeCellDataFunc(TransferStatusFunc));
            column.Resizable = true;
            column.MinWidth  = 150;

            transferList.RowActivated     += OnTransferListRowActivated;
            transferList.ButtonPressEvent += OnTransferListButtonPressEvent;

            downloadImage = Gui.LoadIcon(16, "go-down");
            uploadImage   = Gui.LoadIcon(16, "go-up");

            GLib.Timeout.Add(500, new GLib.TimeoutHandler(RefreshTransferList));

            /*
             * Core.NetworkAdded +=
             *      (NetworkEventHandler)DispatchService.GuiDispatch(
             *              new NetworkEventHandler(Core_NetworkAdded)
             *      );
             */

            Core.FileTransferManager.NewFileTransfer +=
                (EventHandler <FileTransferEventArgs>)DispatchService.GuiDispatch(
                    new EventHandler <FileTransferEventArgs>(manager_NewFileTransfer)
                    );

            Core.FileTransferManager.FileTransferRemoved +=
                (EventHandler <FileTransferEventArgs>)DispatchService.GuiDispatch(
                    new EventHandler <FileTransferEventArgs>(manager_FileTransferRemoved)
                    );
        }