* Implemented OnBeep to install custom beep handler

git-svn-id: trunk@14254 -
This commit is contained in:
michael 2009-11-22 17:33:56 +00:00
parent b3ec68e2e1
commit 01ed4a6745
7 changed files with 36 additions and 9 deletions

View File

@ -635,7 +635,7 @@ end ;
Misc Functions
****************************************************************************}
procedure Beep;
procedure sysBeep;
begin
end;
@ -844,6 +844,7 @@ end;
Initialization
InitExceptions; { Initialize exceptions. OS independent }
InitInternational; { Initialize internationalization settings }
OnBeep:=@SysBeep;
Finalization
DoneExceptions;
end.

View File

@ -152,6 +152,7 @@ ResourceString
SInvalidDateMonthWeek = '(%d, %d, %d, %d) is not a valid DateMonthWeek quad';
SInvalidDateWeek = '(%d, %d, %d) is not a valid DateWeek triplet';
SInvalidDayOfWeekInMonth = '(%d, %d, %d, %d) is not a valid DayOfWeekInMonth quad';
SErrIllegalDateFormatString = '"%s" is not a valid date format string';
SInvalidFileName = '"%s" is not a valid file name.';
SInvalidIcon = 'Invalid Icon';
SInvalidImage = 'Invalid stream format';

View File

@ -173,15 +173,24 @@ type
procedure ShowException(ExceptObject: TObject; ExceptAddr: Pointer);
procedure Abort;
procedure OutOfMemoryError;
Type
TBeepHandler = Procedure;
Var
OnBeep : TBeephandler = Nil;
procedure Beep;
function SysErrorMessage(ErrorCode: Integer): String;
Type
TCreateGUIDFunc = Function(Out GUID : TGUID) : Integer;
Var
OnCreateGUID : TCreateGUIDFunc = Nil;
Function CreateGUID(out GUID : TGUID) : Integer;
type

View File

@ -683,3 +683,11 @@ begin
Result:='';
{$ENDIF}
end;
{ Beep support }
procedure Beep;
begin
If Assigned(OnBeep) then
OnBeep;
end;

View File

@ -836,11 +836,12 @@ end;
{****************************************************************************
Misc Functions
****************************************************************************}
procedure sysbeep;
procedure Beep;
begin
end;
// Maybe implement later on ?
end;
{****************************************************************************
Locale Functions
@ -1075,6 +1076,7 @@ end;
Initialization
InitExceptions; { Initialize exceptions. OS independent }
InitInternational; { Initialize internationalization settings }
OnBeep:=@SysBeep;
Finalization
DoneExceptions;
end.

View File

@ -991,9 +991,6 @@ end;
Misc Functions
****************************************************************************}
procedure Beep;
begin
end;
{****************************************************************************
@ -1356,6 +1353,12 @@ begin
Result:=TheUserDir;
end;
Procedure SysBeep;
begin
Write(#7);
Flush(Output);
end;
{****************************************************************************
Initialization code
@ -1365,6 +1368,8 @@ Initialization
InitExceptions; { Initialize exceptions. OS independent }
InitInternational; { Initialize internationalization settings }
SysConfigDir:='/etc'; { Initialize system config dir }
OnBeep:=@SysBeep;
Finalization
FreeDriveStr;
DoneExceptions;

View File

@ -604,7 +604,7 @@ end;
Misc Functions
****************************************************************************}
procedure Beep;
procedure sysbeep;
begin
MessageBeep(0);
end;
@ -1221,6 +1221,7 @@ Initialization
InitInternational; { Initialize internationalization settings }
LoadVersionInfo;
InitSysConfigDir;
OnBeep:=@SysBeep;
Finalization
DoneExceptions;
if kernel32dll<>0 then