2 #include "view_properties.h"
4 ViewProperties::ViewProperties ():Frame ()
6 lnode_num.set_use_markup (true);
7 lnode_level.set_use_markup (true);
8 lnode_items.set_use_markup (true);
9 lnode_freespace.set_use_markup (true);
10 ldata_type.set_use_markup (true);
11 ldata_key.set_use_markup (true);
12 ldata_child.set_use_markup (true);
14 lnode_num.set_label ("<b>Nodo</b> :");
15 lnode_level.set_label ("<b>Nivel</b> : ");
16 lnode_items.set_label ("<b>Items</b> :");
17 lnode_freespace.set_label ("<b>Libre</b> :");
18 ldata_type.set_label ("<b>Tipo</b> :");
19 ldata_key.set_label ("<b>Clave</b> : ");
20 ldata_child.set_label ("<b>Hijo</b> : ");
22 lnode_num.set_alignment(Gtk::JUSTIFY_LEFT);
23 lnode_level.set_alignment(Gtk::JUSTIFY_LEFT);
24 lnode_items.set_alignment(Gtk::JUSTIFY_LEFT);
25 lnode_freespace.set_alignment(Gtk::JUSTIFY_LEFT);
26 ldata_type.set_alignment(Gtk::JUSTIFY_LEFT);
27 ldata_key.set_alignment(Gtk::JUSTIFY_LEFT);
28 ldata_child.set_alignment(Gtk::JUSTIFY_LEFT);
30 table.attach (lnode_num, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
31 table.attach (lnode_level, 0, 1, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
32 table.attach (lnode_items, 0, 1, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
33 table.attach (lnode_freespace, 0, 1, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
34 table.attach (ldata_type, 0, 1, 4, 5, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
35 table.attach (ldata_key, 0, 1, 5, 6, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
36 table.attach (ldata_child, 0, 1, 6, 7, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
38 table.attach (node_num, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
39 table.attach (node_level, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
40 table.attach (node_items, 1, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
41 table.attach (node_freespace, 1, 2, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
42 table.attach (data_type, 1, 2, 4, 5, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
43 table.attach (data_key, 1, 2, 5, 6, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
44 table.attach (data_child, 1, 2, 6, 7, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
47 set_label ("Propiedades");
48 set_shadow_type(Gtk::SHADOW_NONE);
49 set_size_request (200, 0);
52 void ViewProperties::ShowItem (BTreeData *data, BTreeNodeHeader &header)
54 std::string s1, s2, s3;
55 std::stringstream ss1, ss2, ss3;
57 node_num.set_label ("TODO");
61 node_level.set_label (s1);
63 ss2 << header.item_count;
65 node_items.set_label (s2);
67 ss3 << header.free_space;
69 node_freespace.set_label (s3);
71 if (dynamic_cast<BTreeChildData *>(data)) {
72 data_type.set_label ("BTreeChildData");
73 data_key.set_label ("N/C");
76 std::stringstream ss4;
77 ss4 << data->getChild ();
79 data_child.set_label (s4);
80 } else if (dynamic_cast<BTreeLeafData *>(data)) {
81 data_type.set_label ("BTreeLeafData");
82 data_child.set_label ("N/C");
84 std::string s4 = *(data->getClave ());
85 data_child.set_label (s4);
87 data_type.set_label ("BTreeData");
90 std::stringstream ss4;
91 ss4 << data->getChild ();
93 data_child.set_label (s4);
95 std::string s5 = *(data->getClave ());
96 data_key.set_label (s5);