DesignEditors.TComponentEditor.GetVerbCount

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetVerbCount: Integer; virtual;

C++

virtual int __fastcall GetVerbCount();

Properties

Type Visibility Source Unit Parent
function public
DesignEditors.pas
DesignEditors.hpp
DesignEditors TComponentEditor

Description

Returns the number of menu strings added to the context menu by the component editor.

The form designer calls GetVerbCount when the user right-clicks the component in order to determine the number of menu items that should be added to the context menu. It then adds the menu items by calling GetVerb for every value from 0 to GetVerbCount - 1.

TComponentEditor does not supply any verbs for its component. As a result, GetVerbCount returns 0. Override GetVerbCount when providing a set of verbs, or menu strings, to be added to the context menu. When overriding GetVerbCount, override GetVerb to return the actual strings, and override ExecuteVerb to implement a response to each of these verbs. For example, if adding two verbs to the context menu, GetVerbCount should return 2, GetVerb should return a value for an Index of 0 and for an Index of 1, and ExecuteVerb should perform the corresponding actions for an Index of 0 and for an Index of 1.

See Also