Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - browsemouse() control mouse interface for the browse() function http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 browsemouse()       Control mouse interface for the browse() function
------------------------------------------------------------------------------
 Declaration
   database.hdr

 Syntax
   func logical browsemouse extern
   param value logical lMouse

 Arguments
   lMouse indicates if the browse() function should utilize a mouse
   if available.

 Return
   A logical indicating the previous mouse utilization setting.

 Description
   The browsemouse() function controls if the browse() function
   provides mouse interface for navigating the database browse. The browse() 
   function by default has mouse support. When mouse support is switched off
   by browsemouse( .f. ), the vertical and horizontal scrollbars
   in the browse display are not shown.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   vardef static
      byte bColor2[ 3 ] := CYAN_BLUE, WHITE_WHITE, CYAN_BLUE
   enddef
   
   proc Info2 static
   // Show record information
   savearea( 9, 10, 15, 70 )
   @  9, 10 clear to 15, 70
   @  9, 10 to 15, 70 double
   @ 11, 13 ?? "Record number:", istr( recno() )
   @ 12, 13 ?? "Last name    :", sTest->lastname
   getkey()
   restorearea()
   endproc
   
   func uint BrowseCallback2 static
   param value ulong nAddress, ;
         value uint  uCallType, ;
               char  cRecord
   // Return a record or a key code
   vardef
      uint uRet
   enddef
   uRet := BROWSE_NIL
   do case
   case uCallType == 0                                 // return a record
      arecstring( &cRecord, sTest, arecsize( sTest ) )
   case uCallType == 1                                 // process special keys
      do case
      case lastkey() == K_F5               // info
         Info2()
      case lastkey() == K_DEL              // delete/recall
         if deleted()
            recall
         else
            delete
         endif
         uRet := BROWSE_RESTART
      case lastkey() == K_F10              // quit
         uRet := BROWSE_QUIT
      endcase
   endcase
   return( uRet )
   endfunc
   
   proc Test_browsemouse
   vardef
      char( 74 ) cTitle[ 3 ]
   enddef
   open sTest index sIdxLN
   go top
   cTitle[ 0 ] := "Sample application"
   cTitle[ 1 ] := replicate( "-", 50 )
   cTitle[ 2 ] := center( "Demonstrate using the browse() function", 50 )
   browsemouse( .f. )         // switch off mouse display
   browse( sTest, 8, 17, 18, 63, cTitle[], ;
      center( "F5 Info  Del Delete/Recall  F10, Esc Quit", 50 ), ;
      " First     Last name       A S Balance Due", ;
      bColor2[], 1, 1, reccount() + 1, BrowseCallback2 )
   endproc

   proc main
   Test_browsemouse()
   endproc

See Also: browse()

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