System.Actions.CreateAction

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function CreateAction(AOwner: TComponent; ActionClass: TBasicActionClass; FrameworkType: string = ''): TBasicAction;

C++

extern DELPHI_PACKAGE System::Classes::TBasicAction* __fastcall CreateAction(System::Classes::TComponent* AOwner, System::Classes::TBasicActionClass ActionClass, System::UnicodeString FrameworkType = System::UnicodeString());

Properties

Type Visibility Source Unit Parent
function public
System.Actions.pas
System.Actions.hpp
System.Actions System.Actions

Description

Creates an action of the specified <ActionClass> type.

Calling this function does the same thing as calling the constructor of <ActionClass>. The only difference is that CreateAction uses the Resource parameter of the RegisterActions procedure to initialize the values of the new action object.

To create an action, the CreateAction function calls the procedure stored in the CreateActionProc variable. The IDE should assign the proper procedure to the CreateActionProc variable.

Just before calling the procedure stored in the CreateActionProc variable, CreateAction sets the vDesignAction variable to True. CreateAction restores the initial value of the vDesignAction variable as soon as the execution of the CreateActionProc procedure accomplishes. Therefore, when testing the value of the vDesignAction variable, an action constructor can check whether it is called from the IDE or from a user application.

CreateAction has the following parameters:

  • <AOwner> is the owner of the action. It is typically the form or data module.
  • <ActionClass> defines the type of action to create. The type is an action class belonging to the TBasicActionClass type. Template:F

See Also