aboutsummaryrefslogtreecommitdiff
path: root/externals/g3dlite/G3D/prompt.h
blob: c6df628099ef14a342ed33208bc8ccffd199f61b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/** 
 @file prompt.h
 
 @maintainer Morgan McGuire, http://graphics.cs.williams.edu
 @cite   Windows GUI code by Max McGuire

 @created 2001-08-26
 @edited  2006-08-13
 */

#ifndef G3D_PROMPT_H
#define G3D_PROMPT_H

#include "platform.h"
#include <string>

namespace G3D {

/**
  Prints a prompt to stdout and waits for user input.  The return value is
  the number of the user's choice (the first is 0, if there are no
  choices, returns 0). 
 
  @param useGui Under Win32, use a GUI, not stdout prompt.
  @param windowTitle The title for the prompt window
  @param promptx The text string to prompt the user with
  @param choice  An array of strings that are the choices the user may make
  @param numChoices The length of choice.

  @cite Windows dialog interface by Max McGuire, mmcguire@ironlore.com
  @cite Font setting code by Kurt Miller, kurt@flipcode.com
 */
int prompt(
    const char*     windowTitle,
    const char*     promptx,
    const char**    choice,
    int             numChoices,
    bool            useGui);

/**
  Prints a prompt and waits for user input.  The return value is
  the number of the user's choice (the first is 0, if there are no
  choices, returns 0).
  <P>Uses GUI under Win32, stdout prompt otherwise.
 */
inline int prompt(
    const char*     windowTitle,
    const char*     promptx,
    const char**    choice,
    int             numChoices) {

    return prompt(windowTitle, promptx, choice, numChoices, true);
}


/**
 Displays a GUI prompt with "Ok" as the only choice.
 */
void msgBox(
    const std::string& message,
    const std::string& title = "Message");


}; // namespace

#endif