Code: Select all
#INCLUDE "FIVEWIN.CH"
procedure main()
LOCAL oWnd, oBrw, aDatos
//MsgInfo( "Hola Mundo" )
DEFINE WINDOW oWnd
*aDatos := { { "uno ", "dos ", "tres ", "cuatro", "cinco " },;
* { "Seis ", "Siete ", "Ocho ", "Nueve ", "Diez " } }
aDatos :=creatarray()
WITH OBJECT ( oBrw := TXBrowse():New( oWnd ) )
:SetArray( aDatos )
WITH OBJECT :aCols[01]
:cHeader := "Col1"
:nEditType := 01
:bOnPostEdit := { |oCol| aDatos[ oBrw:nArrayAt ][01] := oCol:oEditGet:cText }
END
WITH OBJECT :aCols[02]
:cHeader := "Col2"
:nEditType := 02
:aEditListTxt := aDatos
:aEditListBound := :aEditListTxt
:bOnPostEdit := { |oCol,cOption| aDatos[ oBrw:nArrayAt ][02] := cOption }
END
WITH OBJECT :aCols[03]
:cHeader := "Col3"
:nEditType := 03
:bOnPostEdit := { || "" }
:bEditBlock := { || MsgInfo( "Hola" ) }
END
WITH OBJECT :aCols[04]
:cHeader := "Col4"
:nEditType := 04
:aEditListTxt := aDatos
:aEditListBound := :aEditListTxt
:bOnPostEdit := { |oCol,cOption| aDatos[ oBrw:nArrayAt ][04] := IF( Len( Alltrim( cOption ) ) > 0, cOption, oCol:oEditGet:cText ) }
END
WITH OBJECT :aCols[05]
:cHeader := "Col5"
:nEditType := 05
:bOnPostEdit := { |oCol| aDatos[ oBrw:nArrayAt ][05] := oCol:oEditGet:cText }
:bEditBlock := { || MsgInfo( "Hola" ) }
END
:CreateFromCode()
END
oWnd:oClient := oBrw
Activate Window oWnd
* TWINDOW():ACTIVATE( oWnd )
function creatarray()
local aData := {},oDlg
use mach
mach->(dbGotop())
do while !mach->(eof())
aadd( aData , mach->mc_serial )
mach->(dbSkip())
enddo
/*
USE THIS ARRAY BY LISTBOX CLASS, you will get the names of mach from DBF
*/
return (aData)