-
Notifications
You must be signed in to change notification settings - Fork 71
/
Alert.cpp
41 lines (33 loc) · 1.08 KB
/
Alert.cpp
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
#include "Alert.h"
AlertWindow::AlertWindow(const string& text): text(text) {
window.set_title(text);
window.show();
}
AlertWindow::~AlertWindow() {}
NodeResult<void> AlertWindow::handleEvent(StateEventType event) {
StateNode<void>::handleEvent(event);
if (ticks >= 50)
return NodeResult<void>(shared_ptr<AlertWindow>
(new AlertWindow(text + " x")));
else
return NodeResult<void>();
}
// MessageNode::MessageNode(const shared_ptr<StateNode>& oknode,
// const shared_ptr<StateNode>& cancelnode,
// const string& text):
// oknode(oknode), cancelnode(cancelnode), text(text)
// {
// }
// shared_ptr<StateNode> MessageNode::handleEvent(StateEventType event) {
// switch (event) {
// case EVENT_2BLINK: return oknode;
// case EVENT_TIMEOUT: return cancelnode;
// case EVENT_DESELECTED:
// alert = 0;
// return StateNode::handleEvent(event);
// case EVENT_SELECTED:
// alert = scoped_ptr<AlertWindow>(new AlertWindow(text));
// return StateNode::handleEvent(event);
// default: return StateNode::handleEvent(event);
// }
// }