donvittorio
Programmer
Hi, I'll try and keep the description of my problem short.
I have a program with two TStringGrids, one a parent and one a child, both of which allow editing.
I have written some functionality in the program which allows you to copy and paste parent items, which is assigned to TAction.OnExecute events (one for copy and one for paste, of course), and the actions are assigned to TMenuItems in a TMainMenu and a TPopupMenu.
I would like to allow the user to use CTRL+C and CTRL+V to call these events, but if I assign these as the shortcuts of the TActions then CTRL+C/CTRL+v will always call these events, regardless of what the user is doing. For example this would remove the ability to use CTRL+C/CTRL+V to copy and paste text when editing cells of the grid. So I would like to call them only if the parent grid has focus and is not in EditorMode.
I hope that made sense, an example of similar behaviour is in Windows Explorer, if file is highlighted and you press CTRL+C then you copy the file, but if the file is being renamed then you copy the text in the filename instead.
I can't figure out a way of doing this, does anybody have any ideas?
Thanks in advance
Steve
I have a program with two TStringGrids, one a parent and one a child, both of which allow editing.
I have written some functionality in the program which allows you to copy and paste parent items, which is assigned to TAction.OnExecute events (one for copy and one for paste, of course), and the actions are assigned to TMenuItems in a TMainMenu and a TPopupMenu.
I would like to allow the user to use CTRL+C and CTRL+V to call these events, but if I assign these as the shortcuts of the TActions then CTRL+C/CTRL+v will always call these events, regardless of what the user is doing. For example this would remove the ability to use CTRL+C/CTRL+V to copy and paste text when editing cells of the grid. So I would like to call them only if the parent grid has focus and is not in EditorMode.
I hope that made sense, an example of similar behaviour is in Windows Explorer, if file is highlighted and you press CTRL+C then you copy the file, but if the file is being renamed then you copy the text in the filename instead.
I can't figure out a way of doing this, does anybody have any ideas?
Thanks in advance
Steve