Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ enum APPEARANCE {
APPEARANCE appAppearance;
/* System property to be set for SWT application to use the system's theme */
static final String USE_SYSTEM_THEME = "org.eclipse.swt.display.useSystemTheme";
/* System property to control beep sounds */
public static final boolean BEEP_ENABLED = !"off".equalsIgnoreCase(System.getProperty("swt.beep"));

/* Windows and Events */
Event [] eventQueue;
Expand Down Expand Up @@ -671,7 +673,9 @@ public void execute(Runnable runnable) {
*/
public void beep () {
checkDevice ();
OS.NSBeep ();
if (BEEP_ENABLED) {
OS.NSBeep ();
}
}

void cascadeWindow (NSWindow window, NSScreen screen) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@ public void stop() {

/* Package name */
static final String PACKAGE_PREFIX = "org.eclipse.swt.widgets."; //$NON-NLS-1$
/* System property to control beep sounds */
public static final boolean BEEP_ENABLED = !"off".equalsIgnoreCase(System.getProperty("swt.beep"));
/* This code is intentionally commented.
* ".class" can not be used on CLDC.
*/
Expand Down Expand Up @@ -988,7 +990,9 @@ public void execute(Runnable runnable) {
*/
public void beep () {
if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
GDK.gdk_display_beep(GDK.gdk_display_get_default());
if (BEEP_ENABLED) {
GDK.gdk_display_beep(GDK.gdk_display_get_default());
}
}

long cellDataProc (long tree_column, long cell, long tree_model, long iter, long data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ public class Display extends Device implements Executor {
boolean useWsBorderTable = false;
static final String USE_WS_BORDER_TEXT_KEY = "org.eclipse.swt.internal.win32.Text.use_WS_BORDER"; //$NON-NLS-1$
boolean useWsBorderText = false;
/* System property to control beep sounds */
public static final boolean BEEP_ENABLED = !"off".equalsIgnoreCase(System.getProperty("swt.beep"));
/**
* Changes the color of Table header's column delimiters.
* Only affects custom-drawn header, that is when background/foreground header color is set.
Expand Down Expand Up @@ -852,7 +854,9 @@ public void execute(Runnable runnable) {
*/
public void beep () {
checkDevice ();
OS.MessageBeep (OS.MB_OK);
if (BEEP_ENABLED) {
OS.MessageBeep (OS.MB_OK);
}
}

/**
Expand Down
Loading