Jump to content

WpFilterPopupMenu: Difference between revisions

From EDM2
Created page with "{{DISPLAYTITLE:wpFilterPopupMenu}} 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..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 3: Line 3:


==Syntax==
==Syntax==
_wpFilterPopupMenu(somSelf, ulFlags, hwndCnr, fMultiSelect)
_wpFilterPopupMenu(somSelf, ulFlags, hwndCnr, fMultiSelect)


==Parameters==
==Parameters==
;''somSelf'' ([[WPObject]] *) - input
;''somSelf'' ([[WPObject]] *) - input:Pointer to the object on which the method is being invoked.
:Pointer to the object on which the method is being invoked.
:Points to an object of class WPObject.
: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.
;''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_ARRANGE Open arrange
|-
:CTXT_CLOSE Close
|CTXT_CLOSE||Close
:CTXT_COPY Copy
|-
:CTXT_DELETE Delete
|CTXT_COPY||Copy
:CTXT_DETAILS Open details view
|-
:CTXT_FIND Open find
|CTXT_DELETE||Delete
:CTXT_HELP Help
|-
:CTXT_ICON Open icon view
|CTXT_DETAILS||Open details view
:CTXT_LINK Create shadow
|-
:CTXT_LOCKUP Open lockup
|CTXT_FIND||Open find
:CTXT_MOVE Move
|-
:CTXT_NEW Create another
|CTXT_HELP||Help
:CTXT_OPEN Open
|-
:CTXT_PALETTE Open palette
|CTXT_ICON||Open icon view
:CTXT_PRINT Print
|-
:CTXT_PROGRAM Open program
|CTXT_LINK||Create shadow
:CTXT_REFRESH Refresh
|-
:CTXT_SELECT Open select
|CTXT_LOCKUP||Open lockup
:CTXT_SHUTDOWN Open shutdown
|-
:CTXT_SORT Open sort
|CTXT_MOVE||Move
:CTXT_SETTINGS Open settings
|-
:CTXT_SWITCHTO Switch to
|CTXT_NEW||Create another
:CTXT_TREE Open tree view
|-
:CTXT_WINDOW Window
|CTXT_OPEN||Open
 
|-
;''hwndCnr'' ([[HWND]]) - input
|CTXT_PALETTE||Open palette
:Handle to container control window.
|-
|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.
::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.
::other: The handle of the container requesting the pop-up menu.
 
;''fMultiSelect'' ([[BOOL]]) - input:Multiple menu items flag.
;''fMultiSelect'' ([[BOOL]]) - input
:Multiple menu items flag.


==Returns==
==Returns==

Latest revision as of 20:13, 1 September 2025

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 );
}

Related Methods