X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/467f3bcabe798b584e470038c3169c374874b18b..6079e1eac2e861165a321fa81a257bb4cb149071:/nviewer/w_btree.cpp diff --git a/nviewer/w_btree.cpp b/nviewer/w_btree.cpp index ae14245..a5a819b 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 ()-2, 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,12 @@ 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); +} + +void wBTree::Show () +{ + wnode->Show (); + Window::Show (); }