Sorry , i did not had the intention to start a new thread , see also the previous one
- Code: Select all Expand view
#include "FiveWin.ch"
#include "xbrowse.ch"
#define CLR_1 nRGB( 190, 215, 190 )
#define CLR_2 nRGB( 230, 230, 230 )
function Main()
local oDlg, oBrw , oCol
DEFINE DIALOG oDlg SIZE 300, 200
@ 0, 0 XBROWSE oBrw OF oDlg ARRAY { { "one","two","three" } , {"aOne","ztwo","bthree"}} AUTOCOLS AUTOSORT
oBrw:Swapcols(1,2,.T.)
FOR EACH oCol IN oBrw:aCols
oCol:bClrStd := {||{CLR_BLACK, iif( oBrw:nArrayAt % 2 = 0, CLR_1, CLR_2 ) + ;
IIF(oCol:cOrder="A",2001,IIF(oCol:cOrder="D",-1000,0))}}
NEXT
oBrw:CreateFromCode()
oBrw:bKeyDown = { || oDlg:SetText( Str( oBrw:nColSel ) ) }
ACTIVATE DIALOG oDlg CENTER ON INIT ( oDlg:oClient := oBrw, oDlg:Resize() )
return nil
Note that Swapcol comes before giving oCol:bClrStd his value.
IT IS NOT SOLVED WHEN THE USER MOVES COLUMNS (Clicking and dragging on the header).
I hope somone can explain why this doesn't work in this case , or in the case oBrw:Swapcols() comes after asigning oCol:bClrStd.
Frank