/* * Class QuitButton is a subclass of PushButton that throws a QuitButtonPressed * exception when pressed. A QuitButton can be used in any context where the * user is allowed to exit from a displayed interactor that is executing within * an InterViews event loop, such as the main loop in World::Run. * * Note that a QuitButton only throws an exception that will exit the event * loop. It does not dismiss any interactor in which it is contained. Such * dismissal is the responsibility of whoever catches QuitButtonPressed. * * A good example of QuitButton use is in the SimpleDialog class, q.v. in * ../dialog/simpledialog.h. */ #ifndef quitbuttonIncluded #define quitbuttonIncluded #include "std-macros.h" #include #include exception QuitButtonPressed; class QuitButton : public PushButton { public: QuitButton(); QuitButton(char* label); QuitButton(Font* font, char* label = "Quit"); protected: virtual void Press(); }; #endif