SetCurrentEventRow() public static method

public static SetCurrentEventRow ( TreeViewBackend treeBackend, string path ) : void
treeBackend TreeViewBackend
path string
return void
Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }