-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessage_box.h
47 lines (37 loc) · 1.11 KB
/
message_box.h
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
#ifndef ASCII_PAINT_MSG_BOX_H
#define ASCII_PAINT_MSG_BOX_H
#include <string>
#include "gui/gui.hpp"
#include "app_user.h"
class MessageBox : public AppUser {
public:
MessageBox();
MessageBox(const char *title, const char *text, int numberOfButtons, bool haveTextBox = false);
virtual ~MessageBox();
void setButtonText(int buttonNumber, const char *text);
void addCustomWidget(Widget *wid);
void show();
//void show(char *title, char *text, int numberOfButtons, bool haveTextBox = false);
int getButtonPressed();
void setButtonPressed(int buttonNumber);
const char *getString();
void setString(const char *str);
private:
void init(const char *title, const char *text, int numberOfButtons, bool haveTextBox = false);
int numberOfButtons;
int buttonPressed;
ToolBar *frame;
Label *textLabel;
TextBox *textBox;
VBox *customWidgetContainer;
Button *buttons[3];
std::string title;
std::string text;
};
struct MessageBoxButtonCbkInfo {
MessageBoxButtonCbkInfo(MessageBox *msg, int bn);
MessageBox *messageBox;
int buttonNumber;
};
void MessageBoxButtonCbk(Widget *wid, void *data);
#endif