SynEdit: Correctly set CaretRespondToFocus for gtk / workaround for QT

git-svn-id: trunk@27168 -
This commit is contained in:
martin 2010-08-22 22:54:14 +00:00
parent ccaef9ff49
commit bdcfa05b81
2 changed files with 6 additions and 20 deletions

View File

@ -7111,10 +7111,8 @@ begin
// (un)register HWND as drop target
if (eoDropFiles in ChangedOptions) and not (csDesigning in ComponentState) and HandleAllocated then
; // ToDo DragAcceptFiles
if (eoPersistentCaret in ChangedOptions) and HandleAllocated then begin
FScreenCaret.PersistentCaret := eoPersistentCaret in fOptions;
if (eoPersistentCaret in ChangedOptions) and HandleAllocated then
UpdateCaret;
end;
if (eoShowSpecialChars in ChangedOptions) and HandleAllocated then
Invalidate;

View File

@ -273,7 +273,6 @@ type
{$IFDeF SynCaretDebug}
FDebugShowCount: Integer;
{$ENDIF}
FPersistentCaret: Boolean;
FPixelWidth, FPixelHeight: Integer;
FOffsetX, FOffsetY: Integer;
FCurrentPosX, FCurrentPosY: Integer;
@ -286,7 +285,6 @@ type
procedure SetClipRect(const AValue: TRect);
procedure SetClipTop(const AValue: Integer);
procedure SetHandle(const AValue: HWND);
procedure SetPersistentCaret(const AValue: Boolean);
procedure UpdateDisplayType;
procedure UpdateDisplay;
procedure ShowCaret;
@ -312,7 +310,6 @@ type
property ExtraLineChars: Integer read FExtraLineChars; // Extend the longest line by x chars
property OnExtraLineCharsChanged: TNotifyEvent
read FOnExtraLineCharsChanged write FOnExtraLineCharsChanged;
property PersistentCaret: Boolean read FPersistentCaret write SetPersistentCaret;
end;
implementation
@ -1554,7 +1551,6 @@ end;
constructor TSynEditScreenCaret.Create(AHandle: HWND);
begin
inherited Create;
FPersistentCaret := False;
FHandle := AHandle;
FVisible := False;
FCurrentVisible := False;
@ -1700,18 +1696,6 @@ begin
UpdateDisplay;
end;
procedure TSynEditScreenCaret.SetPersistentCaret(const AValue: Boolean);
begin
(* Do nothing, keep Value always False.
Most Widgetsets do not even implement it. SynEdit handles it in WMSetFocus/WMKillFocus
QT goes weird, if it is set
*)
//if FPersistentCaret = AValue then exit;
//FPersistentCaret := AValue;
//if FCurrentCreated then
// SetCaretRespondToFocus(Handle, not FPersistentCaret);
end;
procedure TSynEditScreenCaret.SetClipBottom(const AValue: Integer);
begin
if FClipBottom = AValue then exit;
@ -1789,7 +1773,11 @@ begin
FCurrentVisible := False;
FCurrentClippedWidth := w;
FCurrentPosX := x - 1;
SetCaretRespondToFocus(Handle, not FPersistentCaret);
{$IFDEF LCLQT}
SetCaretRespondToFocus(Handle, True); // See bug 17173
{$ELSE}
SetCaretRespondToFocus(Handle, False); // Only for GTK
{$ENDIF}
end;
if (x <> FCurrentPosX) or (y <> FCurrentPosY) then begin
{$IFDeF SynCaretDebug}