]> git.tdb.fi Git - libs/gltk.git/blob - source/dialog.h
Strip copyright messages and id tags from individual files
[libs/gltk.git] / source / dialog.h
1 #ifndef MSP_GLTK_DIALOG_H_
2 #define MSP_GLTK_DIALOG_H_
3
4 #include "panel.h"
5
6 namespace Msp {
7 namespace GLtk {
8
9 class Button;
10
11 /**
12 A Dialog is used for temporary interaction with the user.  When any of the
13 Dialog's action buttons are clicked, it will emit a signal and delete itself.
14 */
15 class Dialog: public Panel
16 {
17 public:
18         sigc::signal<void, int> signal_response;
19
20 private:
21         bool stale;
22
23 public:
24         Dialog();
25
26         /** Adds an action button to the dialog.  Pressing the button will invoke
27         response handlers and delete the dialog. */
28         void add_button(Button &, int);
29
30         virtual void button_release(int, int, unsigned);
31         virtual void key_release(unsigned, unsigned);
32 protected:
33         void response(int);
34
35         /** Called when an action button is pressed. */
36         virtual void on_response(int) { }
37 };
38
39 } // namespace GLtk
40 } // namespace Msp
41
42 #endif