hide cursor

This commit is contained in:
vrd
2023-01-02 20:48:26 +02:00
parent 2ec892755f
commit b49e422cda
5 changed files with 8 additions and 34 deletions
+1
View File
@@ -11,6 +11,7 @@ int main()
/* Init ncurses */ /* Init ncurses */
initscr(); /* Start curses mode */ initscr(); /* Start curses mode */
curs_set(0); /* Hide cursor */
noecho(); noecho();
cbreak(); /* get input instantly */ cbreak(); /* get input instantly */
keypad(stdscr, true); keypad(stdscr, true);
+1 -27
View File
@@ -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 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); 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; name_ = newName;
} }
void Person::print()const void Person::displayInfo()const
{ {
info_tab = newwin(LINES, COLS, 0, 0); info_tab = newwin(LINES, COLS, 0, 0);
@@ -146,17 +131,6 @@ void Person::print()const
werase(info_tab); werase(info_tab);
wrefresh(info_tab); /* todo: dont update */ wrefresh(info_tab); /* todo: dont update */
delwin(info_tab); 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'; */
} }
+1 -1
View File
@@ -46,7 +46,7 @@ public:
void load(std::ifstream &file); void load(std::ifstream &file);
void rename(const char* newName); void rename(const char* newName);
void print() const; void displayInfo() const;
bool isMale() const; bool isMale() const;
U16 boxWidth() const; U16 boxWidth() const;
-1
View File
@@ -7,7 +7,6 @@ Draw distinct regions of a tree
Draw spouses' relatives if main has none Draw spouses' relatives if main has none
Color Color
Display info
Partialy visible people Partialy visible people
Scrolling Scrolling
+5 -5
View File
@@ -399,7 +399,7 @@ void Tree::display()
selectUp(); selectUp();
break; break;
case 'i': case 'i':
people[selected_].print(); people[selected_].displayInfo();
draw(); draw();
break; break;
default: break; default: break;
@@ -423,7 +423,7 @@ void Tree::draw() const
void Tree::print() const void Tree::print() const
{ {
for(auto& member: people) for(auto& member: people)
member.print(); member.displayInfo();
} }
void Tree::printRel(const unsigned id)const 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 void Tree::printMember(const unsigned id)const
{ {
people[id].print(); people[id].displayInfo();
} }
void Tree::printOldestAncestors(const unsigned id)const void Tree::printOldestAncestors(const unsigned id)const
{ {
people[findOldestAncestor(id)].print(); people[findOldestAncestor(id)].displayInfo();
people[findOldestAncestor(id, 1)].print(); people[findOldestAncestor(id, 1)].displayInfo();
} }