本文整理汇总了C#中Gtk.ListStore.SetSortColumnId方法的典型用法代码示例。如果您正苦于以下问题:C# ListStore.SetSortColumnId方法的具体用法?C# ListStore.SetSortColumnId怎么用?C# ListStore.SetSortColumnId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ListStore
的用法示例。
在下文中一共展示了ListStore.SetSortColumnId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SelectGroupsDialog
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 ();
}
示例2: ItemView
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;
}
示例3: PageComboBox
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: ExceptionsDialog
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 ();
}
示例5: SortFuncListViewDialog
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 ();
}
示例6: MassEditDialog
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 ();
}
示例7: DeployFileListWidget
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);
}
示例8: CreateStore
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;
}
示例9: MainWindow
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);
}
示例10: Initialize
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);
}
示例11: RestoreBackupDialog
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();
}
示例12: SortedTableListStore
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);
}
示例13: SortedColumnListStore
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);
}
示例14: AttributeEditorWidget
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 ();
}
示例15: NamePicker
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);
}
}
}