oBrwSel:bRClickHeaders := { || XbrColSelector( oBrwSel, cNaam ) } // Kies welke velden tezien zijn
function XbrColSelector( oBrowse, cNaam ) // Toont de koppen om te tonen in Xbrowse
local oDlg, oBrw
local aSave := aCopy( oBrowse:aCols )
local cSavefile:="Temp.dbf"
DEFAULT cNaam:=""
DEFINE DIALOG oDlg SIZE 1000,800 PIXEL TRUEPIXEL
@ 60,20 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
DATASOURCE oBrowse:aCols ;
COLUMNS "lHide", "cHeader", "cExpr", "nWidth", "cDatatype","nDataLen", "cSortorder", "Value" ;
HEADERS "", "Header","Field","Width","Type","F_Len","Index", "Waarde" ;
COLSIZES 40, 120,120,50,50,50,100,450 ;
CELL LINES NOBORDER
oBrw:bRClickHeaders := { || msginfo("Test") } // Kies welke velden tezien zijn
WITH OBJECT oBrw
:nStretchCol := 2
WITH OBJECT :aCols[ 1 ]
:bEditValue := { |x| If( x == nil, !oBrw:aRow:lHide, oBrw:aRow:lHide := !x ) }
:SetCheck( nil, .t. )
:nHeadBmpNo := 2
END
WITH OBJECT :Width
:nEditType := EDIT_GET
:bClrSel := { || { CLR_BLACK, CLR_YELLOW }}
END
:CreateFromCode()
END
// @ 20,05 BTNBMP PROMPT "DBF" SIZE 80,30 FLAT PIXEL OF oDlg ACTION (cSaveFile:=msgget("Filename",,@cSaveFile), oBrowse:todbf( cSaveFile ,,,.t.))
@ 20,20 BTNBMP PROMPT "Save new Values" SIZE 120,30 2007 PIXEL OF oDlg CENTER ACTION (updatebrowselengte(oBrowse, cNaam))
@ 20,200 BTNBMP PROMPT "Show ALL" SIZE 120,30 2007 PIXEL OF oDlg CENTER ACTION (AEval( oBrowse:aCols, { |o| o:lHide := .f. } ),oDlg:End() )
ACTIVATE DIALOG oDlg CENTERED
oBrowse:Refresh()
return nil
Function updatebrowselengte(oBrw, cNaam)
msginfo("UpdateNaam : "+cNaam)
netopen("brwdetail","code","Tempupd",.f.)
select tempupd
FOR n := 1 TO Len( oBrw:aCols )
oCol := oBrw:aCols[ n ]
cHeader := oBrw:cHeaders[n]
nSize := oBrw:nWidths[n]
tempUpd->(dbgotop())
do while !tempupd->(eof())
if tempupd->brwnaam = cNaam .and. tempupd->veld = oCol:cExpr
tempupd->size = nSize
endif
tempUpd->(dbskip())
enddo
next
close TempUpd
return NIL