-
Notifications
You must be signed in to change notification settings - Fork 6
Refactor popup dialogs #29
Copy link
Copy link
Open
Description
Refactor popup dialogs to use uniform event handler from main thread, and get rid of while-loops within other parts of code.
- gui/CommonDialog.cpp > AboutDialog
- gui/CommonDialog.cpp > QueryDialog
- gui/CommonDialog.cpp > MessageBox
- gui/EditDialog.cpp > EditBox
Suggested steps:
- Extend
GUI_MENU_TYPEwith these dialog types (_ABOUT,_QUERY,_MESSAGE_BOX,_EDITBOX) - Introduce typedef struct
GUI_EDITBOX_DATAinto UserInterface.h with all input parameters (title,description,buffer,maxLength,decimal), current state variables (x,y,w,len,cursor,result,atTheEnd,change) andsigslot::signal2<char *, BYTE> callback(sendingbufferandresult) - Separate all key-handler switches from inner event loops to appropriate methods (
KeyhandlerEditBox,KeyhandlerCommonDialogfor About and MessageBox, andKeyhandlerQueryDialog) and integrate intoMenuHandleKey - Separate all GUI drawing code to appropriate methods (
DrawEditBox,DrawAboutDialog,DrawMessageBox, andDrawQueryDialog) and integrate intoMenuOpenswitch
This is a prerequisite for the proper execution of the Emscripten/WASM build, where an additional infinite loop for polling events leads to the entire application becoming hung.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels