From 0da0f98dc95e68d2f7106fba7e968e160d0a9b75 Mon Sep 17 00:00:00 2001 From: Venelin Date: Sat, 17 Dec 2022 18:12:16 +0200 Subject: [PATCH] nc print person --- compile_debug.sh | 3 +-- main.cpp | 9 ++++++--- person.cpp | 2 +- tree.cpp | 6 +++++- tree.h | 2 ++ 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/compile_debug.sh b/compile_debug.sh index 6bc7113..cdbd6c8 100755 --- a/compile_debug.sh +++ b/compile_debug.sh @@ -1,2 +1 @@ -g++ -o bin/debug/famt -std=gnu++20 -g -Og -Wall *.cpp -lncursesw - +g++ -o bin/debug/famt -std=gnu++20 -g -Og *.cpp -lncursesw diff --git a/main.cpp b/main.cpp index b7fac34..bc082d7 100644 --- a/main.cpp +++ b/main.cpp @@ -5,11 +5,13 @@ using std::cin; using std::cout; - int main() { setlocale(LC_ALL, ""); initscr(); /* Start curses mode */ + noecho(); + cbreak(); /* get input instantly */ + refresh(); /* if not present the first real refresh is missed */ /*Tree test1("Dechkovi"); //addTree Dechkovi addTree Karamanovi load 0 load 1 (to work with these example trees) Tree test2("Karamanovi"); @@ -51,10 +53,11 @@ int main() firstTree.addRelation(2, Brother, 3); firstTree.addRelation(2, Brother, 4); - firstTree.print(); + /* firstTree.print(); */ + firstTree.draw(); firstTree.saveTree(); - firstTree.printRel(3); + /* firstTree.printRel(3); */ firstTree.printOldestAncestors(3); diff --git a/person.cpp b/person.cpp index 5898897..46623e0 100644 --- a/person.cpp +++ b/person.cpp @@ -138,7 +138,7 @@ void Person::print()const waddstr(info_tab, "Death: "); death_.print(); - mvaddstr(LINES-1, 0, "Press any key to return."); + mvwaddstr(info_tab, LINES-1, 0, "Press any key to return."); wrefresh(info_tab); getch(); /* waint press */ diff --git a/tree.cpp b/tree.cpp index 7482861..cf96618 100644 --- a/tree.cpp +++ b/tree.cpp @@ -440,13 +440,17 @@ void Tree::removeRelation(const unsigned firstId, const unsigned secondId) } } +void Tree::draw() const +{ + +} void Tree::print() const { //for(const auto& member: people) // member.print(); for(int i=0; i