The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Using TNTabEd


NTabEd provides a table of numerical values which can be edited in various ways. This table consists of the following key elements:

The data table: the data table consists of numeric cells organized in a rectangular array. Each cell holds a numeric value, which may be marked by certain tags. The data table is based on the TDataTable class. All methods of the TDataTable class can be applied to the table data as well. The data can be accessed by the public identifier Data which is of the type TDataTable.

Row and column attributes: each row or column has a numeric attribute between 0 and 255. These attributes may be used to assign different classes to some of the rows (array property RowAttrib), or columns (array property ColAttrib). The attributes may either be visible or invisible, depending on the state of the properties AttribRowVisible, and AttribColVisible.

Row and column identifiers: each row and column has an identifier which designates its name. The identifier may have a maximum length of 20 characters and can be accessed by the array properties RowName and ColName.

The cell cursor: the cell cursor shows the cell coordinates of the currently active cell (the cell where the cursor is in). The first number is the x-coordinate, the second number after the colon is the y-coordinate. The upper left cell of the control has the coordinates [1:1].

A comment line: the table may contain a comment line of arbitrary length which is accessible via the property Comment. The comment is always invisible except when editing it (see below).

NTABEDUI.gif

The picture above shows the key elements of a table. You may manipulate these items by right clicking at them and selecting the intended action from the popup menu. In general, the behavior of TNTabEd changes with the edit mode, which may be adjusted by setting the goEditing flag of the Options property to TRUE or FALSE. If goEditing is set TRUE individual cells may be edited, if goEditing is set FALSE, a range of cells can be selected for further processing by commands of the popup menu. The editing state may also be switched by using the popup menu.

Editing the comment line

Apart from setting the comment line by using the property Comment it may be edited directly by right clicking at the cell cursor field. This brings up the comment editor. You may enter or edit the comment. Pressing <ENTER> closes the comment editor and stores the edited line in the comment property of TNTabEd. Pressing <ESC>, or clicking into the "comment" label of the editor closes the editor without storing the changed text.

Changing the precision of the numbers in a column

The precision of the numbers can be changed columnwise. This can be achieved either by using the array property Precision, or by right-clicking at the corresponding column header. Thereafter a popup menu is displayed which can be used to change the displayed precision. The number of decimal places can be changed cyclically by clicking the command change precision repeatedly.

Editing the column or row identifiers

The column or row identifiers can be edited by right-clicking at the appropriate identifier. The upcoming pop-up menu contains a command "edit identifier". Clicking at it brings up an edit box which can be used to edit the selected identifier. The new text is stored as the identifier when the <ENTER> key is pressed. Pressing the <ESC> key cancels the editing process. Note that column and row identifiers can be changed by setting the array properties ColName, and RowName, respectively.

Editing the column or row attributes

The column or row attributes can be edited by right-clicking at the appropriate attribute. The upcoming pop-up menu contains a command "edit identifier". Clicking at it brings up an edit box which can be used to edit the selected attribute. Please note, that editor allows text input whereas the attributes are numeric. Inputting any invalid number does not change the existing attribute. The new value is stored when the <ENTER> key is pressed. Pressing the <ESC> key cancels the editing process. Note that column and row attributes can be changed by setting the array properties ColAttrib, and RowAttrib, respectively.

Selecting a range of cells

Some of the actions of the table editor can be applied to a range of cells (see popup menus for details). In order to select a rectangular area, click on one corner of the area, hold down the left mouse and move the mouse to the opposite corner of the intended rectangle. The selected range is displayed using the Windows selection colors. Hint: do not mix up the selection of a cell range and the marking of cells.

Marking cells

Any cell of the table editor can be marked by one of two marks (type A and type B). In order to mark a single cell or a range of cells, select it and right click in order to bring up the context menu. More details on markings is described elsewhere.



Last Update: 2013-May-14