First I created my own Edit menu.
I then catch menu events and pass them to MyEditFormDoCommand:
case menuEvent:
return MyEditFormDoCommand (&event->data.menu.itemID);
MyEditFormDoCommand() changes the itemID to the system's so it'll handle the
event.
static Boolean MyEditFormDoCommand (Word *pwID)
{
switch (*pwID)
{
case EditMenuCut:
*pwID = sysEditMenuCutCmd;
return false; // So system handles it.
break;
case EditMenuCopy:
*pwID = sysEditMenuCopyCmd;
return false; // So system handles it.
break;
case EditMenuPaste:
*pwID = sysEditMenuPasteCmd;
return false; // So system handles it.
break;
}
}
Steve Achelis
"Wang Yan-FYA009" <[EMAIL PROTECTED]> wrote in message
news:45637@palm-dev-forum...
>
> Hi,
>
> If I add a edit menu to my menu bar with those undo/cut/copy/paste, I have
> to give this edit menu as resource ID 10000, then I don't have to anything
> in my code to support those undo/cut/copy/paste/keyboard for edit field,
> right? How can I do that in constructor? I checked Mail sample code, it
> seems nothing is done there. The edit menu ID is just like 1010. But when
> generate a resource.h file from that, the ID changed to 10000. What's the
> trick here?
>
> Regards,
> Yan
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/