Show cursor on exit
[utui.git] / msgbox.h
blobb845802d9261c9393057fcff58382379b5bc0fb8
1 // This file is part of the utui library, a terminal UI framework.
2 //
3 // Copyright (C) 2006 by Mike Sharov <msharov@users.sourceforge.net>
4 // This file is free software, distributed under the MIT License.
5 //
6 // msgbox.h
7 //
9 #ifndef MSGBOX_H_43442878202627633668B1BA269E4ED1
10 #define MSGBOX_H_43442878202627633668B1BA269E4ED1
12 #include "dialog.h"
14 /// Types of standard message boxes.
15 enum EMBType {
16 MB_Ok,
17 MB_OkCancel,
18 MB_YesNo,
19 MB_YesNoCancel,
20 MB_Retry,
21 MB_Last
24 /// Possible return values from CMessageBox::Run
25 enum EMBReturnValue {
26 mbrv_Ok,
27 mbrv_Yes = mbrv_Ok,
28 mbrv_Retry = mbrv_Ok,
29 mbrv_Cancel,
30 mbrv_Abort = mbrv_Cancel,
31 mbrv_No,
32 mbrv_Ignore,
33 mbrv_Last
36 /// \class CMessageBox msgbox.h msgbox.h
37 /// Displays a modal message box.
38 class CMessageBox : public CDialog {
39 public:
40 CMessageBox (const string& s = string::empty_string, EMBType t = MB_Ok);
41 protected:
42 virtual void OnKey (wchar_t key);
43 virtual void OnCommand (cmd_t cmd);
44 private:
45 string m_Text; ///< Message in the box.
46 EMBType m_Type; ///< Button arrangement.
49 //----------------------------------------------------------------------
51 int MessageBox (const string& s, EMBType t = MB_Ok);
53 //----------------------------------------------------------------------
55 #endif