fix, calltip win, VK(53) open would only work on French keyboard

+  hide call tip win on closed round bracket
This commit is contained in:
Basile Burg 2015-03-20 15:58:06 +01:00
parent 0e712aa0ee
commit c955a02715
1 changed files with 16 additions and 12 deletions

View File

@ -105,6 +105,7 @@ type
protected protected
procedure SetVisible(Value: Boolean); override; procedure SetVisible(Value: Boolean); override;
procedure SetHighlighter(const Value: TSynCustomHighlighter); override; procedure SetHighlighter(const Value: TSynCustomHighlighter); override;
procedure UTF8KeyPress(var Key: TUTF8Char); override;
procedure KeyDown(var Key: Word; Shift: TShiftState); override; procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure KeyUp(var Key: Word; Shift: TShiftState); override; procedure KeyUp(var Key: Word; Shift: TShiftState); override;
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
@ -589,8 +590,6 @@ begin
end; end;
procedure TCESynMemo.KeyUp(var Key: Word; Shift: TShiftState); procedure TCESynMemo.KeyUp(var Key: Word; Shift: TShiftState);
var
str: string;
begin begin
if Key in [VK_PRIOR, VK_NEXT, Vk_UP] then if Key in [VK_PRIOR, VK_NEXT, Vk_UP] then
fPositions.store; fPositions.store;
@ -598,24 +597,29 @@ begin
// //
if StaticEditorMacro.automatic then if StaticEditorMacro.automatic then
StaticEditorMacro.Execute; StaticEditorMacro.Execute;
// end;
if Key = 53 then
procedure TCESynMemo.UTF8KeyPress(var Key: TUTF8Char);
var
str: string;
c: TUTF8Char;
begin
c := Key;
inherited;
if c = '(' then
begin begin
if fCallTipWin = nil then
begin
fCallTipWin := TCEEditorHintWindow.Create(self);
fCallTipWin.Color := clInfoBk + $01010100;
end;
DcdWrapper.getCallTip(str); DcdWrapper.getCallTip(str);
if str <> '' then if str <> '' then
begin begin
fCallTipWin.FontSize := Font.Size; fCallTipWin.FontSize := Font.Size;
fCallTipWin.HintRect := fCallTipWin.CalcHintRect(0, str, nil); fCallTipWin.HintRect := fCallTipWin.CalcHintRect(0, str, nil);
fCallTipWin.OffsetHintRect(ClientToScreen(point(CaretXPix, CaretYPix)), fCallTipWin.OffsetHintRect(ClientToScreen(point(CaretXPix, CaretYPix)),
- 5 - fCallTipWin.HintRect.Bottom - fCallTipWin.HintRect.Top); - 5 - fCallTipWin.HintRect.Bottom - fCallTipWin.HintRect.Top);
fCallTipWin.ActivateHint(str); fCallTipWin.ActivateHint(str);
end; end;
end else fCallTipWin.Hide; end
else if c = ')' then
fCallTipWin.Hide;
end; end;
function TCESynMemo.getMouseFileBytePos: Integer; function TCESynMemo.getMouseFileBytePos: Integer;