attachlist_panegridctrl


The attachlist_panegridctrl function attaches a CGridCtrl object to the grid control in a docking pane owned by a view window. Grid Controls are supported by top-level Grid View windows and Grid dialogs, and by docking panes owned by some top-level windows. To attach to the grid control of a top-level window, use the attachlist_gridview function. To attach the grid in a docking pane, use this method. For example, the Image Window attached to a CImageView object offers several dockibg panes for measurements such as Centroids, Statistics, Points, etc. The current function connects a CGridCtrl object to one of the Image Window grid panes. If one grid pane is open more than one grid pane is open by the target view window, a selector window opens for selecting the grid pane.

Syntax

CGridCtrl_obj = attachlist_panegridctrl( View_Object )

bullet.gif    View_Object is an object of a view class, like CImageView or CPlotView.

bullet.gif    On success, CGridCtrl_Obj is a new CGridCtrl class object.

bullet.gif    On failure, nil is returned. This means no grid pane exists or was selected.

Remarks

This function returns a selected grid docking panee owned by the view window attached to View_object. If the target image window has more than one open grid pane, a selector dialog opens for choosing the target docking pane. The selector dialog shown below indicates that the target image window has 3 open grid docking panes. The "FWHM" docking pane is being selected for return to the script:

Example

Assume that at least one image window is displayed on the Mira desktop and one or more of them has an open docking pane containing a grid control. The following script selects an image window and then selects a docking pane containing a grid control. :

V = attachlist_imageview()

-- attach an image window from the desktop

if not V then Exit("No image window.") end

-- exit if no image window is attached

-- display a list of the grid panes of V, then

 

-- select one, and return as CGridCtrl object G

 

G = attachlist_panegridctrl(V)

-- select the pane and attach the grid control

if not G then Exit("No grid pane.") end

-- exit if no grid control was attached

Printf("Pane='%s', cols=%d, rows used=%d\n",

-- list properties of the attached CGridCtrl

   G:GetWndTitle(), G:GetNumCols(), G:GetMaxRow())

--result: Pane='FWHM', cols=10, rows used=1

Related Topics

CGridCtrl class

CGridView class

attachlist_gridview

CGridView class

CGrid class

new_gridctrl

new_gridview

new_griddlg

new_griddlgmodal


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