A newer version of Max is available. Click here to access the latest version of this document.

jit.cellblock

Two-dimensional storage and viewing

Description

The jit.cellblock object provides storage, viewing and editing of two-dimensional data. The format is similar to the "grid" display tools found in many other development environments. The current cell location, format, display and contents within jit.cellblock can be set with the mouse or using Max messages.

Arguments

None.

Messages

bang Sends the contents out the object's left outlet, and sends a message through the third outlet in the form set value-list.
list column-number and row-number [list]
Selects a cell within the cellblock. The message list col-number row-number is equivalent to the message select col-number row-number.
append input [list]
The word append, followed by a data element or a list of elements, will add the specified valid Max data to the contents of the currently selected cell.
cell column-number row-number and object-setting-message [list]
The cell message allows you to control the appearance of a single cell within the cellblock. Using the cell message will override changes for both row and col message.

The word cell, followed by a list in the form cell col-number row-number label text, sets a text label for the selected cell. The label will always be displayed, but does not replace any data stored for the cell. If col-number and row-number are omitted from the list, the currently selected cell is changed.

The word cell, followed by a list in the form cell col-number row-number frgb red green blue, sets the foreground color of the selected cell. All values should be in the range 0-255. If col-number and row-number are omitted from the list, the currently selected cell is changed. If no color values are provided, the cell override will be eliminated and the color returned to the default setting.

The word cell, followed by a list in the form cell col-number row-number brgb red green blue, sets the background color of the selected cell. All values should be in the range 0-255. If col-number and row-number are omitted from the list, the currently selected cell is changed. If no color values are provided, the cell override will be eliminated and the color returned to the default setting.

The word cell, followed by a list in the form cell col-number row-number just justification-value, sets the justification for the cell. Justification values are:

-1 remove cell-based override
0 left-justified
1 center-justified
2 right-justified

If col-number and row-number are omitted from the list, the currently selected cell is changed.

The word cell, followed by a list in the form cell col-number row-number precision precision-value, sets the displayed floating-point precision for the cell. Precision values are:

-1 remove cell-based override
0-9 set displayed precision

If col-number and row-number are omitted from the list, the currently selected cell is changed.

The word cell, followed by a list in the form cell col-number row-number readonly readonly-value, sets the read-only setting for the cell. Readonly values are:

-1 remove cell-based override
0 read/write capable
1 read-only

If col-number and row-number are omitted from the list, the currently selected cell is changed.

Note: Using cell messages without explicitly specifying column or row locations is not recommended when using selmode 2, selmode 3 or selmode 4.
clear column-number and row-number [list]
The clear message removes data from the cellblock. The message clear <col-number row-number> clears the contents of the specified cell. clear all will clear the entire contents of the cellblock. The message clear current will clear the contents of the currently selected cell(s). The clear message with no arguments is equivalent to the message clear current.
col column-settings [list]
The col message allows you to control the appearance of a single column within the cellblock. Using the col message to override color settings will override any color changes made with the row message. Using the cell message will, however, override color changes for both col and row messages.

The word col, followed by a list in the form col col-number frgb red green blue, sets the foreground color of the column. All values should be in the range 0-255. If col-number is omitted from the list, the currently selected column is changed. If no color values are provided, the column override will be eliminated and the color returned to the default setting.

The word col, followed by a list in the form col col-number brgb red green blue, sets the background color of the column. All values should be in the range 0-255. If col-number is omitted from the list, the currently selected column is changed. If no color values are provided, the column override will be eliminated and the color returned to the default setting.

The word col, followed by a list in the form col col-number just justification-value, sets the justification for the cell. Justification values are:

-1 remove column-based override
0 left-justified
1 center-justified
2 right-justified

If col-number is omitted from the list, the currently selected column is changed.

The word col, followed by a list in the form col col-number precision precision-value, sets the displayed floating-point precision for the column. A precision of -1 will remove the column-based precision override.

The word col, followed by a list in the form col col-number readonly readonly-value, sets the read-only setting for the column. readonly values are:

-1 remove column-based override
0 read/write capable
1 read-only

If col-number is omitted from the list, the currently selected column is changed.

The word col, followed by a list in the form col col-number width width, sets the width of the column in pixels. If col-number is omitted from the list, the currently selected column is changed.
deref Disconnects a jit.cellblock object from any attached coll objects.
dump column-number and row-number [list]
Sends a listing of the contents of all non-empty cells out the object's left outlet, one line per cell. Each output line takes the form col-number row-number cell-contents.
jit_deref The message jit_deref will dereference the currently referenced jit.matrix object.
jit_matrix list [list]
The message jit_deref will cause the jit.cellblock object's display/edit to directly reference the received jit.matrix rather than maintaining its own data structure.
mode operational-mode [list]
The mode message sets the operational modes of the jit.cellblock. The message mode selmode int specifies the selection function of the cellblock. The selection mode settings are:

0. no selection

1. select a single cell

2. select an entire column

3. select an entire row

4. select a single cell unless a column or row header is selected, in which case the entire column or row is selected.

5. in-place editing. A single cell is selected and values can be typed directly into the cell.

The message mode saveatoms int toggles whether or not the cell contents will be saved with the patcher.

The message mode sync horizontal-sync-flag vertical-sync-flag select-flag sets the sync modes. The sync modes determine if sync messages received in the rightmost inlet are accepted or ignored. mode sync 1 1 1 would accpt all sync commands, while mode sync 0 0 0 would ignore all commands. Sync allows multiple jit.cellblock objects to display "connected" information.



separate values: Each cell is sent separately, and each data item within the cell is sent as a separate value.

as one list: If more than one cell is selected, all cell contents are formatted into a single list and output as a single cell output.

as one symbol: If more than one cell is selected, or if a cell has more than one value (e.g. a list), all values are combined into a single, space-separated symbol for output.
plane number [int]
The word plane followed by an integer that specifies a numbered plane in a jit.matrix object, will display that plane. The special message plane -1 will display all four planes of an RGBA jit.matrix object simultaneously.
prepend input [list]
Adds the specified valid Max data to the beginning of the currently selected cell contents.
read filename [symbol]
Opens and reads the contents of a cellblock file from disk if a filename is specified. No attempts are made to verify the contents. If no filename is specified, a file dialog box will be displayed to allow selection of a saved cellblock file.
refer coll-object-name [symbol]
The word refer, followed by the name of a coll, object, displays the contents of the named coll object's internal list. Changes to the data in the jit.cellblock will change the contents of the attached coll object.
refresh Causes the jit.cellblock object to be redrawn.
select column-number [int]
row-number [int]
The select message, followed by a column number and row number, will select the requested coll using the current selmode. The contents of the selected cell(s) are output from the object's left outlet, and the outputs a message in the form set value out the third outlet.
set input [list]
Replaces a cell's data with the data specified. Two forms are supported:
set current value replaces the currently selected cell's contents.
set col-number row-number values replaces the specified cell's contents.
row row-settings [list]
The row message allows you to control the appearance of a single row within the cellblock.

The word row, followed by followed a list in the form row row-number frgb red green blue, sets the foreground color of the row. All values should be in the range 0-255. If row-number is omitted from the list, the currently selected row is changed. If no color values are provided, the row override will be eliminated and the color returned to the default setting.

The word row, followed by followed a list in the form row row-number brgb red green blue sets the background color of the row. All values should be in the range 0-255. If row -number is omitted from the list, the currently selected row is changed. If no color values are provided, the row override will be eliminated and the color returned to the default setting.

The word row, followed by followed a list in the form row row-number just justification-value sets the justification for the row. Justification values are:

-1 remove row-based override
0 left-justified
1 center-justified
2 right-justified

If the row-number is omitted from the list, the currently selected row is changed.

The word row, followed by followed a list in the form row row-number precision precision-value sets the displayed floating-point precision for the row. A precision of -1 will remove the row-based precision override.

A list in the form row row-number readonly readonly-value sets the read-only setting for the row. readonly values are:

-1 remove row-based override
0 read/write capable
1 read-only

If row-number is omitted from the list, the currently selected row is changed.

The word row, followed by followed a list in the form row row-number width sets the width of the row in pixels. If row-number is omitted from the list, the currently selected row is changed.
rowblend foreground-blend (0 through 100) [int]
background-blend (0 through 100) [int]
The word rowblend, followed by two numbers in the range 0-100 specifying foreground and background blend percentages. blends the foreground and background colors for the cellblock object.

In cases where there are both column and row foreground and/or background color overrides, the rowblend message will allow you to "blend" the colors using column transparency. Column colors have a higher priority than row colors; if you have a row and column color that affect a cell, only the column color will normally be displayed. The rowblend message allows you to make the column color transparaent using a percentage value, thereby allowing the row color to be displayed. The rowblend message applies the color transparancy to all column colors without discrimination.
text input [list]
Replaces the value of the currently selected cell with the incoming text values. This is provided as a convenient way of receiveing the output of a textedit object.
send receive-object-name [list]
The word send, followed by the name of a receive object, will transmit cellblock values without using connected patch cords; it is the equivalent of sending the output through a send object.

send receive-object col-number row-number will send the data in the specified cell to the specified received object. send receive-object all sends all non-empty cell contents to the specified receive object as a series of lists in the form cell-data-type value.
sync synchronization-setting-messages [list]
Receives input in the jit.cellblock object's right inlet from another jit.cellblock object, so that two cellblocks can maintain location and selection synchronization. Synchronization allows for multiple jit.cellblock objects to react as if connected. One use of synchronization is used to force external cellblock objects to act as header rows and columns for a main jit.cellblock. For more information on setting synchronization, see the mode message.
write filename [symbol]
Opens a file and writes the contents of a cellblock file to disk. If a filename is specified, that file is created and written. If no filename is specified, a file dialog box will be displayed to allow selection of a pathname and file.
writeagain If a file has been written, the writeagain message will allow it to be rewritten without further user interaction.

Attributes

Name Type g/s Description
automouse int
def.:1
Enables/disables scrolling or selecting cells by clicking and dragging with the mouse. The default is 1 (enabled).
bblend int
def.:0
Specifies the percentage of background blending for the jit.cellblock object's display.In cases where there are both column and row background color overrides, this message will allow you to "blend" the colors. Column colors have a higher priority than row colors; if you have a row and column color that affect a cell, only the column color will normally be displayed. The bblend message allows you to make the column color transparaent using a percentage value, thereby allowing the row color to be displayed. This message applies the color transparancy to all column colors without discrimination.
bgcolor float Sets the default background color of the jit.cellblock object in RGBA format.
border int
def.:1
Toggles drawing a border edge around the jit.cellblock.
bordercolor float Sets the default border color of the jit.cellblock object in RGBA format.
colhead int
def.:0
Toggles the behavior of the first column. If the header option is selected, the first column will change color to the rgba3 setting, and will not be directly editable in selmode 5.
cols int
def.:10
Sets the number of columns that are visible within the jit.cellblock. If the number of columns is greater than can be displayed, scrollbars will be shown.
colwidth int
def.:66
Sets the default column width of the individual cells. Changing these settings may change whether the scrollbars are displayed.
datadirty int
def.:0
Enables or disables the patcher-dirty flag. The default is 0 (disabled). When enabled, the jit.cellblock object will dirty the patch whenever its cell data changes.
fblend int
def.:0
Specifies the percentage of foreground blending for the jit.cellblock object's display.In cases where there are both column and row foreground color overrides, this message will allow you to "blend" the colors. Column colors have a higher priority than row colors; if you have a row and column color that affect a cell, only the column color will normally be displayed. The fblend message allows you to make the column color transparaent using a percentage value, thereby allowing the row color to be displayed. This message applies the color transparancy to all column colors without discrimination.
fgcolor float Sets the default foreground color of the jit.cellblock object in RGBA format.
grid int
def.:1
Toggles drawing a border edge around each individual cell.
gridlinecolor float Sets the default grid line color of the jit.cellblock object in RGBA format.
hcellcolor float Sets the default selected cell color of the jit.cellblock object in RGBA format.
headercolor float Sets the default header color of the jit.cellblock object in RGBA format.
hscroll int
def.:1
Toggles horizontal scroll bar behavior. When set to 0, this attribute will override the jit.cellblock object’s automatic handling of scrollbar display when there is more information to show than the current settings can manage.
hsync int
def.:1
Toggles synchronizing horizontal movement with another jit.cellblock object whose third outlet is connected to the right-most inlet of the jit.cellblock object.
interval int
def.:250
Sets the interval, in milliseconds, at which the display of the contents of a coll or jit.matrix object is updated.
just int
def.:0
Sets the default text justification of all cells - left (0), center (1) or right (2).
outmode int
def.:0
Sets the output mode of the cellblock. The output mode settings are:

0. separate values: Each cell is sent separately, and each data item within the cell is sent as a separate value.

1. as one list: If more than one cell is selected, all cell contents are formatted into a single list and output as a single cell output.

2. as one symbol: If more than one cell is selected, or if a cell has more than one value (e.g. a list), all values are combined into a single, space-separated symbol for output.
precision int
def.:2
Sets the default floating point precision for all cells. This does not alter the actual contents of the cell - it only changes the displayed precision of those contents.
readonly int
def.:0
Sets the read-only mode of the jit.cellblock object. The mode settings are:

-1: Eliminate any readonly setting. This option removes the cell/col/row from the structure, preventing any intrusion of the cell/col/row setting on the overall cellblock setting.
0: readonly off
1: readonly on
rowhead int
def.:0
Toggles the behavior of the first row. If the header option is selected, the first row will change color to the rgba3 setting, and will not be directly editable in selmode 5.
rowheight int
def.:18
The word rowheight, followed by a number, sets the default row height of the individual cells. Changing these settings may change whether the scrollbars are displayed.
rows int
def.:10
Sets the number of columns and rows that are visible within the jit.cellblock. If the number of rows is greater than can be displayed, scrollbars will be shown.
savemode int
def.:0
Toggles the ability save the jit.cellblock object's cell contents as part of the main patcher. The default behavior is 0 (save the data as a separate file).
sccolor float Sets the default text background color of the scroller in RGBA format.
selmode int
def.:1
Sets the selection mode of the cellblock. The selection mode settings are:

0. no selection

1. select a single cell

2. select an entire column

3. select an entire row

4. select a single cell unless a column or row header is selected, in which case the entire column or row is selected.

5. in-place editing. A single cell is selected and values can be typed directly into the cell.
selsync int
def.:1
Toggles synchronizing selection with another jit.cellblock object whose third outlet is connected to the right-most inlet of the jit.cellblock object.
sgcolor float Sets the default text color of the scroller gutter in RGBA format.
stcolor float Sets the default text color of the scroller handle (thumb) in RGBA format.
textcolor float Sets the default text color of the jit.cellblock object in RGBA format.
vscroll int
def.:1
Toggles vertical scroll bar behavior. When set to 0, this attribute will override the jit.cellblock object’s automatic handling of scrollbar display when there is more information to show than the current settings can manage.
vsync int
def.:1
Toggles synchronizing vertical movement with another jit.cellblock object whose third outlet is connected to the right-most inlet of the jit.cellblock object.

Information for box attributes common to all objects

Menu Items

Name Description
Color Choosing the Color... menu item from the Object menu when the object is selected opens a color picker, permitting adjustment to the appearance of the jit.cellblock object.

Output

list: Out left outlet: A list containing the currently selected column number, row number and the contents of the cell. The form of the output will be dependent on the mode outmode setting, which will determine if the contents will be provided individually, as a single list or as a single symbol.
list: Out the middle outlet: The Max message set, followed by the cell contents, is provded as a "helper" output for routing the cell contents to either a textedit or message object.
list: Out the right outlet: Synchronization messages are sent out the right outlet, meant as a source for the right inlet of other jit.cellblock objects. These messages can also be used to determine the current state of movement within the cellblock - for instance, the sync click message notifies that a cell has been click-selected, while the sync select message notifies that a cell has been selected (either by clicking, or programmatically).

Examples

jit.cellblock displays data on a two-dimensional grid

See Also

Name Description
coll Store and edit a collection of different messages
maximum Output the greatest in a list of numbers
minimum Output the smallest in a list of numbers
Max Data Tutorial 4: Cellblock Max Data Tutorial 4: Cellblock