forked from BYOBMO/BMOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMessageBox.h
More file actions
58 lines (48 loc) · 1.13 KB
/
CMessageBox.h
File metadata and controls
58 lines (48 loc) · 1.13 KB
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
#pragma once
#ifdef WINDOWS
#define _HAS_STD_BYTE 0
#endif
#include "CButton.h"
#include "CLabel.h"
#include "CForm.h"
#include "CSurfWindow.h"
#include "CMultiLine.h"
using namespace std;
class CMessageBox :
public CForm
{
public:
enum class MessageResult
{
OK,
Cancel,
Yes,
No
};
enum class MessageStyle
{
OK,
OK_Cancel,
Yes_No,
None
};
enum class MessageAlign
{
Left,
Center,
Right
};
CMessageBox(int x, int y, int w, int h);
CButton* btnOK;
CButton* btnCancel;
CMultiLine* mMultiLine;
string mTag;
void ShowMessage(std::string text, std::string caption, MessageStyle style);
void ShowMessage(std::string text, std::string caption, MessageStyle style, MessageAlign align);
void AddLine(string text);
void AddLine(string text, CSurface::HAlignment align);
void AddOnCloseHandler(std::function<void(CMessageBox*, MessageResult)> callback);
std::function<void(CMessageBox*, MessageResult)> OnCloseHandler;
void OnButton(CButton* button);
virtual void OnClose(CIcon*);
};