[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 XPmouseMenu()
 a remplacement of the MENU command, with mouse.
------------------------------------------------------------------------------

  Function:    XPmouseMenu()

               This function is a remplacement of the PROMPT and MENU TO
               commands of Clipper. The enhancement is that it supports
               the Mouse, and it now allows the use of MESSAGEs by means
               of a Code-Block.  Another feature is that it supports the
               handling of keyboard exceptions by means of a MouseTrap.

               This function cannot be Nested, ie. Called again when it
               is already active (eg. from within a MouseTrap).

               A subtle bug, which made the use of the Mouse impossible in
               some scarce, difficult to indicate situations,  has been
               corrected. It was tedious to track the source of the
               Error, but it was traced as having to do with Floating Points.

  Syntax:      XPmouseMenu(aMenu[[,nDefault][,bMouseTrap])

  Arguments:   aMenu is a two dimensional array, containing the
               definitions for every Menu choice. The first index
               represents the Menu choices, the second index should have
               3 values: { nRow, nCol, cPrompt[,bMsg] }, which indicates
               where the Menu item should be placed, and what it is.
               bMsg can be submitted, and is evaluated every time that
               specific choice is highlighted. Using this, one can put
               messages, but really do anything you want.
               nDefault indicates which choice is currrent, 1 when Omitted.
               bMouseTrap is code block that can handle keyboard
               exceptions, more on that in the MouseTraps section. When
               the trap is omitted, a default is used internally.

  Returns:     0 when the user pressed ESC or clicked right when
               confronted with the menus, any positive number when the
               user selected an option using the Arrows, Home, End or
               the first character, or.. when the user clicked on a menu
               choice with the mouse's left button. The XPmouseMenu()
               function, of course, handles all the i/o of the Menu when
               called.

  Usage:       * - This is an ASK function that could be
               *   used anywhere in your Clipper programs.
               Function Ask(S)
               Local x
               Local A := { { 23, 35, " No " } ,;
                         { 23, 40, " Yes " } }
               @ 21,0 clear to 24,79
               @ 21,0 to 24,79
               center(22,s)
               x := XPmouseMenu(A)
               /* break out one ESCAPE */
               if x = 0
                    break
               endif
               Return (x==2)

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