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 &);
25 void action_button(const std::string &, int);
28 sigc::signal<void, int> signal_response;
34 const char *get_class() const override { return "dialog"; }
36 /** Adds an action button to the dialog. Pressing the button will invoke
37 response handlers and delete the dialog. */
38 void add_button(Button &, int);
40 /** Sets the modality of the dialog. When modal, the user can't navigate
41 away from the dialog. */
44 void button_release(int, int, unsigned) override;
45 bool key_release(unsigned, unsigned) override;
46 bool navigate(Navigation) override;
51 /** Called when an action button is pressed. */
52 virtual void on_response(int) { }