graemeg / fpGUI

fpGUI Toolkit is a cross-platform GUI toolkit using Free Pascal

Home Page:http://fpgui.sourceforge.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible tiny logic error in fpg_edit

devEric69 opened this issue · 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.