X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/b4a23678596cdf0fd5993ec6650422a86d2012be..8d4a4f4d97c0275c9275e1934db6ffabbbbcffa5:/viewer/view_btree.h diff --git a/viewer/view_btree.h b/viewer/view_btree.h index 918a377..894bf5d 100644 --- a/viewer/view_btree.h +++ b/viewer/view_btree.h @@ -6,16 +6,40 @@ #include #include "btree.h" - -#define NODE_WIDTH 500 -#define NODE_HEIGHT 50 +#include "view_node.h" using namespace Gnome; +class ViewNode; + class ViewBTree : public Canvas::Group, public BTree { public: - ViewBTree (Canvas::Group *parent, std::string filename); + ViewBTree (Canvas::Group *parent, std::string filename, uint block_size, int tree_type, int type); + + void Clear (); + void HighliteKey (Clave &k); + + static double byte_to_pixels; + static double node_width; + static double node_height; + + typedef SigC::Signal2 type_signal_selected; + type_signal_selected signal_selected (); + protected: + type_signal_selected m_signal_selected; + int max_level; /* Lo saco de la raiz */ + /* Posicion X por nivel */ + std::map pos_x; + /* Control para no poner 2 veces un nodo */ + /* Un nodo que quiera ser puesto 2 veces es un bug :) */ + std::map node_placed; + + public: + void AddNode (uint num, uint padre = 0); + void on_item_selected (BTreeData *, uint, ViewNode *); + void on_item_activated (BTreeData *, uint, ViewNode *); + ViewNode *last_selected; }; #endif