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 ("Árbol de Indentificación"), tree_class ("Árbol de Clasificación")
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_name.set_label ("Nombre de Archivo : ");
16 table.attach (label_name, 0, 1, 2, 3, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8);
17 table.attach (entry_name, 1, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8);
19 label_block.set_label ("Tamaño de Bloque : ");
20 table.attach (label_block, 0, 1, 3, 4, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8);
21 table.attach (entry_block, 1, 2, 3, 4, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8);
23 label_count.set_label ("Cantidad a insertar : ");
24 table.attach (label_count, 0, 1, 4, 5, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8);
25 table.attach (entry_count, 1, 2, 4, 5, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8);
27 label_dels.set_label ("Cantidad a eliminar : ");
28 table.attach (label_dels, 0, 1, 5, 6, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8);
29 table.attach (entry_dels, 1, 2, 5, 6, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8);
31 get_vbox ()->add (table);
33 add_button (Gtk::StockID ("Cancelar"), Gtk::RESPONSE_CANCEL);
34 add_button (Gtk::StockID ("Crear"), Gtk::RESPONSE_OK);
36 Gtk::RadioButton::Group group = fixed_key.get_group();
37 fixed_key.set_group (group);
38 variable_key.set_group (group);
40 Gtk::RadioButton::Group group1 = tree_ident.get_group();
41 tree_ident.set_group (group1);
42 tree_class.set_group (group1);
46 uint NewTreeDialog::getAdds ()
48 return atoi (entry_count.get_text ().c_str());
51 uint NewTreeDialog::getDels ()
53 std::cout << entry_dels.get_text () << std::endl;
54 return atoi (entry_dels.get_text ().c_str());
57 uint NewTreeDialog::getBlockSize()
59 return atoi (entry_block.get_text ().c_str());
62 std::string NewTreeDialog::getName ()
64 return entry_name.get_text ();
67 int NewTreeDialog::getKeyType ()
69 if (fixed_key.get_active ())
70 return BTree::KEY_FIXED;
72 return BTree::KEY_VARIABLE;
75 int NewTreeDialog::getTreeType ()
77 if (tree_ident.get_active ())
78 return BTree::TYPE_IDENTIFICACION;
80 return BTree::TYPE_CLASIFICACION;