From c955a02715b998038ad68c1f532869883c7423a6 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 20 Mar 2015 15:58:06 +0100 Subject: [PATCH] fix, calltip win, VK(53) open would only work on French keyboard + hide call tip win on closed round bracket --- src/ce_synmemo.pas | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/ce_synmemo.pas b/src/ce_synmemo.pas index db874b02..bd297c2d 100644 --- a/src/ce_synmemo.pas +++ b/src/ce_synmemo.pas @@ -105,6 +105,7 @@ type protected procedure SetVisible(Value: Boolean); override; procedure SetHighlighter(const Value: TSynCustomHighlighter); override; + procedure UTF8KeyPress(var Key: TUTF8Char); override; procedure KeyDown(var Key: Word; Shift: TShiftState); override; procedure KeyUp(var Key: Word; Shift: TShiftState); override; procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; @@ -589,8 +590,6 @@ begin end; procedure TCESynMemo.KeyUp(var Key: Word; Shift: TShiftState); -var - str: string; begin if Key in [VK_PRIOR, VK_NEXT, Vk_UP] then fPositions.store; @@ -598,24 +597,29 @@ begin // if StaticEditorMacro.automatic then StaticEditorMacro.Execute; - // - if Key = 53 then +end; + +procedure TCESynMemo.UTF8KeyPress(var Key: TUTF8Char); +var + str: string; + c: TUTF8Char; +begin + c := Key; + inherited; + if c = '(' then begin - if fCallTipWin = nil then - begin - fCallTipWin := TCEEditorHintWindow.Create(self); - fCallTipWin.Color := clInfoBk + $01010100; - end; DcdWrapper.getCallTip(str); if str <> '' then begin fCallTipWin.FontSize := Font.Size; - fCallTipWin.HintRect := fCallTipWin.CalcHintRect(0, str, nil); + fCallTipWin.HintRect := fCallTipWin.CalcHintRect(0, str, nil); fCallTipWin.OffsetHintRect(ClientToScreen(point(CaretXPix, CaretYPix)), - 5 - fCallTipWin.HintRect.Bottom - fCallTipWin.HintRect.Top); - fCallTipWin.ActivateHint(str); + fCallTipWin.ActivateHint(str); end; - end else fCallTipWin.Hide; + end + else if c = ')' then + fCallTipWin.Hide; end; function TCESynMemo.getMouseFileBytePos: Integer;