Example #1
0
        void CreateColumnName()
        {
            // Column: Game Name
            TreeViewColumn name_column = new TreeViewColumn(Catalog.GetString("Game Name"),
                                                            new CellRendererText(), "text", 0);

            name_column.Expand    = true;
            name_column.Clickable = true;
            name_column.Clicked  += delegate(object sender, EventArgs args)
            {
                Gtk.SortType       order;
                Gtk.TreeViewColumn column = (Gtk.TreeViewColumn)sender;

                if (column.SortOrder == Gtk.SortType.Ascending)
                {
                    order = Gtk.SortType.Descending;
                }
                else
                {
                    order = Gtk.SortType.Ascending;
                }

                column.SortOrder = order;
                games_store.SetSortColumnId(COL_NAME, order);
            };

            treeview.AppendColumn(name_column);
        }
Example #2
0
        void UserTaskPriorityResort(object sender, EventArgs args)
        {
            TreeViewColumn col = view.Columns[(int)Columns.Priority];

            foreach (TreeViewColumn c in view.Columns)
            {
                if (c != col)
                {
                    c.SortIndicator = false;
                }
            }
            col.SortOrder     = ReverseSortOrder(col);
            col.SortIndicator = true;
            store.SetSortColumnId((int)Columns.Priority, col.SortOrder);
        }
Example #3
0
        void Init()
        {
            ui = new Glade.XML(null, "dialogs.glade", "groupDialog", null);
            ui.Autoconnect(this);

            viewDialog = groupDialog;

            TreeViewColumn col;

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

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

            allUserStore.SetSortColumnId(0, SortType.Ascending);

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

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

            currentMemberStore.SetSortColumnId(0, SortType.Ascending);

            groupDialog.Resize(350, 400);
        }
 static void Search()
 {
     if (SearchS.Text != "")
     {
         int       c    = 0;
         ListStore temp = new ListStore(typeof(int), typeof(string), typeof(Pixbuf));
         temp.SetSortColumnId(0, SortType.Ascending);
         IV_AllServices.FreezeChildNotify();
         IV_AllServices.Model = null;
         AWQ uwu    = new AWQ(SearchS.Text.ToCharArray());
         int length = AllServicesList.Count;
         for (int i = 0; i < length; i++)
         {
             if (uwu.search(AllServicesList[i].Name.ToCharArray()))
             {
                 if (ServicesImg[i] != null)
                 {
                     temp.AppendValues(c++, AllServicesList[i].Name, ServicesImg[i]);
                 }
                 else
                 {
                     temp.AppendValues(c++, AllServicesList[i].Name, DefaultServiceIcon);
                 }
             }
         }
         IV_AllServices.Model = temp;
         IV_AllServices.ThawChildNotify();
     }
     else
     {
         IV_AllServices.Model = AllServices;
     }
 }
Example #5
0
        void LoadGames()
        {
            if (games_store != null)
            {
                return;
            }

            games_store = new ListStore(typeof(string), typeof(string), typeof(bool), typeof(Game), typeof(int));
            games_store.SetSortFunc(0, new Gtk.TreeIterCompareFunc(GameSort));
            games_store.SetSortColumnId(COL_TYPE, SortType.Ascending);

            // Data
            string type;
            Game   game;

            for (int i = 0; i < games.Length; i++)
            {
                if (games [i].IsGame == false)
                {
                    continue;
                }

                game = (Game)Activator.CreateInstance(games [i].TypeOf, true);
                game.Translations = Translations;
                game.Variant      = games [i].Variant;
                type = GameTypesDescription.GetLocalized(Translations, game.Type);
                games_store.AppendValues(game.Name, type, true, game, i);
            }
        }
        public SortFuncListViewDialog()
        {
            Title         = "Gtk Sort Func List View Box Dialog";
            WidthRequest  = 500;
            HeightRequest = 400;

            var vbox = new HBox();

            VBox.PackStart(vbox);

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

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

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

            listStore.SetSortColumnId(0, SortType.Ascending);

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

            AddItems();

            ShowAll();
        }
Example #7
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();
        }
        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);
        }
Example #9
0
        public MassEditDialog()
        {
            _modList = new List <LdapModification> ();

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

            createCombos();

            modListStore      = new ListStore(typeof(string), typeof(string), typeof(string));
            modListView.Model = modListStore;

            TreeViewColumn col;

            col = modListView.AppendColumn("Action", new CellRendererText(), "text", 0);
            col.SortColumnId = 0;

            col = modListView.AppendColumn("Name", new CellRendererText(), "text", 1);
            col.SortColumnId = 1;

            col = modListView.AppendColumn("Value", new CellRendererText(), "text", 2);
            col.SortColumnId = 2;

            modListStore.SetSortColumnId(0, SortType.Ascending);

            massEditDialog.Resize(300, 450);
            massEditDialog.Icon = Global.latIcon;
            massEditDialog.Run();
            massEditDialog.Destroy();
        }
Example #10
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();
        }
Example #11
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();
        }
Example #12
0
        public PreferencesDialog(Gnome.Program program)
        {
            ui = new Glade.XML(null, "lat.glade", "preferencesDialog", null);
            ui.Autoconnect(this);

            this.program = program;

            profileStore           = new ListStore(typeof(string));
            profilesTreeView.Model = profileStore;
            profileStore.SetSortColumnId(0, SortType.Ascending);

            TreeViewColumn col;

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

            UpdateProfileList();

            LoadPreference(Preferences.BROWSER_SELECTION);

            preferencesDialog.Icon = Global.latIcon;
            preferencesDialog.Resize(300, 400);
            preferencesDialog.Run();

            if (gettingHelp)
            {
                preferencesDialog.Run();
                gettingHelp = false;
            }

            preferencesDialog.Destroy();
        }
Example #13
0
        void setupTreeViews()
        {
            // Object class
            objListStore      = new ListStore(typeof(string));
            objTreeView.Model = objListStore;

            TreeViewColumn col;

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

            objListStore.SetSortColumnId(0, SortType.Ascending);

            // Attributes
            attrListStore      = new ListStore(typeof(string), typeof(string), typeof(string));
            attrTreeView.Model = attrListStore;

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

            col = attrTreeView.AppendColumn("Type", new CellRendererText(), "text", 1);
            col.SortColumnId = 1;

            CellRendererText cell = new CellRendererText();

            cell.Editable = true;
            cell.Edited  += new EditedHandler(OnAttributeEdit);

            col = attrTreeView.AppendColumn("Default Value", cell, "text", 2);
            col.SortColumnId = 2;

            attrListStore.SetSortColumnId(0, SortType.Ascending);
        }
Example #14
0
 void BuildModels()
 {
     // NAME, SHOW, LOCKED, ITEM
     itemsModel = new ListStore(typeof(string), typeof(bool), typeof(bool), typeof(DockItem));
     itemsModel.SetSortColumnId(NAME_COL, SortType.Ascending);
     layoutsModel = new ListStore(typeof(string), typeof(bool));
     layoutsModel.SetSortColumnId(NAME_COL, SortType.Ascending);
 }
Example #15
0
        public AssemblyReferencePanel(SelectReferenceDialog selectDialog)
        {
            Spacing           = 6;
            this.selectDialog = selectDialog;

            store    = new ListStore(typeof(string), typeof(string), typeof(AssemblyInfo), typeof(bool), typeof(string), typeof(IconId), typeof(int));
            treeView = new TreeView(store);

            TreeViewColumn     firstColumn = new TreeViewColumn();
            CellRendererToggle tog_render  = new CellRendererToggle();

            tog_render.Toggled += AddReference;
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", ColSelected);

            treeView.AppendColumn(firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn();

            secondColumn.Title = GettextCatalog.GetString("Assembly");
            CellRendererImage crp = new CellRendererImage();

            secondColumn.PackStart(crp, false);
            secondColumn.AddAttribute(crp, "icon-id", ColIcon);

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "markup", ColName);

            treeView.AppendColumn(secondColumn);

            treeView.AppendColumn(GettextCatalog.GetString("Version"), new CellRendererText(), "markup", ColVersion);
            treeView.AppendColumn(GettextCatalog.GetString("Path"), new CellRendererText(), "text", ColPath);

            treeView.Columns[1].Resizable = true;

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

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            PackStart(sc, true, true, 0);

            var but = new Gtk.Button(GettextCatalog.GetString("Browse..."));

            but.Clicked += HandleClicked;
            var hbox = new Gtk.HBox();

            hbox.PackEnd(but, false, false, 0);
            PackStart(hbox, false, false, 0);

            ShowAll();
            BorderWidth = 6;
        }
        public DeployFileListWidget()
        {
            this.Build();

            store          = new ListStore(typeof(object), typeof(string), typeof(string), typeof(string), typeof(string), typeof(bool));
            fileList.Model = store;

            CellRendererToggle tog = new CellRendererToggle();
            TreeViewColumn     col = new TreeViewColumn();

            tog.Toggled += OnToggled;
            col.Title    = "";
            col.PackStart(tog, false);
            col.AddAttribute(tog, "active", ColIncluded);
            col.SortColumnId = ColIncluded;
            fileList.AppendColumn(col);

            CellRendererText crt = new CellRendererText();

            col       = new TreeViewColumn();
            col.Title = "Solution/Project";
            col.PackStart(crt, true);
            col.AddAttribute(crt, "text", ColProject);
            col.SortColumnId = ColProject;
            col.Resizable    = true;
            fileList.AppendColumn(col);

            crt       = new CellRendererText();
            col       = new TreeViewColumn();
            col.Title = "Source File";
            col.PackStart(crt, true);
            col.AddAttribute(crt, "text", ColSourceFile);
            col.SortColumnId = ColSourceFile;
            col.Resizable    = true;
            fileList.AppendColumn(col);

            crt       = new CellRendererText();
            col       = new TreeViewColumn();
            col.Title = "Target Directory";
            col.PackStart(crt, true);
            col.AddAttribute(crt, "text", ColTargetDir);
            col.SortColumnId = ColTargetDir;
            col.Resizable    = true;
            fileList.AppendColumn(col);

            crt       = new CellRendererText();
            col       = new TreeViewColumn();
            col.Title = "Target Path";
            col.PackStart(crt, true);
            col.AddAttribute(crt, "text", ColDestFile);
            col.SortColumnId = ColDestFile;
            col.Resizable    = true;
            fileList.AppendColumn(col);

            store.SetSortColumnId(ColProject, SortType.Ascending);
        }
Example #17
0
        public DictionaryComboBox()
        {
            store = new ListStore(typeof(string), typeof(T), typeof(int));
            store.SetSortColumnId(2, SortType.Ascending);
            Model = store;

            CellRendererText text_renderer = new CellRendererText();

            PackStart(text_renderer, true);
            AddAttribute(text_renderer, "text", 0);
        }
        ListStore CreateStore()
        {
            // path, name, pixbuf, is_dir
            ListStore store = new ListStore(typeof(string), typeof(string), typeof(Gdk.Pixbuf), typeof(bool));

            // Set sort column and function
            store.DefaultSortFunc = new TreeIterCompareFunc(SortFunc);
            store.SetSortColumnId(COL_DISPLAY_NAME, SortType.Ascending);

            return(store);
        }
Example #19
0
        private void setupTreeViews()
        {
            _store = new ListStore(typeof(string));
            templateTreeView.Model = _store;

            TreeViewColumn col;

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

            _store.SetSortColumnId(0, SortType.Ascending);
        }
        public void Initialize(PropertyDescriptor descriptor)
        {
            store = new ListStore(typeof(Pixbuf), typeof(string));
            Model = store;
            store.SetSortColumnId(1, SortType.Ascending);
            CellRendererPixbuf crp = new CellRendererPixbuf();
            CellRendererText   crt = new CellRendererText();

            PackStart(crp, false);
            PackStart(crt, true);
            SetAttributes(crp, "pixbuf", 0);
            SetAttributes(crt, "text", 1);
        }
 public void BeginProgress()
 {
     IdeApp.Workbench.ActiveLocationList = this;
     newStore = new ListStore(typeof(SearchResult), typeof(bool));
     newStore.DefaultSortFunc = DefaultSortFunc;
     newStore.SetSortFunc(1, CompareProjectFileNames);
     newStore.SetSortFunc(2, CompareFileNames);
     newStore.SetSortFunc(3, CompareFilePaths);
     newStore.SetSortColumnId(2, SortType.Ascending);
     Reset();
     buttonStop.Sensitive = true;
     treeviewSearchResults.FreezeChildNotify();
 }
Example #22
0
        public void DataBind()
        {
            if (dataSource == null)
            {
                Clear();
                return;
            }

            int index = 0;

            Type[] storeTypes = new Type[dataSource.Columns.Count];
            columnCount = dataSource.Columns.Count;
            foreach (DataColumn col in dataSource.Columns)
            {
                DataGridColumn dgCol = new DataGridColumn(this, col, index);
                grid.AppendColumn(dgCol);

                if (col.DataType == typeof(byte))
                {
                    //special case for gchar (TODO: look up the bugzilla bug id)
                    storeTypes[index] = typeof(string);
                    conversionLookup.Add(index, byteConvertFunc);
                }
                else if (col.DataType == typeof(sbyte))
                {
                    storeTypes[index] = typeof(string);
                    conversionLookup.Add(index, sbyteConvertFunc);
                }
                else if (col.DataType.IsPrimitive || col.DataType == typeof(string) || col.DataType.IsEnum)
                {
                    storeTypes[index] = col.DataType;
                }
                else
                {
                    //the ListStore doesn't allow types that can't be converted to a GType
                    storeTypes[index] = typeof(object);
                }

                index++;
            }
            store      = new ListStore(storeTypes);
            grid.Model = store;

            TreeIterCompareFunc sortFunc = new TreeIterCompareFunc(SortFunc);

            store.SetSortFunc(0, sortFunc);
            store.SetSortColumnId(0, SortType.Ascending);              //TODO: is this needed ?

            NavigateToRecord(0);
        }
Example #23
0
        public RestoreBackupDialog(Gtk.Window parent) : base("Saves", parent)
        {
            this.IconName = "document-revert";

            XML gxml = new XML(null, "MultiMC.GTKGUI.RestoreBackupDialog.glade", "restoreRoot", null);

            gxml.Toplevel = this;
            gxml.Autoconnect(this);

            this.VBox.PackStart(restoreRoot);

            this.WidthRequest  = 620;
            this.HeightRequest = 380;

            // set default button states
            btnCancel.Sensitive = true;
            btnOK.Sensitive     = false;

            // FIXME: store date/time properly so ordering works.
            backupsStore      = new ListStore(typeof(string), typeof(DateTime), typeof(string), typeof(string));
            restoreView.Model = backupsStore;
            restoreView.AppendColumn("Backup name", new CellRendererText(), "text", 0);
            restoreView.AppendColumn("Date", new CellRendererText(), new TreeCellDataFunc(DateTimeCell));
            restoreView.AppendColumn("Hash", new CellRendererText(), "text", 2);
            restoreView.Selection.Mode = SelectionMode.Single;

            // this binds view and model columns together for sorting
            restoreView.Columns[0].SortColumnId = 0;
            restoreView.Columns[1].SortColumnId = 1;
            restoreView.Columns[2].SortColumnId = 2;
            // the date column needs a custom sorting function that can compare DateTime objects
            backupsStore.SetSortFunc(1, new TreeIterCompareFunc(DateTimeTreeIterCompareFunc));
            backupsStore.SetSortColumnId(1, SortType.Ascending);            // sort by date
            restoreView.Selection.Changed += (sender, e) =>
            {
                if (restoreView.Selection.CountSelectedRows() != 0)
                {
                    btnOK.Sensitive = true;
                    TreeIter iter;
                    restoreView.Selection.GetSelected(out iter);
                    currentHash = backupsStore.GetValue(iter, 3) as string;
                }
                else
                {
                    btnOK.Sensitive = false;
                }
            };
            ShowAll();
        }
        void Resort(object sender, EventArgs args)
        {
            TreeViewColumn col = (TreeViewColumn)sender;

            foreach (TreeViewColumn c in view.Columns)
            {
                if (c != col)
                {
                    c.SortIndicator = false;
                }
            }
            col.SortOrder     = ReverseSortOrder(col);
            col.SortIndicator = true;
            store.SetSortColumnId(col.SortColumnId, col.SortOrder);
        }
Example #25
0
        public PackageReferencePanel(SelectReferenceDialog selectDialog, bool showAll)
        {
            this.selectDialog = selectDialog;
            this.showAll      = showAll;

            store    = new ListStore(typeof(string), typeof(string), typeof(SystemAssembly), typeof(bool), typeof(string), typeof(string), typeof(IconId), typeof(int), typeof(ReferenceType));
            treeView = new TreeView(store);

            TreeViewColumn     firstColumn = new TreeViewColumn();
            CellRendererToggle tog_render  = new CellRendererToggle();

            tog_render.Toggled += new Gtk.ToggledHandler(AddReference);
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", ColSelected);

            treeView.AppendColumn(firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn();

            secondColumn.Title = GettextCatalog.GetString("Assembly");
            CellRendererImage crp = new CellRendererImage();

            secondColumn.PackStart(crp, false);
            secondColumn.AddAttribute(crp, "icon-id", ColIcon);

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "markup", ColName);

            treeView.AppendColumn(secondColumn);

            treeView.AppendColumn(GettextCatalog.GetString("Version"), new CellRendererText(), "markup", ColVersion);
            treeView.AppendColumn(GettextCatalog.GetString("Package"), new CellRendererText(), "text", ColPackage);

            treeView.Columns[1].Resizable = true;

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

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            this.PackStart(sc, true, true, 0);
            ShowAll();
            BorderWidth = 6;
        }
Example #26
0
    private ListStore CreateModel(int days, bool sum)
    {
        ListStore store = new ListStore(typeof(Task));

        store.SetSortFunc(0, (model, a, b) => {
            Task ta = (Task)model.GetValue(a, 0);
            Task tb = (Task)model.GetValue(b, 0);
            return(ta.Date.CompareTo(tb.Date));
        });
        foreach (Task task in dbManager.getEntries(days, sum))
        {
            store.AppendValues(task);
        }
        store.SetSortColumnId(0, SortType.Descending);
        return(store);
    }
        public GacReferencePanel(SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

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

            TreeViewColumn     firstColumn = new TreeViewColumn();
            CellRendererToggle tog_render  = new CellRendererToggle();

            tog_render.Toggled += new Gtk.ToggledHandler(AddReference);
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", 3);

            treeView.AppendColumn(firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn();

            secondColumn.Title = GettextCatalog.GetString("Assembly");
            CellRendererPixbuf crp = new CellRendererPixbuf();

            secondColumn.PackStart(crp, false);
            crp.StockId = "md-package";

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "text", 0);

            treeView.AppendColumn(secondColumn);

            treeView.AppendColumn(GettextCatalog.GetString("Version"), new CellRendererText(), "text", 1);
            treeView.AppendColumn(GettextCatalog.GetString("Package"), new CellRendererText(), "text", 5);

            treeView.Columns[1].Resizable = true;

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

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            this.PackStart(sc, true, true, 0);
            ShowAll();
            BorderWidth = 6;
        }
Example #28
0
    /// <summary>
    /// Initializes a new instance of the <see cref="T:MainWindow"/> class.
    /// </summary>
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        // Set configuration

        SetConfiguration();

        // Add list voew columns

        AddListViewColumn("Last Name", 0);
        AddListViewColumn("First Name", 1);
        AddListViewColumn("E-Mail", 2);
        AddListViewColumn("Phone No.", 3);
        AddListViewColumn("Id", 4);

        // Create list view and store

        _contactsListViewStore = new ListStore(typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
        contactsDBTreeView.Model = _contactsListViewStore;
        _contactsListViewStore.SetSortColumnId(0, SortType.Ascending);

        // Load contacts and display

        _contacts = _contactDBStore.LoadContactRecords();

        foreach(var id in _contacts.Keys)
        {
            AddContactToListVew(_contacts[id]);
        }

        // Select first contacts record

        if (_contacts.Count > 0)
        {
            if (_contactsListViewStore.GetIterFirst(out _selectedContact))
            {
                contactsDBTreeView.Selection.SelectIter(_selectedContact);
            }

        }

        // Set button(s) status

        SetButtonsStatus();

    }
Example #29
0
        public AttributeEditorWidget() : base()
        {
            sw = new ScrolledWindow();
            sw.HscrollbarPolicy = PolicyType.Automatic;
            sw.VscrollbarPolicy = PolicyType.Automatic;

            store = new ListStore(typeof(string), typeof(string));
            store.SetSortColumnId(0, SortType.Ascending);

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

            TreeViewColumn col;

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

            CellRendererText cell = new CellRendererText();

            cell.Editable = true;
            cell.Edited  += new EditedHandler(OnAttributeEdit);

            tv.AppendColumn("Value", cell, "text", 1);

            tv.KeyPressEvent    += new KeyPressEventHandler(OnKeyPress);
            tv.ButtonPressEvent += new ButtonPressEventHandler(OnRightClick);
            tv.RowActivated     += new RowActivatedHandler(OnRowActivated);

            sw.AddWithViewport(tv);

            HButtonBox hb = new HButtonBox();

            hb.Layout = ButtonBoxStyle.End;

            applyButton           = new Button();
            applyButton.Label     = "Apply";
            applyButton.Image     = new Gtk.Image(Stock.Apply, IconSize.Button);
            applyButton.Clicked  += new EventHandler(OnApplyClicked);
            applyButton.Sensitive = false;

            hb.Add(applyButton);

            this.PackStart(sw, true, true, 0);
            this.PackStart(hb, false, false, 5);

            this.ShowAll();
        }
        public ProjectReferencePanel(SelectReferenceDialog selectDialog) : base(false, 6)
        {
            this.selectDialog = selectDialog;

            store = new ListStore(typeof(string), typeof(string), typeof(Project), typeof(bool), typeof(Xwt.Drawing.Image), typeof(bool), typeof(string));
            store.SetSortFunc(0, CompareNodes);
            treeView = new TreeView(store);

            TreeViewColumn firstColumn  = new TreeViewColumn();
            TreeViewColumn secondColumn = new TreeViewColumn();

            CellRendererToggle tog_render = new CellRendererToggle();

            tog_render.Xalign   = 0;
            tog_render.Toggled += new Gtk.ToggledHandler(AddReference);
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", ColSelected);
            firstColumn.AddAttribute(tog_render, "visible", ColVisible);

            secondColumn.Title = GettextCatalog.GetString("Project");
            CellRendererImage pix_render = new CellRendererImage();

            secondColumn.PackStart(pix_render, false);
            secondColumn.AddAttribute(pix_render, "image", ColPixbuf);

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "markup", ColName);
            secondColumn.AddAttribute(text_render, "foreground", ColColor);

            treeView.AppendColumn(firstColumn);
            treeView.AppendColumn(secondColumn);
            treeView.AppendColumn(GettextCatalog.GetString("Directory"), new CellRendererText(), "markup", ColPath);

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            PackStart(sc, true, true, 0);

            store.SetSortColumnId(0, SortType.Ascending);
            ShowAll();

            BorderWidth = 6;
        }