X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/1293383805edf6a327622ad8edc7a5e5687795dd..3498b60acda90a2686793d86500afb2c1225d714:/viewer/main.cpp?ds=sidebyside diff --git a/viewer/main.cpp b/viewer/main.cpp index 5d43759..16f20e3 100644 --- a/viewer/main.cpp +++ b/viewer/main.cpp @@ -21,6 +21,9 @@ using namespace Gnome::Canvas; " " " " " " +" " +" " +" " " " " " " " @@ -38,6 +41,7 @@ using namespace Gnome::Canvas; void nuevo_arbol (); void agregar_clave (); void borrar_clave (); +void ir_al_padre (); void buscar_clave (); void zoom_out (); void zoom_in (); @@ -76,6 +80,8 @@ int main(int argc, char *argv[]) actiongroup->add( Gtk::Action::create("MenuFile", "_Arbol") ); actiongroup->add( Gtk::Action::create("Nuevo", Gtk::Stock::NEW), &nuevo_arbol); actiongroup->add( Gtk::Action::create("Salir", Gtk::Stock::QUIT), Gtk::AccelKey ("q"), &Gtk::Main::quit); + actiongroup->add( Gtk::Action::create("MenuNode", "_Nodo") ); + actiongroup->add( Gtk::Action::create("Ir al Padre", Gtk::Stock::GO_BACK), Gtk::AccelKey ("b"), &ir_al_padre); actiongroup->add( Gtk::Action::create("MenuKey", "_Clave") ); actiongroup->add( Gtk::Action::create("Agregar Clave", Gtk::Stock::ADD), Gtk::AccelKey ("a"), &agregar_clave); actiongroup->add( Gtk::Action::create("Borrar Clave", Gtk::Stock::REMOVE), Gtk::AccelKey ("d"), &borrar_clave); @@ -244,6 +250,18 @@ void borrar_clave () } } +void ir_al_padre () +{ + if (!tree) + { + Gtk::MessageDialog d("No hay un arbol creado, por favor primero cree un arbol!", + false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); + d.run(); + return; + } + tree->GoBack (); +} + void buscar_clave () { if (!tree)