FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Listbox color for a single column
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Listbox color for a single column
Posted: Thu Jul 17, 2008 02:26 PM

Antonio

It appears the nCol is returning NIL for nClrText ( nClrPane works fiine ).. I am trapping the code block and evaluating nCol .. and the msginfo(ncol ) returns NIL in SelColorf()

Rick Lipkin

..
..
oLbx:nClrText = { | nCOL | SelColorF( nCOL, oRsRpt:Fields("row_color"):Value, "F" ) }
oLbx:nClrPane = { | nCOL | SelColorB( nCOL, oRsRpt:Fields("row_color"):Value, "B" ) }

..

//--------------------
Static Func SelColorB( nCOL, cCOLOR, cTYPE )

LOCAL nCOLOR := CLR_WHITE

DO CASE
CASE nCOL = 8 .and. cCOLOR = "GREEN" .and. cTYPE = "B"
nCOLOR := CLR_GREEN

CASE nCOL = 8 .and. cCOLOR = "YELLOW".and. cTYPE = "B"
nCOLOR := CLR_YELLOW

CASE nCOL = 8 .and. cCOLOR = "RED" .and. cTYPE = "B"
nCOLOR := CLR_RED

ENDCASE

RETURN( nCOLOR )

//--------------------
Static Func SelColorF( nCOL, cCOLOR, cTYPE )

LOCAL nCOLOR := CLR_BLACK

MSGINFO( nCOL ) // return NIL here

DO CASE
CASE nCOL = 8 .and. cCOLOR = "GREEN" .and. cTYPE = "F"
nCOLOR := CLR_WHITE
msginfo( nCOLOR )
CASE nCOL = 8 .and. cCOLOR = "YELLOW".and. cTYPE = "F"
nCOLOR := CLR_WHITE

CASE nCOL = 8 .and. cCOLOR = "RED" .and. cTYPE = "F"
nCOLOR := CLR_WHITE

ENDCASE

RETURN( nCOLOR )

Continue the discussion