Move wxBell() from base to core library.
This allows to get rid of ugly preprocessor checks due to the fact that this function could be defined in one or the other library depending on the port used and also fix a problem with it being defined differently in the base library depending on which GUI port (Carbon or Cocoa) was used under OS X. It also fixes the problem with wxBell() in wxGTK under Windows. Closes #14406. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71797 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
54f59b007e
commit
598fe99d56
@ -130,12 +130,7 @@ wxDEPRECATED_INLINE(inline bool wxStringEq(const wchar_t *s1, const wchar_t *s2)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Sound the bell
|
||||
#if !defined __EMX__ && \
|
||||
(defined __WXMOTIF__ || defined __WXGTK__ || defined __WXX11__)
|
||||
WXDLLIMPEXP_CORE void wxBell();
|
||||
#else
|
||||
WXDLLIMPEXP_BASE void wxBell();
|
||||
#endif
|
||||
|
||||
#if wxUSE_MSGDLG
|
||||
// Show wxWidgets information
|
||||
|
@ -192,6 +192,8 @@ bool wxIsBusy();
|
||||
@note This function is categorized as a GUI one and so is not thread-safe.
|
||||
|
||||
@header{wx/utils.h}
|
||||
|
||||
@library{wxcore}
|
||||
*/
|
||||
void wxBell();
|
||||
|
||||
|
@ -66,14 +66,11 @@ extern GtkWidget *wxGetRootWindow();
|
||||
//----------------------------------------------------------------------------
|
||||
// misc.
|
||||
//----------------------------------------------------------------------------
|
||||
#ifndef __EMX__
|
||||
// on OS/2, we use the wxBell from wxBase library
|
||||
|
||||
void wxBell()
|
||||
{
|
||||
gdk_beep();
|
||||
}
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// display characterstics
|
||||
|
@ -58,14 +58,11 @@ extern GtkWidget *wxGetRootWindow();
|
||||
//----------------------------------------------------------------------------
|
||||
// misc.
|
||||
//----------------------------------------------------------------------------
|
||||
#ifndef __EMX__
|
||||
// on OS/2, we use the wxBell from wxBase library
|
||||
|
||||
void wxBell()
|
||||
{
|
||||
gdk_beep();
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Don't synthesize KeyUp events holding down a key and producing
|
||||
KeyDown events with autorepeat. */
|
||||
|
@ -112,14 +112,11 @@ int wxGUIAppTraits::AddProcessCallback(wxEndProcessData *proc_data, int fd)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Emit a beeeeeep
|
||||
#ifndef __EMX__
|
||||
// on OS/2, we use the wxBell from wxBase library (src/os2/utils.cpp)
|
||||
void wxBell()
|
||||
{
|
||||
// Use current setting for the bell
|
||||
XBell (wxGlobalDisplay(), 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const
|
||||
{
|
||||
|
@ -1076,12 +1076,6 @@ unsigned long wxGetProcessId()
|
||||
return ::GetCurrentProcessId();
|
||||
}
|
||||
|
||||
// Emit a beeeeeep
|
||||
void wxBell()
|
||||
{
|
||||
::MessageBeep((UINT)-1); // default sound
|
||||
}
|
||||
|
||||
bool wxIsDebuggerRunning()
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
|
@ -41,6 +41,12 @@
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// Emit a beeeeeep
|
||||
void wxBell()
|
||||
{
|
||||
::MessageBeep((UINT)-1); // default sound
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// helper functions for showing a "busy" cursor
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -306,12 +306,6 @@ void wxFlushEvents()
|
||||
// wxYield();
|
||||
}
|
||||
|
||||
// Emit a beeeeeep
|
||||
void wxBell()
|
||||
{
|
||||
DosBeep(1000,1000); // 1kHz during 1 sec.
|
||||
}
|
||||
|
||||
wxString wxGetOsDescription()
|
||||
{
|
||||
wxString strVer(wxT("OS/2"));
|
||||
|
@ -42,6 +42,12 @@
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// Emit a beeeeeep
|
||||
void wxBell()
|
||||
{
|
||||
DosBeep(1000,1000); // 1kHz during 1 sec.
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// functions to work with .INI files
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
#include "wx/evtloop.h"
|
||||
|
||||
#if wxUSE_BASE
|
||||
#if wxUSE_GUI
|
||||
|
||||
// Emit a beeeeeep
|
||||
void wxBell()
|
||||
@ -63,10 +63,6 @@ void wxBell()
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
wxTimerImpl* wxGUIAppTraits::CreateTimerImpl(wxTimer *timer)
|
||||
{
|
||||
return new wxOSXTimerImpl(timer);
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
|
||||
#if wxUSE_BASE
|
||||
#if wxUSE_GUI
|
||||
|
||||
// Emit a beeeeeep
|
||||
void wxBell()
|
||||
@ -45,10 +45,6 @@ void wxBell()
|
||||
NSBeep();
|
||||
}
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
@implementation wxNSAppController
|
||||
|
||||
- (void)applicationWillFinishLaunching:(NSNotification *)application {
|
||||
|
@ -39,13 +39,6 @@
|
||||
|
||||
#if 1 // wxUSE_BASE
|
||||
|
||||
// Emit a beeeeeep
|
||||
void wxBell()
|
||||
{
|
||||
// would be kSystemSoundID_UserPreferredAlert but since the headers aren't correct, add it manually
|
||||
AudioServicesPlayAlertSound(0x00001000 );
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Common Event Support
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -91,6 +84,13 @@ void wxApp::DoCleanUp()
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
// Emit a beeeeeep
|
||||
void wxBell()
|
||||
{
|
||||
// would be kSystemSoundID_UserPreferredAlert but since the headers aren't correct, add it manually
|
||||
AudioServicesPlayAlertSound(0x00001000 );
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Launch default browser
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -94,14 +94,11 @@ bool wxCheckForInterrupt(wxWindow *WXUNUSED(wnd))
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Emit a beeeeeep
|
||||
#ifndef __EMX__
|
||||
// on OS/2, we use the wxBell from wxBase library (src/os2/utils.cpp)
|
||||
void wxBell()
|
||||
{
|
||||
// Use current setting for the bell
|
||||
XBell ((Display*) wxGetDisplay(), 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user