protected override void OnCancel(object sender, EventArgs args) { cbTyp.Active = origTyp; textEntry.Buffer.Clear(); var buff = textEntry.Buffer; API_Contract.ConvertDatabaseToEditCategorie(origDbText, ref buff); }
protected override void EditTreeRow(TreeView treeView, RowActivatedArgs args, object tabData) { this.tabName = (string)tabData; string typString = (string)currTreeStore.GetValue(currTreeIter, (int)CategorieColumnID.Typ); origDbText = (string)currTreeStore.GetValue(currTreeIter, (int)CategorieColumnID.Text); origRang = int.Parse((string)currTreeStore.GetValue(currTreeIter, (int)CategorieColumnID.Rang)); int activeTyp; // Get ParentIter and Type if (IsParent(args)) { // Parent Node, just get values currParentIter = currTreeIter; GtkHelper.FillComboBox(cbTyp, API_Contract.CategorieTextTypParentVal); activeTyp = API_Contract.CategorieTextParentTypCR[typString]; } else { // Child Node, get parent and values TreeIter parentIter; currTreeStore.IterParent(out parentIter, currTreeIter); currParentIter = parentIter; GtkHelper.FillComboBox(cbTyp, API_Contract.CategorieTextTypChildVal); activeTyp = API_Contract.CategorieTextChildTypCR[typString]; } // Set new values cbTyp.Active = activeTyp; textEntry.Buffer.Clear(); var buff = textEntry.Buffer; API_Contract.ConvertDatabaseToEditCategorie(origDbText, ref buff); // Set default values origText = buff.Text; origTyp = activeTyp; boldButton.Active = italicButton.Active = false; }