X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/d76cfcfa2ef1363786c12ede4780e99d1bf02803..89e087a53e76331615252ec4e79830f755dbed6a:/viewer/new_tree_dialog.cpp?ds=inline diff --git a/viewer/new_tree_dialog.cpp b/viewer/new_tree_dialog.cpp index 7899cc9..edb1f5a 100644 --- a/viewer/new_tree_dialog.cpp +++ b/viewer/new_tree_dialog.cpp @@ -2,31 +2,56 @@ #include "new_tree_dialog.h" -NewTreeDialog::NewTreeDialog(): Gtk::Dialog ("Nuevo Arbol", true, true) +NewTreeDialog::NewTreeDialog(): Gtk::Dialog ("Nuevo Arbol", true, true), + fixed_key ("Clave Fija"), variable_key ("Clave Variable") { + table.attach (fixed_key, 0, 1, 0, 1); + table.attach (variable_key, 1, 2, 0, 1); + label_block.set_label ("Tamaño de Bloque : "); - table.attach (label_block, 0, 1, 0, 1, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8); - table.attach (entry_block, 1, 2, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8); + table.attach (label_block, 0, 1, 1, 2, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8); + table.attach (entry_block, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8); label_count.set_label ("Cantidad a insertar : "); - table.attach (label_count, 0, 1, 1, 2, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8); - table.attach (entry_count, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8); + table.attach (label_count, 0, 1, 2, 3, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8); + table.attach (entry_count, 1, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8); + + label_dels.set_label ("Cantidad a eliminar : "); + table.attach (label_dels, 0, 1, 3, 4, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8); + table.attach (entry_dels, 1, 2, 3, 4, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8); get_vbox ()->add (table); add_button (Gtk::StockID ("Cancelar"), Gtk::RESPONSE_CANCEL); add_button (Gtk::StockID ("Crear"), Gtk::RESPONSE_OK); + Gtk::RadioButton::Group group = fixed_key.get_group(); + fixed_key.set_group (group); + variable_key.set_group (group); show_all (); } -uint NewTreeDialog::getAmount () +uint NewTreeDialog::getAdds () { return atoi (entry_count.get_text ().c_str()); } +uint NewTreeDialog::getDels () +{ + std::cout << entry_dels.get_text () << std::endl; + return atoi (entry_dels.get_text ().c_str()); +} + uint NewTreeDialog::getBlockSize() { return atoi (entry_block.get_text ().c_str()); } +int NewTreeDialog::getKeyType () +{ + if (fixed_key.get_active ()) + return BTree::KEY_FIXED; + + return BTree::KEY_VARIABLE; +} +