Click or drag to resize
CfxMenuModel Class

[This is preliminary documentation and is subject to change.]

Supports creation and modification of menus. See CfxMenuId for the command ids that have default implementations. All user-defined command ids should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of this structure can only be accessed on the browser process the UI thread.
Inheritance Hierarchy
SystemObject
  ChromiumCfxObject
    ChromiumCfxBase
      ChromiumCfxLibraryBase
        ChromiumCfxMenuModel

Namespace: Chromium
Assembly: ChromiumFX (in ChromiumFX.dll)
Syntax
public class CfxMenuModel : CfxLibraryBase

The CfxMenuModel type exposes the following members.

Properties
  NameDescription
Public propertyCount
Returns the number of items in this menu.
Public propertyNativePtr
Provides access to the underlying native cef struct. This is a refcounted library struct derived from cef_base_t. Add a ref in order to keep it alive when this managed object go out of scope.
(Inherited from CfxLibraryBase.)
Top
Methods
  NameDescription
Public methodAddCheckItem
Add a check item to the menu. Returns true (1) on success.
Public methodAddItem
Add an item to the menu. Returns true (1) on success.
Public methodAddRadioItem
Add a radio item to the menu. Only a single item with the specified |groupId| can be checked at a time. Returns true (1) on success.
Public methodAddSeparator
Add a separator to the menu. Returns true (1) on success.
Public methodAddSubmenu
Add a sub-menu to the menu. The new sub-menu is returned.
Public methodClear
Clears the menu. Returns true (1) on success.
Public methodStatic memberCreate
Create a new MenuModel with the specified |delegate|.
Public methodGetAccelerator
Retrieves the keyboard accelerator for the specified |commandId|. Returns true (1) on success.
Public methodGetAcceleratorAt
Retrieves the keyboard accelerator for the specified |index|. Returns true (1) on success.
Public methodGetCommandIdAt
Returns the command id at the specified |index| or -1 if not found due to invalid range or the index being a separator.
Public methodGetGroupId
Returns the group id for the specified |commandId| or -1 if invalid.
Public methodGetGroupIdAt
Returns the group id at the specified |index| or -1 if invalid.
Public methodGetIndexOf
Returns the index associated with the specified |commandId| or -1 if not found due to the command id not existing in the menu.
Public methodGetLabel
Returns the label for the specified |commandId| or NULL if not found.
Public methodGetLabelAt
Returns the label at the specified |index| or NULL if not found due to invalid range or the index being a separator.
Public methodGetSubmenu
Returns the submenu for the specified |commandId| or NULL if invalid.
Public methodGetSubmenuAt
Returns the submenu at the specified |index| or NULL if invalid.
Public methodGetType
Returns the item type for the specified |commandId|.
Public methodGetTypeAt
Returns the item type at the specified |index|.
Public methodHasAccelerator
Returns true (1) if the specified |commandId| has a keyboard accelerator assigned.
Public methodHasAcceleratorAt
Returns true (1) if the specified |index| has a keyboard accelerator assigned.
Public methodInsertCheckItemAt
Insert a check item in the menu at the specified |index|. Returns true (1) on success.
Public methodInsertItemAt
Insert an item in the menu at the specified |index|. Returns true (1) on success.
Public methodInsertRadioItemAt
Insert a radio item in the menu at the specified |index|. Only a single item with the specified |groupId| can be checked at a time. Returns true (1) on success.
Public methodInsertSeparatorAt
Insert a separator in the menu at the specified |index|. Returns true (1) on success.
Public methodInsertSubmenuAt
Insert a sub-menu in the menu at the specified |index|. The new sub-menu is returned.
Public methodIsChecked
Returns true (1) if the specified |commandId| is checked. Only applies to check and radio items.
Public methodIsCheckedAt
Returns true (1) if the specified |index| is checked. Only applies to check and radio items.
Public methodIsEnabled
Returns true (1) if the specified |commandId| is enabled.
Public methodIsEnabledAt
Returns true (1) if the specified |index| is enabled.
Public methodIsVisible
Returns true (1) if the specified |commandId| is visible.
Public methodIsVisibleAt
Returns true (1) if the specified |index| is visible.
Public methodRemove
Removes the item with the specified |commandId|. Returns true (1) on success.
Public methodRemoveAccelerator
Remove the keyboard accelerator for the specified |commandId|. Returns true (1) on success.
Public methodRemoveAcceleratorAt
Remove the keyboard accelerator at the specified |index|. Returns true (1) on success.
Public methodRemoveAt
Removes the item at the specified |index|. Returns true (1) on success.
Public methodSetAccelerator
Set the keyboard accelerator for the specified |commandId|. |keyCode| can be any virtual key or character value. Returns true (1) on success.
Public methodSetAcceleratorAt
Set the keyboard accelerator at the specified |index|. |keyCode| can be any virtual key or character value. Returns true (1) on success.
Public methodSetChecked
Check the specified |commandId|. Only applies to check and radio items. Returns true (1) on success.
Public methodSetCheckedAt
Check the specified |index|. Only applies to check and radio items. Returns true (1) on success.
Public methodSetCommandIdAt
Sets the command id at the specified |index|. Returns true (1) on success.
Public methodSetEnabled
Change the enabled status of the specified |commandId|. Returns true (1) on success.
Public methodSetEnabledAt
Change the enabled status at the specified |index|. Returns true (1) on success.
Public methodSetGroupId
Sets the group id for the specified |commandId|. Returns true (1) on success.
Public methodSetGroupIdAt
Sets the group id at the specified |index|. Returns true (1) on success.
Public methodSetLabel
Sets the label for the specified |commandId|. Returns true (1) on success.
Public methodSetLabelAt
Set the label at the specified |index|. Returns true (1) on success.
Public methodSetVisible
Change the visibility of the specified |commandId|. Returns true (1) on success.
Public methodSetVisibleAt
Change the visibility at the specified |index|. Returns true (1) on success.
Top
Remarks
See also the original CEF documentation in cef/include/capi/cef_menu_model_capi.h.
See Also