X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/84820a0fe02b9fdd63fb7c28d5a823bfa065c259..379ca6a2fb8c1feb74fb2e5cd78a5a1f5a2f7ab7:/viewer/view_btree.h diff --git a/viewer/view_btree.h b/viewer/view_btree.h index 8227609..18f4df7 100644 --- a/viewer/view_btree.h +++ b/viewer/view_btree.h @@ -4,19 +4,26 @@ #include #include +#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); + void GoBack (); static double byte_to_pixels; + static double node_width; + static double node_height; typedef SigC::Signal2 type_signal_selected; type_signal_selected signal_selected (); @@ -28,25 +35,15 @@ class ViewBTree : public Canvas::Group, public BTree { /* Control para no poner 2 veces un nodo */ /* Un nodo que quiera ser puesto 2 veces es un bug :) */ std::map node_placed; + std::stack back; + uint last_visited; - void AddNode (uint num); - void on_item_selected (BTreeData *, uint); - -}; - -class ViewNode : public Canvas::Group { public: - ViewNode (Canvas::Group *parent, uint num, BTreeNodeHeader &header, std::list &keys); - - std::list& getChilds () { return hijos; } + void AddNode (uint num, uint padre = 0); + void on_item_selected (BTreeData *, uint, ViewNode *); + void on_item_activated (BTreeData *, uint, ViewNode *); - typedef SigC::Signal2 type_signal_selected; - type_signal_selected signal_selected (); - private: - void on_item_clicked (BTreeData *data); - std::list hijos; - type_signal_selected m_signal_selected; - uint num; + ViewNode *last_selected; }; #endif