- Code: Select all Expand view
- #include "Fivewin.ch"
#include "XBrowse.ch"
FUNCTION MAIN()
LOCAL oDlg, oBrw
LOCAL aArray := { { "Row1-Col1", "Row1-Col2", "Row1-Col3" },;
{ "Row2-Col1", "Row2-Col2", "Row2-Col3" },;
{ "Row3-Col1", "Row3-Col2", "Row3-Col3" },;
{ "Row4-Col1", "Row4-Col2", "Row4-Col3" } }
LOCAL nCur := 1
DEFINE DIALOG oDlg;
SIZE 800, 600
@ 0, 0 XBROWSE oBrw FIELDS aArray[ nCur, 1 ],;
aArray[ nCur, 2 ],;
aArray[ nCur, 3 ];
HEADERS "COL1", "COL2", "COL3";
ARRAY aArray
oBrw:CreateFromCode()
oBrw:bGoTop = { || nCur := 1 }
oBrw:bGoBottom = { || nCur := Len( aArray ) }
// oBrw:bBof = { || nCur = 1 }
// oBrw:bEof = { || nCur = Len( aArray ) }
// oBrw:bKeyCount = { || Len( aArray ) }
// oBrw:bPastEof = { || nCur > Len( aArray ) }
oBrw:bBookMark = { | nBkm | If( nBkm == nil, nCur, nCur := nBkm ) }
oBrw:bSkip = { | nSkip | Skipper( aArray, @nCur, nSkip ) }
ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetControl( oBrw );
CENTER
RETURN NIL
STATIC FUNCTION SKIPPER( aArray, nCur, nSkip )
LOCAL nOld := nCur
DEFAULT nSkip := 1
nCur += nSkip
IF nCur > LEN( aArray ); nCur = LEN( aArray ); ENDIF
IF nCur < 1; nCur = 1; ENDIF
RETURN nCur - nOld
EMG