1 #ifndef MSP_GLTK_DIALOG_H_
2 #define MSP_GLTK_DIALOG_H_
4 #include "mspgltk_api.h"
13 A Dialog is used for temporary interaction with the user. When any of the
14 Dialog's action buttons are clicked, it will emit a signal and delete itself.
16 class MSPGLTK_API Dialog: public Panel
19 class MSPGLTK_API Loader: public DataFile::DerivedObjectLoader<Dialog, Panel::Loader>
22 Loader(Dialog &, WidgetMap &);
24 void action_button(const std::string &, int);
27 sigc::signal<void, int> signal_response;
35 virtual const char *get_class() const { return "dialog"; }
37 /** Adds an action button to the dialog. Pressing the button will invoke
38 response handlers and delete the dialog. */
39 void add_button(Button &, int);
41 /** Sets the modality of the dialog. When modal, the user can't navigate
42 away from the dialog. */
45 virtual void button_release(int, int, unsigned);
46 virtual bool key_release(unsigned, unsigned);
47 virtual bool navigate(Navigation);
52 /** Called when an action button is pressed. */
53 virtual void on_response(int) { }