mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-16 05:40:38 +01:00
SynEdit: Fixed , make TAction regard ReadOnly state (Allow CanUndo, CanPaste from app-code, even if read only)
git-svn-id: trunk@39394 -
This commit is contained in:
parent
7804a0b9f1
commit
7bea250603
@ -4910,18 +4910,17 @@ end;
|
||||
|
||||
function TCustomSynEdit.GetCanUndo: Boolean;
|
||||
begin
|
||||
result := fUndoList.CanUndo and (not ReadOnly);
|
||||
result := fUndoList.CanUndo;
|
||||
end;
|
||||
|
||||
function TCustomSynEdit.GetCanRedo: Boolean;
|
||||
begin
|
||||
result := fRedoList.CanUndo and (not ReadOnly);
|
||||
result := fRedoList.CanUndo;
|
||||
end;
|
||||
|
||||
function TCustomSynEdit.GetCanPaste:Boolean;
|
||||
begin
|
||||
Result := (not ReadOnly) and
|
||||
(Clipboard.HasFormat(CF_TEXT) or
|
||||
Result := (Clipboard.HasFormat(CF_TEXT) or
|
||||
Clipboard.HasFormat(TSynClipboardStream.ClipboardFormatId)
|
||||
)
|
||||
end;
|
||||
@ -8050,11 +8049,11 @@ begin
|
||||
else if (TheAction is TEditCopy) then
|
||||
TEditAction(TheAction).Enabled := SelAvail
|
||||
else if TheAction is TEditPaste then
|
||||
TEditAction(TheAction).Enabled := CanPaste
|
||||
TEditAction(TheAction).Enabled := CanPaste and (not ReadOnly)
|
||||
else if TheAction is TEditDelete then
|
||||
TEditAction(TheAction).Enabled := (not ReadOnly)
|
||||
else if TheAction is TEditUndo then
|
||||
TEditAction(TheAction).Enabled := CanUndo
|
||||
TEditAction(TheAction).Enabled := CanUndo and (not ReadOnly)
|
||||
else if TheAction is TEditSelectAll then
|
||||
TEditAction(TheAction).Enabled := TRUE;
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user