5 #include <libgnomecanvasmm.h>
10 #include "view_node.h"
12 using namespace Gnome;
16 class ViewBTree : public Canvas::Group, public BTree {
18 ViewBTree (Canvas::Group *parent, std::string filename, uint block_size, int tree_type, int type);
21 void HighliteKey (Clave &k);
24 static double byte_to_pixels;
25 static double node_width;
26 static double node_height;
28 typedef SigC::Signal2<void, BTreeData *, BTreeNodeHeader&> type_signal_selected;
29 type_signal_selected signal_selected ();
31 type_signal_selected m_signal_selected;
32 int max_level; /* Lo saco de la raiz */
33 /* Posicion X por nivel */
34 std::map<uint,double> pos_x;
35 /* Control para no poner 2 veces un nodo */
36 /* Un nodo que quiera ser puesto 2 veces es un bug :) */
37 std::map<uint,bool> node_placed;
38 std::stack<uint> back;
42 void AddNode (uint num, uint padre = 0);
43 void on_item_selected (BTreeData *, uint, ViewNode *);
44 void on_item_activated (BTreeData *, uint, ViewNode *);
46 ViewNode *last_selected;