I'm trying to program three menu items to respectively perform cut, copy and paste operations on TTMSFMXGrid components. (Ctrl+X, Ctrl+C, Ctrl+V work out of the box but I am having some difficulty doing it through menu items.)
I figured out how to do it if entire cells are selected. I don't know if this is the best method but it works for entire cells:
ActiveObj := Focused.GetObject;
if Assigned(ActiveObj) then
if ActiveObj is TTMSFMXGrid then
But I cannot figure out how to do it if the user is editing a cell and has selected all or part of the cell text.
In edit mode, you'll need to access the inplace editor and use the clipboard functionality of that control. For TEdit based editors, you can use the following code:
if Assigned(TMSFMXGrid1.ActiveEditControl) and Supports(TMSFMXGrid1.ActiveEditControl, ITextActions, ta) then