Skip to main content
All docs
V25.1
  • TdxAICommandList.Move(Integer,Integer) Method

    Moves an AI-powered command within the collection.

    Declaration

    procedure Move(ACurIndex: Integer; ANewIndex: Integer);

    Parameters

    Name Type Description
    ACurIndex Integer

    The initial AI command index in the collection.

    ANewIndex Integer

    The target AI command index in the collection.

    Remarks

    Command indexes indicate their positions in the UI. For example, an editor’s context menu lists all commands in the current list from top to bottom within the AI Assistant submenu:

    VCL Rich Edit: AI-Powered Commands

    Call the Move procedure to move an individual AI command to a different position.

    Code Example: Rearrange AI-Powered Commands

    The following code example moves Explain and Proofread commands to the second and third positions in a context menu, respectively:

    uses
      dxRichEdit.Control,  // Declares TdxRichEditControl
      dxAI;  // Declares AI-specific types
    // ...
    
    procedure TMyForm.dxRichEditControl1GetAICommands(Sender: TObject;
      const AAICommands: TdxAICommandList);
    var
      ACommandIndex: Integer;
    begin
      ACommandIndex := AAICommands.IndexOf(TdxAICommandIDs.Explain);
      AAICommands.Move(ACommandIndex, 1);  // Moves "Explain" to the second position (after "Expand")
      ACommandIndex := AAICommands.IndexOf(TdxAICommandIDs.Proofread);
      AAICommands.Move(ACommandIndex, 2);  // Moves "Proofread" to the third position (after "Explain")
    end;
    

    VCL Shared Libraries: Rearranged AI-Powered Commands in a Context Menu

    See Also