Grid View

From Planimate Knowledge Base
Jump to navigation Jump to search

Grid View

This displays a table as an array of rectangles. The contents of the rectangles can either be from icons/BMPs, using a label list to map index values to images, or the colour can be directly interpreted from the cell value, as an RGB value. The number of rectangles is determined by the dimensions of the table. This can change during the run.

The size of each rectangle is determined by the table dimensions and size of the grid display object, as set by the modeller. The system requires the rectangles are of equal dimensions which may not be an exact multiple of the width/height of the rectangle of the view, so the system will keep the cell array centred within this rectangle.

There is an option to display cell borders on a grid view.


Grid View Modes

Set the mode using the options.

In image mode: A label list determines the name of the image. If the index does not resolve to a name, the cell is painted using the background colour of the grid display (which may be transparent if set to "None").

With in place editing enabled - a click toggles cells between 0 and 1


In RGB mode: Given R, G and B range from 0 to 255, the colour of a cell is determined as follows:

value = red + green * 256 + blue * 256 * 256

In hex, the value is packed as follows:

BBGGRR, so FF0000 will give a blue pixel

If the value is set to > 0xFFFFFF or < 0, the cell is painted using the background colour of the grid display (which may be transparent). With in place editing enabled - a click toggles cells between 0 and 0xFFFFFF (black and white).

The Encode RGB makes it simple to translate R/G/B values to the proper value.

Hexadecimal value format mode makes working with RGBs easier.


Grid View Broadcasts

Grid View Graphs can send a broadcast when clicked

"_row" the row clicked

"_col" the col clicked


Grid View Redraw Overhead

Modifying individual cells will result in slow redrawing due to the call overhead so its a good idea to not have the RGB view visible while its source data is being updated, or to use a separate working table and then table-copy the data into the view's table.