当前位置: 首页>>代码示例>>C#>>正文


C# Gtk.CellRenderer类代码示例

本文整理汇总了C#中Gtk.CellRenderer的典型用法代码示例。如果您正苦于以下问题:C# CellRenderer类的具体用法?C# CellRenderer怎么用?C# CellRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CellRenderer类属于Gtk命名空间,在下文中一共展示了CellRenderer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的Gtk.CellRenderer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。