by Frafive » Thu Sep 25, 2008 8:31 am
Hola
Aqui tienes un trozo de codigo del xbrowse funcionando con eagle
un saludo
::oTabla := TMyTable():New( oVar:oMySQL,::cTabla,,,"nombre",if(oVar:lNavega,::nFilas,))
if ! ::oTabla:Open()
MsgInfo( "No se puede abrir la tabla: " + ::cTabla, "Operación Cancelada" )
lClose:=.f.
oVar:oDlg:=nil
return( nil )
endif
if ::oTabla:RecCount() > 0
::oTabla:GoTop()
endif
/* Vamos a montar el xBrowse */
::oBrw:=TXBrowse():New(oVar:oDlg,0,oVar:nBrw,(oVar:oDlg:nHeight()) /2,(oVar:oDlg:nWidth())/2 )
oCol := ::oBrw:AddCol()
oCol:bStrData := { || ::oTabla:xFieldGet(2)}
oCol:cHeader := "Nombre"
::oBrw:acols[1]:nWidth:=200
oCol := ::oBrw:AddCol()
oCol:bStrData := { || ::oTabla:xFieldGet(5)}
oCol:cHeader := "Contacto"
::oBrw:acols[2]:nWidth:=200
oCol := ::oBrw:AddCol()
oCol:bStrData := { || ::oTabla:xFieldGet(4)}
oCol:cHeader := "Teléfono"
::oBrw:acols[3]:nWidth:=90
oCol := ::oBrw:AddCol()
oCol:bStrData := { || ::oTabla:xFieldGet(7)}
oCol:cHeader := "Móvil"
::oBrw:acols[4]:nWidth:=90
oCol := ::oBrw:AddCol()
oCol:bStrData := { || ::oTabla:xFieldGet(3)}
oCol:cHeader := "Dirección"
::oBrw:acols[5]:nWidth:=200
oCol := ::oBrw:AddCol()
oCol:bStrData := { || ::oTabla:xFieldGet(12)}
oCol:cHeader := "Email"
::oBrw:acols[6]:nWidth:=150
oCol := ::oBrw:AddCol()
oCol:bStrData := { || ::oTabla:xFieldGet(13)}
oCol:cHeader := "Web"
::oBrw:acols[7]:nWidth:=200
::oBrw:nRowHeight:=20
::oBrw:nHeaderHeight:=22
::oBrw:CreateFromCode()
::oBrw:SetTMySql(::oTabla)
::oBrw:setfocus()
::oBrw:Gotop()
aEval( ::oBrw:aCols, { |oCol| oCol:bLDClickData := { || ::Ver(.t.) } } )
aEval( ::oBrw:aCols, { |oCol| oCol:bLClickHeader := {| nMRow, nMCol, nFlags, oCol|::IndexBrowse(oCol) }})
oVar:oDlg:bGotFocus:= { ||::oBrw:setfocus() }
::oBrw:bKeyDown := {|nKey| iif(nKey=13 .and. ::oBrw:nLen >=1 ,::Ver(.t.),.t.)}