GL Studio C++ Runtime API
message_dialogs.h
Go to the documentation of this file.
1/// \file message_dialogs.h
2/// \brief The Message functions. Implements Messages to the user in the form
3/// of pop-up dialog boxes, using FLTK windows.
4///
5/// \par Copyright Information
6///
7/// Copyright (c) 2017 by The DiSTI Corporation.<br>
8/// 12249 Science Drive; Suite 300<br>
9/// Orlando, Florida 32826<br>
10/// USA<br>
11/// <br>
12/// All rights reserved.<br>
13///
14/// This Software contains proprietary trade secrets of DiSTI and may not be
15/// reproduced, in whole or part, in any form, or by any means of electronic,
16/// mechanical, or otherwise, without the written permission of DiSTI. Said
17/// permission may be derived through the purchase of applicable DiSTI product
18/// licenses which detail the distribution rights of this content and any
19/// Derivative Works based on this or other copyrighted DiSTI Software.
20///
21/// NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
22/// AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
23/// PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
24/// AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
25/// IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
26/// PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
27///
28/// LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
29/// IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
30/// INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
31/// DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
32/// INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
33/// INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
34/// OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
35/// EXCEED FIVE DOLLARS (US$5.00).
36///
37/// The aforementioned terms and restrictions are governed by the laws of the
38/// State of Florida and the United States of America.
39
40#ifndef INCLUDED_MESSAGE_DIALOGS_H
41#define INCLUDED_MESSAGE_DIALOGS_H
42
43#include "gls_include.h"
44#include <stdlib.h>
45
46namespace disti
47{
48/// \details The MessageDialogs class. Runtime support for messagebox popups via FLTK.
50{
51public:
52 /// Suppresses popup messages when false, defaults to true.
53 /// \param value The new popup suppression flag to set.
54 void EnableDialogs( bool value ) { _areDialogsEnabled = value; }
55
56 /// \return Whether or not dialogs are enabled.
57 bool AreDialogsEnabled() const { return _areDialogsEnabled; }
58
59 /// Creates and shows a pop-up dialog box and displays a text string and (1)
60 /// button labeled 'OK'. An 'i' (information) icon is displayed.
61 /// \param s The text string to display.
62 virtual void MsgBox( const char* s ) = 0;
63
64 /// Creates and shows a pop-up dialog box and displays a text string and (1)
65 /// button labeled 'OK'. An exclamation icon is displayed.
66 /// \param s The text string to display.
67 virtual void Error( const char* s ) = 0;
68
69 /// Creates and shows a pop-up dialog box and displays a text string and (2)
70 /// buttons labeled 'Yes' and 'No'. A question mark icon is displayed.
71 /// \param s The text string to display.
72 /// \return Equals 1 if user pressed 'Yes', otherwise 0
73 virtual int Question( const char* s ) = 0;
74
75 /// Creates and shows a pop-up dialog box and displays a text string and up
76 /// to (3) buttons labeled according to the last three input parameters. To
77 /// hide any of the buttons, pass a NULL string to the corresponding param.
78 /// A question icon is displayed.
79 /// \param b0 The label for button 0 (ESC is shortcut for this Right button).
80 /// \param b1 The label for button 1 (RET is shortcut for this Center button)
81 /// \param b2 The label for button 3 (left-most button).
82 /// \param s The text string to display.
83 /// \return Equals 0 if b0 pressed, 1 if b1 pressed, 2 if b2 pressed.
84 virtual int Choice( const char* b0, const char* b1, const char* b2, const char* s ) = 0;
85
86 /// Creates and shows a pop-up dialog box and displays a text string and up
87 /// to (3) buttons labeled according to the last three input parameters. To
88 /// hide any of the buttons, pass a NULL string to the corresponding param.
89 /// A question icon is displayed.
90 /// \param b0 The label for button 0 (ESC is shortcut for this Right button).
91 /// \param b1 The label for button 1 (RET is shortcut for this Center button).
92 /// \param b2 The label for button 3 (left-most button).
93 /// \param defaultChoice The value returned when in command-line mode.
94 /// \param s The text string to display.
95 /// \return Equals 0 if b0 pressed, 1 if b1 pressed, 2 if b2 pressed.
96 virtual int ChoiceWithDefault( const char* b0, const char* b1, const char* b2, const int defaultChoice, const char* s ) = 0;
97
98 virtual ~MessageDialogs() {}
99
100protected:
102 : _areDialogsEnabled( true )
103 {
104 }
105
106private:
107 // disallow
108 MessageDialogs( const MessageDialogs& );
109 MessageDialogs& operator=( const MessageDialogs& );
110
111 bool _areDialogsEnabled;
112};
113} // namespace disti
114
115#endif
Definition: message_dialogs.h:50
bool AreDialogsEnabled() const
Definition: message_dialogs.h:57
virtual int Choice(const char *b0, const char *b1, const char *b2, const char *s)=0
virtual int Question(const char *s)=0
virtual void MsgBox(const char *s)=0
virtual void Error(const char *s)=0
virtual int ChoiceWithDefault(const char *b0, const char *b1, const char *b2, const int defaultChoice, const char *s)=0
void EnableDialogs(bool value)
Definition: message_dialogs.h:54
A file for all GL Studio files to include.
Definition: bmpimage.h:46