#include "fivewin.ch"
#include "xbrowse.ch"
function main()
local oWnd,oBrw,oCust,oCol
use customer
database oCust
define window oWnd
oBrw := TXBrowse():New( oWnd )
oCol := oBrw:AddCol()
oCol:cHeader := "First"
oCol:bStrData := { || oCust:first }
oCol := oBrw:AddCol()
oCol:cHeader := "Last"
oCol:bStrData := { || oCust:last }
oBrw:CreateFromCode()
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:bSkip:= {| nRecs | oCust:skipper( nRecs ) }
oWnd:oClient:= oBrw
activate window oWnd
return nil
oBrw:bGoTop := {|| oCust:GoTop() }
oBrw:bGoBottom := {|| oCust:GoBottom() }
oBrw:bSkip := {| n | oCust:Skipper( iif( n == nil,1,n) )}, ;
oBrw:bBof := {|| oCust:Bof() }
oBrw:bEof := {|| oCust:Eof() }
oBrw:bBookMark := {| n | iif( n == nil,(oCust:RecNo()),(oCust:GoTo(n)) ) }
oBrw:bKeyNo :=oBrw:bBookMark
oBrw:bKeyCount := {|| oCust:RecCount()}
::bBookMark := {| n | iif( n == nil,;
( cAlias )->( RecNo() ),;
( cAlias )->( DbGoto( n );
) ) }
METHOD SetoDBF( oDBF ) CLASS TXBrowse
::cAlias := oDBF:cAlias
::bSkip := {| n | oDBF:skipper( n ) }
::bGoTop := {|| oDBF:GoTop() }
::bGoBottom := {|| oDBF:GoBottom() }
::bBof := {|| oDBF:Bof() }
::bEof := {|| oDBF:Eof() }
::bBookMark := {| n | iif( n == nil,(oDBF:RecNo()),(oDBF:GoTo( n )) ) }
::bKeyNo := ::bBookMark
::bKeyCount := {|| oDBF:RecCount()}
return nil
METHOD SetoDbf( oDbf ) CLASS TXBrowse
DEFAULT ::bGoTop := {|| oDbf:GoTop() },;
::bGoBottom := {|| oDbf:GoBottom() },;
::bSkip := {| n | oDbf:Skipper( iif( n == nil,1,n) )}, ;
::bBof := {|| oDbf:Bof() },;
::bEof := {|| oDbf:Eof() },;
::bBookMark := {| n | iif( n == nil,;
(oDbf:RecNo()),;
(oDbf:GoTo(n)) ) },;
::bKeyNo :=::bBookMark,;
::bKeyCount := {|| oDbf:RecCount()}
::nDataType := DATATYPE_ODBF // if FWH agrees only
::oDbf := oDbf
RETURN Self
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: nageswaragunupudi and 26 guests