diff --git a/main.cpp b/main.cpp index c1504ca..fa80d8e 100644 --- a/main.cpp +++ b/main.cpp @@ -11,6 +11,7 @@ int main() /* Init ncurses */ initscr(); /* Start curses mode */ + curs_set(0); /* Hide cursor */ noecho(); cbreak(); /* get input instantly */ keypad(stdscr, true); diff --git a/person.cpp b/person.cpp index 4a55e28..60c3e4a 100644 --- a/person.cpp +++ b/person.cpp @@ -69,21 +69,6 @@ Person::Person(const char* name, EventTime birth, bool isMale, EventTime death) } -/*Person& Person::operator=(const Person &other) -{ - if (&other!=this) - { - rename(other.name); - numRel = other.numRel; - isMale = other.isMale; - day = other.day; - month = other.month; - year = other.year; - } - return *this; -}*/ - - bool Person::operator==(const Person &other)const { return name_ == other.name_ && isMale_ == other.isMale_; //TODO && day == other.day || !day || !other.day) && (month == other.month || !month || !other.month) && (year == other.year || !year || !other.year); @@ -125,7 +110,7 @@ void Person::rename(const char* newName) name_ = newName; } -void Person::print()const +void Person::displayInfo()const { info_tab = newwin(LINES, COLS, 0, 0); @@ -146,17 +131,6 @@ void Person::print()const werase(info_tab); wrefresh(info_tab); /* todo: dont update */ delwin(info_tab); - - /* cout << name_ << '\n'; */ - /* cout << (isMale_ ? "Male\n" : "Female\n"); */ - - /* cout << "Birth: "; */ - /* birth_.print(); */ - - /* cout << "Death: "; //TODO: only print if known */ - /* death_.print(); */ - - /* cout << '\n'; */ } diff --git a/person.h b/person.h index 87d087a..8922dfc 100644 --- a/person.h +++ b/person.h @@ -46,7 +46,7 @@ public: void load(std::ifstream &file); void rename(const char* newName); - void print() const; + void displayInfo() const; bool isMale() const; U16 boxWidth() const; diff --git a/todo.txt b/todo.txt index f0446e0..1b84c02 100644 --- a/todo.txt +++ b/todo.txt @@ -7,7 +7,6 @@ Draw distinct regions of a tree Draw spouses' relatives if main has none Color -Display info Partialy visible people Scrolling diff --git a/tree.cpp b/tree.cpp index f175acf..07c6465 100644 --- a/tree.cpp +++ b/tree.cpp @@ -399,7 +399,7 @@ void Tree::display() selectUp(); break; case 'i': - people[selected_].print(); + people[selected_].displayInfo(); draw(); break; default: break; @@ -423,7 +423,7 @@ void Tree::draw() const void Tree::print() const { for(auto& member: people) - member.print(); + member.displayInfo(); } void Tree::printRel(const unsigned id)const @@ -479,13 +479,13 @@ void Tree::printRel(const unsigned id)const void Tree::printMember(const unsigned id)const { - people[id].print(); + people[id].displayInfo(); } void Tree::printOldestAncestors(const unsigned id)const { - people[findOldestAncestor(id)].print(); - people[findOldestAncestor(id, 1)].print(); + people[findOldestAncestor(id)].displayInfo(); + people[findOldestAncestor(id, 1)].displayInfo(); }