本文整理汇总了C#中Gtk.TreeViewColumn.SetCellDataFunc方法的典型用法代码示例。如果您正苦于以下问题:C# TreeViewColumn.SetCellDataFunc方法的具体用法?C# TreeViewColumn.SetCellDataFunc怎么用?C# TreeViewColumn.SetCellDataFunc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.TreeViewColumn
的用法示例。
在下文中一共展示了TreeViewColumn.SetCellDataFunc方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SelectSchemaWidget
public SelectSchemaWidget ()
{
store = new ListStore (typeof (bool), typeof (ISchemaContainer));
list = new TreeView (store);
TreeViewColumn col = new TreeViewColumn ();
CellRendererToggle toggleRenderer = new CellRendererToggle ();
toggleRenderer.Activatable = true;
toggleRenderer.Toggled += new ToggledHandler (ItemToggled);
col.PackStart (toggleRenderer, false);
CellRendererPixbuf pixbufRenderer = new CellRendererPixbuf ();
col.PackStart (pixbufRenderer, false);
CellRendererText textRenderer = new CellRendererText ();
col.PackStart (textRenderer, true);
col.SetCellDataFunc (textRenderer, new CellLayoutDataFunc (TextDataFunc));
col.SetCellDataFunc (pixbufRenderer, new CellLayoutDataFunc (PixbufDataFunc));
list.AppendColumn (col);
list.HeadersVisible = false;
this.Add (list);
}
示例2: SharingConfigDialog
public SharingConfigDialog ()
{
this.Build ();
categoriesTreeView.Model = model;
var complete_column = new TreeViewColumn ();
var toggle_render = new CellRendererToggle ();
toggle_render.Toggled += CellRendererToggle_Toggled;
complete_column.PackStart (toggle_render, false);
complete_column.SetCellDataFunc (toggle_render, new TreeCellDataFunc (ToggleDataFunc));
var pix_render = new CellRendererPixbuf () { Mode = CellRendererMode.Inert };
complete_column.PackStart (pix_render, false);
complete_column.SetCellDataFunc (pix_render, new TreeCellDataFunc (IconDataFunc));
var text_render = new CellRendererText () { Mode = CellRendererMode.Inert };
complete_column.PackStart (text_render, true);
complete_column.SetCellDataFunc (text_render, new TreeCellDataFunc (NameDataFunc));
categoriesTreeView.AppendColumn (complete_column);
empty_pixbuf.Fill(0xffffff00);
Update ();
LoadPreferences ();
}
示例3: ProjectFileSelectorDialog
public ProjectFileSelectorDialog (Project project, string defaultFilterName, string defaultFilterPattern, string [] buildActions)
{
this.project = project;
this.defaultFilter = new SelectFileDialogFilter (defaultFilterName, defaultFilterPattern ?? "*");
this.buildActions = buildActions;
this.Build();
projBuf = ImageService.GetIcon (project.StockIcon, IconSize.Menu);
dirClosedBuf = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.ClosedFolder, IconSize.Menu);
dirOpenBuf = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.OpenFolder, IconSize.Menu);
TreeViewColumn projectCol = new TreeViewColumn ();
projectCol.Title = GettextCatalog.GetString ("Project Folders");
var pixRenderer = new CellRendererImage ();
CellRendererText txtRenderer = new CellRendererText ();
projectCol.PackStart (pixRenderer, false);
projectCol.PackStart (txtRenderer, true);
projectCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (PixDataFunc));
projectCol.SetCellDataFunc (txtRenderer, new TreeCellDataFunc (TxtDataFunc));
projectTree.Model = dirStore;
projectTree.AppendColumn (projectCol);
TreeIter projectIter = dirStore.AppendValues ("", FilePath.Empty);
InitDirs (projectIter);
projectTree.ExpandAll ();
projectTree.RowActivated += delegate {
fileList.GrabFocus ();
};
projectTree.KeyPressEvent += ProjectListKeyPressEvent;
TreeViewColumn fileCol = new TreeViewColumn ();
var filePixRenderer = new CellRendererImage ();
fileCol.Title = GettextCatalog.GetString ("Files");
fileCol.PackStart (filePixRenderer, false);
fileCol.PackStart (txtRenderer, true);
fileCol.AddAttribute (filePixRenderer, "image", 1);
fileCol.SetCellDataFunc (txtRenderer, new TreeCellDataFunc (TxtFileDataFunc));
fileList.Model = fileStore;
fileList.AppendColumn (fileCol);
fileList.RowActivated += delegate {
TreeIter iter;
if (fileList.Selection.GetSelected (out iter))
Respond (ResponseType.Ok);
};
fileList.KeyPressEvent += FileListKeyPressEvent;
fileList.KeyReleaseEvent += FileListKeyReleaseEvent;
TreeIter root;
if (dirStore.GetIterFirst (out root))
projectTree.Selection.SelectIter (root);
UpdateFileList (null, null);
projectTree.Selection.Changed += UpdateFileList;
fileList.Selection.Changed += UpdateSensitivity;
this.DefaultResponse = ResponseType.Cancel;
this.Modal = true;
}
示例4: PeopleTreeView
public PeopleTreeView()
{
Selection.Mode = SelectionMode.Single;
HeadersVisible = false;
peopleTreeStore = new TreeStore(typeof(uint),typeof(string),typeof(Tag));
this.Model = peopleTreeStore;
TagStore.ItemsAdded += TagStoreItemsAdded;
TagStore.ItemsChanged += TagStoreItemsChanged;
TagStore.ItemsRemoved += TagStoreItemsRemoved;
complete_column = new TreeViewColumn();
pix_render = new CellRendererPixbuf();
complete_column.PackStart(pix_render,false);
complete_column.SetCellDataFunc(pix_render, new TreeCellDataFunc(IconDataFunc));
text_render = new CellRendererText();
complete_column.PackStart( text_render, true);
complete_column.SetCellDataFunc( text_render, new TreeCellDataFunc( NameDataFunc));
AppendColumn(complete_column);
RefreshPeopleTreeStore ();
//TODO If have time - add people search.
}
示例5: TagSelectionWidget
// Constructor.
public TagSelectionWidget(TagStore tag_store)
: base(new TreeStore (typeof(uint), typeof(string)))
{
database = MainWindow.Toplevel.Database;
HeadersVisible = false;
complete_column = new TreeViewColumn ();
pix_render = new CellRendererPixbuf ();
complete_column.PackStart (pix_render, false);
complete_column.SetCellDataFunc (pix_render, new TreeCellDataFunc (IconDataFunc));
//complete_column.AddAttribute (pix_render, "pixbuf", OpenIconColumn);
//icon_column = AppendColumn ("icon",
//, new TreeCellDataFunc (IconDataFunc));
//icon_column = AppendColumn ("icon", new CellRendererPixbuf (), new TreeCellDataFunc (IconDataFunc));
text_render = new CellRendererText ();
complete_column.PackStart (text_render, true);
complete_column.SetCellDataFunc (text_render, new TreeCellDataFunc (NameDataFunc));
AppendColumn (complete_column);
this.tag_store = tag_store;
Update ();
ExpandDefaults ();
tag_store.ItemsAdded += HandleTagsAdded;
tag_store.ItemsRemoved += HandleTagsRemoved;
tag_store.ItemsChanged += HandleTagsChanged;
// TODO make the search find tags that are not currently expanded
EnableSearch = true;
SearchColumn = NameColumn;
// Transparent white
empty_pixbuf.Fill(0xffffff00);
/* set up drag and drop */
DragDataGet += HandleDragDataGet;
DragDrop += HandleDragDrop;
DragBegin += HandleDragBegin;
Gtk.Drag.SourceSet (this,
Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask,
tag_source_target_table,
DragAction.Copy | DragAction.Move);
DragDataReceived += HandleDragDataReceived;
DragMotion += HandleDragMotion;
Gtk.Drag.DestSet (this,
DestDefaults.All,
tag_dest_target_table,
DragAction.Copy | DragAction.Move);
}
示例6: GetOutlineWidget
public Gtk.Widget GetOutlineWidget()
{
if (TreeView != null)
return TreeView;
TreeStore = new TreeStore(typeof(object));
/*
settings = ClassOutlineSettings.Load();
comparer = new ClassOutlineNodeComparer(GetAmbience(), settings, outlineTreeModelSort);
outlineTreeModelSort.SetSortFunc(0, comparer.CompareNodes);
outlineTreeModelSort.SetSortColumnId(0, SortType.Ascending);
*/
TreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView(TreeStore);
var pixRenderer = new CellRendererPixbuf();
pixRenderer.Xpad = 0;
pixRenderer.Ypad = 0;
TreeView.TextRenderer.Xpad = 0;
TreeView.TextRenderer.Ypad = 0;
TreeViewColumn treeCol = new TreeViewColumn();
treeCol.PackStart(pixRenderer, false);
treeCol.SetCellDataFunc(pixRenderer, new TreeCellDataFunc(OutlineTreeIconFunc));
treeCol.PackStart(TreeView.TextRenderer, true);
treeCol.SetCellDataFunc(TreeView.TextRenderer, new TreeCellDataFunc(OutlineTreeTextFunc));
TreeView.AppendColumn(treeCol);
TreeView.TextRenderer.Editable = true;
TreeView.TextRenderer.Edited += new EditedHandler(nameCell_Edited);
TreeView.HeadersVisible = false;
TreeView.Selection.Changed += delegate
{
if (dontJumpToDeclaration || !outlineReady)
return;
clickedOnOutlineItem = true;
JumpToDeclaration(true);
clickedOnOutlineItem = false;
};
TreeView.Realized += delegate { RefillOutlineStore(); };
//UpdateSorting();
var sw = new CompactScrolledWindow();
sw.Add(TreeView);
sw.ShowAll();
return sw;
}
示例7: InitializeTreeView
private void InitializeTreeView()
{
_storeItems = new Gtk.TreeStore(typeof(SyncMenuItemEntity));
treeView.HeadersVisible = false;
treeView.Selection.Mode = SelectionMode.Multiple;
Gtk.TreeViewColumn colTitle = new Gtk.TreeViewColumn();
Gtk.CellRendererText cellTitle = new Gtk.CellRendererText();
Gtk.CellRendererPixbuf cellPixbuf = new Gtk.CellRendererPixbuf();
colTitle.PackStart(cellPixbuf, false);
colTitle.PackStart(cellTitle, true);
colTitle.SetCellDataFunc(cellPixbuf, new Gtk.TreeCellDataFunc(RenderCell));
colTitle.SetCellDataFunc(cellTitle, new Gtk.TreeCellDataFunc(RenderCell));
treeView.AppendColumn(colTitle);
}
示例8: ItemList
public ItemList(ItemView itemView, ChannelList channelList)
{
this.itemView = itemView;
channelList.ChannelSelectedEvent += channel => CurrentChannel = channel;
CellRendererPixbuf cell2 = new CellRendererPixbuf();
iconColumn = new TreeViewColumn();
iconColumn.PackStart(cell2, true);
iconColumn.Sizing = TreeViewColumnSizing.GrowOnly;
iconColumn.Expand = false;
iconColumn.SetCellDataFunc(cell2,
new TreeCellDataFunc(IconCellDataFunc));
AppendColumn(iconColumn);
titleColumn = new TreeViewColumn();
CellRendererText cell = new CellRendererText();
titleColumn.PackStart(cell, true);
titleColumn.SetCellDataFunc(cell,
new TreeCellDataFunc(NameCellDataFunc));
AppendColumn(titleColumn);
this.Selection.Changed += new EventHandler(SelectionChanged);
this.Model = new ListStore (typeof(Imendio.Blam.Item));
this.HeadersVisible = false;
(Model as ListStore).DefaultSortFunc = CompareFunc;
SetSortOrder(Conf.Get(Preference.REVERSE_ENTRIES, false));
Conf.AddNotify (Conf.GetFullKey(Preference.REVERSE_ENTRIES), new NotifyEventHandler (ConfNotifyHandler));
}
示例9: Groups
public Groups()
{
this.Build();
store= new Gtk.ListStore (typeof(string),typeof(Group),typeof(bool));
//treeview1.AppendColumn("Group",new CellRendererText(),"text",0);
Gtk.TreeViewColumn groupColumn = new Gtk.TreeViewColumn();
groupColumn.Title = "Group";
Gtk.CellRendererText groupNameCell = new Gtk.CellRendererText();
groupColumn.PackStart(groupNameCell, true);
groupColumn.SetCellDataFunc(groupNameCell, new Gtk.TreeCellDataFunc(RenderGroupName));
treeview1.AppendColumn(groupColumn);
treeview1.Model=store;
MainClass.onRegister += new MainClass.register(MainClass_onRegister);
MainClass.onDeregister += new MainClass.deregister(MainClass_onDeregister);
if(MainClass.client != null ) { MainClass_onRegister(); }
if (MainClass.client != null)
{
if (MainClass.client.Network.LoginStatusCode == OpenMetaverse.LoginStatus.Success)
{
MainClass.client.Groups.RequestCurrentGroups();
}
}
}
示例10: BuildColumns
private void BuildColumns ()
{
priorityColumn = new TreeViewColumn ();
filenameColumn = new TreeViewColumn ();
progressColumn = new TreeViewColumn ();
filenameColumn.Resizable = true;
priorityColumn.Title = "";
filenameColumn.Title = "Filename";
progressColumn.Title = "Progress";
Gtk.CellRendererPixbuf priorityCell = new CellRendererPixbuf ();
Gtk.CellRendererText filenameCell = new CellRendererText ();
Gtk.CellRendererProgress progressCell = new CellRendererProgress ();
priorityColumn.PackStart (priorityCell, true);
filenameColumn.PackStart (filenameCell, true);
progressColumn.PackStart(progressCell, true);
priorityColumn.SetCellDataFunc (priorityCell, new Gtk.TreeCellDataFunc (RenderPriority));
filenameColumn.SetCellDataFunc (filenameCell, new Gtk.TreeCellDataFunc (RenderFilename));
progressColumn.SetCellDataFunc (progressCell, new Gtk.TreeCellDataFunc (RenderProgress));
AppendColumn (priorityColumn);
AppendColumn (filenameColumn);
AppendColumn (progressColumn);
}
示例11: InitializeDeviceTreeView
private void InitializeDeviceTreeView()
{
_storeDevices = new Gtk.TreeStore(typeof(SyncDevice));
treeViewDevices.ShowExpanders = false;
treeViewDevices.HeadersVisible = false;
// Create title column
Gtk.TreeViewColumn colTitle = new Gtk.TreeViewColumn();
Gtk.CellRendererPixbuf cellPixbuf = new Gtk.CellRendererPixbuf();
Gtk.CellRendererText cellTitle = new Gtk.CellRendererText();
colTitle.PackStart(cellPixbuf, false);
colTitle.PackStart(cellTitle, true);
colTitle.SetCellDataFunc(cellPixbuf, new Gtk.TreeCellDataFunc(RenderDeviceCell));
colTitle.SetCellDataFunc(cellTitle, new Gtk.TreeCellDataFunc(RenderDeviceCell));
treeViewDevices.AppendColumn(colTitle);
}
示例12: PopulateForm
public void PopulateForm ()
{
Gtk.TreeViewColumn serialColumn = new Gtk.TreeViewColumn ();
serialColumn.Title = "Serial";
Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn ();
nameColumn.Title = "Name";
Gtk.CellRendererText serialCell = new Gtk.CellRendererText ();
Gtk.CellRendererText nameCell = new Gtk.CellRendererText ();
serialColumn.PackStart (serialCell, false);
serialColumn.SetCellDataFunc (serialCell, new Gtk.TreeCellDataFunc (RenderSerial));
nameColumn.PackEnd (nameCell, true);
nameColumn.SetCellDataFunc (nameCell, new Gtk.TreeCellDataFunc (RenderName));
treeviewDevices.Model = DeviceListStore;
treeviewDevices.AppendColumn (serialColumn);
treeviewDevices.AppendColumn (nameColumn);
List<String> deviceNames = new List<string> ();
foreach (LedController controller in Manager.Controllers) {
deviceNames.Add (controller.DeviceVisibleName);
}
deviceNames.Sort ();
foreach (String name in deviceNames) {
DeviceListStore.AppendValues(Manager.FindControllerBySerialNumber(name));
}
UpdateFormComponents();
}
示例13: TableMappingWidget
public TableMappingWidget (bool showCheckBoxes)
{
store = new ListStore (typeof (bool), typeof (TableContainer));
list = new TreeView (store);
TreeViewColumn colName = new TreeViewColumn ();
colName.Title = AddinCatalog.GetString ("Name");
CellRendererToggle toggleRenderer = new CellRendererToggle ();
toggleRenderer.Activatable = true;
toggleRenderer.Toggled += new ToggledHandler (SelectToggled);
colName.PackStart (toggleRenderer, false);
CellRendererText nameRenderer = new CellRendererText ();
colName.PackStart (nameRenderer, true);
TreeViewColumn colClassName = new TreeViewColumn ();
colClassName.Title = AddinCatalog.GetString ("Class Name");
CellRendererText propNameRenderer = new CellRendererText ();
propNameRenderer.Editable = true;
propNameRenderer.Edited += new EditedHandler (ClassNameEdited);
colClassName.PackStart (propNameRenderer, true);
colName.SetCellDataFunc (nameRenderer, new CellLayoutDataFunc (NameDataFunc));
colClassName.SetCellDataFunc (propNameRenderer, new CellLayoutDataFunc (ClassNameDataFunc));
list.AppendColumn (colName);
list.AppendColumn (colClassName);
list.HeadersVisible = true;
this.Add (list);
}
示例14: ViewOrderDetails
public ViewOrderDetails() : base()
{
CellRenderer productrenderer = new CellRendererText();
CellRenderer taxrenderer = new CellRendererText();
taxrenderer.Xalign = 1;
CellRenderer pricerenderer = new CellRendererText();
pricerenderer.Xalign = 1;
CellRenderer quantrenderer = new CellRendererText();
quantrenderer.Xalign = 1;
CellRenderer totpricerenderer = new CellRendererText();
totpricerenderer.Xalign = 1;
CellRenderer tottaxrenderer = new CellRendererText();
tottaxrenderer.Xalign = 1;
CellRenderer totpricettcrenderer = new CellRendererText();
totpricettcrenderer.Xalign = 1;
TreeViewColumn prodcol = new TreeViewColumn();
prodcol.Title = "Product";
prodcol.PackStart( productrenderer,true);
prodcol.SetCellDataFunc(productrenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailProduct);
prodcol.Expand = true;
treeview.AppendColumn(prodcol);
treeview.AppendColumn("Unit Price", pricerenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailPrice);
treeview.AppendColumn("Unit Tax", taxrenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailTax);
treeview.AppendColumn("Unit Price TTC", taxrenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailPriceTaxInc);
treeview.AppendColumn("Quantity", quantrenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailQuantity);
treeview.AppendColumn("Price", totpricerenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailTotalPrice);
treeview.AppendColumn("Tax", tottaxrenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailTotalTax);
treeview.AppendColumn("Price TTC", totpricettcrenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailTotalPriceTaxInc);
this.DataMember="OrderDetails";
this.Show();
}
示例15: ContentDirectoryInfo
public ContentDirectoryInfo (RemoteContentDirectory contentDirectory)
{
if (contentDirectory == null) {
throw new ArgumentNullException ("contentDirectory");
}
this.content_directry = contentDirectory;
this.store = new TreeStore (typeof (ObjectRow));
var objects = new TreeView ();
var column = new TreeViewColumn ();
var cell = new CellRendererText ();
column.PackStart (cell, true);
column.SetCellDataFunc (cell, RenderObject);
column.Title = "Objects";
objects.AppendColumn (column);
objects.Selection.Changed += HandleObjectsSelectionChanged;
objects.RowExpanded += HandleObjectsRowExpanded;
objects.Model = store;
var root = contentDirectory.GetRootObject ();
store.AppendValues (new ObjectRow (root));
TreeIter iter;
store.GetIterFirst (out iter);
store.AppendValues (iter, loading);
Add (objects);
}