2 #include "new_tree_dialog.h"
5 NewTreeDialog::NewTreeDialog(): Gtk::Dialog ("Nuevo Arbol", true, true),
6 fixed_key ("Clave Fija"), variable_key ("Clave Variable"),
7 tree_ident ("Arbol de Indentificación"), tree_class ("Arbol de Clasificacion")
9 table.attach (tree_ident, 0, 1, 0, 1);
10 table.attach (tree_class, 1, 2, 0, 1);
12 table.attach (fixed_key, 0, 1, 1, 2);
13 table.attach (variable_key, 1, 2, 1, 2);
15 label_block.set_label ("Tamaño de Bloque : ");
16 table.attach (label_block, 0, 1, 2, 3, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8);
17 table.attach (entry_block, 1, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8);
19 label_count.set_label ("Cantidad a insertar : ");
20 table.attach (label_count, 0, 1, 3, 4, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8);
21 table.attach (entry_count, 1, 2, 3, 4, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8);
23 label_dels.set_label ("Cantidad a eliminar : ");
24 table.attach (label_dels, 0, 1, 4, 5, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8);
25 table.attach (entry_dels, 1, 2, 4, 5, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8);
27 get_vbox ()->add (table);
29 add_button (Gtk::StockID ("Cancelar"), Gtk::RESPONSE_CANCEL);
30 add_button (Gtk::StockID ("Crear"), Gtk::RESPONSE_OK);
32 Gtk::RadioButton::Group group = fixed_key.get_group();
33 fixed_key.set_group (group);
34 variable_key.set_group (group);
36 Gtk::RadioButton::Group group1 = tree_ident.get_group();
37 tree_ident.set_group (group1);
38 tree_class.set_group (group1);
42 uint NewTreeDialog::getAdds ()
44 return atoi (entry_count.get_text ().c_str());
47 uint NewTreeDialog::getDels ()
49 std::cout << entry_dels.get_text () << std::endl;
50 return atoi (entry_dels.get_text ().c_str());
53 uint NewTreeDialog::getBlockSize()
55 return atoi (entry_block.get_text ().c_str());
58 int NewTreeDialog::getKeyType ()
60 if (fixed_key.get_active ())
61 return BTree::KEY_FIXED;
63 return BTree::KEY_VARIABLE;
66 int NewTreeDialog::getTreeType ()
68 if (tree_ident.get_active ())
69 return BTree::TYPE_IDENTIFICACION;
71 return BTree::TYPE_CLASIFICACION;