I must be doing something very wrong here. I am taking my 'listbox' code for an ADO recordset and modifying it for xBrowse.
The program compiles .. but when the browse fires ... all I get is a Grey mdichild window .. no data .. just blank.
Here is the code :
- Code: Select all Expand view
oRs:MoveFirst()
DEFINE WINDOW oGRP ;
FROM 2,2 to 25,80 ;
of oWndMDI ;
TITLE "HOLIDAY Schedule" ;
MENU BuildMenu( oRs ) ;
NOMINIMIZE ;
NOZOOM ;
MDICHILD
@ 0, 0 xBrowse oBrow of oGrp RECORDSET oRs ;
FIELDS ;
dtoc(oRs:Fields("begin_date"):Value),;
dtoc(oRs:Fields("end_date"):Value), ;
oRs:Fields("holiday"):Value ;
SIZES 90,90,200 ;
HEADERS "Begin DT", ;
"End DT", ;
"Holiday" ;
AUTOSORT FASTEDIT LINES CELL
oBrow:bClrRowFocus := { || { CLR_BLACK, RGB(185,220,255) } }
oBrow:nMarqueeStyle := MARQSTYLE_HIGHLROWMS
// ;
* ON DBLCLICK( _HoliView( "V", oRs )) ;
* UPDATE
oBrow:bLogicLen := { || oRs:RecordCount }
oBrow:bGoTop := { || oRs:MoveFirst() }
oBrow:bGoBottom := { || oRs:MoveLast() }
oBrow:bSkip := { | nSkip | Skipper( oRs, nSkip ) }
oBrow:cAlias := "ARRAY"
oGrp:oClient := oBROW
oGrp:SetControl( oBrow )
ACTIVATE WINDOW oGRP ;
VALID ( IIF( !lOK, GrpCLose( .T. , oRs ), .F. ))
RETURN( NIL )
//-------------------------------
STATIC FUNCTION SKIPPER( oRsx, nSkip )
LOCAL nRec := oRsx:AbsolutePosition
oRsx:Move( nSkip )
IF oRsx:EOF; oRsx:MoveLast(); ENDIF
IF oRsx:BOF; oRsx:MoveFirst(); ENDIF
RETURN( oRsx:AbsolutePosition - nRec )