new_grid


 The new_grid function is a non-class version of the CGrid:new method that creates a CGrid object. This object can be opened into a dialog window using new_griddlg or new_griddlgmodal.

When a new CGrid object is created, the grid dimensions in columns and rows and other parameters are initialized using the GridParams table. See the Example below.

Syntax

G = new_grid()

bullet.gif    Creates a CGrid with grid properties initialized to default values.

G = new_grid( GridParams )

bullet.gif    Creates a new CGrid object with properties initialized to the properties in a GridParams table.

bullet.gif    On failure, nil is returned.

Example

The following script creates a CGrid object using the GridParams table to initialize the grid:

params =

-- define the grid properties

{

 

  nCols = 12,

-- create 12 columns

  nRows = 20,

 

  nSH_Cols = 1,

 

  nSH_Width = 24,

 

  nTH_Rows = 2,

-- create 2 top heading rows

  nTH_Height = 16,

-- each top heading row has a height of 16

}

 

G = new_grid(params)

-- create CGrid with properties in params

-- assemble the grid

 

D = new_griddlg(G)

-- open the final grid into a modeless dialog

Related Topics

CGrid class, new, delete, new_griddlg, new_griddlgmodal, GridParams table


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