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;
33 const char *get_class() const override { return "dialog"; }
35 /** Adds an action button to the dialog. Pressing the button will invoke
36 response handlers and delete the dialog. */
37 void add_button(Button &, int);
39 /** Sets the modality of the dialog. When modal, the user can't navigate
40 away from the dialog. */
43 void button_release(int, int, unsigned) override;
44 bool key_release(unsigned, unsigned) override;
45 bool navigate(Navigation) override;
50 /** Called when an action button is pressed. */
51 virtual void on_response(int) { }