From 41ae290f8d3c5b30968d9ea94e8945d9cb66e0ca Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Tue, 22 Nov 2005 17:04:25 +0000 Subject: [PATCH] Cuando agrego una clave la selecciono. --- viewer/main.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/viewer/main.cpp b/viewer/main.cpp index 16f20e3..aa0746a 100644 --- a/viewer/main.cpp +++ b/viewer/main.cpp @@ -215,8 +215,28 @@ void agregar_clave () ClaveVariable c(str_key, atoi(str_val.c_str())); tree->AddKey(c); } - delete tree->last_selected; - tree->AddNode (0); + + /* Muestro la clave agregada */ + BTreeFindResult* result = 0; + Clave *c = NULL; + if (tree->type() == BTree::KEY_FIXED) { + c = new ClaveFija (atoi(str_key.c_str()), 0); + result = tree->FindKey(*c); + } else { + c = new ClaveVariable (str_key, 0); + result = tree->FindKey(*c); + } + if (result) { + tree->Clear (); + tree->AddNode(result->node); + tree->HighliteKey (*c); + delete result; + } else { + delete tree->last_selected; + tree->last_selected = NULL; + tree->AddNode (0); + } + if (c) delete c; real_canvas->scroll_to (0, 0); } } @@ -246,7 +266,6 @@ void borrar_clave () } delete tree->last_selected; tree->AddNode (0); - real_canvas->scroll_to (0, 0); } } -- 2.43.0