#include "goptionpane.h"

class GOptionPane

This class represents graphical input/output dialog boxes that can be popped up on the screen.
    GOptionPane::showMessageDialog("Hello, world!");
    string input = GOptionPane::showInputDialog("What is your name?");
    if (GOptionPane::showConfirmDialog("Are you sure?") == GOPTIONPANE_YES) {
        ...
    }
Static Methods
showConfirmDialog(message) Pops up a yes/no confirmation box.
showInputDialog(message) Pops up an input box with a text field where the user can type a response.
showMessageDialog(message) Displays an output message dialog to the user.
showOptionDialog(optionsinitial) Shows a general input box with a set of buttons from which the user may choose one.

Static Method detail


static GOptionPaneResult showConfirmDialog(string message);
Pops up a yes/no confirmation box. Once the user clicks a button to close the box, one of the GOptionPaneResult enumeration constants is returned.

Usage:

if (GOptionPane::showConfirmDialog("Are you sure?") == GOPTIONPANE_YES) {
    ...
}

static string showInputDialog(string message);
Pops up an input box with a text field where the user can type a response, which is returned. If the user cancels the box, an empty string is returned.

Usage:

string input = GOptionPane::showInputDialog(message);

static void showMessageDialog(string message);
Displays an output message dialog to the user. The user must click the 'OK' button to close the dialog.

Usage:

GOptionPane::showMessageDialog("Hello, world!");

static string showOptionDialog(const Vector<string>& options, string initiallySelected = "");
Shows a general input box with a set of buttons from which the user may choose one option. The button the user clicks is returned as a string. If the user cancels the box, an empty string is returned.

Usage:

Vector<string> options;
options += "Leo", "Mike", "Don", "Raph";
string fave = GOptionPane::showOptionDialog(options, "Leo");