• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Gtk.CellRendererToggle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



CellRendererToggle类属于Gtk命名空间,在下文中一共展示了CellRendererToggle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: MonoDroidBuildOptionsWidget

		public MonoDroidBuildOptionsWidget ()
		{
			this.Build ();
			
			linkerCombo.AppendText ("Don't link"); //MtouchLinkMode.None
			linkerCombo.AppendText ("Link SDK assemblies only"); //MtouchLinkMode.SdkOnly
			linkerCombo.AppendText ("Link all assemblies"); //MtouchLinkMode.All
			
			i18NTreeView.Model = i18nStore;
			
			var toggle = new CellRendererToggle ();
			i18NTreeView.AppendColumn ("", toggle, "active", 1);
			i18NTreeView.AppendColumn ("", new CellRendererText (), "text", 0);
			i18NTreeView.HeadersVisible = false;
			toggle.Toggled += delegate(object o, ToggledArgs args) {
				TreeIter iter;
				if (i18nStore.GetIter (out iter, new TreePath (args.Path)))
					i18nStore.SetValue (iter, 1, !(bool)i18nStore.GetValue (iter, 1));
			};
			
			abisTreeView.Model = abisStore;

			var abiToggle = new CellRendererToggle ();
			abisTreeView.AppendColumn ("", abiToggle, "active", 1);
			abisTreeView.AppendColumn ("", new CellRendererText (), "text", 0);
			abisTreeView.HeadersVisible = false;
			abiToggle.Toggled += delegate (object o, ToggledArgs args) {
				TreeIter iter;
				if (abisStore.GetIter (out iter, new TreePath (args.Path)))
					abisStore.SetValue (iter, 1, !(bool)abisStore.GetValue (iter, 1));
			};
			
			ShowAll ();
		}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:34,代码来源:MonoDroidBuildOptions.cs


示例2: ManageSitesDialog

		public ManageSitesDialog (SetupService service, Builder builder, IntPtr handle): base (handle)
		{
			builder.Autoconnect (this);
//			TransientFor = parent;
//			Services.PlaceDialog (this, parent);
			this.service = service;
			treeStore = new Gtk.ListStore (typeof (string), typeof (string), typeof(bool));
			repoTree.Model = treeStore;
			repoTree.HeadersVisible = false;
			var crt = new Gtk.CellRendererToggle ();
			crt.Toggled += HandleRepoToggled;
			repoTree.AppendColumn ("", crt, "active", 2);
			repoTree.AppendColumn ("", new Gtk.CellRendererText (), "markup", 1);
			repoTree.Selection.Changed += new EventHandler(OnSelect);
			
			AddinRepository[] reps = service.Repositories.GetRepositories ();
			foreach (AddinRepository rep in reps)
				AppendRepository (rep);

			btnRemove.Sensitive = false;

			//Wire buttons
			btnRemove.Clicked += OnRemove;
			btnAdd.Clicked += OnAdd;

			ShowAll ();
		}
开发者ID:wanglehui,项目名称:mono-addins,代码行数:27,代码来源:ManageSitesDialog.cs


示例3: GacReferencePanel

        public GacReferencePanel(SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

            store = new TreeStore (typeof (string), typeof (string), typeof(string), typeof(bool), typeof(string));
            treeView = new TreeView (store);

            TreeViewColumn firstColumn = new TreeViewColumn ();
            firstColumn.Title = GettextCatalog.GetString ("Reference Name");
            CellRendererToggle tog_render = new CellRendererToggle ();
            tog_render.Toggled += new Gtk.ToggledHandler (AddReference);
            firstColumn.PackStart (tog_render, false);
            firstColumn.AddAttribute (tog_render, "active", 3);

            CellRendererText text_render = new CellRendererText ();
            firstColumn.PackStart (text_render, true);
            firstColumn.AddAttribute (text_render, "text", 0);

            treeView.AppendColumn (firstColumn);
            treeView.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "text", 1);
            // FIXME: this seems useless
            //treeView.AppendColumn (GettextCatalog.GetString ("Path"), new CellRendererText (), "text", 2);

            store.SetSortColumnId (0, SortType.Ascending);
            store.SetSortFunc (0, new TreeIterCompareFunc (SortTree));

            PrintCache();
            ScrolledWindow sc = new ScrolledWindow ();
            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add (treeView);
            this.PackStart (sc, true, true, 0);
            ShowAll ();
            BorderWidth = 6;
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:34,代码来源:GacReferencePanel.cs


示例4: AddObjectClassDialog

        public AddObjectClassDialog(Connection conn)
        {
            objectClasses = new List<string> ();

            ui = new Glade.XML (null, "lat.glade", "addObjectClassDialog", null);
            ui.Autoconnect (this);

            store = new ListStore (typeof (bool), typeof (string));

            CellRendererToggle crt = new CellRendererToggle();
            crt.Activatable = true;
            crt.Toggled += OnClassToggled;

            objClassTreeView.AppendColumn ("Enabled", crt, "active", 0);
            objClassTreeView.AppendColumn ("Name", new CellRendererText (), "text", 1);

            objClassTreeView.Model = store;

            try {

                foreach (string n in conn.Data.ObjectClasses)
                    store.AppendValues (false, n);

            } catch (Exception e) {

                store.AppendValues (false, "Error getting object classes");
                Log.Debug (e);
            }

            addObjectClassDialog.Icon = Global.latIcon;
            addObjectClassDialog.Resize (300, 400);
            addObjectClassDialog.Run ();
            addObjectClassDialog.Destroy ();
        }
开发者ID:MrJoe,项目名称:lat,代码行数:34,代码来源:AddObjectClassDialog.cs


示例5: InitializeListView

        private void InitializeListView(TreeView treeView, ListStore store, String nameColumnTitle, 
                                      IEnumerable<ItemSetting> data, ToggledHandler includeToggleHandler) 
        {
            treeView.Model = store;

            //create columns with associated cell renderings
            CellRendererText nameRenderer = new CellRendererText();
            TreeViewColumn nameColumn = treeView.AppendColumn(nameColumnTitle, nameRenderer);
            nameColumn.SetCellDataFunc(nameRenderer, new TreeCellDataFunc(RenderName));            

            CellRendererText typeRenderer = new CellRendererText();
            TreeViewColumn typeColumn = treeView.AppendColumn("Type", typeRenderer);
            typeColumn.SetCellDataFunc(typeRenderer, new TreeCellDataFunc(RenderType));   

            CellRendererToggle includeCheckBoxRenderer = new CellRendererToggle();
            TreeViewColumn includeColumn = treeView.AppendColumn("Include", includeCheckBoxRenderer);
            includeColumn.SetCellDataFunc(includeCheckBoxRenderer, new TreeCellDataFunc(RenderIncludeCheckBox));
            includeCheckBoxRenderer.Activatable = true;
            includeCheckBoxRenderer.Toggled += includeToggleHandler;

            //fill store with data
            foreach (ItemSetting item in data) 
            {
                store.AppendValues(item, item, item);
            }
        }
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:26,代码来源:IOSpecSetupPage.cs


示例6: CounterSelectorDialog

		public CounterSelectorDialog ()
		{
			this.Build ();
			
			HasSeparator = false;
			store = new TreeStore (typeof(bool), typeof(string), typeof(CounterCategory), typeof(Counter), typeof(bool));
			treeCounters.Model = store;
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRendererToggle crt = new CellRendererToggle ();
			col.PackStart (crt, false);
			col.AddAttribute (crt, "active", 0);
			col.AddAttribute (crt, "visible", 4);
			
			CellRendererText crx = new CellRendererText ();
			col.PackStart (crx, true);
			col.AddAttribute (crx, "text", 1);
			treeCounters.AppendColumn (col);
			
			foreach (CounterCategory cat in App.Service.GetCategories ())
				AppendCategory (TreeIter.Zero, cat);
			
			UpdateSelectedCounters ();
			treeCounters.ExpandAll ();
			
			crt.Toggled += CrtToggled;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:27,代码来源:CounterSelectorDialog.cs


示例7: 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);
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:26,代码来源:SelectSchemaWidget.cs


示例8: AddInManagerDialog

        public AddInManagerDialog()
        {
            this.BorderWidth = 12;
            this.Title = GettextCatalog.GetString ("AddInManager");
            this.TransientFor = (Window) WorkbenchSingleton.Workbench;
            this.SetDefaultSize (400, 350);

            ScrolledWindow sw = new ScrolledWindow ();
            sw.ShadowType = ShadowType.In;
            TreeView tv = new TreeView ();
            tv.Selection.Changed += new EventHandler (OnSelectionChanged);
            tv.RowActivated += new RowActivatedHandler (OnRowActivated);

            CellRendererToggle toggle = new CellRendererToggle ();
            toggle.Toggled += OnCellToggled;
            tv.AppendColumn (GettextCatalog.GetString ("Enabled"), toggle, "active", 0);
            tv.AppendColumn (GettextCatalog.GetString ("AddIn Name"), new CellRendererText (), "text", 1);
            tv.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "text", 2);
            sw.Add (tv);

            this.AddButton (Gtk.Stock.Close, ResponseType.Close);

            LoadAddIns ();
            tv.Model = store;
            this.VBox.Add (sw);

            addinDetails = new AddInDetailsFrame ();
            this.VBox.Add (addinDetails);
            this.ShowAll ();
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:30,代码来源:AddInManagerDialog.cs


示例9: PackageBuilderMainPage

        public PackageBuilderMainPage()
        {
            this.Build();

            /*
            1 -- Node Data
            */
            m_packageContentStore = new Gtk.TreeStore(typeof(PackageFileSourceInfo));
            this.treeView.Model = m_packageContentStore;

            //create columns with associated cell renderings
            CellRendererText nameRenderer = new CellRendererText();
            TreeViewColumn nameColumn = treeView.AppendColumn("Name", nameRenderer);
            nameColumn.SetCellDataFunc(nameRenderer, new TreeCellDataFunc(RenderName));

            CellRendererToggle hasComponentsCheckBoxRenderer = new CellRendererToggle();
            TreeViewColumn hasComponentsColumn = treeView.AppendColumn("Has Components", hasComponentsCheckBoxRenderer);
            hasComponentsColumn.SetCellDataFunc(hasComponentsCheckBoxRenderer, new TreeCellDataFunc(RenderHasComponentCheckBox));
            hasComponentsCheckBoxRenderer.Activatable = true;
            hasComponentsCheckBoxRenderer.Toggled += HasComponentCheckBoxToggled;

            CellRendererToggle hasTypesCheckBoxRenderer = new CellRendererToggle();
            TreeViewColumn hasTypesColumn = treeView.AppendColumn("Has Types", hasTypesCheckBoxRenderer);
            hasTypesColumn.SetCellDataFunc(hasTypesCheckBoxRenderer, new TreeCellDataFunc(RenderHasTypesCheckBox));
            hasTypesCheckBoxRenderer.Activatable = true;
            hasTypesCheckBoxRenderer.Toggled += HasTypesCheckBoxToggled;

            this.treeView.Selection.Mode = Gtk.SelectionMode.Multiple;

            EnableDrop();
        }
开发者ID:CoEST,项目名称:TraceLab,代码行数:31,代码来源:PackageBuilderMainPage.cs


示例10: MassAccrualCreation

        public MassAccrualCreation()
        {
            this.Build ();

            MainClass.ComboAccrualYearsFill (comboYear);

            //Создаем таблицу "Договора"
            ContractsListStore = new Gtk.ListStore (typeof (bool), typeof(int), typeof (string), typeof (string), typeof (string), typeof (string),
                                                    typeof (string), typeof (decimal), typeof (bool), typeof(int));

            CellRendererToggle CellSelect = new CellRendererToggle();
            CellSelect.Activatable = true;
            CellSelect.Toggled += onCellSelectToggled;
            TreeViewColumn SelectColumn = new TreeViewColumn("Выбор", CellSelect, "active", (int)ContractsCol.selected);
            SelectColumn.SetCellDataFunc (CellSelect, new Gtk.TreeCellDataFunc (RenderSelectColumn));

            treeviewContracts.AppendColumn(SelectColumn);
            treeviewContracts.AppendColumn("Номер", new Gtk.CellRendererText (), "text", (int)ContractsCol.number);
            treeviewContracts.AppendColumn("Место", new Gtk.CellRendererText (), "text", (int)ContractsCol.place);
            treeviewContracts.AppendColumn("Арендатор", new Gtk.CellRendererText (), "text", (int)ContractsCol.lessee);
            treeviewContracts.AppendColumn("Дата окончания", new Gtk.CellRendererText (), "text", (int)ContractsCol.end_date);
            treeviewContracts.AppendColumn("Сумма", new Gtk.CellRendererText (), "text", (int)ContractsCol.sum_text);

            ContractsFilter = new Gtk.TreeModelFilter (ContractsListStore, null);
            ContractsFilter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTreeContracts);
            treeviewContracts.Model = ContractsFilter;
            treeviewContracts.ShowAll();

            comboMonth.Active = DateTime.Now.Month;
            CalculateSelected ();
        }
开发者ID:QualitySolution,项目名称:Bazar,代码行数:31,代码来源:MassAccrualCreation.cs


示例11: Initialize

		public void Initialize (Gtk.TreeView treeView)
		{
			TreeViewColumn column = new TreeViewColumn ();

			CellRendererToggle toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Toggled += ToggleRendererToggled;
			column.PackStart (toggleRenderer, false);
			column.AddAttribute (toggleRenderer, "active", 0);

			var pixbufRenderer = new CellRendererPixbuf ();
			column.PackStart (pixbufRenderer, false);
			column.AddAttribute (pixbufRenderer, "pixbuf", 1);

			CellRendererText textRenderer = new CellRendererText ();
			column.PackStart (textRenderer, true);
			column.AddAttribute (textRenderer, "text", 2);
			column.Expand = true;

			treeView.AppendColumn (column);
			Ambience ambience = AmbienceService.GetAmbienceForFile (options.Document.FileName);
			foreach (object obj in GetValidMembers ()) {
				var member = obj as IEntity;
				if (member != null) {
					Store.AppendValues (false, ImageService.GetPixbuf (member.GetStockIcon (), IconSize.Menu), ambience.GetString (member, OutputFlags.ClassBrowserEntries), member);
					continue;
				}
				
				var variable = obj as IVariable;
				if (variable != null)
					Store.AppendValues (false, ImageService.GetPixbuf (variable.GetStockIcon (), IconSize.Menu), variable.Name, variable);
				
			}
			
			treeView.Model = store;
		}
开发者ID:gary-b,项目名称:monodevelop,代码行数:35,代码来源:AbstractGenerateAction.cs


示例12: ContextActionPanelWidget

		public ContextActionPanelWidget (string mimeType)
		{
			this.mimeType = mimeType;
			this.Build ();
			
			var col = new TreeViewColumn ();
			
			searchentryFilter.Ready = true;
			searchentryFilter.Visible = true;
			searchentryFilter.Entry.Changed += ApplyFilter;

			var togRender = new CellRendererToggle ();
			togRender.Toggled += delegate(object o, ToggledArgs args) {
				TreeIter iter;
				if (!treeStore.GetIterFromString (out iter, args.Path)) 
					return;
				var provider = (CodeActionProvider)treeStore.GetValue (iter, 2);
				providerStates [provider] = !providerStates [provider];
				treeStore.SetValue (iter, 1, providerStates [provider]);
			};
			col.PackStart (togRender, false);
			col.AddAttribute (togRender, "active", 1);
			
			var textRender = new CellRendererText ();
			col.PackStart (textRender, true);
			col.AddAttribute (textRender, "markup", 0);
			
			treeviewContextActions.AppendColumn (col);
			treeviewContextActions.HeadersVisible = false;
			treeviewContextActions.Model = treeStore;
			GetAllProviderStates ();
			FillTreeStore (null);
			treeviewContextActions.Selection.Changed += HandleTreeviewContextActionsSelectionChanged;
		}
开发者ID:segaman,项目名称:monodevelop,代码行数:34,代码来源:CodeActionPanelWidget.cs


示例13: Initialize

		public void Initialize (TreeView treeView)
		{
			var column = new TreeViewColumn ();

			var toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Toggled += ToggleRendererToggled;
			column.PackStart (toggleRenderer, false);
			column.AddAttribute (toggleRenderer, "active", 0);

			var pixbufRenderer = new CellRendererImage ();
			column.PackStart (pixbufRenderer, false);
			column.AddAttribute (pixbufRenderer, "image", 1);

			var textRenderer = new CellRendererText ();
			column.PackStart (textRenderer, true);
			column.AddAttribute (textRenderer, "text", 2);
			column.Expand = true;

			treeView.AppendColumn (column);
			foreach (object obj in GetValidMembers ()) {
				var member = obj as ISymbol;
				if (member != null) {
					Store.AppendValues (false, ImageService.GetIcon (member.GetStockIcon (), IconSize.Menu), member.ToDisplayString (Ambience.LabelFormat), member);
					continue;
				}

				var tuple = obj as Tuple<ISymbol, bool>;
				if (tuple != null) {
					Store.AppendValues (false, ImageService.GetIcon (tuple.Item1.GetStockIcon (), IconSize.Menu), tuple.Item1.ToDisplayString (Ambience.LabelFormat), tuple);
					continue;
				}
			}
			
			treeView.Model = store;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:35,代码来源:AbstractGenerateAction.cs


示例14: ProjectSelectorWidget

        public ProjectSelectorWidget()
        {
            this.Build();

            store = new TreeStore (typeof(string), typeof(string), typeof(object), typeof(bool), typeof(bool));
            tree.Model = store;

            tree.HeadersVisible = false;
            TreeViewColumn col = new TreeViewColumn ();
            Gtk.CellRendererToggle ctog = new CellRendererToggle ();
            ctog.Toggled += OnToggled;
            col.PackStart (ctog, false);
            var cr = new CellRendererImage ();
            col.PackStart (cr, false);
            Gtk.CellRendererText crt = new Gtk.CellRendererText();
            crt.Mode &= ~CellRendererMode.Activatable;
            col.PackStart (crt, true);
            col.AddAttribute (cr, "stock-id", 0);
            col.AddAttribute (crt, "markup", 1);
            col.AddAttribute (ctog, "active", 3);
            col.AddAttribute (ctog, "visible", 4);
            tree.AppendColumn (col);

            tree.Selection.Changed += HandleTreeSelectionChanged;
        }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:25,代码来源:ProjectSelectorWidget.cs


示例15: CombineConfigurationPanelWidget

            public CombineConfigurationPanelWidget(IProperties CustomizationObject)
                : base("Base.glade", "CombineConfigurationsPanel")
            {
                configuration = (CombineConfiguration)((IProperties)CustomizationObject).GetProperty("Config");

                store = new TreeStore (typeof(object), typeof(string), typeof(bool), typeof(string));
                configsList.Model = store;
                configsList.HeadersVisible = true;

                TreeViewColumn col = new TreeViewColumn ();
                CellRendererText sr = new CellRendererText ();
                col.PackStart (sr, true);
                col.Expand = true;
                col.AddAttribute (sr, "text", 1);
                col.Title = "Solution Item";
                configsList.AppendColumn (col);

                CellRendererToggle tt = new CellRendererToggle ();
                tt.Activatable = true;
                tt.Toggled += new ToggledHandler (OnBuildToggled);
                configsList.AppendColumn ("Build", tt, "active", 2);
                configsList.AppendColumn ("Configuration", new CellRendererText (), "text", 3);

                foreach (CombineConfigurationEntry ce in configuration.Entries)
                    store.AppendValues (ce, ce.Entry.Name, ce.Build, ce.ConfigurationName);
            }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:26,代码来源:CombineConfigurationPanel.cs


示例16: IncludeNewFilesDialog

		public IncludeNewFilesDialog (string title, FilePath baseDirectory)
		{
			this.Build ();
			this.Title = title;
			this.baseDirectory = baseDirectory;
			
			treeviewFiles.Model = store;
			
			treeviewFiles.HeadersVisible = false; // Headers are untranslated because they're hidden as default
			
			TreeViewColumn textColumn = new TreeViewColumn ();
			
			CellRendererToggle toggleRender = new CellRendererToggle ();
			toggleRender.Toggled += ToggleRenderToggled;
			textColumn.PackStart (toggleRender, false);
			textColumn.AddAttribute (toggleRender, "active", Columns.IsToggled);
			
			textColumn.Title = "Name";
			var pixbufRenderer = new CellRendererImage ();
			textColumn.PackStart (pixbufRenderer, false);
			textColumn.AddAttribute (pixbufRenderer, "image", Columns.IconOpened);
			textColumn.AddAttribute (pixbufRenderer, "image-expander-open", Columns.IconOpened);
			textColumn.AddAttribute (pixbufRenderer, "image-expander-closed", Columns.IconClosed);
			
			CellRendererText textRenderer = new CellRendererText ();
			textColumn.PackStart (textRenderer, false);
			textColumn.AddAttribute (textRenderer, "text", Columns.Text);
			treeviewFiles.AppendColumn (textColumn);
			buttonExcludeAll.Clicked += ButtonExcludeAllClicked;
			buttonIncludeAll.Clicked += ButtonIncludeAllClicked;
			buttonOk.Clicked += ButtonOkClicked;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:32,代码来源:IncludeNewFilesDialog.cs


示例17: CreateCellRenderers

 protected override void CreateCellRenderers()
 {
     CellRendererToggle renderer = new CellRendererToggle();
     this.PackStart(renderer, false);
     this.AddAttribute(renderer, "active", Mapping.AddValueMapping(GType.Boolean, GetActive));
     this.AddAttribute(renderer, "inconsistent", Mapping.AddValueMapping(GType.Boolean, GetInconsistent));
 }
开发者ID:langpavel,项目名称:LPS-old,代码行数:7,代码来源:CheckBoxColumn.cs


示例18: CreateTreeViewColumn

		TreeViewColumn CreateTreeViewColumn ()
		{
			var column = new TreeViewColumn ();
			column.Spacing = 0;

			var dummyRenderer = new CellRendererImage ();
			dummyRenderer.Width = 1;
			dummyRenderer.Xpad = 0;
			column.PackStart (dummyRenderer, false);

			var checkBoxRenderer = new CellRendererToggle ();
			checkBoxRenderer.Toggled += PackageSourceCheckBoxToggled;
			checkBoxRenderer.Xpad = 7;
			checkBoxRenderer.Ypad = 12;
			checkBoxRenderer.Xalign = 0;
			checkBoxRenderer.Yalign = 0;
			column.PackStart (checkBoxRenderer, false);
			column.AddAttribute (checkBoxRenderer, "active", IsEnabledCheckBoxColumn);

			var iconRenderer = new CellRendererImage ();
			iconRenderer.StockSize = IconSize.Dnd;
			iconRenderer.Xalign = 0;
			iconRenderer.Xpad = 0;
			column.PackStart (iconRenderer, false);
			column.AddAttribute (iconRenderer, "icon-id", PackageSourceIconColumn);

			var packageSourceRenderer = new PackageSourceCellRenderer ();
			packageSourceRenderer.Mode = CellRendererMode.Activatable;
			column.PackStart (packageSourceRenderer, true);
			column.AddAttribute (packageSourceRenderer, "package-source", PackageSourceViewModelColumn);

			return column;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:33,代码来源:PackageSourcesWidget.cs


示例19: MultiChooserDialog

        public MultiChooserDialog(IList options, IList banned)
        {
            base.Modal = true;
            base.HeightRequest = 400;
            base.WidthRequest = 250;
            //TODO: i18n
            base.Title = GettextCatalog.GetString ("Choose elements");
            base.AddButton(GettextCatalog.GetString ("_Cancel"), Gtk.ResponseType.Cancel);
            base.AddButton(GettextCatalog.GetString ("_Accept"), Gtk.ResponseType.Accept);
            base.Response += new Gtk.ResponseHandler(OnResponse);

            TreeView treeView = new TreeView();
            treeView.HeadersVisible = false;
            _store = new ListStore(typeof(bool), typeof(string));
            treeView.Model = _store;
            CellRendererToggle crtgl = new CellRendererToggle();
            crtgl.Activatable = true;
            crtgl.Toggled += new ToggledHandler(CheckboxToggledHandler);
            TreeViewColumn column = new TreeViewColumn ();
            column.PackStart(crtgl, false);
            column.AddAttribute(crtgl, "active", 0);
            treeView.AppendColumn(column);
            CellRendererText crtxt = new CellRendererText ();
            column = new TreeViewColumn ();
            column.PackStart(crtxt, false);
            column.AddAttribute(crtxt, "text", 1);
            treeView.AppendColumn(column);
            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            sw.ShadowType = Gtk.ShadowType.In;
            sw.Add(treeView);
            treeView.Show();
            base.VBox.Add(sw);
            ShowList(options, banned);
            sw.Show();
        }
开发者ID:MonoBrasil,项目名称:historico,代码行数:35,代码来源:MultiChooserDialog.cs


示例20: 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);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:31,代码来源:TableMappingWidget.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Gtk.CheckButton类代码示例发布时间:2022-05-26
下一篇:
C# Gtk.CellRendererText类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap