by Otto » Mon Dec 17, 2007 9:39 pm
Hello Robert,
oBrw:aCols[3]:lHide = .t.
ACTIVATE WINDOW oChild ON INIT (oBrw:SwapCols( oBrw:aCols[1], oBrw:aCols[2] ), oBrw:SetFocus())
This is from FWH/SAMPLES/TESTXBRW.prg
I implemented the changes.
STATIC FUNCTION ArraySort( oWnd )
local oChild, oBrw, oCol
local aStruc
DEFINE WINDOW oChild TITLE "DBF structure with auto sort and incremental seek" MDICHILD OF oWnd
oBrw := TXBrowse():New( oWnd )
aStruc := DBStruct()
Aeval( aStruc, {|v| v[1] := Padr( v[1], 10 ) } )
oBrw:SetArray( aStruc, .t. )
oBrw:aCols[1]:cHeader := "NAME"
oBrw:aCols[2]:cHeader := "TYPE"
oBrw:aCols[2]:nDataStrAlign := AL_CENTER
oBrw:aCols[2]:nHeadStrAlign := AL_CENTER
oBrw:aCols[3]:cHeader := "SIZE"
oBrw:aCols[3]:nDataStrAlign := AL_RIGHT
oBrw:aCols[3]:nHeadStrAlign := AL_RIGHT
oBrw:aCols[3]:nHeadStrAlign := AL_RIGHT
oBrw:aCols[3]:lHide = .t.
oBrw:aCols[4]:cHeader := "LENGTH"
oBrw:aCols[4]:nDataStrAlign := AL_RIGHT
oBrw:aCols[4]:nHeadStrAlign := AL_RIGHT
oBrw:lHScroll := .f.
oBrw:lVScroll := .f.
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:CreateFromCode()
oChild:oClient := oBrw
ACTIVATE WINDOW oChild ON INIT (oBrw:SwapCols( oBrw:aCols[1], oBrw:aCols[2] ), oBrw:SetFocus())
RETURN NIL