mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 02:49:19 +02:00
fixed syncompletion for UTF8 keypress
git-svn-id: trunk@7248 -
This commit is contained in:
parent
19553ee2d3
commit
107a955dd6
@ -62,6 +62,8 @@ type
|
|||||||
TValidateEvent = procedure(Sender: TObject; Shift: TShiftState) of object;
|
TValidateEvent = procedure(Sender: TObject; Shift: TShiftState) of object;
|
||||||
TSynBaseCompletionSearchPosition = procedure(var Position :integer) of object;
|
TSynBaseCompletionSearchPosition = procedure(var Position :integer) of object;
|
||||||
|
|
||||||
|
{ TSynBaseCompletionForm }
|
||||||
|
|
||||||
TSynBaseCompletionForm = class(TForm)
|
TSynBaseCompletionForm = class(TForm)
|
||||||
protected
|
protected
|
||||||
FCurrentString: string;
|
FCurrentString: string;
|
||||||
@ -83,6 +85,7 @@ type
|
|||||||
FOnKeyCompletePrefix: TNotifyEvent;
|
FOnKeyCompletePrefix: TNotifyEvent;
|
||||||
FTextColor: TColor;
|
FTextColor: TColor;
|
||||||
FTextSelectedColor: TColor;
|
FTextSelectedColor: TColor;
|
||||||
|
procedure UTF8KeyPress(var UTF8Key: TUTF8Char); override;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
procedure SetCurrentString(const Value: string);
|
procedure SetCurrentString(const Value: string);
|
||||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
@ -559,6 +562,25 @@ begin
|
|||||||
Position := Position - 1;
|
Position := Position - 1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
procedure TSynBaseCompletionForm.UTF8KeyPress(var UTF8Key: TUTF8Char);
|
||||||
|
begin
|
||||||
|
if UTF8Key=#8 then begin
|
||||||
|
if Assigned(OnUTF8KeyPress) then OnUTF8KeyPress(Self, UTF8Key);
|
||||||
|
end else if (length(UTF8Key)>=1) and (not (UTF8Key[1] in [#33..'z'])) then
|
||||||
|
begin
|
||||||
|
if Assigned(OnCancel) then
|
||||||
|
OnCancel(Self);
|
||||||
|
end else begin
|
||||||
|
if Assigned(OnUTF8KeyPress) then
|
||||||
|
OnUTF8KeyPress(Self, UTF8Key);
|
||||||
|
if UTF8Key<>'' then
|
||||||
|
CurrentString := CurrentString + UTF8Key;
|
||||||
|
end;
|
||||||
|
UTF8Key:='';
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
procedure TSynBaseCompletionForm.SetCurrentString(const Value: string);
|
procedure TSynBaseCompletionForm.SetCurrentString(const Value: string);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user