private void ComboCellRenderer_Edited(object o, EditedArgs args) { ProjectileEffectType selectedType = ProjectileEffectType.Damage; TreeIter iter; if (EffectsModel.GetIterFromString(out iter, args.Path)) { var values = Enum.GetValues(typeof(ProjectileEffectType)); var names = Enum.GetNames(typeof(ProjectileEffectType)); for (int i = 0; i < names.Length; i++) { if (args.NewText == names[i]) { selectedType = (ProjectileEffectType)values.GetValue(i); break; } } int row = (int)EffectsModel.GetValue(iter, 0); ProjectileEffectType currentType = Projectile.Effects[row].EffectType; if (selectedType != currentType) { EffectsModel.SetValue(iter, 1, args.NewText); Projectile.Effects[row].EffectType = selectedType; WriteChanges(); } } }
private void RefTableEdited(object sender, EditedArgs args) { TreeIter iter; if (store.GetIterFromString(out iter, args.Path)) { FillReferenceColumnSelector(iter, args.NewText); } }
private void SelectToggled(object sender, ToggledArgs args) { TreeIter iter; if (store.GetIterFromString(out iter, args.Path)) { bool val = (bool)store.GetValue(iter, columnSelected); store.SetValue(iter, columnSelected, !val); } }
private void IsColumnConstraintToggled(object sender, ToggledArgs args) { TreeIter iter; if (store.GetIterFromString(out iter, args.Path)) { bool val = (bool)store.GetValue(iter, colIsColumnConstraintIndex); store.SetValue(iter, colIsColumnConstraintIndex, !val); EmitContentChanged(); } }
void HandleOnEditValue(object o, Gtk.EditedArgs e) { Gtk.TreeIter iter; if (storeEntries.GetIterFromString(out iter, e.Path)) { string key = (string)storeEntries.GetValue(iter, 1); entry.SetEntry(key, e.NewText); storeEntries.SetValue(iter, 2, e.NewText); NotifyChanged(); } }
private void UpdatePosition() { TreeIter iter; int position = DataManager.Position; if (position >= 0) { if (store.GetIterFromString(out iter, position.ToString())) { list_widget.SetActiveIter(iter); } } }
private void ComboCellRenderer_Edited(object o, EditedArgs args) { TreeIter iter; if (WavesModel.GetIterFromString(out iter, args.Path)) { int row = (int)WavesModel.GetValue(iter, 0); if (args.NewText != LevelDesc.Waves[row].Enemy) { WavesModel.SetValue(iter, 1, args.NewText); LevelDesc.Waves[row].Enemy = args.NewText; } } }
void OnExpEditing(object s, Gtk.EditingStartedArgs args) { TreeIter it; if (!store.GetIterFromString(out it, args.Path)) { return; } Gtk.Entry e = (Gtk.Entry)args.Editable; if (e.Text == createMsg) { e.Text = string.Empty; } }
void HandleInProgressCellToggled(object o, ToggledArgs args) { TreeIter iter; subtaskList.GetIterFromString(out iter, args.Path); if ((bool)subtaskList.GetValue(iter, 2)) { subtaskList.SetValue(iter, 2, false); } else { subtaskList.SetValue(iter, 2, true); } }
private void DescriptionbodyRenderer_Edited(object o, EditedArgs args) { TreeIter iter; if (WavesModel.GetIterFromString(out iter, args.Path)) { int row = (int)WavesModel.GetValue(iter, 0); if (args.NewText != LevelDesc.Waves[row].DescriptionBody) { WavesModel.SetValue(iter, 4, args.NewText); LevelDesc.Waves[row].DescriptionBody = args.NewText; WriteChanges(); } } }
public void HandleLabelEdited(object sender, EditedArgs args) { args.RetVal = false; TreeIter iter; if (!constraints_store.GetIterFromString(out iter, args.Path)) { return; } using (GLib.Value val = new GLib.Value(args.NewText)) constraints_store.SetValue(iter, 0, val); args.RetVal = true; }
private void Replace(int index, SyncPoint syncPoint) { TreeIter iter; model.GetIterFromString(out iter, index.ToString()); model.SetValue(iter, 0, syncPoint); }
void OnAttributeEdit(object o, EditedArgs args) { TreeIter iter; if (!columnStore.GetIterFromString(out iter, args.Path)) { return; } string oldAttr = (string)columnStore.GetValue(iter, 1); colAttrs.Remove(oldAttr); colAttrs.Add(args.NewText); columnStore.SetValue(iter, 1, args.NewText); }
void MarketSummaries_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { var coll = sender as ICollection <PriceTicker>; switch (e.Action) { case NotifyCollectionChangedAction.Replace: Debug.Assert(e.NewItems.Count == 1); Debug.Assert(e.NewStartingIndex == e.OldStartingIndex); //Debug.Print($"MarketSummaries: Replaced {e.NewItems.Count} items."); Gtk.Application.Invoke(delegate { TreeIter iter; store.GetIterFromString(out iter, e.OldStartingIndex.ToString()); store.SetValue(iter, 0, e.NewItems[0]); }); break; case NotifyCollectionChangedAction.Reset: Debug.Print($"MarketSummaries: Reset. {coll.Count} items."); Gtk.Application.Invoke(delegate { store.Clear(); foreach (var item in coll) { store.AppendValues(item); } BuildMarkets(); }); break; } }
public void AddReference(object sender, Gtk.ToggledArgs e) { Gtk.TreeIter iter; store.GetIterFromString(out iter, e.Path); var ainfo = (AssemblyInfo)store.GetValue(iter, ColAssemblyInfo); string fullName = (string)store.GetValue(iter, ColPath); if (!(bool)store.GetValue(iter, ColSelected)) { store.SetValue(iter, ColSelected, true); ainfo.Selected = true; AddReference(fullName); } else { store.SetValue(iter, ColSelected, false); ainfo.Selected = false; RemoveReference(fullName); // Ensure that this file is kept in the recents list, so it can be added later on if (IsExternalAssembly(fullName)) { selectDialog.RegisterFileReference(fullName); } else if (!IsNuGetAssembly(fullName)) { selectDialog.RegisterFileReference(fullName, project.ParentSolution.FileName); } } }
void InitializeRealWidgets() { minAndroidVersionCombo.AppendText(GettextCatalog.GetString("Automatic")); foreach (var v in MonoDroidFramework.AndroidVersions) { minAndroidVersionCombo.AppendText(v.Label); } foreach (var p in MonoDroidFramework.Permissions) { permissionsStore.AppendValues(false, p); } var toggleRenderer = new CellRendererToggle(); permissionsTreeView.AppendColumn("", toggleRenderer, "active", 0); permissionsTreeView.AppendColumn("", new CellRendererText(), "text", 1); permissionsTreeView.Model = permissionsStore; toggleRenderer.Toggled += delegate(object o, ToggledArgs args) { TreeIter iter; if (permissionsStore.GetIterFromString(out iter, args.Path)) { permissionsStore.SetValue(iter, 0, !toggleRenderer.Active); } }; permissionsTreeView.HeadersVisible = false; //FIXME: build a nice drawable resource picker foreach (var kv in project.GetAndroidResources("drawable")) { appIconCombo.AppendText("@drawable/" + kv.Key); } ShowAll(); }
protected void OnOK(object sender, EventArgs e) { // Clear media player list for (int j = 0; j != mediaPlayerCombo.Model.IterNChildren();) { Console.WriteLine("Removing a line"); mediaPlayerCombo.RemoveText(0); } // Add media players to list for (int i = 0; i < store.IterNChildren(); i++) { TreeIter iter; string playerValue; // Get strings from list store.GetIterFromString(out iter, i.ToString()); playerValue = store.GetValue(iter, 0).ToString(); // Append strings to combo box Console.WriteLine("Adding " + playerValue); mediaPlayerCombo.AppendText(playerValue); // Select first player in combo box TreeIter newSelect; mediaPlayerCombo.Model.GetIterFirst(out newSelect); mediaPlayerCombo.SetActiveIter(newSelect); } this.Destroy(); }
public void AddReference(object sender, Gtk.ToggledArgs e) { Gtk.TreeIter iter; store.GetIterFromString(out iter, e.Path); ReferenceType rt = (ReferenceType)store.GetValue(iter, ColType); string fullName = (string)store.GetValue(iter, ColFullName); if ((bool)store.GetValue(iter, ColSelected) == false) { store.SetValue(iter, ColSelected, true); switch (rt) { case ReferenceType.Package: selectDialog.AddReference(ProjectReference.CreateAssemblyReference((SystemAssembly)store.GetValue(iter, ColAssembly))); break; case ReferenceType.Assembly: selectDialog.AddReference(ProjectReference.CreateAssemblyFileReference(fullName)); break; case ReferenceType.Project: selectDialog.AddReference(ProjectReference.CreateProjectReference(fullName)); break; } } else { store.SetValue(iter, ColSelected, false); selectDialog.RemoveReference(rt, fullName); } }
public void AddReference(object sender, Gtk.ToggledArgs e) { Gtk.TreeIter iter; store.GetIterFromString(out iter, e.Path); ReferenceType rt = (ReferenceType)store.GetValue(iter, ColType); string fullName = (string)store.GetValue(iter, ColFullName); if ((bool)store.GetValue(iter, ColSelected) == false) { store.SetValue(iter, ColSelected, true); if (rt == ReferenceType.Package) { selectDialog.AddReference(new ProjectReference((SystemAssembly)store.GetValue(iter, ColAssembly))); } else { selectDialog.AddReference(new ProjectReference(rt, fullName)); } } else { store.SetValue(iter, ColSelected, false); selectDialog.RemoveReference(rt, fullName); } }
void SetupTreeview() { CellRendererToggle crToggle = new CellRendererToggle(); crToggle.Activatable = true; crToggle.Toggled += delegate(object o, ToggledArgs args) { TreeIter iter; if (!model.GetIterFromString(out iter, args.Path)) { return; } IElement e = (IElement)model.GetValue(iter, 2); bool oldValue = (bool)model.GetValue(iter, 0); if (oldValue) { countLabel.Text = (--selectedCount).ToString(); elements.Remove(e); } else { countLabel.Text = (++selectedCount).ToString(); elements.Add(e); } model.SetValue(iter, 0, !oldValue); codeTextView.Buffer.Text = renderer(elements); }; selectionTv.AppendColumn(string.Empty, crToggle, "active", 0); selectionTv.AppendColumn("Name", new CellRendererText(), "text", 1); }
void OnItemToggled(object s, ToggledArgs args) { Gtk.TreeIter it; listStore.GetIterFromString(out it, args.Path); bool run = (bool)listStore.GetValue(it, 1); listStore.SetValue(it, 1, !run); }
void OnPropertyEdited(object sender, EditedArgs args) { TreeIter iter; if (!store.GetIterFromString(out iter, args.Path)) { return; } store.SetValue(iter, colPropertyNameIndex, args.NewText); if (!CheckAndUpdateConflictMessage(iter, true)) { // unselect this field store.SetValue(iter, colCheckedIndex, false); } UpdateOKButton(); }
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); } }
private void NameEdited(object sender, EditedArgs args) { TreeIter iter; if (store.GetIterFromString(out iter, args.Path)) { if (!string.IsNullOrEmpty(args.NewText) && !constraints.Contains(args.NewText)) { store.SetValue(iter, colNameIndex, args.NewText); EmitContentChanged(); } else { string oldText = store.GetValue(iter, colNameIndex) as string; (sender as CellRendererText).Text = oldText; } } }
private void ItemToggled(object o, ToggledArgs args) { Gtk.TreeIter iter; if (store.GetIterFromString(out iter, args.Path)) { Task task = (Task)store.GetValue(iter, DataColumns.Task); task.Completed = !task.Completed; OnTaskToggled(new TaskEventArgs(task)); } }
private void RefTableEdited(object sender, EditedArgs args) { TreeIter iter; if (store.GetIterFromString(out iter, args.Path)) { if (tables.Contains(args.NewText)) { store.SetValue(iter, colReferenceTableIndex, args.NewText); SetSelectionFromIter(iter); EmitContentChanged(); } else { string oldText = store.GetValue(iter, colReferenceTableIndex) as string; (sender as CellRendererText).Text = oldText; } } }
void PackageSourceCheckBoxToggled(object o, ToggledArgs args) { TreeIter iter; packageSourcesStore.GetIterFromString(out iter, args.Path); PackageSourceViewModel packageSourceViewModel = GetPackageSourceViewModel(iter); packageSourceViewModel.IsEnabled = !packageSourceViewModel.IsEnabled; packageSourcesStore.SetValue(iter, IsEnabledCheckBoxColumn, packageSourceViewModel.IsEnabled); }
/// <summary> /// Handles the export mip toggle clicked event. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">E.</param> protected void OnExportMipToggleClicked(object sender, ToggledArgs e) { TreeIter Iter; MipLevelListStore.GetIterFromString(out Iter, e.Path); bool currentValue = (bool)MipLevelListStore.GetValue(Iter, 0); MipLevelListStore.SetValue(Iter, 0, !currentValue); }
void OnToggled(object sender, Gtk.ToggledArgs args) { TreeIter iter; store.GetIterFromString(out iter, args.Path); DeployFile file = (DeployFile)store.GetValue(iter, ColObject); bool inc = !builder.IsFileIncluded(file); builder.SetFileIncluded(file, inc); store.SetValue(iter, ColIncluded, inc); }
void OnAttributeEdit(object o, EditedArgs args) { TreeIter iter; if (!attrListStore.GetIterFromString(out iter, args.Path)) { return; } attrListStore.SetValue(iter, 1, args.NewText); }