]> git.tdb.fi Git - libs/gltk.git/blob - source/dialog.cpp
Strip copyright messages and id tags from individual files
[libs/gltk.git] / source / dialog.cpp
1 #include "button.h"
2 #include "dialog.h"
3
4 namespace Msp {
5 namespace GLtk {
6
7 Dialog::Dialog():
8         stale(false)
9 { }
10
11 void Dialog::add_button(Button &button, int code)
12 {
13         add(button);
14         button.signal_clicked.connect(sigc::bind(sigc::mem_fun(this, &Dialog::response), code));
15 }
16
17 void Dialog::button_release(int x, int y, unsigned button)
18 {
19         Panel::button_release(x, y, button);
20         if(stale)
21                 delete this;
22 }
23
24 void Dialog::key_release(unsigned key, unsigned mod)
25 {
26         Panel::key_release(key, mod);
27         if(stale)
28                 delete this;
29 }
30
31 void Dialog::response(int code)
32 {
33         on_response(code);
34         signal_response.emit(code);
35         stale = true;
36 }
37
38 } // namespace GLtk
39 } // namespace Msp