I tried a dummy menu and it works. I may as well do it this way and copy the menu to each form. Now the shortcuts can be changed, enabled, disabled, etc, and this is reflected throughout the program. Not so messy after all.
From: [email protected] [mailto:[email protected]] On Behalf Of Ross Levis Sent: Monday, 4 February 2013 11:13 p.m. To: 'NZ Borland Developers Group - Delphi List' Subject: Re: [DUG] Mainform ActionList keyboard shortcuts from other forms I have noticed you can assign event properties in another form to an action on the mainform, but in this case there is no component in each form to assign each action, so not relevant in this case. I suppose I could put a hidden menu on each form and assign menu items to each of the actions on the mainform. But rather messy. From: [email protected] [mailto:[email protected]] On Behalf Of Kyley Harris Sent: Monday, 4 February 2013 8:49 p.m. To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] Mainform ActionList keyboard shortcuts from other forms from what I'm aware, and you can look at the source to confirm, but any action in an action list on the main form are handled by all forms. the action call back code checks the active form, before asking the mainform to test it. I have just added basic edit cut,copy paste actions to my main form and have a single popup menu on the main form, which i dynamically bind to all edit controls in the app. its working perfectly On Mon, Feb 4, 2013 at 8:00 PM, Ross Levis <[email protected]> wrote: What would be the easiest method to get some shortcuts that are defined in an Actionlist on the mainform to work when another form has the focus? I have code to set the ShortCut number in the Actionlist based on user settings. I believe I can use TApplication.OnShortCut and manually check for keys pressed. Is that the best method? It will mean duplicating code as I still need the ActionList for some associated buttons and menu items. Ross. _______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: [email protected] Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [email protected] with Subject: unsubscribe -- Kyley Harris Harris Software +64-21-671-821
_______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: [email protected] Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [email protected] with Subject: unsubscribe
