wpFilterPopupMenu
Appearance
This instance method is called to allow the object to modify its context menu.
Syntax
_wpFilterPopupMenu(somSelf, ulFlags, hwndCnr, fMultiSelect)
Parameters
- somSelf (WPObject *) - input
- Pointer to the object on which the method is being invoked.
- Points to an object of class WPObject.
- ulFlags (ULONG) - input
- Pop-up menu flags. If the flag is set, the corresponding pop-up menu item is available. These flags are **ORed** together, with the flags already defined by ancestor classes, to specify the standard pop-up menu items that apply to this object.
CTXT_ARRANGE Open arrange CTXT_CLOSE Close CTXT_COPY Copy CTXT_DELETE Delete CTXT_DETAILS Open details view CTXT_FIND Open find CTXT_HELP Help CTXT_ICON Open icon view CTXT_LINK Create shadow CTXT_LOCKUP Open lockup CTXT_MOVE Move CTXT_NEW Create another CTXT_OPEN Open CTXT_PALETTE Open palette CTXT_PRINT Print CTXT_PROGRAM Open program CTXT_REFRESH Refresh CTXT_SELECT Open select CTXT_SHUTDOWN Open shutdown CTXT_SORT Open sort CTXT_SETTINGS Open settings CTXT_SWITCHTO Switch to CTXT_TREE Open tree view CTXT_WINDOW Window
- hwndCnr (HWND) - input
- Handle to container control window.
- NULLHANDLE: A pop-up request is made on the "whitespace" of an open view.
- other: The handle of the container requesting the pop-up menu.
- fMultiSelect (BOOL) - input
- Multiple menu items flag.
Returns
- rc (ULONG) - returns
- New pop-up menu flags for this object.
Usage
This method is generally called only by the system when a request is made to display the object's pop-up window.
How to Override
This method should be overridden to remove undesired pop-up menu actions that were added by ancestor classes. The parent method should be called prior to any override processing.
Example Code
In this example, the Tree view option is removed from the Open popup menu.
SOM_Scope ULONG SOMLINK TextFolderwps_wpFilterPopupMenu(TextFolder *somSelf, ULONG ulFlags, HWND hwndCnr, BOOL fMultiSelect) { /* TextFolderData *somThis = TextFolderGetData(somSelf); */ TextFolderMethodDebug("TextFolder","TextFolderwps_wpFilterPopupMenu"); ulFlags = parent_wpFilterPopupMenu(somSelf,ulFlags,hwndCnr,fMultiSelect); /* Remove the tree view menu option and make sure delete is available */ return ( ( ulFlags | CTXT_DELETE) & ~CTXT_TREE ); }