diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2016-02-10 22:43:45 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2016-02-10 22:43:45 +0000 |
| commit | 5aa3fc9655560c68ab43573e4afb2d40833d01bf (patch) | |
| tree | f2d5b14fbc41a498edfa11b356b6656d7570a740 /src/drivers/WinAPI | |
| parent | 1a3c2dfd08a230e253b35df6e553c499c62c8686 (diff) | |
Moving fl_beep into screen driver.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11152 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/WinAPI')
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx | 28 | ||||
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.h | 14 |
2 files changed, 36 insertions, 6 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx index 0531e093f..ddf9deaac 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx @@ -19,6 +19,7 @@ #include "../../config_lib.h" #include "Fl_WinAPI_Screen_Driver.h" +#include <FL/fl_ask.h> # if !defined(HMONITOR_DECLARED) && (_WIN32_WINNT < 0x0500) # define COMPILE_MULTIMON_STUBS @@ -172,6 +173,7 @@ void Fl_WinAPI_Screen_Driver::screen_dpi(float &h, float &v, int n) } } + int Fl_WinAPI_Screen_Driver::x() { RECT r; @@ -180,6 +182,7 @@ int Fl_WinAPI_Screen_Driver::x() return r.left; } + int Fl_WinAPI_Screen_Driver::y() { RECT r; @@ -188,6 +191,7 @@ int Fl_WinAPI_Screen_Driver::y() return r.top; } + int Fl_WinAPI_Screen_Driver::h() { RECT r; @@ -196,6 +200,7 @@ int Fl_WinAPI_Screen_Driver::h() return r.bottom - r.top; } + int Fl_WinAPI_Screen_Driver::w() { RECT r; @@ -205,6 +210,29 @@ int Fl_WinAPI_Screen_Driver::w() } +void Fl_WinAPI_Screen_Driver::beep(int type) +{ + 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; + } +} + + // // End of "$Id$". diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.h b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.h index be0ee2caf..f0f5c823c 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.h +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.h @@ -32,12 +32,12 @@ class FL_EXPORT Fl_WinAPI_Screen_Driver : public Fl_Screen_Driver { protected: - RECT screens[MAX_SCREENS];
- RECT work_area[MAX_SCREENS];
- float dpi[MAX_SCREENS][2];
-
- static BOOL CALLBACK screen_cb(HMONITOR mon, HDC, LPRECT r, LPARAM);
- BOOL screen_cb(HMONITOR mon, HDC, LPRECT r);
+ RECT screens[MAX_SCREENS]; + RECT work_area[MAX_SCREENS]; + float dpi[MAX_SCREENS][2]; + + static BOOL CALLBACK screen_cb(HMONITOR mon, HDC, LPRECT r, LPARAM); + BOOL screen_cb(HMONITOR mon, HDC, LPRECT r); public: virtual void init(); @@ -48,6 +48,8 @@ public: virtual void screen_xywh(int &X, int &Y, int &W, int &H, int n); virtual void screen_dpi(float &h, float &v, int n=0); virtual void screen_work_area(int &X, int &Y, int &W, int &H, int n); + // --- audible output + virtual void beep(int type); }; |
