From: <ob...@us...> - 2006-11-01 13:50:27
|
Revision: 11000 http://svn.sourceforge.net/jvcl/?rev=11000&view=rev Author: obones Date: 2006-11-01 05:50:19 -0800 (Wed, 01 Nov 2006) Log Message: ----------- Mantis 3977: Add an event for translation of user defined commands or modify the translation for default commands Modified Paths: -------------- trunk/jvcl/run/JvTranslateString.pas Modified: trunk/jvcl/run/JvTranslateString.pas =================================================================== --- trunk/jvcl/run/JvTranslateString.pas 2006-11-01 13:31:49 UTC (rev 10999) +++ trunk/jvcl/run/JvTranslateString.pas 2006-11-01 13:50:19 UTC (rev 11000) @@ -55,6 +55,9 @@ /// PRODUCTVERSION : Product version of the application out of the File-Version-Information /// SCREENSIZE : Size of the screen in format widthxheight /// DESKTOPSIZE : Size of the desktop in format widthxheight + TProcessCommandEvent = procedure(Sender: TObject; const Command: string; + var CommandResult: string; var Changed: Boolean) of object; + TJvTranslateString = class(TJvComponent) private FAppNameHandled: Boolean; @@ -70,6 +73,7 @@ FLeftDelimiter: string; FRightDelimiter: string; FTimeFormat: string; + FOnProcessCommand: TProcessCommandEvent; function GetFormName: string; function GetFormCaption: string; function GetVersionInfoAppName: string; @@ -90,6 +94,7 @@ property LeftDelimiter: string read FLeftDelimiter write FLeftDelimiter; property RightDelimiter: string read FRightDelimiter write FRightDelimiter; property TimeFormat: string read FTimeFormat write FTimeFormat; + property OnProcessCommand: TProcessCommandEvent read FOnProcessCommand write FOnProcessCommand; end; {$IFDEF UNITVERSIONING} @@ -353,6 +358,8 @@ CommandResult := Format('%dx%d', [Screen.DesktopWidth, Screen.DesktopHeight]) else Result := False; + if Assigned(FOnProcessCommand) then + FOnProcessCommand(Self, UpperCommand, CommandResult, Result); end; procedure TJvTranslateString.SetDateTimeFormat(const Value: string); @@ -451,3 +458,4 @@ end. + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |