Skip to content

Refactor popup dialogs #29

@mborik

Description

@mborik

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions