[utf8vcl-cvs] utf8vcl UTF8VCLControls.pas,1.1,1.2
Status: Alpha
Brought to you by:
bluelive
From: Robert M. <mar...@us...> - 2007-03-19 00:16:20
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22158 Modified Files: UTF8VCLControls.pas Log Message: style cleanup, TMethod used instead of custom record Index: UTF8VCLControls.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLControls.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UTF8VCLControls.pas 16 Mar 2007 23:39:11 -0000 1.1 --- UTF8VCLControls.pas 17 Mar 2007 18:36:43 -0000 1.2 *************** *** 10,14 **** private procedure HookTWinControlDoKeyPress; ! function DoKeyPressPatch(var Message: TWMKey): Boolean; end; --- 10,14 ---- private procedure HookTWinControlDoKeyPress; ! function DoKeyPressPatch(var Mesg: TWMKey): Boolean; end; *************** *** 21,28 **** type ! TProc = function(var Message: TWMKey): Boolean of Object; ! TProcBreaker = packed record ! Proc, Self: Pointer; ! end; procedure HookTWinControlDoKeyPress; --- 21,25 ---- type ! TProc = function(var Message: TWMKey): Boolean of object; procedure HookTWinControlDoKeyPress; *************** *** 31,35 **** end; ! function TWinControlPatch.DoKeyPressPatch(var Message: TWMKey): Boolean; var Form: TCustomForm; --- 28,32 ---- end; ! function TWinControlPatch.DoKeyPressPatch(var Mesg: TWMKey): Boolean; var Form: TCustomForm; *************** *** 39,45 **** Form := GetParentForm(Self); if (Form <> nil) and (Form <> TWinControl(Self)) and Form.KeyPreview and ! TWinControlPatch(Form).DoKeyPress(Message) then Exit; if not (csNoStdEvents in ControlStyle) then ! with Message do begin if CharCode < 256 then --- 36,43 ---- Form := GetParentForm(Self); if (Form <> nil) and (Form <> TWinControl(Self)) and Form.KeyPreview and ! TWinControlPatch(Form).DoKeyPress(Mesg) then ! Exit; if not (csNoStdEvents in ControlStyle) then ! with Mesg do begin if CharCode < 256 then *************** *** 48,52 **** KeyPress(Ch); CharCode := Word(Ch); ! if Char(CharCode) = #0 then Exit; end; end; --- 46,51 ---- KeyPress(Ch); CharCode := Word(Ch); ! if Char(CharCode) = #0 then ! Exit; end; end; *************** *** 56,66 **** procedure TWinControlPatch.HookTWinControlDoKeyPress; var ! a, b: TProc; ! m: TWMKey; begin ! a := DoKeyPress; ! b := DoKeyPressPatch; ! InjectJumpHook(TProcBreaker(a).Proc, TProcBreaker(b).Proc); end; end. --- 55,65 ---- procedure TWinControlPatch.HookTWinControlDoKeyPress; var ! A, B: TProc; begin ! A := DoKeyPress; ! B := DoKeyPressPatch; ! InjectJumpHook(TMethod(A).Code, TMethod(B).Code); end; end. + |