message-dialog.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #if defined(Hiro_MessageDialog)
  2. struct MessageDialog {
  3. using type = MessageDialog;
  4. MessageDialog(const string& text = "");
  5. auto checked() const -> bool;
  6. auto dismissed() const -> bool;
  7. auto error(const vector<string>& buttons = {"Ok"}) -> string;
  8. auto information(const vector<string>& buttons = {"Ok"}) -> string;
  9. auto question(const vector<string>& buttons = {"Yes", "No"}) -> string;
  10. auto setAlignment(Alignment = Alignment::Center) -> type&;
  11. auto setAlignment(sWindow relativeTo, Alignment = Alignment::Center) -> type&;
  12. auto setChecked(bool checked = true) -> type&;
  13. auto setOption(const string& option = "") -> type&;
  14. auto setText(const string& text = "") -> type&;
  15. auto setTitle(const string& title = "") -> type&;
  16. auto warning(const vector<string>& buttons = {"Ok"}) -> string;
  17. private:
  18. struct State {
  19. Alignment alignment = Alignment::Center;
  20. vector<string> buttons;
  21. bool checked = false;
  22. bool dismissed = false;
  23. image icon;
  24. string option;
  25. sWindow relativeTo;
  26. string response;
  27. string text;
  28. string title;
  29. } state;
  30. auto _run() -> string;
  31. };
  32. #endif