SynEdit: Fixes for caret. Recreate persistent caret / stop using RespondToFocus (QT issue)

git-svn-id: trunk@27097 -
This commit is contained in:
martin 2010-08-14 19:42:59 +00:00
parent abc928b804
commit 9c570545dd
2 changed files with 10 additions and 4 deletions

View File

@ -4571,6 +4571,7 @@ begin
{$IFDEF VerboseFocus}
DebugLn('[TCustomSynEdit.WMSetFocus] A ',Name,':',ClassName);
{$ENDIF}
FScreenCaret.DestroyCaret; // Ensure recreation. On Windows only one caret exists, and it must be moved to the focused editor
FScreenCaret.Visible := True;
//if FHideSelection and SelAvail then
// Invalidate;

View File

@ -1548,6 +1548,7 @@ end;
constructor TSynEditScreenCaret.Create(AHandle: HWND);
begin
inherited Create;
FPersistentCaret := False;
FHandle := AHandle;
FVisible := False;
FCurrentVisible := False;
@ -1687,10 +1688,14 @@ end;
procedure TSynEditScreenCaret.SetPersistentCaret(const AValue: Boolean);
begin
if FPersistentCaret = AValue then exit;
FPersistentCaret := AValue;
if FCurrentCreated then
SetCaretRespondToFocus(Handle, not FPersistentCaret);
(* 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);