Finally implemented the stack control, and used it for town comments in the town details dialog

This commit is contained in:
2014-12-22 13:22:06 -05:00
parent 5e762147bd
commit dcd28b363b
20 changed files with 469 additions and 17 deletions

View File

@@ -413,3 +413,18 @@ void cTextField::handleInput(cKey key) {
}
setText(contents);
}
cControl::storage_t cTextField::store() {
storage_t storage = cControl::store();
storage["fld-ip"] = insertionPoint;
storage["fld-sp"] = selectionPoint;
return storage;
}
void cTextField::restore(storage_t to) {
cControl::restore(to);
if(to.find("fld-ip") != to.end())
insertionPoint = boost::any_cast<int>(to["fld-ip"]);
if(to.find("fld-sp") != to.end())
selectionPoint = boost::any_cast<int>(to["fld-sp"]);
}