nc print person

This commit is contained in:
vrd
2022-12-17 18:12:16 +02:00
parent 87dc80c9f8
commit 0da0f98dc9
5 changed files with 15 additions and 7 deletions
+1 -2
View File
@@ -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
+6 -3
View File
@@ -5,11 +5,13 @@
using std::cin; using std::cin;
using std::cout; using std::cout;
int main() int main()
{ {
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
initscr(); /* Start curses mode */ 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 test1("Dechkovi"); //addTree Dechkovi addTree Karamanovi load 0 load 1 (to work with these example trees)
Tree test2("Karamanovi"); Tree test2("Karamanovi");
@@ -51,10 +53,11 @@ int main()
firstTree.addRelation(2, Brother, 3); firstTree.addRelation(2, Brother, 3);
firstTree.addRelation(2, Brother, 4); firstTree.addRelation(2, Brother, 4);
firstTree.print(); /* firstTree.print(); */
firstTree.draw();
firstTree.saveTree(); firstTree.saveTree();
firstTree.printRel(3); /* firstTree.printRel(3); */
firstTree.printOldestAncestors(3); firstTree.printOldestAncestors(3);
+1 -1
View File
@@ -138,7 +138,7 @@ void Person::print()const
waddstr(info_tab, "Death: "); waddstr(info_tab, "Death: ");
death_.print(); 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); wrefresh(info_tab);
getch(); /* waint press */ getch(); /* waint press */
+4
View File
@@ -440,6 +440,10 @@ void Tree::removeRelation(const unsigned firstId, const unsigned secondId)
} }
} }
void Tree::draw() const
{
}
void Tree::print() const void Tree::print() const
{ {
+2
View File
@@ -55,6 +55,8 @@ public:
void removeRelation(const unsigned firstId, const unsigned secondId); void removeRelation(const unsigned firstId, const unsigned secondId);
void removeRelation(const char* firstName, const char* secondName); void removeRelation(const char* firstName, const char* secondName);
void draw() const;
void print()const; void print()const;
void printRel(const unsigned id)const; //Prints out close relatives void printRel(const unsigned id)const; //Prints out close relatives
void printMember(const unsigned id)const; void printMember(const unsigned id)const;