Skip to content

Refactor popup dialogs#30

Open
mborik wants to merge 2 commits into
masterfrom
29-refactor-popup-dialogs
Open

Refactor popup dialogs#30
mborik wants to merge 2 commits into
masterfrom
29-refactor-popup-dialogs

Conversation

@mborik

@mborik mborik commented Aug 20, 2025

Copy link
Copy Markdown
Owner

Refactor popup dialogs to use uniform event handler from main thread, and get rid of while-loops within other parts of code.

Suggested steps:

  • Extend GUI_MENU_TYPE with these dialog types (_ABOUT, _QUERY, _MESSAGE_BOX, _EDITBOX)
  • Introduce typedef struct GUI_EDITBOX_DATA into UserInterface.h with all input parameters (title, description, buffer, maxLength, decimal), current state variables (x, y, w, len, cursor, result, atTheEnd, change) and sigslot::signal2<char *, BYTE> callback (sending buffer and result)
  • Separate all key-handler switches from inner event loops to appropriate methods (KeyhandlerEditBox, KeyhandlerCommonDialog for About and MessageBox, and KeyhandlerQueryDialog) and integrate into MenuHandleKey
  • Separate all GUI drawing code to appropriate methods (DrawEditBox, DrawAboutDialog, DrawMessageBox, and DrawQueryDialog) and integrate into MenuOpen switch

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.

@mborik mborik linked an issue Aug 20, 2025 that may be closed by this pull request
8 tasks
@mborik mborik changed the title Refactor popup dialogs #29 Refactor popup dialogs Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor popup dialogs

1 participant