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
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_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"
51
52#include <stdlib.h>
53
54namespace disti
55{
56class MessageDialogs;
57
58/// Set the current dialogs to use.
59/// \param dlgs The new dialogs to use.
60DISTI_EXPORT void SetMessageDialogs( MessageDialogs* dlgs );
61
62/// Suppresses popup messages when false, defaults to true.
63DISTI_EXPORT void EnableDialogs( bool );
64
65/// \return Whether or not dialogs are enabled.
66DISTI_EXPORT bool AreDialogsEnabled();
67
68/// Suppresses popup messages when false, defaults to true.
69/// Deprecated function. Use EnableDialogs() instead.
70DISTI_DEPRECATED( "Use EnableDialogs() instead." )
71DISTI_EXPORT void PopupsUseCommandLine( bool );
72
73/// Deprecated function. Use AreDialogsEnabled() instead.
74/// \return whether or not dialogs are enabled
75DISTI_DEPRECATED( "Use AreDialogsEnabled() instead." )
76DISTI_EXPORT bool PopupsUseCommandLine();
77
78/// Creates and shows a pop-up dialog box and displays a text string and (1)
79/// button labeled 'OK'. An 'i' (information) icon is displayed.
80/// \param s The text string to display.
81DISTI_EXPORT void MsgBox( const char* s, ... );
82
83/// Creates and shows a pop-up dialog box and displays a text string and (1)
84/// button labeled 'OK'. An exclamation icon is displayed.
85/// \param s The text string to display.
86DISTI_EXPORT void Error( const char* s, ... );
87
88/// Creates and shows a pop-up dialog box and displays a text string and (1)
89/// button labeled 'OK'. An exclamation icon is displayed. This version
90/// does not use varargs for formatting.
91/// \param s The text string to display.
92DISTI_EXPORT void Error_NoVarArg( const char* s );
93
94/// Creates and shows a pop-up dialog box and displays a text string and (2)
95/// buttons labeled 'Yes' and 'No'. A question mark icon is displayed.
96/// \param s The text string to display.
97/// \return Equals 1 if user pressed 'Yes', otherwise 0.
98DISTI_EXPORT int Question( const char* s, ... );
99
100/// Creates and shows a pop-up dialog box and displays a text string and up
101/// to (3) buttons labeled according to the last three input parameters. To
102/// hide any of the buttons, pass a NULL string to the corresponding param.
103/// A question icon is displayed.
104/// \param b0 The label for button 0 (ESC is shortcut for this Right button).
105/// \param b1 The label for button 1 (RET is shortcut for this Center button).
106/// \param b2 The label for button 3 (left-most button).
107/// \param s The text string to display.
108/// \return Equals 0 if b0 pressed, 1 if b1 pressed, 2 if b2 pressed.
109DISTI_EXPORT int Choice( const char* b0, const char* b1, const char* b2, const char* s, ... );
110
111/// Creates and shows a pop-up dialog box and displays a text string and up
112/// to (3) buttons labeled according to the last three input parameters. To
113/// hide any of the buttons, pass a NULL string to the corresponding param.
114/// A question icon is displayed.
115/// \param b0 The label for button 0 (ESC is shortcut for this Right button).
116/// \param b1 The label for button 1 (RET is shortcut for this Center button).
117/// \param b2 The label for button 3 (left-most button).
118/// \param defaultChoice The value returned when in command-line mode.
119/// \param s The text string to display.
120/// \return Equals 0 if b0 pressed, 1 if b1 pressed, 2 if b2 pressed.
121DISTI_EXPORT int ChoiceWithDefault( const char* b0, const char* b1, const char* b2, const int defaultChoice, const char* s, ... );
122
123} // namespace disti
124
125#endif
Definition: message_dialogs.h:51
A file for all GL Studio files to include.
Macros and helper code to determine what subset of C++11/14/17 is available.
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:457
A file for all GL Studio files to include.
Force inclusion of the DirectShow library.
Definition: bmpimage.h:47
void MsgBox(const char *s,...)
int Question(const char *s,...)
void PopupsUseCommandLine(bool)
void EnableDialogs(bool)
Suppresses popup messages when false, defaults to true.
int Choice(const char *b0, const char *b1, const char *b2, const char *s,...)
bool AreDialogsEnabled()
void Error(const char *s,...)
void SetMessageDialogs(MessageDialogs *dlgs)
int ChoiceWithDefault(const char *b0, const char *b1, const char *b2, const int defaultChoice, const char *s,...)
void Error_NoVarArg(const char *s)