establish message subroutines and register grid-type
  DIM sub[upperMessage]
' sub[#Callback]         = SUBADDRESS (Callback)
  sub[#Create]           = SUBADDRESS (Create)
  sub[#CreateWindow]     = SUBADDRESS (CreateWindow)
  sub[#GetSmallestSize]  = SUBADDRESS (GetSmallestSize)
  sub[#Resize]           = SUBADDRESS (Resize)
  sub[#Selection]        = SUBADDRESS (Selection)
  IF sub[0] THEN PRINT "XuiDialog2B(): Initialize: Error::: (Undefined Message)"
  IF func[0] THEN PRINT "XuiDialog2B(): Initialize: Error::: (Undefined Message)"
  XuiRegisterGridType (@XuiDialog2B, @"XuiDialog2B", &XuiDialog2B(), @func[], @sub[])

The sub[] array, which must contain the message processing subroutine addresses for this grid function, is dimensioned large enough to hold subroutine addresses for the highest message number.  Then subroutine addresses are then assigned to sub[] for those messages to be processed by internal message processing subroutines.

Every grid function must have message processing subroutines for #Create and #CreateWindow messages, so whenever GuiDesigner creates a grid function, it generates message subroutines and corresponding message subroutine address assignments for #Create and #CreateWindow.

  sub[#Create]           = SUBADDRESS (Create)
  sub[#CreateWindow]     = SUBADDRESS (CreateWindow)

GuiDesigner also creates subroutines and address assignments for #Callback and #Selection messages.  But the Callback address assignment is disabled, since func[#Callback]=&XuiCallback() handles callback messages for visual grid types.

To add functionality to a visual only grid type, disable the func[#Callback]=&XuiCallback() line, then enable the sub[#Callback]=SUBADDRESS(Callback) line and add functionality code to the Selection subroutine and/or any other callback relevant callback message processing subroutines.

To make XuiDialog2B grids resizable, a programmer provided message subroutines for #GetSmallestSize and #Resize messages.  To make these subroutines execute when this grid function receives these messages, the following lines were added to Initialize :

  func[#GetSmallestSize] = 0 ' cancel standard function
  func[#Resize]          = 0 ' cancel standard function

  sub[#GetSmallestSize]  = SUBADDRESS (GetSmallestSize) ' enable internal subroutine
  sub[#Resize]           = SUBADDRESS (Resize) ' enable internal subroutine

The first two lines cancel any default standard message functions that might exist, and the second two lines install the programmer written message subroutines.

Finally, the XuiDialog2B grid type is registered with GraphicsDesigner and GuiDesigner by XuiRegisterGridType().