phoenix::MessageWindow

The usual message box functionality.

struct MessageWindow {
  enum class Buttons : unsigned {
    Ok,
    OkCancel,
    YesNo,
  };

  enum class Response : unsigned {
    Ok,
    Cancel,
    Yes,
    No,
  };

  static Response information(Window &parent, const string &text, Buttons = Buttons::Ok);
  static Response question(Window &parent, const string &text, Buttons = Buttons::YesNo);
  static Response warning(Window &parent, const string &text, Buttons = Buttons::Ok);
  static Response critical(Window &parent, const string &text, Buttons = Buttons::Ok);
};

static Response MessageWindow::information(Window &parent, const string &text, Buttons = Buttons::Ok);

Displays a modal dialog message box.

parent can specify which window to be modal to, or Window::None can be used. text is the message to display, which can contain '\n' line feeds. Buttons are the buttons to display. response is the button that the user pressed. If the user hits the window manager's window close button, Cancel, then No, then Ok is chosen, based on the buttons available.

static Response MessageWindow::question(Window &parent, const string &text, Buttons = Buttons::YesNo);

The same as information(), but will display a different icon in the window, and potentially make a different chime noise. Also defaults to YesNo buttons.

static Response MessageWindow::warning(Window &parent, const string &text, Buttons = Buttons::Ok);

The same as information(), but will display a different icon in the window, and potentially make a different chime noise.

static Response MessageWindow::critical(Window &parent, const string &text, Buttons = Buttons::Ok);

The same as information(), but will display a different icon in the window, and potentially make a different chime noise.