Working with xbrowse , i try to give the column with order (ocol:corder is 'A' or 'D') a color to make it more visible.
- 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
FOR EACH oCol IN oBrw:aCols
oCol:bClrStd := {||{CLR_BLACK, iif( oBrw:nArrayAt % 2 = 0, CLR_1, CLR_2 ) + IIF(oCol:cOrder="A",2000,IIF(oCol:cOrder="D",-1000,0))}}
NEXT
//oBrw:Swapcols(1,2,.T.)
oBrw:CreateFromCode()
oBrw:bKeyDown = { || oDlg:SetText( Str( oBrw:nColSel ) ) }
ACTIVATE DIALOG oDlg CENTER ON INIT ( oDlg:oClient := oBrw, oDlg:Resize() )
return nil
This works , BUT the code is wrong when tho columns are swapped or when a column is moved (clicking and dragging in the header)
What is wrong ? maybe something in the code from fivewin ?
Frank