up down select and focus

This commit is contained in:
vrd
2023-01-02 17:31:29 +02:00
parent 1c91d7b775
commit 6cbe64f927
7 changed files with 154 additions and 50 deletions
+11 -2
View File
@@ -159,6 +159,12 @@ void Person::print()const
/* cout << '\n'; */
}
bool Person::isMale() const
{
return isMale_;
}
U16 Person::boxWidth() const
{
return name_.size() + 4; /* TODO: get actual lenght */
@@ -176,12 +182,15 @@ U16 Person::boxWidth() const
/* return pad; */
/* } */
void Person::draw(I16 drawY, I16 drawX, bool hasSpouse, bool isSpouse, bool hasKids) const
void Person::draw(I16 drawY, I16 drawX, bool selected, bool hasSpouse, bool isSpouse, bool hasKids) const
{
U16 width = boxWidth();
WINDOW* pad = newpad(BOX_HEIGHT, width);
auto color_pair = COLOR_PAIR(isMale_ ? COLOR_MALE : COLOR_FEMALE);
auto color_pair = COLOR_PAIR( selected ? COLOR_SELECTED
: (isMale_ ? COLOR_MALE : COLOR_FEMALE) );
wbkgd(pad, color_pair);
/* wattron(pad, color_pair); */