UI: Make System_InputBox API asynchronous.

Doing this as a precursor to cleaning up the Android madness.
This commit is contained in:
Unknown W. Brackets
2020-03-08 18:59:17 -07:00
parent f648a82df9
commit efceb031ce
8 changed files with 70 additions and 88 deletions
+5 -7
View File
@@ -26,13 +26,11 @@ void ChatMenu::CreatePopupContents(UI::ViewGroup *parent) {
#if defined(USING_WIN_UI)
//freeze the ui when using ctrl + C hotkey need workaround
if (g_Config.bBypassOSKWithKeyboard && !g_Config.bFullScreen) {
std::wstring titleText = ConvertUTF8ToWString(n->T("Chat"));
std::wstring defaultText = ConvertUTF8ToWString(n->T("Chat Here"));
std::wstring inputChars;
if (System_InputBoxGetWString(titleText.c_str(), defaultText, inputChars)) {
//chatEdit_->SetText(ConvertWStringToUTF8(inputChars));
sendChat(ConvertWStringToUTF8(inputChars));
}
System_InputBoxGetString(n->T("Chat"), n->T("Chat Here"), [](bool result, const std::string &value) {
if (result) {
sendChat(value);
}
});
}
#endif
chatEdit_->OnEnter.Handle(this, &ChatMenu::OnSubmit);