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