CGrid:new


The new method constructs a new instance of a CGridobject which can be opened into a dialog window. The CGrid object may also be constructed using the new_grid function.

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 = CGrid:new()

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

G = CGrid:new( GridParams )

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

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 = CGrid:new(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_grid, GridParams table


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