2 #include "view_properties.h"
4 ViewProperties::ViewProperties ():Frame ()
6 vbox.pack_start (node_num, false, false, 5);
7 vbox.pack_start (node_level, false, false, 5);
8 vbox.pack_start (node_items, false, false, 5);
9 vbox.pack_start (node_freespace, false, false, 5);
11 vbox.pack_start (data_type, false, false, 5);
12 vbox.pack_start (data_key, false, false, 5);
13 vbox.pack_start (data_child, false, false, 5);
17 set_label ("Propiedades");
18 set_shadow_type(Gtk::SHADOW_NONE);
21 void ViewProperties::ShowItem (BTreeData *data, BTreeNodeHeader &header)
23 std::string s1, s2, s3;
24 std::stringstream ss1, ss2, ss3;
28 node_level.set_label ("Nivel : " + s1);
30 ss2 << header.item_count;
32 node_items.set_label ("Items : " + s2);
34 ss3 << header.free_space;
36 node_freespace.set_label ("Libre : " + s3);
38 if (dynamic_cast<BTreeChildData *>(data)) {
39 data_type.set_label ("Tipo : BTreeChildData");
40 data_key.set_label ("");
43 std::stringstream ss4;
44 ss4 << data->getChild ();
46 data_child.set_label ("Hijo Izquierdo : " + s4);
47 } else if (dynamic_cast<BTreeLeafData *>(data)) {
48 data_type.set_label ("Tipo : BTreeLeafData");
49 data_child.set_label ("");
51 std::string s4 = *(data->getClave ());
52 data_child.set_label ("Clave : " + s4);
54 data_type.set_label ("Tipo : BTreeData");
57 std::stringstream ss4;
58 ss4 << data->getChild ();
60 data_child.set_label ("Hijo Derecho : " + s4);
62 std::string s5 = *(data->getClave ());
63 data_key.set_label ("Clave : " + s5);