GL Studio C++ Runtime API
message.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
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 */
41 #ifndef INCLUDED_MESSAGE_H
42 #define INCLUDED_MESSAGE_H
43 
44 #include "gls_include.h"
45 
46 #if defined( GLS_EDITOR_CODE ) && !defined( ALLOW_EDITOR_CODE_TO_USE_MESSAGE_H )
47 # error "Editor code should not include message.h which uses FLTK. Use editor_message.h instead."
48 #endif
49 #include "disti_include.h"
50 #include <stdlib.h>
51 namespace disti
52 {
53 class MessageDialogs;
54 
55 DISTI_EXPORT void SetMessageDialogs( MessageDialogs* dlgs );
56 
57 /** Suppresses popup messages when false, defaults to true */
58 DISTI_EXPORT void EnableDialogs( bool );
59 DISTI_EXPORT bool AreDialogsEnabled();
60 
61 /** Deprecated functions. Use EnableDialogs() and AreDialogsEnabled() instead. */
62 DISTI_EXPORT void PopupsUseCommandLine( bool );
63 DISTI_EXPORT bool PopupsUseCommandLine();
64 
65 /** Creates and shows a pop-up dialog box and displays a text string and (1)
66  button labeled 'OK'. An 'i' (information) icon is displayed.
67  \param s The text string to display
68 */
69 DISTI_EXPORT void MsgBox( const char* s, ... );
70 
71 /** Creates and shows a pop-up dialog box and displays a text string and (1)
72  button labeled 'OK'. An exclamation icon is displayed
73  \param s The text string to display
74 */
75 DISTI_EXPORT void Error( const char* s, ... );
76 
77 /** Creates and shows a pop-up dialog box and displays a text string and (1)
78  button labeled 'OK'. An exclamation icon is displayed. This versioj
79  does not use varargs for formatting
80  \param s The text string to display
81 */
82 DISTI_EXPORT void Error_NoVarArg( const char* s );
83 
84 /** Creates and shows a pop-up dialog box and displays a text string and (2)
85  buttons labeled 'Yes' and 'No'. A question mark icon is displayed
86  \param s The text string to display
87  \return Equals 1 if user pressed 'Yes', otherwise 0
88 */
89 DISTI_EXPORT int Question( const char* s, ... );
90 
91 /** Creates and shows a pop-up dialog box and displays a text string and up
92  to (3) buttons labeled according to the last three input parameters. To
93  hide any of the buttons, pass a NULL string to the corresponding param.
94  A question icon is displayed.
95  \param b0 The label for button 0 (ESC is shortcut for this Right button)
96  \param b1 The label for button 1 (RET is shortcut for this Center button)
97  \param b2 The label for button 3 (left-most button)
98  \param s The text string to display
99  \return Equals 0 if b0 pressed, 1 if b1 pressed, 2 if b2 pressed
100 */
101 DISTI_EXPORT int Choice( const char* b0, const char* b1, const char* b2, const char* s, ... );
102 
103 /** Creates and shows a pop-up dialog box and displays a text string and up
104  to (3) buttons labeled according to the last three input parameters. To
105  hide any of the buttons, pass a NULL string to the corresponding param.
106  A question icon is displayed.
107  \param b0 The label for button 0 (ESC is shortcut for this Right button)
108  \param b1 The label for button 1 (RET is shortcut for this Center button)
109  \param b2 The label for button 3 (left-most button)
110  \param defaultChoice The value returned when in command-line mode
111  \param s The text string to display
112  \return Equals 0 if b0 pressed, 1 if b1 pressed, 2 if b2 pressed
113 */
114 DISTI_EXPORT int ChoiceWithDefault( const char* b0, const char* b1, const char* b2, const int defaultChoice, const char* s, ... );
115 
116 } // namespace disti
117 
118 #endif
void PopupsUseCommandLine(bool)
int Question(const char *s,...)
void MsgBox(const char *s,...)
A file for all GL Studio files to include.
void Error(const char *s,...)
A file for all GL Studio files to include.
int ChoiceWithDefault(const char *b0, const char *b1, const char *b2, const int defaultChoice, const char *s,...)
int Choice(const char *b0, const char *b1, const char *b2, const char *s,...)
void Error_NoVarArg(const char *s)
void EnableDialogs(bool)
Definition: bmpimage.h:46