First, do I have to implement myself a right-click popup menu for SynEdit to get right-click Cut,Copy,Paste,Delete functionality?
If so, I would like to use the PopupComponent property of the popup menu to determine which of three SynEdit's popped the menu. But, the following code leaves all the menu items enabled even when there is no selected text in ChecklistSynEdit when I right-click ChecklistSynEdit:
procedure TForm1.EditPopupMenuPopup(Sender: TObject);
begin
if EditPopupMenu.PopupComponent = ChecklistSynEdit then
with ChecklistSynEdit do begin
CutItem.Enabled := SelText <> '';
CopyItem.Enabled := SelText <> '';
DeleteItem.Enabled := SelText <> '';
PasteItem.Enabled := Clipboard.HasFormat(CF_TEXT) ;
end;
end;
If I remove the if EditPopupMenu.PopupComponent... check, the enable's work as expected.