area.add (canvas);
hbox.pack_start (area);
- hbox.pack_end (frame, true, true, 10);
+ hbox.pack_start (frame, false, false, 10);
+ frame.set_size_request (200, 200);
Glib::RefPtr<Gtk::ActionGroup> actiongroup = Gtk::ActionGroup::create();
double ViewBTree::node_height = 0;
ViewBTree::ViewBTree (Canvas::Group *parent, std::string filename, uint block_size, int type):Canvas::Group (*parent, 0, 0),
- BTree (filename, block_size, type)
+ BTree (filename, block_size, BTree::TYPE_UNIQUE, type)
{
/* Cada bytes lo hago de 5 units de ancho */
node_width = 5 * block_size;
table.property_column_spacing () = 8;
table.property_row_spacing () = 8;
- add (table);
+
+ hbox.pack_start (table, false, true, 8);
+ hbox.pack_start (raw_view, true, true, 8);
+
+ table.set_size_request (250, 0);
+
+ add (hbox);
property_label_xalign () = 0;
set_label ("Propiedades");
ss3 >> s3;
node_freespace.set_label (s3);
+ raw_view.get_buffer ()->assign (ToRaw (data));
+
if (dynamic_cast<BTreeChildData *>(data)) {
data_type.set_label ("BTreeChildData");
data_key.set_label ("N/C");
}
}
+std::string ViewProperties::ToRaw (BTreeData *p)
+{
+ std::stringstream ss;
+ uint size = p->Size (), i;
+ uchar *arr = p->ToArray ();
+
+ for (i=0; i < size; i++) {
+ if (isalnum (arr[i]))
+ ss << arr[i];
+ else
+ ss << ".";
+ }
+
+ delete [] arr;
+ return ss.str ();
+}
+
void ShowItem (BTreeData *, BTreeNodeHeader &header);
private:
+ std::string ToRaw (BTreeData *);
+
Gtk::Table table;
+ Gtk::HBox hbox;
+ Gtk::TextView raw_view;
/* Node Info */
Gtk::Label node_num;