wpMenuItemSelected
Appearance
This instance method is called to allow an object to process a pop-up menu selection.
Syntax
_wpMenuItemSelected(somSelf, hwndFrame, ulMenuId)
Parameters
- somSelf (WPObject *) - input
- Pointer to the object on which the method is being invoked.
- Points to an object of class WPObject.
- hwndFrame (HWND) - input
- Handle to the frame window.
- ulMenuId (ULONG) - input
- ID of the selected pop-up menu.
- For a listing of WPMENUIDs, see the individual object classes.
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE: Successful completion.
- FALSE: Error occurred.
Remarks
Class-specific menu IDs should be above WPMENUID_USER.
Usage
This method is generally called only by the system when a pop-up menu item is selected.
How to Override
This method should be overridden to process class-specific menu-item actions or to modify the behavior of a menu-item action provided by an ancestor class.
Example Code
This example opens Hex and Text views.
SOM_Scope BOOL SOMLINK Browse_O_Maticwps_wpMenuItemSelected(Browse_O_Matic *somSelf,
HWND hwndFrame,
ULONG ulMenuId)
{
/* Browse_O_MaticData *somThis = Browse_O_MaticGetData(somSelf); */
Browse_O_MaticMethodDebug("Browse_O_Matic","Browse_O_Maticwps_wpMenuItemSelected");
switch( ulMenuId ){
case ID_OPEN_TEXT:
_wpViewObject( somSelf, NULLHANDLE, ulMenuId, 0L );
break;
case ID_OPEN_HEX:
_wpViewObject( somSelf, NULLHANDLE, ulMenuId, 0L );
break;
case ID_OPEN_PRODUCTINFO:
case ID_PRODUCTINFOMENU:
_wpViewObject( somSelf, NULLHANDLE, ulMenuId, 0L );
default:
return( parent_wpMenuItemSelected( somSelf, hwndFrame, ulMenuId) );
}
return( TRUE );
}