protected void OnEdited(object sender, Gtk.EditedArgs args) { Gtk.TreeSelection selection = treeview1.Selection; Gtk.TreeIter iter; selection.GetSelected(out iter); treeview1.Model.SetValue(iter, 1, args.NewText); // the CellRendererText }
void HandleEdited (object o, EditedArgs args, int column) { TreeIter iter; store.GetIterFromString (out iter, args.Path); if (!store.IterIsValid (iter)) return; string newText = args.NewText; if (column == 0) newText = Switch.EspaceSwitchName (newText); else if (column == 1) newText = Switch.EscapeSwitchDefine (newText); store.SetValue (iter, column, newText); Switch s = store.GetValue (iter, 3) as Switch; if (s != null) target.RemoveSwitch (s); s = new Switch (store.GetValue (iter, 0) as string, store.GetValue (iter, 1) as string, store.GetValue (iter, 2) as string); store.SetValue (iter, 3, s); target.AddSwitch (s); }
private void ComboNodeCellEdited(object o, Gtk.EditedArgs args) { Gtk.TreeIter iter; INodeCellRenderer cell = o as INodeCellRenderer; CellRendererCombo combo = o as CellRendererCombo; if (cell != null) { // Resolve path as it was passed in the arguments Gtk.TreePath tp = new Gtk.TreePath(args.Path); // Change value in the original object if (YTreeModel.Adapter.GetIter(out iter, tp)) { object obj = YTreeModel.NodeFromIter(iter); if (cell.DataPropertyInfo.CanWrite && !String.IsNullOrWhiteSpace(args.NewText)) { foreach (object[] row in (ListStore)combo.Model) { if ((string)row[(int)NodeCellRendererColumns.title] == args.NewText) { cell.DataPropertyInfo.SetValue(obj, row[(int)NodeCellRendererColumns.value], null); break; } } } } } }
private void timeCellEdited(object o, Gtk.EditedArgs args) { Gtk.TreeIter iter; store.GetIter(out iter, new Gtk.TreePath(args.Path)); if (Util.IsNumber(args.NewText, true)) { /* * currently all pulseTypes are non fixed, and it's not possible to create more types (by user), then there are no limitations */ /* * //if it's limited by fixed value of seconds * //and new seconds are bigger than allowed, return * if(runType.FixedValue > 0 && ! runType.TracksLimited && * getTotalTime() //current total time in treeview * - Convert.ToDouble((string) treeview_subevents.Model.GetValue(iter,1)) //-old cell + Convert.ToDouble(args.NewText) //+new cell + > runType.FixedValue) { //bigger than allowed + return; + } else { */ store.SetValue(iter, 1, args.NewText); //update the totaltime label label_totaltime_value.Text = getTotalTime().ToString() + " " + Catalog.GetString("seconds"); /* * } */ } //if is not number or if it was -1, the old data will remain }
void OnExpEdited(object s, Gtk.EditedArgs args) { TreeIter it; if (!store.GetIterFromString(out it, args.Path)) { return; } bool isInserter = !(bool)store.GetValue(it, 2); if (args.NewText.Length == 0) { if (!isInserter) { store.Remove(ref it); } return; } store.SetValue(it, 0, args.NewText); store.SetValue(it, 2, true); store.SetValue(it, 3, null); if (isInserter) { AppendInserter(); } }
void OnValueCellEdited(CellRendererText cell, Gtk.EditedArgs args, Services.TextResources textResources) { _filter.GetIter(out TreeIter iter, new TreePath(args.Path)); string key = (string)_filter.GetValue(iter, 0); textResources.SaveValue(key, args.NewText); }
private void NoteContentEdited(object o, Gtk.EditedArgs args) { Logger.Write("content edited"); NoteTreeNode node = store.GetNode(new TreePath(args.Path)) as NoteTreeNode; Note note = node.GetNote(); note.content = args.NewText; clientActivated.UpdateRecord(note); }
private void rssCellEdited(object o, Gtk.EditedArgs args) { Gtk.TreeIter iter; treeview_lines_store.GetIter(out iter, new Gtk.TreePath(args.Path)); userLine line = (userLine)treeview_lines_store.GetValue(iter, 0); line.m_rss_url = args.NewText; }
private void sectionCell_edit(object o, Gtk.EditedArgs args) { Gtk.TreeIter iter; store.GetIter(out iter, new Gtk.TreePath(args.Path)); TexString sec = (TexString)store.GetValue(iter, 0); sec.Text = args.NewText; }
private void AliasEdited (object o, EditedArgs args) { TreeIter iter; if (m_configStore.GetIterFromString (out iter, args.Path)) { ConfigItemSetting itemSetting = (ConfigItemSetting)m_configStore.GetValue(iter, 2); itemSetting.Alias = args.NewText; } }
void OnValEdited(object s, Gtk.EditedArgs args) { TreeIter it; if (!store.GetIterFromString(out it, args.Path)) { return; } store.SetValue(it, 1, args.NewText); }
private void codeCellEdited(object o, Gtk.EditedArgs args) { Gtk.TreeIter iter; treeview_lines_store.GetIter(out iter, new Gtk.TreePath(args.Path)); userLine line = (userLine)treeview_lines_store.GetValue(iter, 0); line.m_code = args.NewText; set_lines_inactive(); set_line_active(line); }
void HandleEdited (object o, EditedArgs args) { SetCurrentEventRow (); var view = (ITextCellViewFrontend) Frontend; if (!view.RaiseTextChanged () && view.TextField != null) { Gtk.TreeIter iter; if (TreeModel.GetIterFromString (out iter, args.Path)) CellUtil.SetModelValue (TreeModel, iter, view.TextField.Index, view.TextField.FieldType, args.NewText); } }
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(); } }
void OnTaskSummaryEdited(object sender, Gtk.EditedArgs args) { Gtk.TreeIter iter; Gtk.TreePath path = new TreePath(args.Path); if (store_sort.GetIter(out iter, path) == false) { return; } Task task = store_sort.GetValue(iter, 0) as Task; task.Summary = args.NewText; }
private void HandleSummaryCellEdited(object o, EditedArgs args) { TreeIter iter; taskList.GetIterFromString(out iter, args.Path); taskList.SetValue(iter, 1, args.NewText); tasks.Load(); int id = Convert.ToInt32((string) taskList.GetValue(iter, 3)); Task task = tasks.Find(id); if (task != null) { task.Summary = args.NewText; } tasks.Save(); }
private void timeCellEdited(object o, Gtk.EditedArgs args) { Gtk.TreeIter iter; treeview_lines_store.GetIter(out iter, new Gtk.TreePath(args.Path)); userLine line = (userLine)treeview_lines_store.GetValue(iter, 0); try { int.TryParse(args.NewText, out line.m_time); } catch (Exception) { } }
private void onRawValueEdited(object o, Gtk.EditedArgs args) { Gtk.TreeIter iter; treeVars.Model.GetIter(out iter, new Gtk.TreePath(args.Path)); try { vars[(string)treeVars.Model.GetValue(iter, 0)] = float.Parse(args.NewText); } catch { Console.WriteLine("Incorrect format"); } // FIXME: probably shouldn't be here UpdateRawValues(); }
void OnValueEdited(object s, Gtk.EditedArgs args) { OnEndEditing(); TreeIter it; if (!store.GetIterFromString(out it, args.Path)) { return; } ObjectValue val = store.GetValue(it, ObjectCol) as ObjectValue; try { string newVal = args.NewText; /* if (newVal == null) { * MessageService.ShowError (GettextCatalog.GetString ("Unregognized escape sequence.")); * return; * } */ if (val.Value != newVal) { val.Value = newVal; } } catch (Exception ex) { LoggingService.LogError("Could not set value for object '" + val.Name + "'", ex); } store.SetValue(it, ValueCol, val.DisplayValue); // Update the color string newColor = null; string valPath = GetIterPath(it); string oldValue; if (oldValues.TryGetValue(valPath, out oldValue)) { if (oldValue != val.Value) { newColor = modifiedColor; } } store.SetValue(it, NameColorCol, newColor); store.SetValue(it, ValueColorCol, newColor); }
void CollectionNameEditedHandler(object o, Gtk.EditedArgs ea) { string collid = store.GetCollectionAtPathString(ea.Path); IImageCollection coll = repo.GetCollection(collid); if (coll == null) { Console.WriteLine("collection " + collid + " not found "); return; } if (coll.Name != ea.NewText) { coll.Name = ea.NewText; Console.WriteLine("new name '" + ea.NewText + "' for collection '" + collid + "' set!"); } }
private void NumericNodeCellEdited(object o, Gtk.EditedArgs args) { TreeIter iter; INodeCellRenderer cell = o as INodeCellRenderer; //CellRendererSpin cellSpin = o as CellRendererSpin; if (cell != null) { // Resolve path as it was passed in the arguments Gtk.TreePath tp = new Gtk.TreePath(args.Path); // Change value in the original object if (YTreeModel.Adapter.GetIter(out iter, tp)) { object obj = YTreeModel.NodeFromIter(iter); if (cell.DataPropertyInfo.CanWrite && !String.IsNullOrWhiteSpace(args.NewText)) { object newval = null; if (cell.EditingValueConverter == null) { try { newval = Convert.ChangeType(args.NewText, cell.DataPropertyInfo.PropertyType); } catch (FormatException ex) { Console.WriteLine("'{0}' is not number", args.NewText); } } else { newval = cell.EditingValueConverter.ConvertBack(args.NewText, cell.DataPropertyInfo.PropertyType, null, null); } if (newval != null) { cell.DataPropertyInfo.SetValue(obj, newval, null); } } } } }
protected virtual void OnNameCellEdited(object o, Gtk.EditedArgs args) { Gtk.TreeIter iter; object item; Model.GetIter(out iter, new Gtk.TreePath(args.Path)); item = this.Model.GetValue(iter, 0); if (item is TimeNode) { (item as TimeNode).Name = args.NewText; EmitTimeNodeChanged((item as TimeNode), args.NewText); } else if (item is Player) { (item as Player).Name = args.NewText; } editing = false; nameCell.Editable = false; }
void HandleOnEditMimeType(object o, Gtk.EditedArgs e) { Gtk.TreeIter iter; if (storeMimeTypes.GetIterFromString(out iter, e.Path)) { string mt = e.NewText; string oldmt = (string)storeMimeTypes.GetValue(iter, 0); if (mt.Length > 0) { if (!entry.MimeTypes.Contains(mt)) { entry.MimeTypes.Add(mt); storeMimeTypes.SetValue(iter, 0, mt); storeMimeTypes.SetValue(iter, 1, DesktopService.GetMimeTypeDescription(mt)); if (!string.IsNullOrEmpty(oldmt)) { // It is a modification. Remove the old name. entry.MimeTypes.Remove(oldmt); } else { // Add a new line, so the user can add several types at a time TreeIter newit = storeMimeTypes.AppendValues("", ""); treeMimeTypes.Selection.SelectIter(newit); treeMimeTypes.ScrollToCell(storeMimeTypes.GetPath(newit), treeMimeTypes.Columns [0], false, 0f, 0f); treeMimeTypes.SetCursor(storeMimeTypes.GetPath(newit), treeMimeTypes.Columns [0], true); NotifyChanged(); } } } else { storeMimeTypes.Remove(ref iter); if (!string.IsNullOrEmpty(oldmt)) { entry.MimeTypes.Remove(oldmt); } } } }
void HandleOnEditKey(object o, Gtk.EditedArgs e) { entryKeyCell.Editable = false; Gtk.TreeIter iter; if (storeEntries.GetIterFromString(out iter, e.Path)) { string key = e.NewText; if (key.Length > 0) { entry.SetEntry(key, ""); storeEntries.SetValue(iter, 0, "<b>" + key + "</b>"); storeEntries.SetValue(iter, 1, key); treeEntries.SetCursor(storeEntries.GetPath(iter), treeEntries.Columns [1], true); NotifyChanged(); } else { storeEntries.Remove(ref iter); } } }
protected void OnEdited(object sender, Gtk.EditedArgs args) { int rowIndex = 0; // Get current position TreePath rowPath; TreeIter rowPointer; // Convert path in row and rowPointer rowPath = new Gtk.TreePath(args.Path); this.tvCategories.Model.GetIter(out rowPointer, rowPath); rowIndex = rowPath.Indices[0]; try { this.agendaSystem.CategoryList.Modify(rowIndex, args.NewText); this.tvCategories.Model.SetValue(rowPointer, 0, args.NewText); } catch (Exception exc) { Util.MsgError(this, AppInfo.Name, exc.Message); args.RetVal = false; } }
private void TextNodeCellEdited(object o, Gtk.EditedArgs args) { Gtk.TreeIter iter; INodeCellRenderer cell = o as INodeCellRenderer; CellRendererText cellText = o as CellRendererText; if (cell != null) { // Resolve path as it was passed in the arguments Gtk.TreePath tp = new Gtk.TreePath(args.Path); // Change value in the original object if (YTreeModel.Adapter.GetIter(out iter, tp)) { object obj = YTreeModel.NodeFromIter(iter); if (cell.DataPropertyInfo != null && cell.DataPropertyInfo.CanWrite) { cell.DataPropertyInfo.SetValue(obj, args.NewText, null); } } } }
void OnExpEdited(object s, Gtk.EditedArgs args) { OnEndEditing(); TreeIter it; if (!store.GetIterFromString(out it, args.Path)) { return; } if (store.GetValue(it, ObjectCol) == null) { if (args.NewText.Length > 0) { valueNames.Add(args.NewText); Refresh(); } } else { string exp = (string)store.GetValue(it, NameCol); if (args.NewText == exp) { return; } int i = valueNames.IndexOf(exp); if (args.NewText.Length != 0) { valueNames [i] = args.NewText; } else { valueNames.RemoveAt(i); } Refresh(); } }
void OnTaskNameEdited(object sender, Gtk.EditedArgs args) { Gtk.TreeIter iter; Gtk.TreePath path = new TreePath(args.Path); if (!Model.GetIter(out iter, path)) { return; } ITask task = Model.GetValue(iter, 0) as ITask; if (task == null) { return; } string newText = args.NewText; // Attempt to derive due date information from text. if (Application.Preferences.GetBool(Preferences.ParseDateEnabledKey) && task.State == TaskState.Active && task.DueDate == DateTime.MinValue) { string parsedTaskText; DateTime parsedDueDate; TaskParser.Instance.TryParse(newText, out parsedTaskText, out parsedDueDate); if (parsedDueDate != DateTime.MinValue) { task.DueDate = parsedDueDate; } newText = parsedTaskText; } task.Name = newText; }
void OnTaskPriorityEdited(object sender, Gtk.EditedArgs args) { Gtk.TreeIter iter; Gtk.TreePath path = new TreePath(args.Path); if (store_sort.GetIter(out iter, path) == false) { return; } TaskPriority new_priority; if (args.NewText.CompareTo(Catalog.GetString("Low")) == 0) { new_priority = TaskPriority.Low; } else if (args.NewText.CompareTo(Catalog.GetString("Normal")) == 0) { new_priority = TaskPriority.Normal; } else if (args.NewText.CompareTo(Catalog.GetString("High")) == 0) { new_priority = TaskPriority.High; } else { new_priority = TaskPriority.Undefined; } // Update the priority if it's different Task task = store_sort.GetValue(iter, 0) as Task; if (task.Priority != new_priority) { task.Priority = new_priority; } }
void OnTaskPriorityEdited(object sender, Gtk.EditedArgs args) { Gtk.TreeIter iter; Gtk.TreePath path = new TreePath(args.Path); if (!Model.GetIter(out iter, path)) { return; } TaskPriority newPriority; if (args.NewText.CompareTo(Catalog.GetString("3")) == 0) { newPriority = TaskPriority.Low; } else if (args.NewText.CompareTo(Catalog.GetString("2")) == 0) { newPriority = TaskPriority.Medium; } else if (args.NewText.CompareTo(Catalog.GetString("1")) == 0) { newPriority = TaskPriority.High; } else { newPriority = TaskPriority.None; } // Update the priority if it's different ITask task = Model.GetValue(iter, 0) as ITask; if (task.Priority != newPriority) { task.Priority = newPriority; } }
void OnServicePriceEdited(object o, EditedArgs args) { TreeIter iter; if (!ServiceListStore.GetIterFromString (out iter, args.Path)) return; decimal Price; decimal count = (decimal)ServiceListStore.GetValue (iter, (int)ServiceCol.count); if (decimal.TryParse (args.NewText, out Price)) { ServiceListStore.SetValue (iter, (int)ServiceCol.price, Price); ServiceListStore.SetValue (iter, (int)ServiceCol.sum, Price * count); CalculateServiceSum (); } }
void OnServiceMinSumEdited(object o, EditedArgs args) { TreeIter iter; if (!ServiceListStore.GetIterFromString (out iter, args.Path)) return; decimal MinSum; if (decimal.TryParse (args.NewText, out MinSum)) { ServiceListStore.SetValue (iter, (int)ServiceCol.min_pay, MinSum); } }
private void EditStimAmp(object sender, Gtk.EditedArgs args) { EditStimTable(sender, args, "amp"); }
private void OnVisibilityEdited (object sender, EditedArgs args) { TreeIter iter; if (store.GetIterFromString (out iter, args.Path)) store.SetValue (iter, colVisibilityIndex, args.NewText); }
// ========== Order Value Edited ========== protected void OnOrderValueEdited(object sender, Gtk.EditedArgs args) { if (this.CurrentOrder == null) { return; } Gtk.TreeIter iter; this.OrderTreeStore.GetIter(out iter, new Gtk.TreePath(args.Path)); string propertyName = (string)this.OrderTreeStore.GetValue(iter, 0); string propertyValueOld = (string)this.OrderTreeStore.GetValue(iter, 1); string propertyValue = args.NewText; if (propertyValue == propertyValueOld) { return; } try { if (propertyName == "Customer Name") { this.CurrentOrder.CustomerName = propertyValue; } if (propertyName == "Customer Email") { this.CurrentOrder.CustomerEmail = propertyValue; this.OrderEmailLabel.Text = this.CurrentOrder.CustomerEmail; } if (propertyName == "Customer Phone") { this.CurrentOrder.CustomerPhone = propertyValue; } if (propertyName == "Postcode") { this.CurrentOrder.Postcode = propertyValue; } if (propertyName == "Country") { this.CurrentOrder.Country = propertyValue; } if (propertyName == "Region") { this.CurrentOrder.Region = propertyValue; } if (propertyName == "City") { this.CurrentOrder.City = propertyValue; } if (propertyName == "Street") { this.CurrentOrder.Street = propertyValue; } if (propertyName == "Locality") { this.CurrentOrder.Locality = propertyValue; } if (propertyName == "Order Status") { this.CurrentOrder.OrderStatus = propertyValue; } if (propertyName == "Order Number") { this.CurrentOrder.OrderNumber = propertyValue; this.OrderNumberLabel.Text = this.CurrentOrder.OrderNumber; } if (propertyName == "Date") { this.CurrentOrder.OrderDate = propertyValue; } if (propertyName == "Total Weight") { this.CurrentOrder.OrderWeight = Convert.ToDouble(propertyValue); } if (propertyName == "Total Cost") { this.CurrentOrder.OrderCost = Convert.ToDouble(propertyValue); } if (propertyName == "Shipping Cost") { this.CurrentOrder.ShippingCost = Convert.ToDouble(propertyValue); } if (propertyName == "Tax") { this.CurrentOrder.TaxAmount = Convert.ToDouble(propertyValue); } if (propertyName == "Item Count") { this.CurrentOrder.ItemAmount = Convert.ToInt16(propertyValue); } if (propertyName == "Channel") { this.CurrentOrder.Channel = propertyValue; } if (propertyName == "Zone") { Zone zone = Zone.GetZone(propertyValue); if (zone != null) { this.CurrentOrder.Zone = zone; } else { Program.LogWarning("Order Editor", "The Zone: " + propertyValue + " does not exist, this is case sensitive."); return; } } if (propertyName == "Carrier Name") { Carrier carrier = Carrier.GetCarrier(propertyValue); if (carrier != null) { this.CurrentOrder.Carrier = carrier; } else { Program.LogWarning("Order Editor", "The Carrier: " + propertyValue + " does not exist, this is case sensitive."); return; } } if (propertyName == "Carrier Type") { this.CurrentOrder.CarrierType = propertyValue; } if (propertyName == "Carrier Service") { this.CurrentOrder.Service = propertyValue; } if (propertyName == "Carrier Enhancement") { this.CurrentOrder.Enhancement = propertyValue; } if (propertyName == "Carrier Format") { this.CurrentOrder.Format = propertyValue; } this.OrderTreeStore.SetValue(iter, 1, propertyValue); } catch (Exception e) { Program.LogError("Order Editor", "Invalid order input, please ensure that entries like Weight or Cost are numeric only, etc:\n" + e.ToString()); Program.LogException(e); return; } Program.Log("Order Editor", "Changed " + propertyName + " to " + propertyValue + "."); }
void item_name_Edited(object o, EditedArgs args) { Gtk.TreeModel mod; Gtk.TreeIter iter; TreePath[] paths = treeview_inv.Selection.GetSelectedRows(out mod); if (mod.GetIter(out iter, paths[0])) { InventoryBase item = (InventoryBase)mod.GetValue(iter, 3); if(item.UUID==MainClass.client.Inventory.Store.RootFolder.UUID || item.UUID==MainClass.client.Inventory.Store.LibraryFolder.UUID) { args.RetVal=true; return; } if(item is InventoryItem) MainClass.client.Inventory.MoveItem(item.UUID,item.ParentUUID,args.NewText); if(item is InventoryFolder) MainClass.client.Inventory.MoveFolder(item.UUID, item.ParentUUID, args.NewText); inventory.SetValue(filter.ConvertIterToChildIter(iter), 1, args.NewText); args.RetVal = false; } }
void OnCountSpinEdited(object o, EditedArgs args) { TreeIter iter; if (!NomenclatureStore.GetIterFromString (out iter, args.Path)) return; int count; if (int.TryParse (args.NewText, out count)) { NomenclatureStore.SetValue (iter, (int)NomenclatureCol.count, count); } }
private void OnTextEdited( object sender, EditedArgs args ) { TreeIter iter; store.GetIter( out iter, new TreePath( args.Path ) ); HTreeNode node = getNodeFromIter( iter ); node.Text = args.NewText; if( NodeEdited != null ) NodeEdited( this, new NodeEventArgs( node ) ); }
void OnCategoryEdited (object sender, EditedArgs args) { TreeIter iter; if (!store.GetIterFromString (out iter, args.Path)) return; string old = (string) store.GetValue (iter, 0); if (args.NewText.Length == 0) { options.Categories.Remove (old); store.Remove (ref iter); } else { int i = options.Categories.IndexOf (old); if (i == -1) options.Categories.Add (args.NewText); else options.Categories [i] = args.NewText; store.SetValue (iter, 0, args.NewText); } }
void OnPriceEdited(object o, EditedArgs args) { TreeIter iter; Decimal NewValue; if (!ComponentsStore.GetIterFromString (out iter, args.Path)) return; try { if (args.NewText == null) NewValue = 0; else NewValue = Decimal.Parse (args.NewText); ComponentsStore.SetValue(iter, (int)ComponentCol.price, (NewValue).ToString()); CalculateTotalPrice (); } catch(Exception e) { logger.Warn (e, "Error occured in OnPriceEdited");} }
void OnMaterialComboEdited(object o, EditedArgs args) { TreeIter iter, RefIter; if (!ComponentsStore.GetIterFromString (out iter, args.Path)) return; if(args.NewText == null) { logger.Warn("newtext is empty"); return; } if(ListStoreWorks.SearchListStore((ListStore)MaterialNameList, args.NewText, out RefIter)) { ComponentsStore.SetValue(iter, (int)ComponentCol.material, args.NewText); ComponentsStore.SetValue(iter, (int)ComponentCol.material_id, MaterialNameList.GetValue(RefIter, 1)); } }
void OnDiscountEdited(object o, EditedArgs args) { TreeIter iter; int discount; if (!ComponentsStore.GetIterFromString (out iter, args.Path)) return; if (args.NewText == null){ logger.Warn ("text is empty"); return; } if (int.TryParse (args.NewText, out discount)) { ComponentsStore.SetValue (iter, (int)ComponentCol.discount, discount); CalculateTotalPrice (); } }
private void EditStimDur(object sender, Gtk.EditedArgs args) { EditStimTable(sender, args, "dur"); }
private void HandleExcludedAssembliesEdited(object o, EditedArgs args) { EditItem(this.treeviewExcludedAssemblies, args); }
void OnCostSpinEdited(object o, EditedArgs args) { TreeIter iter; if (!ServiceListStore.GetIterFromString (out iter, args.Path)) return; double Cost; if (double.TryParse (args.NewText, out Cost)) { ServiceListStore.SetValue (iter, 3, Cost); CalculateTotal (); } }
private void SpinTest1Edited(object o, EditedArgs args) { Console.WriteLine("SpinTest1Edited()"); // Note: The args.NewText value must be parsed into the same // data type specified for the column in the model. If it isn't then // the model's SetValue() method will not work. float val; if (!float.TryParse(args.NewText, out val)) { // Maybe alert the user of invalid data entered here. return; } TreeIter iter; this.listStore1.GetIterFromString(out iter, args.Path); this.listStore1.SetValue(iter, (int)Column.Spin, val); }
private void OnAmountEdited (object sender, EditedArgs args) { TreeModel filter = locationsView.Model; TreeIter iter; filter.GetIter (out iter, new TreePath (args.Path)); (filter.GetValue (iter, 0) as Location).Amount = int.Parse(args.NewText); }
/// <summary>User has finished renamed a node.</summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="NodeLabelEditEventArgs"/> instance containing the event data.</param> private void OnAfterLabelEdit(object sender, EditedArgs e) { // TreeView.ContextMenuStrip = this.PopupMenu; if (Renamed != null && !string.IsNullOrEmpty(e.NewText)) { NodeRenameArgs args = new NodeRenameArgs() { NodePath = this.nodePathBeforeRename, NewName = e.NewText }; Renamed(this, args); if (!args.CancelEdit) previouslySelectedNodePath = args.NodePath; } }
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; } } }
private void EditStimTable(object sender, Gtk.EditedArgs args, string type) { Gtk.TreeIter iter; _handles.stimListStore.GetIter(out iter, new TreePath(args.Path)); string Oldname = (string)_handles.stimListStore.GetValue(iter, 0); double Oldonset = (double)_handles.stimListStore.GetValue(iter, 1); double Olddur = (double)_handles.stimListStore.GetValue(iter, 2); double Oldamp = (double)_handles.stimListStore.GetValue(iter, 3); string name = (string)_handles.stimListStore.GetValue(iter, 0); double onset = (double)_handles.stimListStore.GetValue(iter, 1); double dur = (double)_handles.stimListStore.GetValue(iter, 2); double amp = (double)_handles.stimListStore.GetValue(iter, 3); _handles.stimListStore.Remove(ref iter); if (type.Equals("name")) { name = args.NewText; } else if (type.Equals("onset")) { onset = Convert.ToDouble(args.NewText); } else if (type.Equals("dur")) { dur = Convert.ToDouble(args.NewText); } else if (type.Equals("amp")) { amp = Convert.ToDouble(args.NewText); } _handles.stimListStore.AppendValues(name, onset, dur, amp); _handles.stimListStore.SetSortColumnId(1, SortType.Ascending); nirs.Stimulus ev; nirs.Stimulus ev2 = new nirs.Stimulus();; for (int i = 0; i < nirsdata[0].stimulus.Count; i++) { ev = nirsdata[0].stimulus[i]; if (ev.name == Oldname) { for (int j = 0; j < ev.onsets.Count; j++) { if (ev.onsets[j] == Oldonset) { if (type.Equals("name")) { ev.onsets.RemoveAt(j); ev.duration.RemoveAt(j); ev.amplitude.RemoveAt(j); nirsdata[0].stimulus[i] = ev; bool found = false; for (int k = 0; k < nirsdata[0].stimulus.Count; k++) { ev2 = nirsdata[0].stimulus[k]; if (ev2.name == name) { ev2.amplitude.Add(amp); ev2.duration.Add(dur); ev2.onsets.Add(onset); nirsdata[0].stimulus[k] = ev2; found = true; } } if (!found) { ev2.name = name; ev2.amplitude = new List <double>(); ev2.duration = new List <double>(); ev2.onsets = new List <double>(); ev2.amplitude.Add(amp); ev2.duration.Add(dur); ev2.onsets.Add(onset); nirsdata[0].stimulus.Add(ev2); } } else { ev.onsets[j] = onset; ev.duration[j] = dur; ev.amplitude[j] = amp; nirsdata[0].stimulus[i] = ev; } } } } } drawingarea_Data.QueueDraw(); drawingarea_Data2.QueueDraw(); return; }
private void HandleAdditionnalLibrariesEdited(object o, EditedArgs args) { EditItem(this.treeviewAdditionnalLibraries, args); }
private void NameEdited (object sender, EditedArgs args) { TreeIter iter; if (store.GetIterFromString (out iter, args.Path)) { if (!string.IsNullOrEmpty (args.NewText)) { store.SetValue (iter, colNameIndex, args.NewText); EmitContentChanged (); } else { string oldText = store.GetValue (iter, colNameIndex) as string; (sender as CellRendererText).Text = oldText; } } }
void OnAttributeEdit(object o, EditedArgs args) { TreeIter iter; if (!attrListStore.GetIterFromString (out iter, args.Path)) return; string oldText = (string) attrListStore.GetValue (iter, 2); if (oldText.Equals (args.NewText)) return; attrListStore.SetValue (iter, 2, args.NewText); }
private void DeleteActionEdited (object sender, EditedArgs args) { TreeIter iter; if (store.GetIterFromString (out iter, args.Path)) { if (IsValidForeignKeyAction (args.NewText)) { store.SetValue (iter, colDeleteActionIndex, args.NewText); EmitContentChanged (); } else { string oldText = store.GetValue (iter, colDeleteActionIndex) as string; (sender as CellRendererText).Text = oldText; } } }
private void TextStringEdited(object o, EditedArgs args) { Console.WriteLine("TextStringEdited()"); TreeIter iter; this.listStore1.GetIterFromString(out iter, args.Path); this.listStore1.SetValue(iter, (int)Column.TextString, args.NewText); }
void OnCashComboEdited(object o, EditedArgs args) { TreeIter iter; if (!ServiceListStore.GetIterFromString (out iter, args.Path)) return; if(args.NewText == null){ return; } ServiceListStore.SetValue(iter, (int)ServiceCol.cash, args.NewText); TreeIter CashIter; if (!CashNameList.GetIterFirst (out CashIter)) return; do { if(CashNameList.GetValue (CashIter,0).ToString () == args.NewText) { ServiceListStore.SetValue (iter, (int)ServiceCol.cash_id, CashNameList.GetValue (CashIter, 1)); object[] Values = (object[]) CashNameList.GetValue (CashIter, 2); ServiceListStore.SetValue (iter, (int)ServiceCol.row_color, Values[2] != DBNull.Value ? (string)Values[2] : null) ; break; } } while(CashNameList.IterNext (ref CashIter)); TestCanSave (); CalculateServiceSum (); }
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 (); }
void OnServiceComboEdited(object o, EditedArgs args) { TreeIter iter; if (!ServiceListStore.GetIterFromString (out iter, args.Path)) return; if(args.NewText == null){ return; } ServiceListStore.SetValue(iter, (int)ServiceCol.service, args.NewText); TreeIter ServiceIter; if (!ServiceRefListStore.GetIterFirst (out ServiceIter)) return; do { if(args.NewText.Equals (ServiceRefListStore.GetValue (ServiceIter, 1).ToString ())) { ServiceListStore.SetValue (iter, (int)ServiceCol.service_id, ServiceRefListStore.GetValue (ServiceIter,0)); ServiceListStore.SetValue (iter, (int)ServiceCol.units, ServiceRefListStore.GetValue (ServiceIter,3)); bool choice = (bool) ServiceRefListStore.GetValue (ServiceIter,4); ServiceListStore.SetValue (iter, (int)ServiceCol.by_aria, choice); if(choice) ServiceListStore.SetValue (iter, (int)ServiceCol.count, PlaceArea); break; } } while(ServiceRefListStore.IterNext (ref ServiceIter)); TestCanSave (); }
public void ComboboxEdited (object o, EditedArgs args) { TreeIter iter; if (model.GetIterFromString (out iter, args.Path)) { var info = GetProperty (model, iter); if (info == null) return; var value = ConvertProperty (info.PropertyType, args.NewText); info.SetValue (dialog.profile, value, null); dialog.UpdateExample (model, iter); } }
void OnServiceCountEdited(object o, EditedArgs args) { TreeIter iter; if (!ServiceListStore.GetIterFromString (out iter, args.Path)) return; decimal Price = (decimal)ServiceListStore.GetValue (iter, (int)ServiceCol.price); decimal count; if(decimal.TryParse(args.NewText, out count)) { logger.Debug ("Parsed:{0}", count); ServiceListStore.SetValue (iter, (int)ServiceCol.count, count); ServiceListStore.SetValue (iter, (int)ServiceCol.sum, Price * count); CalculateServiceSum (); } }