void MapTitle(ListViewColumn col, Gtk.TreeViewColumn tc) { if (col.HeaderView == null) { tc.Title = col.Title; } else { tc.Widget = CellUtil.CreateCellRenderer(ApplicationContext, col.HeaderView); tc.Widget?.Show(); } }
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); } } }
protected override void OnToggled(string path) { CellUtil.SetCurrentEventRow(treeBackend, path); IDataField field = (IDataField)view.StateField ?? view.ActiveField; if (!view.RaiseToggled() && (field != null)) { Type type = field.FieldType; Gtk.TreeIter iter; if (treeModel.GetIterFromString(out iter, path)) { CheckBoxState newState; if (view.AllowMixed && type == typeof(CheckBoxState)) { if (Inconsistent) { newState = CheckBoxState.Off; } else if (Active) { newState = CheckBoxState.Mixed; } else { newState = CheckBoxState.On; } } else { if (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); } } base.OnToggled(path); }
void HandleToggled(object o, ToggledArgs args) { SetCurrentEventRow(); var view = (IToggleCellViewFrontend)Frontend; IDataField field = (IDataField)(view as ICheckBoxCellViewFrontend)?.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 (type == typeof(CheckBoxState) && ((ICheckBoxCellViewFrontend)view).AllowMixed) { 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); } } }
protected override void OnEdited(string path, string new_text) { CellUtil.SetCurrentEventRow(treeBackend, path); if (!view.RaiseTextChanged() && view.TextField != null) { Gtk.TreeIter iter; if (treeModel.GetIterFromString(out iter, path)) { CellUtil.SetModelValue(treeModel, iter, view.TextField.Index, view.TextField.FieldType, new_text); } } base.OnEdited(path, new_text); }
void MapColumn(ListViewColumn col, Gtk.TreeViewColumn tc) { foreach (var k in cellViews.Where(e => e.Value.Column == tc).Select(e => e.Key).ToArray()) { cellViews.Remove(k); } foreach (var v in col.Views) { var r = CellUtil.CreateCellRenderer(ApplicationContext, Frontend, this, tc, v); cellViews [v] = new CellInfo { Column = tc, Renderer = r }; } }
public object GetValue(Gtk.TreeIter it, int column) { return(CellUtil.GetModelValue(Store, it, column)); }
public void SetValue(Gtk.TreeIter it, int column, object value) { CellUtil.SetModelValue(Store, it, column, ColumnTypes [column], value); }
public object GetValue(IDataField field) { return(CellUtil.GetModelValue(TreeModel, CurrentIter, field.Index)); }
object ICellDataSource.GetValue(IDataField field) { return(CellUtil.GetModelValue(treeModel, iter, field.Index)); }