fpGUI icon indicating copy to clipboard operation
fpGUI copied to clipboard

Possible tiny logic error in fpg_edit

Open infologick opened this issue 5 years ago • 0 comments

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.

infologick avatar Oct 06 '20 16:10 infologick