CGrid:AddMenuExecute


The AddMenuExecute method adds an "Execute Script" command to the pop-up menu for the modeless CGrid Dialog. When this command is execute from the pop-up menu, it opens the file browser for selecting and executing a selected script. This feature is available only with the modeless grid dialog created using new_griddlg.

Syntax

CGrid:AddMenuExecute()

Example

The following script adds an "Execute Script" command and two other script commands to the pop-up menu of the modeless grid dialog. The second parameter in AddMenu() should be the full file path to the script. Since thee are normally very long strings, they are shown here in an abbreviated form.

G = new_grid()

-- create a new CGrid object

-- assemble the grid

 

G:AddMenuExecute()

-- add an "Execute Script" command

G:AddMenu("Name 1", C:\\...\\script1.lua")

-- add the command "Name 1" to the menu

G:AddMenu("Name 2", C:\\...\\script2.lua")

-- add the command "Name 1" to the menu

D = new_griddlg(G)

-- open the modeless grid dialog

Related Topics

CGrid class, AddMenu , DeleteMenus , new_griddlg


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.