Jump to content

wpInsertPopupMenuItems

From EDM2

This instance method is called to allow an object to insert items into its pop-up menu.

Syntax

_wpInsertPopupMenuItems(somSelf, hwndMenu, iPosition, hmod, MenuID, SubMenuId)

Parameters

somSelf (WPObject *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPObject.
hwndMenu (HWND) - input
Handle to the pop-up menu.
iPosition (ULONG) - input
Position at which to start inserting items.
hmod (HMODULE) - input
Module handle where MenuID can be found.
MenuID (ULONG) - input
ID of menu to put into pop-up menu.
For a listing of WPMENUIDs, see the individual object classes.
SubMenuId (ULONG) - input
ID of submenu to put into pop-up menu.

Returns

rc (BOOL) - returns
Success indicator.
TRUE: Successful completion.
FALSE: Error occurred.

Remarks

This instance method will insert all menu items in **MenuID** into the pop-up menu. Menu item IDs in open cascade must match corresponding open view. Class-specific menu IDs should be above WPMENUID_USER.

Usage

This method can be called only during the processing of wpModifyPopupMenu.

How to Override

This method is generally not overridden.

Example Code

This example adds an extra option to the context menu to close all but the first view.

SOM_Scope BOOL   SOMLINK myfold_wpModifyPopupMenu(MYFOLDER *somSelf,
                                 HWND hwndMenu,
                                 HWND hwndCnr,
                                 ULONG iPosition)

{
    HMODULE   hmod = NULLHANDLE;
    zString   zsPathName;

    /* MYFOLDERData *somThis = MYFOLDERGetData(somSelf); */
    MYFOLDERMethodDebug("MYFOLDER","myfold_wpModifyPopupMenu");

    hmod = _clsQueryModuleHandle(_MYFOLDER);
    if (hmod)
    {
       _wpInsertPopupMenuItems( somSelf, hwndMenu, 0, hmod, ID_CLOSEVIEWSMENU, 0);
    }

    return (parent_wpModifyPopupMenu(somSelf,hwndMenu,hwndCnr,iPosition));
}

Related Methods