Automatically trigger the focus handler for the active field when toasting the dialog, and don't toast if the handler returns false

- But provide an option to skip this step, for the purpose of cancel buttons
This commit is contained in:
2014-12-04 13:48:50 -05:00
parent 7e07d195f9
commit 04cba387d5
12 changed files with 97 additions and 100 deletions

View File

@@ -122,9 +122,9 @@ void flash_rect(RECT /*to_flash*/)
sf::sleep(time_in_ticks(5));
}
static bool get_num_event_filter(cDialog& me, std::string, eKeyMod)
static bool get_num_event_filter(cDialog& me, std::string id, eKeyMod)
{
me.toast();
me.toast(id == "okay");
me.setResult<long long>(me["number"].getTextAsNum());
return true;
}