本文整理汇总了C#中Gtk.ToggledArgs类的典型用法代码示例。如果您正苦于以下问题:C# ToggledArgs类的具体用法?C# ToggledArgs怎么用?C# ToggledArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToggledArgs类属于Gtk命名空间,在下文中一共展示了ToggledArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleToggled
void HandleToggled (object o, ToggledArgs args)
{
SetCurrentEventRow ();
var view = (ICheckBoxCellViewFrontend) Frontend;
IDataField field = (IDataField) view.StateField ?? view.ActiveField;
if (!view.RaiseToggled () && (field != null)) {
Type type = field.FieldType;
Gtk.TreeIter iter;
if (TreeModel.GetIterFromString (out iter, args.Path)) {
CheckBoxState newState;
if (view.AllowMixed && type == typeof(CheckBoxState)) {
if (renderer.Inconsistent)
newState = CheckBoxState.Off;
else if (renderer.Active)
newState = CheckBoxState.Mixed;
else
newState = CheckBoxState.On;
} else {
if (renderer.Active)
newState = CheckBoxState.Off;
else
newState = CheckBoxState.On;
}
object newValue = type == typeof(CheckBoxState) ?
(object) newState : (object) (newState == CheckBoxState.On);
CellUtil.SetModelValue (TreeModel, iter, field.Index, type, newValue);
}
}
}
示例2: FixedToggled
private void FixedToggled (object o, ToggledArgs args)
{
Gtk.TreeIter iter;
if (store.GetIterFromString (out iter, args.Path)) {
bool val = (bool) store.GetValue (iter, 0);
store.SetValue (iter, 0, !val);
}
}
示例3: IncludeCheckBoxToggled
private void IncludeCheckBoxToggled(object o, ToggledArgs args)
{
TreeIter iter;
if (m_configStore.GetIterFromString (out iter, args.Path))
{
ConfigItemSetting itemSetting = (ConfigItemSetting)m_configStore.GetValue(iter, 3);
itemSetting.Include = !itemSetting.Include;
}
}
示例4: HandleFilterCellToggled
protected void HandleFilterCellToggled(object o, ToggledArgs args)
{
Gtk.TreeIter iter;
if (store.GetIterFromString (out iter, args.Path)) {
bool active = !((bool)store.GetValue (iter, 1));
UpdateSelection (iter, active);
}
}
示例5: InputIncludeCheckBoxToggled
private void InputIncludeCheckBoxToggled(object o, ToggledArgs args)
{
TreeIter iter;
if (m_inputsStore.GetIterFromString (out iter, args.Path))
{
ItemSetting itemSetting = (ItemSetting)m_inputsStore.GetValue(iter, 2);
itemSetting.Include = !itemSetting.Include;
}
}
示例6: HandleToggled
void HandleToggled (object o, ToggledArgs args)
{
TreeIter iter;
Check (store.GetIter (out iter, new TreePath (args.Path)));
var val = !(bool)store.GetValue (iter, COL_SELECTED);
store.SetValue (iter, COL_SELECTED, val);
selectedCount += val ? 1 : -1;
addButton.Sensitive = selectedCount > 0;
}
示例7: ItemToggled
private void ItemToggled (object sender, ToggledArgs args)
{
int column = columns.IndexOf (sender);
Gtk.TreeIter iter;
if (store.GetIterFromString (out iter, args.Path)) {
bool val = (bool) store.GetValue (iter, column);
store.SetValue (iter, column, !val);
}
}
示例8: onCellSelectToggled
void onCellSelectToggled(object o, ToggledArgs args)
{
TreeIter iter;
if (MetersList.GetIter (out iter, new TreePath(args.Path)))
{
bool old = (bool) MetersList.GetValue(iter,1);
MetersList.SetValue(iter, 1, !old);
}
}
示例9: crt_toggled
void crt_toggled(object o, ToggledArgs args)
{
TreeIter iter;
Console.WriteLine("Toggled");
Gtk.ListStore store = (Gtk.ListStore) tvBar.Model;
if (store.GetIter (out iter, new TreePath(args.Path))) {
bool old = (bool) store.GetValue(iter, 3);
store.SetValue(iter, 3, !old);
}
}
示例10: OnCellRendererToggled
protected virtual void OnCellRendererToggled(object sender, ToggledArgs e)
{
TreeIter iter;
if (store.GetIter (out iter, new TreePath(e.Path))) {
Addin addin = store.GetValue (iter, 2) as Addin;
bool old = (bool)store.GetValue (iter, 1);
if (addin != null) {
addin.Enabled = !old;
store.SetValue (iter, 1, !old);
}
}
}
示例11: DoToggle
private void DoToggle(object sender, ToggledArgs args)
{
ListStore store = (ListStore) this.AreasTreeView.Model;
TreePath path = new TreePath(args.Path);
TreeIter iter;
if(store.GetIter(out iter, path))
{
bool old_value = (bool) store.GetValue(iter, 0);
long area_id = (long) store.GetValue(iter, 2);
if(old_value)
this.SelectedIds.Remove(area_id);
else
this.SelectedIds.Add(area_id);
store.SetValue(iter, 0, !old_value);
}
}
示例12: HandleToggled
private void HandleToggled (object o, ToggledArgs args)
{
TreeIter iter;
if (m_treeStore.GetIter(out iter, new TreePath(args.Path)))
{
PackageReferenceNode node = (PackageReferenceNode)m_treeStore.GetValue(iter, 0);
node.State = !node.State;
var packageReference = new TraceLab.Core.PackageSystem.PackageReference(node.Package);
if (node.State == false)
{
PackagesViewModelHelper.RemoveReference(m_experiment, packageReference);
}
else if(node.State && !m_experiment.References.Contains(packageReference))
{
PackagesViewModelHelper.AddReference(m_experiment, packageReference);
}
}
}
示例13: ToggleCheckBoxToggled
private void ToggleCheckBoxToggled(object o, ToggledArgs args)
{
Console.WriteLine("ToggleCheckBoxToggled()");
TreeIter iter;
if (this.listStore1.GetIterFromString(out iter, args.Path))
{
bool value = (bool)this.listStore1.GetValue(iter, (int)Column.ToggleCheckBox);
this.listStore1.SetValue(iter, (int)Column.ToggleCheckBox, !value);
}
}
示例14: ToggleRadioButtonToggled
private void ToggleRadioButtonToggled(object o, ToggledArgs args)
{
Console.WriteLine("ToggleRadioButtonToggled()");
TreeIter iter;
// Radio button "group" behavior must be manually implemneted with something like this:
if (this.listStore1.GetIterFirst(out iter))
{
do
{
this.listStore1.SetValue(iter, (int)Column.ToggleRadioButton, false);
}
while (this.listStore1.IterNext(ref iter));
}
if (this.listStore1.GetIterFromString(out iter, args.Path))
{
this.listStore1.SetValue(iter, (int)Column.ToggleRadioButton, true);
}
}
示例15: ItemToggled
private void ItemToggled (object o, ToggledArgs args)
{
Gtk.TreeIter iter;
if (store.GetIterFromString(out iter, args.Path)) {
bool val = (bool) store.GetValue(iter, (int)Columns.Selected);
Breakpoint bp = (Breakpoint) store.GetValue (iter, (int) Columns.Breakpoint);
store.SetValue (iter, (int)Columns.Selected, !val);
bp.Enabled = !bp.Enabled;
}
}