Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- TSDWIN: Clipper 5.0 Interface Library - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

 twRASpotOff( nSpotNo )
 ----------------------------------------------------------------------------

     twRASpotOff() and the related function twRASpotOn() are used to
     disable and enable mouse action on an area of the screen defined
     by nSpotNo. These functions are useful if, for instance, you are
     calling another function on an ActionKey which also uses mouse hot
     spots. If you have a hotspot in the called function which overlies
     the region defined by a previous one, you may want to temporarily
     suspend some spots while you use others. The spots are retained in
     memory but no action is taken when a mouse click occurs in the
     region of the spot when it is disabled. When you leave the calling
     function, turn the old spots back on.

       Arguments:

     nSpotNo - 'N' Handle of the hot spot to be disabled.

       Return:

     NIL

       Example:

     FUNCTION MyBrowse( wT, wL, wB, wR )
     LOCAL aSpots := {}, nChoice := 0, aArray, aActionKeys := {}
     LOCAL nCount

     // add the action keys
     AADD( aActionKeys, { K_F2, {|| ListCodes( 5, 5, 10, 25, aSpots) } })

     // add a hot spot to call a picklist function.
     AADD( aSpots, twRAHotSpot( 24, 0, 24, 12, ;
                                {|| ListCodes( 5, 5, 10, 25, aSpots) },
                                1,, .T.  )
     // add more spots as needed

     aArray := twDIRECTORY("*.*", "D")
     ASORT( aArray,,, {|x,y| x[1] < y[1]} )

     // display a message for the hot spots.
     twInfoLine( -2, ".F2..List Codes", "P" )

     // Call the browse.
     nChoice := twRABrowse( wT, wL, wB, wR, aArray,
                            .............
                             "File;Attribute"};
                            ,, .T., aActionKeys, ;
                            "bg+/rg,gr+/n,,bg+/rg,n/w", ;
                            3, 1, "gr+/g", .T., .T., 1, .T. )
     // pop the message
     twAMPop()

     // release hot spots
     FOR nCount = 1 TO LEN( aSpots )
         twRARemHotSpot( nCount )
     NEXT

     RETURN nChoice

     .........
     .........  other code
     .........
     .........

     // this function may be in a  separate PRG.
     FUNCTION ListCodes( wT, wL, wB, wR, aFirstSpots )
     LOCAL nCount, aSecondSpots  := {}

     // disable passed spots.
     FOR nCount = 1 TO LEN( aFirstSpots )
         twRASpotOff( nCount )
     NEXT

     // set up the new spots.
     AADD( aSecondSpots, twRAHotSpot( 24, 0, 24, 12, ;
                                      {|| Help() }, 1,, .T.  )
     // more spots etc.

     //  call another browse of the same or different type
     twBRBrowse( .......

     // Release second set of spots
     FOR nCount = 1 TO LEN( aSecondSpots )
         twBRRemHotSpot( nCount )
     NEXT

     // enable old spots
     FOR nCount = 1 TO LEN( aFirstSpots )
         twRASpotOn( nCount )
     NEXT

     RETURN .T. // or whatever.

See Also: twRAMouseLine() twRAHotSpot() twRABrowse()

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