Page 1 of 1

How to enable action shortcut

Posted: Sun Feb 03, 2008 5:28 pm
by DickBryant
I have an editor form that has no "main menu" itself - only buttons and popup menus. I've modified RVAPopupMenuHelper.PreparePopup(X, Y: Integer) as follows:
-----------------
AddAction(TrvActionCut);
AddAction(TrvActionCopy);
AddAction(TrvActionPaste);
AddAction(nil);
//------------My Mods
AddAction(TrvActionFontBold);
AddAction(TrvActionFontItalic);
AddAction(TrvActionFontUnderline);
AddAction(nil);
//-----------End My Mods
AddAction(TrvActionFontEx);
AddAction(TrvActionParagraph);
AddAction(TrvActionParaList);
-----------------

My problem is that the shortcuts associated with FontBold, FontItalic and Font Underline (Ctrl-B, Ctrl-I and Ctrl-U) do not work until I display the popup the first time. After that they work properly.

How can I get these shortcuts to work without having to first display the popup menu?

Posted: Mon Feb 04, 2008 4:03 pm
by Sergey Tkachenko
When actions are placed on the form, shortcuts work even if they are not assigned to any menu item or button
(I just checked in D6)

Posted: Mon Feb 04, 2008 9:18 pm
by DickBryant
Thanks! I'll give that a try :-)

<Later> Yes, that worked. I was using actions that were placed on a different form, with that form in the Uses clause. I removed that form from the Uses clause and put a 'fresh' TActionList and TImageList on the actual editor form and now the shortcuts work fine.