delegate draw to persons

This commit is contained in:
vrd
2022-12-24 17:59:54 +02:00
parent 5e9d2d8501
commit cd221476a5
4 changed files with 47 additions and 22 deletions
+14
View File
@@ -169,3 +169,17 @@ WINDOW* Person::createPad()const
return pad;
}
void Person::draw(U16 drawY, U16 drawX) const
{
U16 width = name_.size() + 4; /* TODO: get actual lenght */
WINDOW* pad = newpad(BOX_HEIGHT, width);
box(pad, BOX_HEIGHT, width);
mvwaddstr(pad, 2, 2, name_.data());
pnoutrefresh(pad, 0, 0,
drawY, drawX,
drawY + BOX_HEIGHT-1, drawX + width-1);
delwin(pad);
}