cells.icn: Procedures for creating and coloring panels of cells

procedure makepanel:       make panel of cells
procedure colorcell:       color cell in panel
procedure colorcells:      color all cells in panel
procedure tiercells:       color all cells in panel

link cells
December 16, 2002; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

These procedures create an manipulate panels of cells.

     makepanel(n, m, size, fg, bg, pg)
             makes a panel in a hidden window with nxm cells of the
             given size, default 10.  fg, bg, and pg are the
             colors for the window and panel backgrounds. fg
             and bg default to black and white, respectively.
             If pg is not given a patterned background is used.

     matrixpanel(matrix, size, fg, bg, pg)
             same as makepanel(), except matrix determines the
             dimensions.

     clearpanel(panel)
             restores the panel to its original state as made by
             makepanel.

     colorcell(panel, n, m, color)
             colors the cell (n,m) in panel with color.

     colorcells(panel, tier)
             is like colorcell(), except it operates on a tie-up
             record.

     cell(panel, x, y)
             returns Cell() record for the cell in which x,y
             lies.  If fails if the point is out of bounds.

     tiercells(panel, matrix)
             is like colorcell(), except all cells are colored
             using a matrix of colors.

Source code | Program Library Page | Icon Home Page