Problem with xbrowse with tdatabase - Resolved
Posted: Sat May 04, 2019 8:32 am
on oldest application to show records with xbrowse I used
1.) create the xbrowse with coordinates
2.) an array aBrowse where I inserted all fields, titles,pictures and sizes
3) then createfromsource comand
I make a small test
I convert EL-> into oElementi why now not run ok ? How I can to have the same ?
now I resolved with
I'd like to have the same schema also because I build the Xbrowse from an external class (tfsdi) with oApp():oDlg:NewGrid( nSplit )
thanks
1.) create the xbrowse with coordinates
2.) an array aBrowse where I inserted all fields, titles,pictures and sizes
3) then createfromsource comand
I make a small test
Code: Select all
#include "FiveWin.ch"
#include "xBrowse.ch"
static oElementi
REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO
Function test()
Local oDlg,oGrid
Local cDir:= ".\data\"
RddSetDefault( "DBFCDX" )
oElementi:=TDatabase():Open( , cDir+"Elementi", "DBFCDX", .T. )
oElementi:setorder(2)
oElementi:gotop()
define dialog oDlg size 600,400
oGrid := TXBrowse():New(oDlg )
oGrid:nTop := 00
oGrid:nLeft := 10
oGrid:nBottom := 200
oGrid:nRight := 400
aBrowse := { { { || oElementi:ELATTIVO }, i18n("Attivo"),80, },;
{ { || oElementi:ELNOME }, i18n("Descrizione elemento"),80, },;
{ { || "" }, i18n("Colore "),80, },;
{ { || oElementi:ELCOLORE }, i18n("Descr. Colore"),80, },;
{ { || oElementi:ELORDINE }, i18n("Ordine"),80, },;
{ { || oElementi:ELLOCK }, i18n("Bloccato"),200, }}
FOR i := 1 TO Len(aBrowse)
oCol := oGrid:AddCol()
oCol:bEditValue := aBrowse[ i, 1 ]
oCol:cHeader := aBrowse[ i, 2 ]
oCol:nWidth := aBrowse[ i, 3 ]
if !Empty(aBrowse[ i, 4 ])
oCol:cEditPicture:=aBrowse[ i, 4 ]
Endif
NEXT
WITH OBJECT oGrid
:CreateFromCode()
END
activate dialog oDlg
return nil
now I resolved with
Code: Select all
@0,nSplit+2 XBROWSE oApp:oGrid SIZE oApp():oDlg:nGridBottom,oApp():oDlg:nGridRight PIXEL OF oApp():oDlg ;
COLUMNS "ELATTIVO","ELNOME","","ELCOLORE","ELORDINE","ELLOCK";
HEADERS "Attivo","Descrizione elemento","Colore ", "Descr. Colore","Ordine","Bloccato";
COLSIZES 80,80,80,80,80,80 ;
CELL LINES NOBORDER ;
DATASOURCE oElementi
thanks