Skip to content

Possible tiny logic error in fpg_edit #104

@infologick

Description

@infologick

Hello,

The status of the TPopupMenu Copy is set like this (right click in a TfpgEdit):

procedure SetDefaultPopupMenuItemsState;
...\...
else if itm.Name = ipmCopy then
        itm.Enabled := FSelOffset <> 0

Therefore, a char must be selected to enable the 'Copy' menu, to activate it. If it is Enabled, active, with 1 or several highlighted char (even in a TfpgEdit with ReadOnly=True), and if one clicks on this enabled TfpgPopupMenu 'Copy', then nothing is done because here is the called code:

procedure TfpgBaseEdit.DefaultPopupCopy(Sender: TObject);
begin
  if ReadOnly then // ??
    Exit; // ??
  CopyToClipboard;
end; 

said differently, we cannot copy into a readonly TfpgEdit.
Amo, the statement "if ReadOnly then Exit;" should be deleted.

Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions