DEFINE CONTROL CONTEXT MENU
Add a Context Menu to a Control

 

 

 

Standard Syntax (xBase Style):

 

 

      DEFINE CONTROL CONTEXT MENU <ControlName> [ OF <ParentWindowName> ]

 

            MENUITEM <cItemCaption>

                  ACTION <ActionProvedureName> | <bBlock>

                  [ NAME <MenuItemName>]

                  [ IMAGE <cImageName> ]

                  [ CHECKED ]

                  [ NOTRANSPARENT ]

                  [ TOOLTIP <cToolTipText> ]

 

            ...

            ...

 

            [ SEPARATOR ]

 

            ...

            ...

 

      END MENU

 

 

Alternate Syntax:

 

 

      DEFINE CONTROL CONTEXTMENU <ControlName> [ PARENT <ParentWindowName> ]

 

            MENUITEM <cItemCaption>

                  ONCLICK <ActionProvedure>

                  [ NAME <MenuItemName>]

                  [ IMAGE <cImageName> ]

                  [ CHECKED <lValue> ]

                  [ TRANSPARENT <lValue> ]

                  [ TOOLTIP <cToolTipText> ]

 

            ...

            ...

 

            [ SEPARATOR ]

 

            ...

            ...

 

      END MENU

 

 

Control ContextMenu Properties:

 

 

      - Parent (R)

 

      R: Read-Only

 

 

MenuItem Properties:

 

 

      - Name (R)

      - Checked

      - Enabled

      - Image

      - ToolTip

 

      R: Read-Only

 

 

MenuItem Events:

 

 

      - OnClick

 

 

 

You can DEFINE/RELEASE Menu at runtime:

 

      - RELEASE CONTROL CONTEXT MENU  cControlName  OF | PARENT cParentName

      - RELEASE CONTROL CONTEXTMENU   cControlName  OF | PARENT cParentName

      - ReleaseControlContextMenu   ( cControlName, cParentForm )

 

      - IsControlContextMenuDefined ( cControlName, cParentForm ) --> Return lBoolean

 

 

  

Set On/Off Control Context Menu:

      - SET CONTROL CONTEXTMENU  [ ON | OFF ]

      - SET CONTROL CONTEXT MENU [ ON | OFF ]