mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-12 03:09:38 +01:00
SynEdit: CaretRespondsToFocus
git-svn-id: trunk@27096 -
This commit is contained in:
parent
76e6393192
commit
abc928b804
@ -7111,7 +7111,7 @@ begin
|
|||||||
if (eoDropFiles in ChangedOptions) and not (csDesigning in ComponentState) and HandleAllocated then
|
if (eoDropFiles in ChangedOptions) and not (csDesigning in ComponentState) and HandleAllocated then
|
||||||
; // ToDo DragAcceptFiles
|
; // ToDo DragAcceptFiles
|
||||||
if (eoPersistentCaret in ChangedOptions) and HandleAllocated then begin
|
if (eoPersistentCaret in ChangedOptions) and HandleAllocated then begin
|
||||||
SetCaretRespondToFocus(Handle,not (eoPersistentCaret in fOptions));
|
FScreenCaret.PersistentCaret := eoPersistentCaret in fOptions;
|
||||||
UpdateCaret;
|
UpdateCaret;
|
||||||
end;
|
end;
|
||||||
if (eoShowSpecialChars in ChangedOptions) and HandleAllocated then
|
if (eoShowSpecialChars in ChangedOptions) and HandleAllocated then
|
||||||
|
|||||||
@ -268,6 +268,7 @@ type
|
|||||||
procedure SetDisplayType(const AType: TSynCaretType);
|
procedure SetDisplayType(const AType: TSynCaretType);
|
||||||
procedure SetVisible(const AValue: Boolean);
|
procedure SetVisible(const AValue: Boolean);
|
||||||
private
|
private
|
||||||
|
FPersistentCaret: Boolean;
|
||||||
FPixelWidth, FPixelHeight: Integer;
|
FPixelWidth, FPixelHeight: Integer;
|
||||||
FOffsetX, FOffsetY: Integer;
|
FOffsetX, FOffsetY: Integer;
|
||||||
FCurrentPosX, FCurrentPosY: Integer;
|
FCurrentPosX, FCurrentPosY: Integer;
|
||||||
@ -280,6 +281,7 @@ type
|
|||||||
procedure SetClipRect(const AValue: TRect);
|
procedure SetClipRect(const AValue: TRect);
|
||||||
procedure SetClipTop(const AValue: Integer);
|
procedure SetClipTop(const AValue: Integer);
|
||||||
procedure SetHandle(const AValue: HWND);
|
procedure SetHandle(const AValue: HWND);
|
||||||
|
procedure SetPersistentCaret(const AValue: Boolean);
|
||||||
procedure UpdateDisplayType;
|
procedure UpdateDisplayType;
|
||||||
procedure UpdateDisplay;
|
procedure UpdateDisplay;
|
||||||
procedure ShowCaret;
|
procedure ShowCaret;
|
||||||
@ -305,6 +307,7 @@ type
|
|||||||
property ExtraLineChars: Integer read FExtraLineChars; // Extend the longest line by x chars
|
property ExtraLineChars: Integer read FExtraLineChars; // Extend the longest line by x chars
|
||||||
property OnExtraLineCharsChanged: TNotifyEvent
|
property OnExtraLineCharsChanged: TNotifyEvent
|
||||||
read FOnExtraLineCharsChanged write FOnExtraLineCharsChanged;
|
read FOnExtraLineCharsChanged write FOnExtraLineCharsChanged;
|
||||||
|
property PersistentCaret: Boolean read FPersistentCaret write SetPersistentCaret;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -1682,6 +1685,14 @@ begin
|
|||||||
UpdateDisplay;
|
UpdateDisplay;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSynEditScreenCaret.SetPersistentCaret(const AValue: Boolean);
|
||||||
|
begin
|
||||||
|
if FPersistentCaret = AValue then exit;
|
||||||
|
FPersistentCaret := AValue;
|
||||||
|
if FCurrentCreated then
|
||||||
|
SetCaretRespondToFocus(Handle, not FPersistentCaret);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSynEditScreenCaret.SetClipBottom(const AValue: Integer);
|
procedure TSynEditScreenCaret.SetClipBottom(const AValue: Integer);
|
||||||
begin
|
begin
|
||||||
if FClipBottom = AValue then exit;
|
if FClipBottom = AValue then exit;
|
||||||
@ -1752,6 +1763,7 @@ begin
|
|||||||
FCurrentVisible := False;
|
FCurrentVisible := False;
|
||||||
FCurrentClippedWidth := w;
|
FCurrentClippedWidth := w;
|
||||||
FCurrentPosX := x - 1;
|
FCurrentPosX := x - 1;
|
||||||
|
SetCaretRespondToFocus(Handle, not FPersistentCaret);
|
||||||
end;
|
end;
|
||||||
if (x <> FCurrentPosX) or (y <> FCurrentPosY) then
|
if (x <> FCurrentPosX) or (y <> FCurrentPosY) then
|
||||||
SetCaretPosEx(FHandle, x, y);
|
SetCaretPosEx(FHandle, x, y);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user