Пример #1
0
        public ItemView()
        {
            // set up the liststore for the view
            store = new ListStore(typeof(Gdk.Pixbuf), typeof(bool), typeof(bool), typeof(string), typeof(string), typeof(string), typeof(int));
            Model = store;

            // set up the columns for the view
            InsertColumn(-1, "Read", new CellRendererPixbuf(), "pixbuf", 0);
            CellRendererText trender = new CellRendererText();

            column_Date = new TreeViewColumn("Date", trender, "text", 3);
            column_Date.AddAttribute(trender, "weight", 6);
            column_Date.SortColumnId = 3;
            column_Date.SortIndicator = true;
            AppendColumn(column_Date);
            column_Title = new TreeViewColumn("Title", trender, "text", 4);
            column_Title.AddAttribute(trender, "weight", 6);
            AppendColumn(column_Title);

            RulesHint = true;
            HeadersClickable = true;
            store.SetSortColumnId(3, SortType.Descending);

            // set up the icon theme so that we can make stuff pretty
            icon_theme = IconTheme.Default;
        }
Пример #2
0
        public void OnColumnClick(object sender, EventArgs args)
        {
            TreeViewColumn column = sender as TreeViewColumn;

            foreach (TreeViewColumn c in view.Columns)
            {
                if (c.SortColumnId != column.SortColumnId)
                {
                    c.SortIndicator = false;
                }
            }

            if (currentSortColumnId == column.SortColumnId)
            {
                if (currentSortType == SortType.Ascending)
                {
                    currentSortType = SortType.Descending;
                }
                else
                {
                    currentSortType = SortType.Ascending;
                }
            }
            else
            {
                currentSortColumnId = column.SortColumnId;
                currentSortType     = SortType.Ascending;
            }

            column.SortOrder     = currentSortType;
            column.SortIndicator = true;
            store.SetSortColumnId(currentSortColumnId, currentSortType);
        }
Пример #3
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 ();
        }
Пример #4
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 WebDeployOptionsPanelWidget(AspNetAppProject project)
        {
            localCollection = project.WebDeployTargets.Clone();

            //fill model and set it up
            this.Build();
            foreach (WebDeployTarget target in localCollection)
            {
                targetList.AppendValues(target.GetMarkup(), target);
            }
            targetView.HeadersVisible = false;
            targetList.SetSortFunc(LISTCOL_TEXT, delegate(TreeModel m, TreeIter a, TreeIter b)
            {
                return(string.Compare((string)m.GetValue(a, LISTCOL_TEXT), (string)m.GetValue(b, LISTCOL_TEXT)));
            });
            targetList.SetSortColumnId(LISTCOL_TEXT, SortType.Ascending);

            //set up the view
            targetView.Model = targetList;
            targetView.AppendColumn("", new Gtk.CellRendererText(), "markup", LISTCOL_TEXT);
            targetView.Selection.Changed += delegate(object sender, EventArgs e)
            {
                UpdateButtonState();
            };

            UpdateButtonState();
        }
Пример #6
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 ();
        }
Пример #7
0
        public WebDeployLaunchDialog(AspNetAppProject project)
        {
            this.Build();

            this.project = project;

            //set up the sort order
            targetStore.SetSortFunc(LISTCOL_Text, delegate(TreeModel m, TreeIter a, TreeIter b) {
                return(string.Compare((string)m.GetValue(a, LISTCOL_Text), (string)m.GetValue(b, LISTCOL_Text)));
            });
            targetStore.SetSortColumnId(LISTCOL_Text, SortType.Ascending);

            //set up the view
            targetView.Model          = targetStore;
            targetView.HeadersVisible = false;

            CellRendererToggle toggleRenderer = new CellRendererToggle();

            toggleRenderer.Activatable = true;
            toggleRenderer.Xpad        = 6;
            TreeViewColumn checkCol = new TreeViewColumn("", toggleRenderer, "active", LISTCOL_Checked);

            checkCol.Expand = false;
            targetView.AppendColumn(checkCol);
            toggleRenderer.Toggled += HandleToggle;

            CellRendererText textRenderer = new CellRendererText();

            textRenderer.WrapMode = Pango.WrapMode.WordChar;
            targetView.AppendColumn("", textRenderer, "markup", LISTCOL_Text);

            fillStore();
        }
Пример #8
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 ();
        }
		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 ();
		}
Пример #10
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();
        note_store = new NoteStore(basedir);

        preview.ModifyFont(Pango.FontDescription.FromString("Monospace 12"));

        Gtk.TreeViewColumn titleColumn = new Gtk.TreeViewColumn();
        titleColumn.Title = "Title";
        Gtk.CellRendererText titleCell = new Gtk.CellRendererText();
        titleColumn.PackStart(titleCell, true);
        titleColumn.AddAttribute(titleCell, "text", 0);
        titleColumn.SortColumnId = 0;
        titleColumn.Expand       = true;
        filenames.AppendColumn(titleColumn);

/*
 *      if (false) {
 *          Gtk.TreeViewColumn filenameColumn = new Gtk.TreeViewColumn ();
 *          filenameColumn.Title = "Filename";
 *          Gtk.CellRendererText filenameCell = new Gtk.CellRendererText();
 *          filenameColumn.PackStart(filenameCell, true);
 *          filenameColumn.AddAttribute(filenameCell, "text", 1);
 *          filenameColumn.SortColumnId = 1;
 *          filenames.AppendColumn(filenameColumn);
 *      }
 */

        Gtk.TreeViewColumn dateColumn = new Gtk.TreeViewColumn();
        dateColumn.Title = "Date added";
        Gtk.CellRendererText dateCell = new Gtk.CellRendererText();
        dateColumn.PackStart(dateCell, true);
        dateColumn.SetCellDataFunc(dateCell, this.RenderDate);
        dateColumn.SortColumnId = 2;

        filenames.AppendColumn(dateColumn);

        filename_list = new ListStore(typeof(String), typeof(String), typeof(DateTime), typeof(Note));
        UpdateFiles();

        filename_list.SetSortColumnId(0, SortType.Ascending);

        filter = new Gtk.TreeModelFilter(filename_list, null);

        filter.VisibleFunc = new TreeModelFilterVisibleFunc(FilterTree);

        TreeModelSort tm = new TreeModelSort(filter);

        tm.SetSortFunc(2, this.SortDates);
        filenames.Model = tm;

        preview.WrapMode = WrapMode.Word;
        preview.ModifyFont(Pango.FontDescription.FromString("Droid Sans Mono 10"));
        preview.Buffer.Changed += new EventHandler(this.WriteToNotefile);
    }
Пример #11
0
		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);
		}
Пример #12
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;
		}
Пример #13
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build();
        note_store = new NoteStore(basedir);

        preview.ModifyFont(Pango.FontDescription.FromString("Monospace 12"));

        Gtk.TreeViewColumn titleColumn = new Gtk.TreeViewColumn ();
        titleColumn.Title = "Title";
        Gtk.CellRendererText titleCell = new Gtk.CellRendererText();
        titleColumn.PackStart(titleCell, true);
        titleColumn.AddAttribute(titleCell, "text", 0);
        titleColumn.SortColumnId = 0;
        titleColumn.Expand = true;
        filenames.AppendColumn(titleColumn);
        /*
        if (false) {
            Gtk.TreeViewColumn filenameColumn = new Gtk.TreeViewColumn ();
            filenameColumn.Title = "Filename";
            Gtk.CellRendererText filenameCell = new Gtk.CellRendererText();
            filenameColumn.PackStart(filenameCell, true);
            filenameColumn.AddAttribute(filenameCell, "text", 1);
            filenameColumn.SortColumnId = 1;
            filenames.AppendColumn(filenameColumn);
        }
        */

        Gtk.TreeViewColumn dateColumn = new Gtk.TreeViewColumn ();
        dateColumn.Title = "Date added";
        Gtk.CellRendererText dateCell = new Gtk.CellRendererText();
        dateColumn.PackStart(dateCell, true);
        dateColumn.SetCellDataFunc(dateCell, this.RenderDate);
        dateColumn.SortColumnId = 2;

        filenames.AppendColumn(dateColumn);

        filename_list = new ListStore(typeof(String), typeof(String), typeof(DateTime), typeof(Note));
        UpdateFiles();

        filename_list.SetSortColumnId(0, SortType.Ascending);

        filter = new Gtk.TreeModelFilter (filename_list, null);

        filter.VisibleFunc = new TreeModelFilterVisibleFunc(FilterTree);

        TreeModelSort tm = new TreeModelSort(filter);
        tm.SetSortFunc(2, this.SortDates);
        filenames.Model = tm;

        preview.WrapMode = WrapMode.Word;
        preview.ModifyFont(Pango.FontDescription.FromString("Droid Sans Mono 10"));
        preview.Buffer.Changed += new EventHandler(this.WriteToNotefile);
    }
Пример #14
0
		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);
		}
Пример #15
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();
        }
Пример #16
0
		public SortedTableListStore (TableSchemaCollection tables)
		{
			if (tables == null)
				throw new ArgumentNullException ("tables");
			
			this.tables = tables;
			
			store = new ListStore (typeof (bool), typeof (string), typeof (TableSchema));
			store.SetSortColumnId (ColNameIndex, SortType.Ascending);
			store.SetSortFunc (ColNameIndex, new TreeIterCompareFunc (SortName));
			
			foreach (TableSchema table in tables)
				AddTable (table);
			
			tables.ItemAdded += new SortedCollectionItemEventHandler<TableSchema> (OnTableAdded);
			tables.ItemRemoved += new SortedCollectionItemEventHandler<TableSchema> (OnTableRemoved);
		}
Пример #17
0
		public SortedColumnListStore (ColumnSchemaCollection columns)
		{
			if (columns == null)
				throw new ArgumentNullException ("columns");
			
			this.columns = columns;
			
			store = new ListStore (typeof (bool), typeof (string), typeof (ColumnSchema));
			store.SetSortColumnId (ColNameIndex, SortType.Ascending);
			store.SetSortFunc (ColNameIndex, new TreeIterCompareFunc (SortName));
			
			foreach (ColumnSchema col in columns)
				AddColumn (col);
			
			columns.ItemAdded += new SortedCollectionItemEventHandler<ColumnSchema> (OnColumnAdded);
			columns.ItemRemoved += new SortedCollectionItemEventHandler<ColumnSchema> (OnColumnRemoved);
		}
Пример #18
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 ();
        }
Пример #19
0
        public NamePicker()
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build();
            store= new Gtk.ListStore (typeof(string),typeof(UUID));
            treeview1.AppendColumn("Name",new Gtk.CellRendererText(),"text",0);
            treeview1.Model=store;
            store.SetSortColumnId(0,Gtk.SortType.Ascending);

            lock(MainClass.name_cache.av_names)
            {
                foreach(KeyValuePair<UUID,string> name in MainClass.name_cache.av_names)
                {
                    store.AppendValues(name.Value,name.Key);

                }
            }
        }
			public SyntaxHighlightingPanelWidget () :  base ("EditorBindings.glade", "SyntaxHighlightingPanel")
			{
				enableSyntaxHighlighting.Active = TextEditorProperties.SyntaxHighlight;
				
				// add available sourceLanguages
				ListStore store = new ListStore (typeof (string));
				foreach (SourceLanguage sl in SourceViewService.AvailableLanguages)
					store.AppendValues (sl.Name);
				store.SetSortColumnId (0, SortType.Ascending);
				sourceLanguages.Model = store;

				CellRendererText cr = new CellRendererText ();
				sourceLanguages.PackStart (cr, true);
				sourceLanguages.AddAttribute (cr, "text", 0);
				sourceLanguages.Active = 0;

				stylesTreeView.AppendColumn ("styles", new CellRendererText (), "text", 0);
				stylesTreeView.Selection.Changed += new EventHandler (OnStyleChanged);
			}
        public PatternEditorWidget()
        {
            this.Build();

            Gtk.TreeViewColumn patternNameColumn = new Gtk.TreeViewColumn();
            patternNameColumn.Title = "Name";
            Gtk.CellRendererText patternNameCell = new Gtk.CellRendererText();
            patternNameColumn.PackStart(patternNameCell, true);
            patternNameColumn.SetCellDataFunc(patternNameCell, new Gtk.TreeCellDataFunc(RenderPatternName));

            treeviewPatterns.AppendColumn("Play", new Gtk.CellRendererPixbuf(), "stock_id", 0);
            treeviewPatterns.AppendColumn(patternNameColumn);
            treeviewPatterns.AppendColumn("Edit", new Gtk.CellRendererPixbuf(), "stock_id", 2);
            treeviewPatterns.AppendColumn("Copy", new Gtk.CellRendererPixbuf(), "stock_id", 3);
            treeviewPatterns.AppendColumn("Delete", new Gtk.CellRendererPixbuf(), "stock_id", 4);

            treeviewPatterns.Columns[3].Expand = false;
            treeviewPatterns.Columns[2].Expand = false;
            treeviewPatterns.Columns[4].Expand = false;
            treeviewPatterns.Columns[1].Expand = true;

            PatternListStore.SetSortFunc(0, delegate(TreeModel model, TreeIter a, TreeIter b) {
                Pattern p1 = (Pattern)model.GetValue(a, PatternColumn);
                Pattern p2 = (Pattern)model.GetValue(b, PatternColumn);
                if (p1 == null || p2 == null)
                {
                    return(0);
                }
                return(String.Compare(p1.Name, p2.Name));
            });

            PatternListStore.SetSortColumnId(0, SortType.Ascending);

            treeviewPatterns.Model = PatternListStore;

            //These events get lost in the designer
            treeviewPatterns.RowActivated  += OnTreeviewPatternsRowActivated;
            treeviewPatterns.CursorChanged += OnTreeviewPatternsCursorChanged;

            blinkstickemulatorwidget1.EmulatedDevice = BlinkStickDeviceEnum.BlinkStick;

            UpdateButtons();
        }
		public ProjectReferencePanel (SelectReferenceDialog selectDialog) : base (false, 6)
		{
			this.selectDialog = selectDialog;
			
			store = new ListStore (typeof (string), typeof (string), typeof(Project), typeof(bool), typeof(Gdk.Pixbuf), 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", 3);
			firstColumn.AddAttribute (tog_render, "visible", 5);

			secondColumn.Title = GettextCatalog.GetString ("Project");
			Gtk.CellRendererPixbuf pix_render = new Gtk.CellRendererPixbuf ();
			secondColumn.PackStart (pix_render, false);
			secondColumn.AddAttribute (pix_render, "pixbuf", 4);
			
			CellRendererText text_render = new CellRendererText ();
			secondColumn.PackStart (text_render, true);
			secondColumn.AddAttribute (text_render, "text", 0);
			secondColumn.AddAttribute (text_render, "foreground", 6);
			
			treeView.AppendColumn (firstColumn);
			treeView.AppendColumn (secondColumn);
			treeView.AppendColumn (GettextCatalog.GetString ("Directory"), new CellRendererText (), "markup", 1);
			
			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;
		}
        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;
        }
        public GroupChatList()
        {
            this.Build();
            store= new Gtk.ListStore (typeof(string),typeof(ChatSessionMember));
            MyTreeViewColumn tvc;
            Gtk.CellRendererText NameRenderer=new Gtk.CellRendererText();
            tvc=new MyTreeViewColumn("Name",NameRenderer,"text",0,true);
            tvc.Sizing=Gtk.TreeViewColumnSizing.Autosize;
            tvc.setmodel(store);

            tvc.SetCellDataFunc(NameRenderer,new Gtk.TreeCellDataFunc(RenderName));

            this.treeview_members.AppendColumn(tvc);
            this.treeview_members.HeadersClickable=true;
            store.SetSortColumnId(0,SortType.Ascending);

            this.treeview_members.Selection.Mode = SelectionMode.Multiple;
            this.treeview_members.ButtonPressEvent += new ButtonPressEventHandler(treeview_ButtonPressEvent);
            Dictionary <UUID,TreeIter> memberstree= new Dictionary<UUID,TreeIter>();

            treeview_members.Model=store;
        }
        public VersionInformationTabPage ()
        {
            TreeView treeView = new TreeView ();

            TreeViewColumn treeViewColumnTitle = new TreeViewColumn (GettextCatalog.GetString ("Title"), cellRenderer, "text", 0);
            treeViewColumnTitle.FixedWidth = 200;
            treeViewColumnTitle.Sizing = TreeViewColumnSizing.Fixed;
            treeViewColumnTitle.Resizable = true;
            treeView.AppendColumn (treeViewColumnTitle);

            TreeViewColumn treeViewColumnVersion = new TreeViewColumn (GettextCatalog.GetString ("Version"), cellRenderer, "text", 1);
            treeView.AppendColumn (treeViewColumnVersion);

            TreeViewColumn treeViewColumnPath = new TreeViewColumn (GettextCatalog.GetString ("Path"), cellRenderer, "text", 2);
            treeView.AppendColumn (treeViewColumnPath);

            treeView.RulesHint = true;

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

            ScrolledWindow scrolledWindow = new ScrolledWindow ();
            scrolledWindow.Add (treeView);
            scrolledWindow.ShadowType = ShadowType.In;

            BorderWidth = 6;

            PackStart (scrolledWindow, true, true, 0);

            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies ()) {
                try {
                    AssemblyName assemblyName = assembly.GetName ();
                    data.AppendValues (assemblyName.Name, assemblyName.Version.ToString (), System.IO.Path.GetFullPath (assembly.Location));
                }
                catch { }
            }

            data.SetSortColumnId (0, SortType.Ascending);
        }
Пример #26
0
        public OpenTaskView()
        {
            store = new Gtk.ListStore (
                typeof (Gdk.Pixbuf), // image
                typeof (int),        // line
                typeof (string),     // desc
                typeof (string),     // file
                typeof (string),     // path
                typeof (Task),       // task
                typeof (bool),       // read?
                typeof (bool),       // marked?
                typeof (int));       // read? -- use Pango weight

            TreeIterCompareFunc sortFunc = new TreeIterCompareFunc (TaskSortFunc);
            store.SetSortFunc (COL_TASK, sortFunc);
            store.DefaultSortFunc = sortFunc;
            store.SetSortColumnId (COL_TASK, SortType.Ascending);

            view = new Gtk.TreeView (store);
            view.RulesHint = true;
            view.PopupMenu += new PopupMenuHandler (OnPopupMenu);
            view.ButtonPressEvent += new ButtonPressEventHandler (OnButtonPressed);
            view.HeadersClickable = true;
            AddColumns ();

            sw = new Gtk.ScrolledWindow ();
            sw.ShadowType = ShadowType.In;
            sw.Add (view);

            Runtime.TaskService.TasksChanged     += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (ShowResults));
            Runtime.TaskService.TaskAdded        += (TaskEventHandler) Runtime.DispatchService.GuiDispatch (new TaskEventHandler (TaskAdded));
            Runtime.ProjectService.EndBuild      += (ProjectCompileEventHandler) Runtime.DispatchService.GuiDispatch (new ProjectCompileEventHandler (SelectTaskView));
            Runtime.ProjectService.CombineOpened += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineOpen));
            Runtime.ProjectService.CombineClosed += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineClosed));
            view.RowActivated            += new RowActivatedHandler (OnRowActivated);
            Control.ShowAll ();
        }
        private void BuildWidget ()
        {
            store = new ListStore (typeof (string), typeof (EqualizerSetting));
            Model = store;
            TextColumn = 0;

            store.DefaultSortFunc = (model, ia, ib) => {
                var a = GetEqualizerSettingForIter (ia);
                var b = GetEqualizerSettingForIter (ib);
                if (a != null && b != null) {
                    return a.IsReadOnly == b.IsReadOnly
                        ? a.Name.CompareTo (b.Name)
                        : a.IsReadOnly.CompareTo (b.IsReadOnly);
                } else if (a == null && b == null) {
                    return 0;
                } else if ((a == null && b.IsReadOnly) || (b == null && !a.IsReadOnly)) {
                    return -1;
                } else if ((a == null && !b.IsReadOnly) || (b == null && a.IsReadOnly)) {
                    return 1;
                }
                return 0;
            };


            store.SetSortColumnId (-1, SortType.Ascending);

            RowSeparatorFunc = (model, iter) =>
                store.GetValue (iter, 0) as String == String.Empty &&
                store.GetValue (iter, 1) == null;

            foreach (EqualizerSetting eq in manager) {
                AddEqualizerSetting(eq);
            }

            manager.EqualizerAdded += (o, e) => AddEqualizerSetting (e.Value);
            manager.EqualizerRemoved += (o, e) => RemoveEqualizerSetting (e.Value);
        }
            public CompileFileOptionsWidget(IProperties CustomizationObject)
                : base("Base.glade", "CompileFileOptionsPanel")
            {
                this.project = (Project)((IProperties)CustomizationObject).GetProperty("Project");

                includeLabel.UseUnderline = true;
                store = new ListStore (typeof(bool), typeof(string));
                store.SetSortColumnId (1, SortType.Ascending);
                includeTreeView.Selection.Mode = SelectionMode.None;
                includeTreeView.Model = store;
                CellRendererToggle rendererToggle = new CellRendererToggle ();
                rendererToggle.Activatable = true;
                rendererToggle.Toggled += new ToggledHandler (ItemToggled);
                includeTreeView.AppendColumn ("Choosen", rendererToggle, "active", 0);
                includeTreeView.AppendColumn ("Name", new CellRendererText (), "text", 1);

                foreach (ProjectFile info in project.ProjectFiles) {
                    if (info.BuildAction == BuildAction.Nothing || info.BuildAction == BuildAction.Compile) {
                        string name = Runtime.FileUtilityService.AbsoluteToRelativePath(
                            project.BaseDirectory, info.Name).Substring(2);
                        store.AppendValues (info.BuildAction == BuildAction.Compile ? true : false, name);
                    }
                }
            }
Пример #29
0
        public Playlist()
        {
            Build();

            ContentsList = new ListStore(typeof(bool),typeof(int),typeof(string),typeof(string),typeof(string),typeof(string), typeof(MpdFileInfo));
            ContentsList.SetSortColumnId(1, SortType.Ascending);
            Contents.Model = ContentsList;
            var ren=new CellRendererText();
            Contents.AppendColumn(new TreeViewColumn("", new CellRendererToggle(), "active", 0) {Clickable = true});
            //Contents.AppendColumn(new TreeViewColumn("ID", ren, "text", 1));
            Contents.AppendColumn(new TreeViewColumn("Artist", ren, "text", 2));
            Contents.AppendColumn(new TreeViewColumn("Album", ren, "text", 3));
            Contents.AppendColumn(new TreeViewColumn("Title", ren, "text", 4));
            Contents.AppendColumn(new TreeViewColumn("Length", ren, "text", 5));

            Contents.CursorChanged += Contents_CursorChanged;
            Contents.RowActivated += listView_ItemActivate;

            detachableButtons = new HBox(false, 6);
            var b = new Button { Label = "Remove item" };
            b.Clicked += RemoveItem_Click;
            detachableButtons.Add(b);
            detachableButtons.ShowAll();
        }
		private EncapsulateFieldDialog (MonoDevelop.Ide.Gui.Document editor, IType declaringType, IField field)
		{
			this.editor = editor;
			this.declaringType = declaringType;
			this.Build ();

			Title = GettextCatalog.GetString ("Encapsulate Fields");
			buttonOk.Sensitive = true;
			store = new ListStore (typeof (bool), typeof(string), typeof (string), typeof (string), typeof (bool), typeof (IField));
			visibilityStore = new ListStore (typeof (string));

			// Column #1
			CellRendererToggle cbRenderer = new CellRendererToggle ();
			cbRenderer.Activatable = true;
			cbRenderer.Toggled += OnSelectedToggled;
			TreeViewColumn cbCol = new TreeViewColumn ();
			cbCol.Title = "";
			cbCol.PackStart (cbRenderer, false);
			cbCol.AddAttribute (cbRenderer, "active", colCheckedIndex);
			treeview.AppendColumn (cbCol);

			// Column #2
			CellRendererText fieldRenderer = new CellRendererText ();
			fieldRenderer.Weight = (int) Pango.Weight.Bold;
			TreeViewColumn fieldCol = new TreeViewColumn ();
			fieldCol.Title = GettextCatalog.GetString ("Field");
			fieldCol.Expand = true;
			fieldCol.PackStart (fieldRenderer, true);
			fieldCol.AddAttribute (fieldRenderer, "text", colFieldNameIndex);
			treeview.AppendColumn (fieldCol);

			// Column #3
			CellRendererText propertyRenderer = new CellRendererText ();
			propertyRenderer.Editable = true;
			propertyRenderer.Edited += new EditedHandler (OnPropertyEdited);
			TreeViewColumn propertyCol = new TreeViewColumn ();
			propertyCol.Title = GettextCatalog.GetString ("Property");
			propertyCol.Expand = true;
			propertyCol.PackStart (propertyRenderer, true);
			propertyCol.AddAttribute (propertyRenderer, "text", colPropertyNameIndex);
			propertyCol.SetCellDataFunc (propertyRenderer, new TreeCellDataFunc (RenderPropertyName));
			treeview.AppendColumn (propertyCol);

			// Column #4
			CellRendererCombo visiComboRenderer = new CellRendererCombo ();
			visiComboRenderer.Model = visibilityStore;
			visiComboRenderer.Editable = true;
			visiComboRenderer.Edited += new EditedHandler (OnVisibilityEdited);
			visiComboRenderer.HasEntry = false;
			visiComboRenderer.TextColumn = 0;

			TreeViewColumn visiCol = new TreeViewColumn ();
			visiCol.Title = GettextCatalog.GetString ("Visibility");
			visiCol.PackStart (visiComboRenderer, false);
			visiCol.AddAttribute (visiComboRenderer, "text", colVisibilityIndex);
			treeview.AppendColumn (visiCol);

			// Column #5
			CellRendererToggle roRenderer = new CellRendererToggle ();
			roRenderer.Activatable = true;
			roRenderer.Xalign = 0.0f;
			roRenderer.Toggled += new ToggledHandler (OnReadOnlyToggled);
			TreeViewColumn roCol = new TreeViewColumn ();
			roCol.Title = GettextCatalog.GetString ("Read only");
			roCol.PackStart (roRenderer, false);
			roCol.AddAttribute (roRenderer, "active", colReadOnlyIndex);
			treeview.AppendColumn (roCol);

			visibilityStore.AppendValues ("Public");
			visibilityStore.AppendValues ("Private");
			visibilityStore.AppendValues ("Protected");
			visibilityStore.AppendValues ("Internal");

			treeview.Model = store;

			foreach (IField ifield in declaringType.Fields) {
				bool enabled = field != null && (field.Name == ifield.Name);
				string propertyName = GeneratePropertyName (ifield.Name);
				store.AppendValues (enabled, ifield.Name, propertyName,
				                    "Public", ifield.IsReadonly || ifield.IsLiteral, ifield);

				if (enabled)
					CheckAndUpdateConflictMessage (propertyName, false);
			}

			store.SetSortColumnId (colFieldNameIndex, SortType.Ascending);
			buttonSelectAll.Clicked += OnSelectAllClicked;
			buttonUnselectAll.Clicked += OnUnselectAllClicked;
			buttonOk.Clicked += OnOKClicked;
			buttonCancel.Clicked += OnCancelClicked;

			UpdateOKButton ();
		}
Пример #31
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);
		}
Пример #32
0
        // TODO: Since allows editing probably should be renamed to SlideDialog
        public AddSlideDialog(Project project)
            : base("AddSlideDialog.ui", "addslide")
        {
            this.project = project;
            LoadWindowPosition ();

            image_view = new SlideShowImageView ();
            image_view.ChangeEvent = new ShowImageSelectionEventHandler (OnChangeImage);
            image_view.UpdatedElements = new ShowImageUpdatedElementsEventHandler (OnUpdatedImages);
            scrolled_images.Add (image_view);

            up_button.Clicked += new EventHandler (OnButtonUp);
            down_button.Clicked += new EventHandler (OnButtonDown);
            audio_button.Clicked += new EventHandler (OnButtonAudio);

            file_view = new ImagesFileView ();
            new DirectoryView (vbox_dir, new ChangeDirectoryEventHandler (OnDirectoryChanged),
                Mistelix.Preferences.GetStringValue (Preferences.ImagesDirectoryKey));

            scrolledwin_files.Add (file_view);

            drawing_area = new TransitionPreview ();
            ctrls_hbox.Add (drawing_area);
            drawing_area.Visible = true;

            file_view.ShowAll ();
            left_vbox.ShowAll ();
            vpaned.Position = 650; // W (left)
            hpaned.Position = 300; // H (right)

            transition_store = new ListStore (typeof (string), typeof (string)); // DisplayName, Name
            LoadTransitionsIntoCombo ();
            transition_combo.Model = transition_store;

            CellRenderer transition_cell = new CellRendererText ();
            transition_combo.PackStart (transition_cell, true);
            transition_combo.SetCellDataFunc (transition_cell, Utils.ComboBoxCellFunc);
            transition_store.SetSortFunc (0, new Gtk.TreeIterCompareFunc (TransitionSort));
            transition_store.SetSortColumnId (0, SortType.Ascending);

            textposition_store = new ListStore (typeof (string), typeof (int)); // DisplayName, int
            textposition_combo.Model = textposition_store;
            CellRenderer textposition_cell = new CellRendererText ();
            textposition_combo.PackStart (textposition_cell, true);
            textposition_combo.SetCellDataFunc (textposition_cell, Utils.ComboBoxCellFunc);
            LoadTextPositionsIntoCombo ();

            SetTransisitionToNone ();
            ImageControlsSensitive (false);
            OnUpdatedImages (this, EventArgs.Empty);
            duration_spin.ValueChanged += new EventHandler (TimeValueChanged);
        }
		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 ();
		}
Пример #34
0
    public static Gtk.TreeView MainTree(Gtk.ListStore store)
    {
        Gtk.TreeView localTree = new Gtk.TreeView();

        Gtk.TreeViewColumn packageidColumn = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn versionColumn   = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn contentColumn   = new Gtk.TreeViewColumn();
        //Gtk.TreeViewColumn copyrightColumn = new Gtk.TreeViewColumn ();
        Gtk.TreeViewColumn publishedColumn            = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn licenseurlColumn           = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn licensenamesColumn         = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn latestversionColumn        = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn packagehashColumn          = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn packagehashalgorithmColumn = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn packagesizeColumn          = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn summaryColumn = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn versiondownloadcountColumn = new Gtk.TreeViewColumn();

        packageidColumn.Title = "ID";
        versionColumn.Title   = "Version";
        contentColumn.Title   = "Link";
        //copyrightColumn.Title  = "Copyright";
        publishedColumn.Title            = "Publish Date";
        licenseurlColumn.Title           = "License Link";
        licensenamesColumn.Title         = "Licenses";
        latestversionColumn.Title        = "Latest Version";
        packagehashColumn.Title          = "Package Hash";
        packagehashalgorithmColumn.Title = "Hash Algorithm";
        packagesizeColumn.Title          = "Package Size";
        summaryColumn.Title = "Summary";
        versiondownloadcountColumn.Title = "Download Count";

        //Hide crazy wide columns



        contentColumn.Visible              = false;
        licenseurlColumn.Visible           = false;
        latestversionColumn.Visible        = false;
        packagehashColumn.Visible          = false;
        packagehashalgorithmColumn.Visible = false;
        summaryColumn.Visible              = false;


        Gtk.CellRendererText packageidCell = new Gtk.CellRendererText();
        Gtk.CellRendererText versionCell   = new Gtk.CellRendererText();
        Gtk.CellRendererText contentCell   = new Gtk.CellRendererText();
        //Gtk.CellRendererText copyrightCell = new Gtk.CellRendererText ();
        Gtk.CellRendererText publishedCell            = new Gtk.CellRendererText();
        Gtk.CellRendererText licenseurlCell           = new Gtk.CellRendererText();
        Gtk.CellRendererText licensenamesCell         = new Gtk.CellRendererText();
        Gtk.CellRendererText latestversionCell        = new Gtk.CellRendererText();
        Gtk.CellRendererText packagehashCell          = new Gtk.CellRendererText();
        Gtk.CellRendererText packagehashalgorithmCell = new Gtk.CellRendererText();
        Gtk.CellRendererText packagesizeCell          = new Gtk.CellRendererText();
        Gtk.CellRendererText summaryCell = new Gtk.CellRendererText();
        Gtk.CellRendererText versiondownloadcountCell = new Gtk.CellRendererText();

        packageidColumn.PackStart(packageidCell, true);
        versionColumn.PackStart(versionCell, true);
        contentColumn.PackStart(contentCell, true);
        //copyrightColumn.PackStart ( copyrightCell, true);
        publishedColumn.PackStart(publishedCell, true);
        licenseurlColumn.PackStart(licenseurlCell, true);
        licensenamesColumn.PackStart(licensenamesCell, true);
        latestversionColumn.PackStart(latestversionCell, true);
        packagehashColumn.PackStart(packagehashCell, true);
        packagehashalgorithmColumn.PackStart(packagehashalgorithmCell, true);
        packagesizeColumn.PackStart(packagesizeCell, true);
        summaryColumn.PackStart(summaryCell, true);
        versiondownloadcountColumn.PackStart(versiondownloadcountCell, true);

        localTree.AppendColumn(packageidColumn);
        localTree.AppendColumn(versionColumn);
        localTree.AppendColumn(contentColumn);
        //localTree.AppendColumn (copyrightColumn);
        localTree.AppendColumn(publishedColumn);
        localTree.AppendColumn(licenseurlColumn);
        localTree.AppendColumn(licensenamesColumn);
        localTree.AppendColumn(latestversionColumn);
        localTree.AppendColumn(packagehashColumn);
        localTree.AppendColumn(packagehashalgorithmColumn);
        localTree.AppendColumn(packagesizeColumn);
        localTree.AppendColumn(summaryColumn);
        localTree.AppendColumn(versiondownloadcountColumn);

        packageidColumn.AddAttribute(packageidCell, "text", 0);
        versionColumn.AddAttribute(versionCell, "text", 1);
        contentColumn.AddAttribute(contentCell, "text", 2);
        //copyrightColumn.AddAttribute ( copyrightCell, "text", 0);
        publishedColumn.AddAttribute(publishedCell, "text", 3);
        licenseurlColumn.AddAttribute(licenseurlCell, "text", 4);
        licensenamesColumn.AddAttribute(licensenamesCell, "text", 5);
        latestversionColumn.AddAttribute(latestversionCell, "text", 6);
        packagehashColumn.AddAttribute(packagehashCell, "text", 7);
        packagehashalgorithmColumn.AddAttribute(packagehashalgorithmCell, "text", 8);
        packagesizeColumn.AddAttribute(packagesizeCell, "text", 9);
        summaryColumn.AddAttribute(summaryCell, "text", 10);
        versiondownloadcountColumn.AddAttribute(versiondownloadcountCell, "text", 11);

        //store.DefaultSortFunc = CustomSort;
        store.SetSortColumnId(1, Gtk.SortType.Descending);

        localTree.Model          = store;
        localTree.CursorChanged += new EventHandler(tree_CursorChanged);



        return(localTree);
    }
        public void Initialize()
        {
            log.Debug("Setting up treeview");

            Gtk.TreeViewColumn enabledColumn = new Gtk.TreeViewColumn();
            enabledColumn.Title = "";

            Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn();
            nameColumn.Title = "Name";

            Gtk.TreeViewColumn blinkStickColumn = new Gtk.TreeViewColumn();
            blinkStickColumn.Title = "BlinkStick";

            Gtk.TreeViewColumn patternColumn = new Gtk.TreeViewColumn();
            patternColumn.Title = "Pattern";

            Gtk.CellRendererPixbuf enabledCell    = new Gtk.CellRendererPixbuf();
            Gtk.CellRendererText   nameCell       = new Gtk.CellRendererText();
            Gtk.CellRendererText   typeCell       = new Gtk.CellRendererText();
            Gtk.CellRendererText   blinkStickCell = new Gtk.CellRendererText();
            Gtk.CellRendererText   patternCell    = new Gtk.CellRendererText();

            CellRendererPixbuf iconCell = new CellRendererPixbuf();

            nameColumn.PackStart(iconCell, false);
            nameColumn.AddAttribute(iconCell, "pixbuf", 4);

            enabledColumn.PackEnd(enabledCell, false);
            blinkStickColumn.PackEnd(blinkStickCell, false);
            nameColumn.PackEnd(nameCell, true);
            patternColumn.PackEnd(patternCell, false);

            enabledColumn.SetCellDataFunc(enabledCell, new Gtk.TreeCellDataFunc(RenderEnabledCell));
            nameColumn.SetCellDataFunc(nameCell, new Gtk.TreeCellDataFunc(RenderNameCell));
            blinkStickColumn.SetCellDataFunc(blinkStickCell, new Gtk.TreeCellDataFunc(RenderBlinkStickCell));
            patternColumn.SetCellDataFunc(patternCell, new Gtk.TreeCellDataFunc(RenderPatternCell));

            treeviewEvents.AppendColumn(enabledColumn);

            treeviewEvents.AppendColumn(nameColumn);
            treeviewEvents.Columns[1].Expand = true;
            treeviewEvents.AppendColumn(patternColumn);

            if (this.ApplicationSettings.SingleBlinkStickMode)
            {
                DeleteColumnIndex = 5;
            }
            else
            {
                treeviewEvents.AppendColumn(blinkStickColumn);
                DeleteColumnIndex = 6;
            }

            treeviewEvents.AppendColumn("", new Gtk.CellRendererPixbuf(), "stock_id", 1);
            treeviewEvents.AppendColumn("", new Gtk.CellRendererPixbuf(), "stock_id", 2);
            treeviewEvents.AppendColumn("", new Gtk.CellRendererPixbuf(), "stock_id", 3);
            NotificationListStore.SetSortFunc(0, delegate(TreeModel model, TreeIter a, TreeIter b)
            {
                CustomNotification n1 = (CustomNotification)model.GetValue(a, 0);
                CustomNotification n2 = (CustomNotification)model.GetValue(b, 0);
                if (n1 == null || n2 == null)
                {
                    return(0);
                }
                return(String.Compare(n1.Name, n2.Name));
            });

            NotificationListStore.SetSortColumnId(1, SortType.Ascending);
            treeviewEvents.Model = NotificationListStore;

            log.Debug("Adding notifications to the tree");
            foreach (CustomNotification e in DataModel.Notifications)
            {
                NotificationListStore.AppendValues(e, "icon-dark-pencil-square-o", "icon-dark-clone", "icon-dark-trash", NotificationRegistry.FindIcon(e.GetType()));
            }
        }
Пример #36
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);
        }
Пример #37
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");
            CellRendererIcon crp = new CellRendererIcon ();
            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;
        }
Пример #38
0
        /// <summary>
        /// Set up the UI inside the Window
        /// </summary>
        private void InitializeWidgets()
        {
            this.SetDefaultSize(500, 400);
            this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));

            VBox dialogBox = new VBox();

            dialogBox.Spacing     = 10;
            dialogBox.BorderWidth = 10;
            this.VBox.PackStart(dialogBox, true, true, 0);

            Label l = new Label(
                string.Format("<span size=\"large\" weight=\"bold\">{0}</span>",
                              Util.GS("Add users to this iFolder")));

            l.Xalign    = 0;
            l.UseMarkup = true;
            dialogBox.PackStart(l, false, false, 0);



            //------------------------------
            // Selection Area
            //------------------------------
            HBox selBox = new HBox(false, 10);

            dialogBox.PackStart(selBox, true, true, 0);

            //------------------------------
            // All Users tree
            //------------------------------
            VBox vbox = new VBox(false, 0);

            selBox.PackStart(vbox, false, false, 0);

            //------------------------------
            // Find Entry
            //------------------------------
            HBox searchHBox = new HBox(false, 4);

            vbox.PackStart(searchHBox, false, false, 0);

            Label findLabel = new Label(Util.GS("_Find:"));

            searchHBox.PackStart(findLabel, false, false, 0);
            findLabel.Xalign = 0;

            SearchEntry = new Entry();
            searchHBox.PackStart(SearchEntry, true, true, 0);
            findLabel.MnemonicWidget = SearchEntry;
            SearchEntry.SelectRegion(0, -1);
            SearchEntry.CanFocus = true;
            SearchEntry.Changed +=
                new EventHandler(OnSearchEntryChanged);

            Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu);

            stopImage.SetAlignment(0.5F, 0F);

            CancelSearchButton = new Button(stopImage);
            searchHBox.PackEnd(CancelSearchButton, false, false, 0);
            CancelSearchButton.Relief    = ReliefStyle.None;
            CancelSearchButton.Sensitive = false;

            CancelSearchButton.Clicked +=
                new EventHandler(OnCancelSearchButton);

            memberListModel = new MemberListModel(domainID, simws);

            memberList = new BigList(memberListModel);

            // FIXME: Fix up the BigList class to support both horizontal and vertical scrolling and then use the scroll adjustments to construct the ScrolledWindow
            ScrolledWindow sw = new ScrolledWindow(memberList.HAdjustment, memberList.VAdjustment);

            sw.ShadowType = Gtk.ShadowType.EtchedIn;
            sw.Add(memberList);
            vbox.PackStart(sw, true, true, 0);
            memberList.ItemSelected  += new ItemSelected(OnMemberIndexSelected);
            memberList.ItemActivated += new ItemActivated(OnMemberIndexActivated);


            //------------------------------
            // Buttons
            //------------------------------
            VBox btnBox = new VBox();

            btnBox.Spacing = 10;
            selBox.PackStart(btnBox, false, false, 0);

            Label spacer = new Label("");

            btnBox.PackStart(spacer, true, true, 0);

            HBox buttonHBox = new HBox(false, 4);

            spacer = new Label("");
            buttonHBox.PackStart(spacer, true, true, 0);
            Label buttonLabel = new Label(Util.GS("_Add"));

            buttonHBox.PackStart(buttonLabel, false, false, 0);
            Image buttonImage = new Image(Stock.GoForward, IconSize.Button);

            buttonHBox.PackStart(buttonImage, false, false, 0);
            spacer = new Label("");
            buttonHBox.PackStart(spacer, true, true, 0);
            UserAddButton = new Button(buttonHBox);
            btnBox.PackStart(UserAddButton, false, true, 0);
            UserAddButton.Clicked += new EventHandler(OnAddButtonClicked);

            buttonHBox = new HBox(false, 4);
            spacer     = new Label("");
            buttonHBox.PackStart(spacer, true, true, 0);
            buttonImage = new Image(Stock.GoBack, IconSize.Button);
            buttonHBox.PackStart(buttonImage, false, false, 0);
            buttonLabel = new Label(Util.GS("_Remove"));
            buttonHBox.PackStart(buttonLabel, false, false, 0);
            spacer = new Label("");
            buttonHBox.PackStart(spacer, true, true, 0);
            UserDelButton = new Button(buttonHBox);
            btnBox.PackStart(UserDelButton, false, true, 0);
            UserDelButton.Clicked += new EventHandler(OnRemoveButtonClicked);

            spacer = new Label("");
            btnBox.PackStart(spacer, true, true, 0);

            //------------------------------
            // Selected Users tree
            //------------------------------
            vbox = new VBox(false, 0);
            selBox.PackStart(vbox, true, true, 0);

            l        = new Label(Util.GS("_Users to add:"));
            l.Xalign = 0;
            vbox.PackStart(l, false, false, 0);

            SelTreeView = new TreeView();
            ScrolledWindow ssw = new ScrolledWindow();

            ssw.ShadowType = Gtk.ShadowType.EtchedIn;
            ssw.Add(SelTreeView);
            vbox.PackStart(ssw, true, true, 0);
            ssw.WidthRequest = 200;
            l.MnemonicWidget = SelTreeView;

            // Set up the iFolder TreeView
            SelTreeStore = new ListStore(typeof(MemberInfo));
            SelTreeStore.SetSortFunc(
                0,
                new TreeIterCompareFunc(SelTreeStoreSortFunction));
            SelTreeStore.SetSortColumnId(0, SortType.Ascending);
            SelTreeView.Model          = SelTreeStore;
            SelTreeView.HeadersVisible = false;

            // Set up Pixbuf and Text Rendering for "iFolder Users" column
            TreeViewColumn   selmemberColumn = new TreeViewColumn();
            CellRendererText smcrt           = new CellRendererText();

            selmemberColumn.PackStart(smcrt, false);
            selmemberColumn.SetCellDataFunc(smcrt, new TreeCellDataFunc(
                                                UserCellTextDataFunc));
            selmemberColumn.Title = Util.GS("Users to Add...");
            SelTreeView.AppendColumn(selmemberColumn);
            SelTreeView.Selection.Mode = SelectionMode.Multiple;

            SelTreeView.Selection.Changed += new EventHandler(
                OnSelUserSelectionChanged);

            this.AddButton(Stock.Cancel, ResponseType.Cancel);
            this.AddButton(Stock.Ok, ResponseType.Ok);
            this.AddButton(Stock.Help, ResponseType.Help);

            SetResponseSensitive(ResponseType.Ok, false);

            SearchiFolderUsers();
        }