Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Mouse interface routines - <b>menubutton</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 MENUBUTTON
 Command to make a mouse button on screen calling Button()
------------------------------------------------------------------------------
 Syntax
      BUTTON <nTop>, <nLeft>, <nBottom>, <nRight> TO <aId>;
              ACTION <bAction> MESSAGE <xString> ;
              [KEY <nFunctionKey>] [MBUTTON <nButton>] ;
              [SLEEP <nSleep>] [RELEASE <lRelease>] ;
              [COLOR <cColor>]
 Arguments
     <nTop>, <nLeft>, <nBottom>, <nRight> are coordinates to include
          in hot spot and to clear to put string
     <xString> is either a character string to print or a code block
          which will print the button on the screen. It is centered
          in the area defined above.
     <nFunctionKey> is the function key (as defined in inkey.ch) to be
          associated with this button. Can be NIL
     <bAction> is a code block to be associated with this button.
     <nButton> - Optional button number for action to occur. IF
              equal to 0 or NIL, the action occurs on
              clicking any button (the code block can decide
              what to do with based upon the button). If equal
              to 1, code block executes only on left click,
              if equal to 2 only on right click and if equal
              to 4(?) then the middle button.
     <nSleep> - Optional value of a minimum time (in seconds) to
              wait between servicing multiple button presse2s.
              Prevents routine from operating too quickly and
              reading the press of a button multiple times
              when not intended. If =NIL then the default value
              is used (see MDefSleep()).
     <lRelease> -  Optional Logical Value. If set to .T. the
              servicing routine will pause after the completion
              of bAction for the release of the mouse button(s)
              Useful for guaranteeing no multiple hits on
              an area. If =NIL then the default is used (see
              MDefRelease())
              to be release before proceeding.
     <cColor> is the the color for button. If blank then current color
          used.

 Returns
     <aId> which is a unique identifier of the button. It is not the same
           as the ids produced by the individual hotspot routines so do not
           use them for that purpose.
 Description
      This routine provides a simple method of associating a screen hot
      spot and a function key to a given action in the MENU TO mouse
      subsystem Hot Spot pool.

      The screen area behind the button is saved and can be restored when
      removing the hot spot.
 Examples
     MENUButton 0,0,0,6 TO aId1 STRING "Help" KEY K_F1 ACTION {|| MyHelp()}
           COLOR "W/N" SLEEP 0.1 RELEASE .T. MBUTTON 1
 Header File: MOUSE.CH


 Source: MOUSE.CH

 Author: Leo Letendre

See Also: Button() RemButton() ButtonCool() ButtonWarm() BUTTON ACHOICEBUTTON

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson