>What is the method for handling the standard Edit Menu options (cut, paste,
>undo, etc.)? In my app I have been handling them by specifically handling
>the event code for each one, call FrmGetFocus, and then calling FldCut,
>FldUndo, etc. Looking at the source code for the Memo Pad app, however, I
>don't see any handling of these events even though they're obviously
>supported. Did I miss something? Are there some default event IDs for these
>options that the OS will handle if I return "false" in my own event handler?
Here's one way to get the system to handle them for you (inspired by
a comment someone made on this list a few months ago). In your form
event handler:
Boolean handled = false;
case menuEvent:
if ( ! EditMenuCommand ( &eventP->data.menu.itemID ))
{
handled = MainFormDoMenuCommand ( eventP->data.menu.itemID );
}
break;
/***********************************************************************
* FUNCTION: EditMenuCommand
*
* DESCRIPTION: This routine handles edit menu commands by converting
* the edit menu command ID to a system
edit menu command ID.
*
* RETURNED: true if the command is an edit menu command
***********************************************************************/
static Boolean EditMenuCommand
(
UInt16 * command // ( in ) Pointer to the ID of the menu command to do
)
{
Boolean isEditCmd = false;
UInt16 cmd = * command;
if ( *command >= EditUndo && *command <= EditGraffitiHelp ) // my menu defs
{
*command = * command - EditUndo + sysEditMenuUndoCmd;
isEditCmd = true;
}
return ( isEditCmd );
}
--
-------------------------------------------
Creative Digital Publishing Inc.
1315 Palm Street, San Luis Obispo, CA 93401-3117
-------------------------------------------
805.784.9461 805.784.9462 (fax)
[EMAIL PROTECTED] http://www.cdpubs.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/