X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/467f3bcabe798b584e470038c3169c374874b18b..b9869b55bfb58a28c42aa62b5a45fc7d7b5fdcc4:/nviewer/w_btree.cpp?ds=sidebyside diff --git a/nviewer/w_btree.cpp b/nviewer/w_btree.cpp index ae14245..5cddabb 100644 --- a/nviewer/w_btree.cpp +++ b/nviewer/w_btree.cpp @@ -2,9 +2,10 @@ #include #include "w_btree.h" -wBTree::wBTree ():Window ("TreeMulator", 0, 0) +wBTree::wBTree (Window *p):Window (p, "", p->Width()-2, p->Height ()-5, 1, 1, true) { last_length = 0; + wnode = new wNodeHeader (this, p->Width () - 30, 2); } wBTree::~wBTree () @@ -50,6 +51,8 @@ void wBTree::ShowNode (uint node_num) wattron (win, COLOR_PAIR (2)); else wattron (win, COLOR_PAIR (3)); + mvwaddnstr (win, y, x, " ", 1); + x++; mvwaddnstr (win, y, x, (const char *)(s.c_str ()), s.length ()); if (n%2) wattroff (win, COLOR_PAIR (2)); @@ -60,6 +63,14 @@ void wBTree::ShowNode (uint node_num) it++; } last_length = x; - mvwaddstr (win, 20, 5, "Ir al nodo (-1 para salir) : "); + wnode->ShowHeader (node_num, node_header); + + Show (); +} + +void wBTree::Show () +{ + wnode->Show (); + Window::Show (); }