message processing functions

Whenever a grid function is called, it takes whatever action is appropriate for its grid type and the message it receives.

Create and CreateWindow messages are always processed within grid functions, but most other messages are simply passed on to a message processing function for processing. Grid functions simply ignore messages they don't recognize.

message function array - func[]
Every grid type has a message function array that contains a function address to call for every message. When a grid function receives a message, it calls the appropriate function in its message function array. If there's no function in the message function array for a given message, the grid function processes the message internally in a message processing subroutine or ignores it and returns.

individuated grids
All grids of a given grid type act the same, so there's only one message function array for each grid type. A program can, however, modify the behavior of a particular grid by adding or replacing one or more message function addresses for the grid.

A message function is changed by sending a SetMessageFunc message to the grid along with the new message function address to replace the old one. The first time a new message function is assigned to a grid the message function array from the grid type is duplicated, updated with the new entry, and assigned to the individual grid.

Henceforth the customized message function array is accessed to dispatch messages for that grid. The grid still responds to most messages like other grids of the same grid type, but it now responds differently to messages whose entries have been changed in its message function array. For example, the #Redraw entry in the message function array for most grid types contains the address of the standard XuiRedraw() message processing function. This can be changed to another function with #SetMessageFunc.

not recommended
The practice of individuating grids is not recommended, though in extreme cases it may be justified to modify the behavior of a complex grid you have no source access to. In such a case, considerable testing is in order, to assure existing functionality is not broken or disturbed in undesirable ways.