home *** CD-ROM | disk | FTP | other *** search
/ BUG 4 / BUGCD1997_05.BIN / aplic / clip4win / clip4win.exe / C4W30E.HUF / SOURCE / WBTDEMO.ZIP / WBMACH6.PRG < prev   
Text File  |  1994-08-28  |  3KB  |  92 lines

  1. /*
  2.  
  3.   WBMACH6.PRG -- Jason Massey   5-3-94 9:00pm
  4.   For use with MACHSIX and Wbrowse(s)
  5.  
  6.   These functions proportionately update the scroll bar when filtering records
  7.   using MachSix and a fully optimized Filter.
  8.   Be sure to Include "MACHSIX.CH" in your .PRG files.
  9.   You can check Optimization level with (m6_IsFilter()==OPT_FULL).
  10.  
  11.         **************** COMPILER NOTE (The .LIB order is important) ***************
  12.         With Version 1.5 of the Six Drivers:
  13.  
  14.         link /se:1200 /NOE myapp+Mach6six+Machsix,,nul,SIXCDX+MACHSIX+CLIP4WIN+WBROWSES
  15.  
  16.         With Version Pre-Release 2.0 you get GPF's, so don't use it:
  17.         *****************************************************************************
  18.  
  19.         USAGE:  Case nMsg == WM_INITDIALOG
  20.                                         **After you create your browse object as oB**
  21.                                         oB:goTopBlock           :={||M6_TopBlock(oB)}
  22.                                         oB:goBottomBlock        :={||M6_BottBlock(oB)}
  23.                                         oB:skipBlock            :={|oB,nSkip|M6_Skip(oB,nSkip)}
  24.  
  25.                                 Be aware that if your using MachSix and shared database files,
  26.                                 you need to call M6_RefreshFilter() when your filter changes,
  27.                                 otherwise your filters won't work.
  28. */
  29. #include "SIXCDX.CH"
  30. #include "MACHSIX.CH"
  31.  
  32. FUNCTION M6_Skip( o, nSkip )
  33.         LOCAL hM6,aM6
  34.         dbSkip(nSkip)
  35.    DO CASE
  36.    CASE BOF()
  37.                 o:nCurRec:=1
  38.                 o:nCrecNo:=recno()
  39.                 o:hitTop := .T.
  40.                 o:hitBottom := EOF()
  41.    CASE EOF()
  42.                 hM6:=m6_GetAreaFilter()
  43.                 aM6:=m6_FiltInfo(hM6)
  44.                 o:nCurRec:=if(M6_isfilter()==OPT_FULL,;
  45.                                                 aM6[INFO_COUNT]+1,recno())
  46.                 o:nCrecNo:=recno()-1
  47.                 o:nMaxRec:=if(M6_isfilter()==OPT_FULL,;
  48.                                                 aM6[INFO_COUNT],o:nMaxRec)
  49.                 o:hitBottom := .T.
  50.                 o:hitTop := BOF()
  51.    OTHERWISE
  52.                 o:nCurRec += nSkip
  53.                 o:nCrecNo := RECNO()
  54.                 o:hitTop  := .F.
  55.                 o:hitBottom := .F.
  56.                 return nSkip
  57.         ENDCASE
  58. RETURN (0)
  59.  
  60. Function M6_TopBlock(o)
  61.         local hM6,aM6
  62.         hM6:=m6_GetAreaFilter()
  63.         aM6:=m6_FiltInfo(hM6)
  64.         go top
  65.         o:hitTop:=.t.
  66.         o:hitBottom:=eof()
  67.         o:rowPos:=1
  68.         o:nCurRec:=1
  69.         o:nCrecNo:=recno()
  70.         o:nMaxRec:=if(M6_isfilter()==OPT_FULL,;
  71.                                                 aM6[INFO_COUNT],reccount())
  72.         SetCursor(LoadCursor(,IDC_ARROW))
  73. return NIL
  74.  
  75. Function M6_BottBlock(o)
  76.         local hM6,aM6
  77.         hM6:=m6_GetAreaFilter()
  78.         aM6:=m6_FiltInfo(hM6)
  79.         go bottom
  80.         o:hitTop:=bof()
  81.         o:hitBottom:=.t.
  82.         o:rowPos:=o:nMaxLines
  83.         o:nCurRec:=if(M6_isfilter()==OPT_FULL,;
  84.                                                 aM6[INFO_COUNT],recno())
  85.         o:nCrecNo:=recno()
  86.         o:nMaxRec:=if(M6_isfilter()==OPT_FULL,;
  87.                                                 aM6[INFO_COUNT],reccount())
  88.         SetCursor(LoadCursor(,IDC_ARROW))
  89. return NIL
  90.  
  91.  
  92.