How to enable action shortcut

General TRichView support forum. Please post your questions here
Post Reply
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

How to enable action shortcut

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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)
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

Post 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.
Post Reply