StanfordCPPLib
Static Public Member Functions | List of all members
GColorChooser Class Reference

The GColorChooser class contains static methods for popping up color-choosing dialog boxes that allow the user to select a color. More...

#include "gcolorchooser.h"

Static Public Member Functions

static string showDialog(string title, int initialColor)
 Pops up a color chooser dialog with the given top title text, with the given initial color selected. More...
 
static string showDialog(GWindow *parent, string title, int initialColor)
 Pops up a color chooser dialog with the given top title text, with the given initial color selected. More...
 
static string showDialog(QWidget* parent, string title, int initialColor)
 Pops up a color chooser dialog with the given top title text, with the given initial color selected. More...
 
static string showDialog(string title="", string initialColor="")
 Pops up a color chooser dialog with the given top title text, with the given initial color selected. More...
 
static string showDialog(GWindow *parent, string title="", string initialColor="")
 Pops up a color chooser dialog with the given top title text, with the given initial color selected. More...
 
static string showDialog(QWidget* parent, string title="", string initialColor="")
 Pops up a color chooser dialog with the given top title text, with the given initial color selected. More...
 

Detailed Description

The GColorChooser class contains static methods for popping up color-choosing dialog boxes that allow the user to select a color.

Each method blocks until the color is chosen and the dialog is closed, returning the color the user chose (or an empty string if the user canceled).

Member Function Documentation

◆ showDialog() [1/6]

string showDialog ( string   title,
int  initialColor 
)
static

Pops up a color chooser dialog with the given top title text, with the given initial color selected.

Returns the color that was chosen as a color string such as "#ff0077" or "blue".

◆ showDialog() [2/6]

string showDialog ( GWindow parent,
string   title,
int  initialColor 
)
static

Pops up a color chooser dialog with the given top title text, with the given initial color selected.

Returns the color that was chosen as a color string such as "#ff0077" or "blue".

◆ showDialog() [3/6]

string showDialog ( QWidget*   parent,
string   title,
int  initialColor 
)
static

Pops up a color chooser dialog with the given top title text, with the given initial color selected.

Returns the color that was chosen as a color string such as "#ff0077" or "blue".

◆ showDialog() [4/6]

string showDialog ( string   title = "",
string   initialColor = "" 
)
static

Pops up a color chooser dialog with the given top title text, with the given initial color selected.

Returns the color that was chosen as a color string such as "#ff0077" or "blue".

◆ showDialog() [5/6]

string showDialog ( GWindow parent,
string   title = "",
string   initialColor = "" 
)
static

Pops up a color chooser dialog with the given top title text, with the given initial color selected.

Returns the color that was chosen as a color string such as "#ff0077" or "blue".

◆ showDialog() [6/6]

string showDialog ( QWidget*   parent,
string   title = "",
string   initialColor = "" 
)
static

Pops up a color chooser dialog with the given top title text, with the given initial color selected.

Returns the color that was chosen as a color string such as "#ff0077" or "blue".