本文整理汇总了C#中Gtk.CellRenderer类的典型用法代码示例。如果您正苦于以下问题:C# CellRenderer类的具体用法?C# CellRenderer怎么用?C# CellRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CellRenderer类属于Gtk命名空间,在下文中一共展示了CellRenderer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TextDataFunc
private void TextDataFunc(CellLayout cell_layout, CellRenderer renderer, TreeModel model, TreeIter iter)
{
CellRendererText textRenderer = (CellRendererText) renderer;
Tilegroup group = (Tilegroup) Model.GetValue(iter, 0);
textRenderer.Text = group.Name;
}
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:7,代码来源:TileGroupSelector.cs
示例2: CellDataHandler
public static void CellDataHandler (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
{
SourceRowRenderer renderer = cell as SourceRowRenderer;
if (renderer == null) {
return;
}
var type = model.GetValue (iter, (int)SourceModel.Columns.Type);
if (type == null || (SourceModel.EntryType) type != SourceModel.EntryType.Source) {
renderer.Visible = false;
return;
}
Source source = model.GetValue (iter, 0) as Source;
renderer.Source = source;
renderer.Iter = iter;
if (source == null) {
return;
}
renderer.Visible = true;
renderer.Text = source.Name;
renderer.Sensitive = source.CanActivate;
}
开发者ID:gclark916,项目名称:banshee,代码行数:25,代码来源:SourceRowRenderer.cs
示例3: OnPixbufCellLayout
private void OnPixbufCellLayout(CellLayout layout, CellRenderer cell,
TreeModel model, TreeIter iter)
{
CellRendererPixbuf pixbufCell = (cell as CellRendererPixbuf);
IVirtualDevice device = (IVirtualDevice) model.GetValue (iter, 0);
switch (device.DeviceType) {
case VirtualDeviceType.HardDisk:
pixbufCell.Pixbuf = hdPixbuf;
break;
case VirtualDeviceType.CdRom:
pixbufCell.Pixbuf = cdromPixbuf;
break;
case VirtualDeviceType.Ethernet:
pixbufCell.Pixbuf = ethernetPixbuf;
break;
case VirtualDeviceType.Floppy:
pixbufCell.Pixbuf = floppyPixbuf;
break;
default:
pixbufCell.Pixbuf = null;
break;
}
}
开发者ID:snorp,项目名称:vmx-manager,代码行数:25,代码来源:DeviceView.cs
示例4: AlbumCellDataFunc
private void AlbumCellDataFunc(TreeViewColumn column,
CellRenderer renderer,
TreeModel model,
TreeIter iter)
{
MusicStoreTrackInfo track = (MusicStoreTrackInfo) model.GetValue (iter, 0);
((CellRendererText)renderer).Text = track.Album;
}
开发者ID:jrmuizel,项目名称:banshee-unofficial-plugins,代码行数:8,代码来源:MusicStoreView.cs
示例5: ImageDataFunc
static void ImageDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
{
var isError = (bool)tree_model.GetValue (iter, 2);
var crpixbuf = (CellRendererPixbuf)cell;
crpixbuf.Visible = isError;
crpixbuf.Pixbuf = isError ? errorPixbuf.Value : null;
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:8,代码来源:HighlightingPanel.cs
示例6: ContentDataFunc
private void ContentDataFunc (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
{
object dataObject = model.GetValue (iter, columnIndex);
if (dataObject == null)
nullRenderer.SetContent (cell as CellRendererText, dataObject);
else
contentRenderer.SetContent (cell as CellRendererText, dataObject);
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:8,代码来源:DataGridColumn.cs
示例7: RenderCoverage
public static void RenderCoverage (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
var txt = cell as CellRendererText;
CodeRecord rc = (CodeRecord)model.GetValue (iter, 0);
if (txt != null) {
txt.Foreground = CellColor (rc.Coverage);
txt.Text = String.Format ("{0:00.0}%", rc.Coverage * 100.0);
}
}
开发者ID:Money520,项目名称:XR.Baboon,代码行数:9,代码来源:CodeRecordCellRenderFuncs.cs
示例8: RenderFont
private void RenderFont (CellLayout layout, CellRenderer renderer, TreeModel model, TreeIter iter)
{
string fontName = (string)model.GetValue (iter, 0);
CellRendererText cell = renderer as CellRendererText;
cell.Text = fontName;
cell.Font = string.Format ("{0} 10", fontName);
cell.Family = fontName;
}
开发者ID:RudoCris,项目名称:Pinta,代码行数:10,代码来源:ToolBarFontComboBox.cs
示例9: AppendColumn
public TreeViewColumn AppendColumn(string title, CellRenderer cell, CellLayoutDataFunc cell_data)
{
Gtk.TreeViewColumn col = new Gtk.TreeViewColumn ();
col.Title = title;
col.PackStart (cell, true);
col.SetCellDataFunc (cell, cell_data);
AppendColumn (col);
return col;
}
开发者ID:Gravecorp,项目名称:gtk-sharp,代码行数:10,代码来源:TreeView.cs
示例10: SetAttributes
public void SetAttributes (CellRenderer cell, params object[] attrs)
{
if (attrs.Length % 2 != 0)
throw new ArgumentException ("attrs should contain pairs of attribute/col");
ClearAttributes (cell);
for (int i = 0; i < attrs.Length - 1; i += 2) {
AddAttribute (cell, (string) attrs [i], (int) attrs [i + 1]);
}
}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:10,代码来源:ComboBox.cs
示例11: SetCellDataFunc
public void SetCellDataFunc (CellRenderer cell_renderer, NodeCellDataFunc func)
{
if (func == null) {
gtk_tree_view_column_set_cell_data_func (Handle, cell_renderer == null ? IntPtr.Zero : cell_renderer.Handle, (GtkSharp.TreeCellDataFuncNative) null, IntPtr.Zero, null);
return;
}
NodeCellDataFuncWrapper func_wrapper = new NodeCellDataFuncWrapper (func);
GCHandle gch = GCHandle.Alloc (func_wrapper);
gtk_cell_layout_set_cell_data_func (Handle, cell_renderer == null ? IntPtr.Zero : cell_renderer.Handle, func_wrapper.NativeDelegate, (IntPtr) gch, GLib.DestroyHelper.NotifyHandler);
}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:11,代码来源:TreeViewColumn.cs
示例12: ProfileNameDataFunc
public static void ProfileNameDataFunc (CellLayout layout, CellRenderer renderer, TreeModel model, TreeIter iter)
{
if (model.GetValue (iter, 0) != null) {
Cms.Profile profile = (Cms.Profile) model.GetValue (iter, 0);
if (profile.ProductName.Length < NameLenth)
(renderer as Gtk.CellRendererText).Text = profile.ProductName;
else
(renderer as Gtk.CellRendererText).Text = profile.ProductName.Substring(0, NameLenth) + "...";
}
else
(renderer as Gtk.CellRendererText).Text = "";
}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:12,代码来源:PreferenceDialog.cs
示例13: LocalizationColumn
public LocalizationColumn(bool editable = false)
: base()
{
CellRendererText textRenderer = new CellRendererText () { Editable = editable };
textRenderer.Edited += (_, args) => this.Edited (this, new ResourceEditedEventArgs () {
Path = args.Path,
NextText = args.NewText
});
m_renderer = textRenderer;
m_columnType = typeof(string);
this.PackStart (m_renderer, true);
}
开发者ID:CalebMorris,项目名称:Xamarin-ResxEditor,代码行数:15,代码来源:LocalizationColumn.cs
示例14: CreateTreeViewColumn
public static TreeViewColumn CreateTreeViewColumn (string title, int width, CellRenderer cell, TreeCellDataFunc dataFunction) {
cell.Xalign = 0.5f;
cell.Yalign = 0;
TreeViewColumn column = new TreeViewColumn();
column.Alignment = 0.5f;
column.Title = title;
if (width != -1) {
column.FixedWidth = width;
column.Sizing = TreeViewColumnSizing.Fixed;
}
column.Resizable = true;
column.PackStart(cell, true);
column.SetCellDataFunc(cell, dataFunction);
return column;
}
开发者ID:GNOME,项目名称:gnome-subtitles,代码行数:17,代码来源:Util.cs
示例15: CellDataHandler
public static void CellDataHandler (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
{
SourceRowRenderer renderer = cell as SourceRowRenderer;
Source source = model.GetValue (iter, 0) as Source;
if (renderer == null) {
return;
}
renderer.Source = source;
renderer.Iter = iter;
if (source == null) {
return;
}
renderer.Text = source.Name;
renderer.Sensitive = source.CanActivate;
}
开发者ID:allquixotic,项目名称:banshee-gst-sharp-work,代码行数:19,代码来源:SourceRowRenderer.cs
示例16: IconDataFunc
private void IconDataFunc(TreeViewColumn column,
CellRenderer renderer,
TreeModel model,
TreeIter iter)
{
GLib.Value value = new GLib.Value ();
Model.GetValue (iter, IdColumn, ref value);
uint tag_id = (uint) value;
Tag tag = TagStore.Get (tag_id) as Tag;
if (tag.SizedIcon != null) {
Cms.Profile screen_profile;
if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) {
Gdk.Pixbuf temp = tag.SizedIcon.Copy();
FSpot.ColorManagement.ApplyProfile (temp, screen_profile);
(renderer as CellRendererPixbuf).Pixbuf = temp;
} else
(renderer as CellRendererPixbuf).Pixbuf = tag.SizedIcon;
} else
(renderer as CellRendererPixbuf).Pixbuf = empty_pixbuf;
}
开发者ID:kanitw,项目名称:facespot,代码行数:22,代码来源:PeopleTreeView.cs
示例17: ToggleDataFunc
void ToggleDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
var cellRenderer = (CellRendererToggle)cell;
var info = GetProperty (model, iter);
if (info == null || info.PropertyType != typeof(bool))
return;
bool value = (bool)info.GetValue (this.profile, null);
cellRenderer.Active = value;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:9,代码来源:CSharpFormattingProfileDialog.cs
示例18: ComboboxDataFunc
void ComboboxDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
var cellRenderer = (CellRendererCombo)cell;
var info = GetProperty (model, iter);
if (info == null) {
cellRenderer.Text = "<invalid>";
return;
}
object value = info.GetValue (this.profile, null);
cellRenderer.Text = value is Enum ? TranslateValue (value) : value.ToString ();
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:12,代码来源:CSharpFormattingProfileDialog.cs
示例19: RenderIcon
void RenderIcon (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
var pixbufCellRenderer = (CellRendererPixbuf)cell;
if (model.IterHasChild (iter)) {
pixbufCellRenderer.Pixbuf = ImageService.GetPixbuf (((TreeView)col.TreeView).GetRowExpanded (model.GetPath (iter)) ? MonoDevelop.Ide.Gui.Stock.OpenFolder : MonoDevelop.Ide.Gui.Stock.ClosedFolder, IconSize.Menu);
} else {
pixbufCellRenderer.Pixbuf = ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Property, IconSize.Menu);
}
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:9,代码来源:CSharpFormattingProfileDialog.cs
示例20: renderMedia
// render the media file into the treeview
private void renderMedia(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
{
Media media = (Media) model.GetValue (iter, 0);
string text = System.IO.Path.GetFileNameWithoutExtension (media.Path);
(cell as CellRendererText).Markup = Utils.ParseMarkup (text);
}
开发者ID:gsterjov,项目名称:fusemc,代码行数:7,代码来源:Theatre.cs
注:本文中的Gtk.CellRenderer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论