]> git.llucax.com Git - z.facultad/75.52/treemulator.git/commitdiff
Agrego ViewProperties para ver propiedades de nodos.
authorRicardo Markiewicz <rmarkie@fi.uba.ar>
Sun, 25 Sep 2005 02:03:31 +0000 (02:03 +0000)
committerRicardo Markiewicz <rmarkie@fi.uba.ar>
Sun, 25 Sep 2005 02:03:31 +0000 (02:03 +0000)
viewer/Makefile
viewer/view_properties.cpp [new file with mode: 0644]
viewer/view_properties.h [new file with mode: 0644]

index b085b15c5bd670792bde8f01b5c5582184fad530..4f9fa9d2fe3507add420a6b7cbc0772daeb70709 100644 (file)
@@ -1,6 +1,6 @@
 TARGET=viewer
 CXXFLAGS=-Wall -g `pkg-config gtkmm-2.4 libgnomecanvasmm-2.6 --cflags` -I../src
-OBJECTS=main.o view_btree.o view_btree_data.o
+OBJECTS=main.o view_btree.o view_btree_data.o view_properties.o
 
 all: $(TARGET)
 
diff --git a/viewer/view_properties.cpp b/viewer/view_properties.cpp
new file mode 100644 (file)
index 0000000..cd48676
--- /dev/null
@@ -0,0 +1,38 @@
+
+#include "view_properties.h"
+
+ViewProperties::ViewProperties ():Frame ()
+{
+       vbox.pack_start (node_num, false, false, 5);
+       vbox.pack_start (node_level, false, false, 5);
+       vbox.pack_start (node_items, false, false, 5);
+       vbox.pack_start (node_freespace, false, false, 5);
+       
+       vbox.pack_start (data_type, false, false, 5);
+       vbox.pack_start (data_key, false, false, 5);
+       vbox.pack_start (data_child, false, false, 5);
+
+       add (vbox);
+       
+       set_label ("Propiedades");
+       set_shadow_type(Gtk::SHADOW_NONE);
+}
+
+void ViewProperties::ShowItem (BTreeData *, BTreeNodeHeader &header)
+{
+       std::string s1, s2, s3;
+       std::stringstream ss1, ss2, ss3;
+
+       ss1 << header.level;
+       ss1 >> s1;
+       node_level.set_label ("Nivel : " + s1);
+
+       ss2 << header.item_count;
+       ss2 >> s2;
+       node_items.set_label ("Items : " + s2);
+
+       ss3 << header.free_space;
+       ss3 >> s3;
+       node_freespace.set_label ("Libre : " + s3);
+}
+
diff --git a/viewer/view_properties.h b/viewer/view_properties.h
new file mode 100644 (file)
index 0000000..d86ea72
--- /dev/null
@@ -0,0 +1,30 @@
+
+#ifndef _VIEW_PROPERTIES_H_
+#define _VIEW_PROPERTIES_H_
+
+#include <gtkmm.h>
+#include "btree.h"
+#include "btree_data.h"
+
+class ViewProperties:public Gtk::Frame {
+       public:
+               ViewProperties ();
+
+               void ShowItem (BTreeData *, BTreeNodeHeader &header);
+       private:
+               Gtk::VBox vbox;
+
+               /* Node Info */
+               Gtk::Label node_num;
+               Gtk::Label node_level;
+               Gtk::Label node_items;
+               Gtk::Label node_freespace;
+               
+               /* BTreeData Into */
+               Gtk::Label data_type;
+               Gtk::Label data_key;
+               Gtk::Label data_child;
+};
+
+#endif
+