StanfordCPPLib
gcolorchooser.h
1 /*
2  * File: gcolorchooser.h
3  * ---------------------
4  * This file defines the <code>GColorChooser</code> class which supports
5  * popping up graphical dialog boxes to select colors.
6  *
7  * @author Marty Stepp
8  * @version 2018/09/07
9  * - added doc comments for new documentation generation
10  * - added overloads that accept GWindow* parent
11  * @version 2018/08/23
12  * - renamed to gcolorchooser.h to replace Java version
13  * @version 2018/07/29
14  * - initial version
15  */
16 
17 #include "private/init.h" // ensure that Stanford C++ lib is initialized
18 
19 #ifndef INTERNAL_INCLUDE
20 // signal that GUI system is in use (so it will be initialized)
21 #define SPL_QT_GUI_IN_USE 1
22 #include "private/initstudent.h" // insert necessary included code by student
23 #endif // INTERNAL_INCLUDE
24 
25 #ifndef _gcolorchooser_h
26 #define _gcolorchooser_h
27 
28 #include <string>
29 #include <QWidget>
30 
31 #define INTERNAL_INCLUDE 1
32 #include "gwindow.h"
33 #undef INTERNAL_INCLUDE
34 
42 public:
48  static string showDialog(const string& title, int initialColor);
49 
55  static string showDialog(GWindow* parent, const string& title, int initialColor);
56 
62  static string showDialog(QWidget* parent, const string& title, int initialColor);
63 
69  static string showDialog(const string& title = "", const string& initialColor = "");
70 
76  static string showDialog(GWindow* parent, const string& title = "", const string& initialColor = "");
77 
83  static string showDialog(QWidget* parent, const string& title = "", const string& initialColor = "");
84 
85 private:
86  GColorChooser(); // prevent construction
87 };
88 
89 #endif // _gcolorchooser_h
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...
Definition: gcolorchooser.cpp:29
The GColorChooser class contains static methods for popping up color-choosing dialog boxes that allow...
Definition: gcolorchooser.h:41
This class represents a graphics window that supports simple graphics.
Definition: gwindow.h:114