diff options
Diffstat (limited to 'src/fl_ask.cxx')
| -rw-r--r-- | src/fl_ask.cxx | 55 |
1 files changed, 6 insertions, 49 deletions
diff --git a/src/fl_ask.cxx b/src/fl_ask.cxx index ce61a2796..127339535 100644 --- a/src/fl_ask.cxx +++ b/src/fl_ask.cxx @@ -41,6 +41,7 @@ #include <FL/Fl_Input.H> #include <FL/Fl_Secret_Input.H> #include <FL/x.H> +#include <FL/Fl_Screen_Driver.H> #include <FL/fl_draw.H> static Fl_Window *message_form; @@ -54,9 +55,6 @@ static const char *message_title_default; Fl_Font fl_message_font_ = FL_HELVETICA; Fl_Fontsize fl_message_size_ = -1; static int enableHotspot = 1; -#ifdef __APPLE__ -extern "C" void NSBeep(void); -#endif static char avoidRecursion = 0; @@ -275,59 +273,18 @@ const char* fl_cancel= "Cancel"; ///< string pointer used in common dialogs, you const char* fl_close= "Close"; ///< string pointer used in common dialogs, you can change it to another language // fltk functions: + /** Emits a system beep message. \param[in] type The beep type from the \ref Fl_Beep enumeration. \note \#include <FL/fl_ask.H> */ -void fl_beep(int type) { -#ifdef WIN32 - switch (type) { - case FL_BEEP_QUESTION : - case FL_BEEP_PASSWORD : - MessageBeep(MB_ICONQUESTION); - break; - case FL_BEEP_MESSAGE : - MessageBeep(MB_ICONASTERISK); - break; - case FL_BEEP_NOTIFICATION : - MessageBeep(MB_ICONASTERISK); - break; - case FL_BEEP_ERROR : - MessageBeep(MB_ICONERROR); - break; - default : - MessageBeep(0xFFFFFFFF); - break; - } -#elif defined(__APPLE__) - switch (type) { - case FL_BEEP_DEFAULT : - case FL_BEEP_ERROR : - NSBeep(); - break; - default : - break; - } -#elif defined(FL_PORTING) -# pragma message "FL_PORTING: implement beeping or other noise generating functions" -#else - switch (type) { - case FL_BEEP_DEFAULT : - case FL_BEEP_ERROR : - if (!fl_display) fl_open_display(); - - XBell(fl_display, 100); - break; - default : - if (!fl_display) fl_open_display(); - - XBell(fl_display, 50); - break; - } -#endif // WIN32 +void fl_beep(int type) +{ + Fl::screen_driver()->beep(type); } + /** Shows an information message dialog box. \note Common dialog boxes are application modal. No more than one common dialog box |
