本文整理汇总了C#中Gtk.CellRendererToggle类的典型用法代码示例。如果您正苦于以下问题:C# CellRendererToggle类的具体用法?C# CellRendererToggle怎么用?C# CellRendererToggle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CellRendererToggle类属于Gtk命名空间,在下文中一共展示了CellRendererToggle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 ();
}
示例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 ();
}
示例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;
}
示例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 ();
}
示例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);
}
}
示例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;
}
示例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);
}
示例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 ();
}
示例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();
}
示例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 ();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}