CGridView:new


The new method constructs a new instance of a CGridViewobject. This object is an interface to a grid window on the Mira desktop that can be manipulated using methods in the CGridView class. The CGridView object may also be constructed using the new_gridview function.

When a new CGridView object is created, rather than attached to an existing window, the grid dimensions in columns and rows and other parameters are normally initialized using the GridParams table. See the Example below.

Syntax

G = CGridView:new( strName )

bullet.gif    Creates a CGridView with window title strName and grid properties initialized to default values.

G = CGridView:new( strName, GridParams )

bullet.gif    Creates a new CGridView object with window title strName and grid properties initialized to the properties in a GridParams table.

Example

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

params =

-- define the grid properties

{

 

  nCols = 12,

-- create 12 columns

  nRows = 20,

 

  nSheets = 1,

 

  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 = CGridView:new("My Grid", params)

-- create CGridView with properties in params

Related Topics

CGridView class, new_gridview, GridParams table


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