[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 XPmouseChoice()
 an Achoice() alike function, supporting Mouse.
------------------------------------------------------------------------------

  Function:    XPmouseChoice()

               The XPmouseChoice() function is a function similar to
               Achoice(), supporting the Mouse and handling some things
               other ways, more compatible with the other 'high level'
               Mouse routines.

               Next to normal editing keys (see "MouseTrap"), XPmouseChoice()
               also reacts to normal keys (alphanumeric, letters etc..), by
               positionning the bar on the next item whose first letter
               matches the key pressed.

               XPmouseChoice() now also supports passing a code-block instead
               of an Array. In quite some situations, this can be much
               more handy.

  Syntax:      XPmouseChoice(nTop,nLeft,nBottom,nRight,abData[,bTrap])

  Arguments:   The four first arguments define the table's position
               on the screen. abData is an array or a code-block
               which defines what to display. bTrap is an
               optionnal trap function, see MouseTrap.

               abData can simply be a 1-dimensional array of character values,
               that Array is then used for choices. abData can also be a
               code-block which defines what to display. the code-block
               is called with 1 parameter which indicates what to return:
               when 0, the code-block should return the Maximum number of
               items, otherwise, the correspoding item should be returned.

  Returns:     This function returns the following: 0 when the user
               pressed Esc (or pressed the right button) and current
               selection number when selected with Enter (or Left
               button).

  Usage:       See the DEMO programs that have been supplied with
               the Expand Library for some detailed examples on how to
               use this function.

               Use of code-Block:

               XPmouseChoice(0,0,MaxRow(),MaxCol(),{|i|EnvTrap(i)})

               Where:

               Function EnvTrap(i)
               if i = 0         // Return #of elements
                    Return EnvCount()
               else             // Return Ith element
                    Return EnvString(i)
               endif

               This display's all the environment strings of your system.

               Use of Array is much like aChoice().

See Also: MouseTrap XPmouseMenu() XPmouseEdit() XPmouseBrowse()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson