本文整理汇总了C#中Gtk.EditedArgs类的典型用法代码示例。如果您正苦于以下问题:C# EditedArgs类的具体用法?C# EditedArgs怎么用?C# EditedArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EditedArgs类属于Gtk命名空间,在下文中一共展示了EditedArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleEdited
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);
}
示例2: AliasEdited
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;
}
}
示例3: HandleEdited
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);
}
}
示例4: HandleSummaryCellEdited
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();
}
示例5: OnVisibilityEdited
private void OnVisibilityEdited (object sender, EditedArgs args)
{
TreeIter iter;
if (store.GetIterFromString (out iter, args.Path))
store.SetValue (iter, colVisibilityIndex, args.NewText);
}
示例6: OnAfterLabelEdit
/// <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;
}
}
示例7: SpinTest1Edited
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);
}
示例8: HandleExcludedAssembliesEdited
private void HandleExcludedAssembliesEdited(object o, EditedArgs args)
{
EditItem(this.treeviewExcludedAssemblies, args);
}
示例9: item_name_Edited
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;
}
}
示例10: OnCountSpinEdited
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);
}
}
示例11: OnCategoryEdited
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);
}
}
示例12: OnTextEdited
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 ) );
}
示例13: OnPriceEdited
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");}
}
示例14: OnMaterialComboEdited
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));
}
}
示例15: OnDiscountEdited
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 ();
}
}