Listbox color for a single column

Postby Antonio Linares » Thu Jul 17, 2008 8:40 am

This is the right code:
Code: Select all  Expand view  RUN
               SetTextColor( hDC, If( nColAct != nil, If( ValType( nClrTxt ) == "B",;
                             Eval( nClrTxt, n ), nClrTxt ),;
                             If( ValType( nClrText ) == "B", Eval( nClrText, n ), nClrText ) ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rick Lipkin » Thu Jul 17, 2008 2: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 )
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nageswaragunupudi and 67 guests