CGrid:Class Definition


The CGrid works with data in the 2-dimensional tabular form of a data grid. The CGrid class works with a Mira CTableView Window. It can use the default "Grid" pane of the Script Editor or an existing CTableView window created by some other means.

Global Functions

The following functions are provided to expedite plotting of data when the values to be plotted are in arrays. The functions also can plot x and y error bars. They return an instance of a CGrid object to the script for additional use. These functions are compared here.

NewGrid

Global form of the new method used to create a new CGrid object

DefGrid

Attaches the default grid provided by the Script Editor window.

AttachGrid

Attaches an existing grid window to the script.

Usage

Construction

Object = CGrid:new()

Alternatvely, use one of the global functions listed above.

Destruction

Object:delete()

CGrid Topics

Plotting a Least Squares Fit

Class Methods

Construction

new

Creates a new instance of a CGrid object.

delete

Deletes a CGrid object.

Attach

Attaches the top-most window (a grid window) to the script and creates a new CGrid class object for it.

Grid Configuration

These methods work with grid configuration. Note: A new grid has 1 sheet by default.

SetDim

Set the number of columns, rows, and sheets.

SetNumCols

Sets the number of columns in the grid.

SetNumRows

Sets the number of rows in the grid.

SetNumSheets

Sets the number of sheets in the grid.

GetNumCols

Returns the number of columns in the grid.

GetNumRows

Returns the number of rows in the grid.

GetNumSheets

Returns the number of sheets in the grid.

SelectSheet

Selects the current sheet, from 1 to GetNumSheets.

DeleteSheet

Deletes a sheet from the grid.

Operations on Columns, Rows, and Cells

These methods work with data in the grid.

Set

Sets the data in a cell.

SetCol

Sets a column of data using data in a lua array.

SetRow

Sets a row of data using data in a lua array.

Get

Returns the data from a cell.

GetCol

Returns a column of data as a lua array.

GetRow

Returns a row of data as a lua array.

Operations on Grids

GetHandle

 

AttachHandle

 

Related Topics

Script classes