FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse changing row-color on groups ( index ) ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

xBrowse changing row-color on groups ( index ) ?

Posted: Sat Apr 06, 2013 10:08 PM
Hello,

I want to switch the row-color of a image-group like this row-change sample for deleted:

oBrw:bClrStd = { || If( oBrw:KeyNo() % 2 == 0, ;
{ If( ( oBrw:cAlias )->( Deleted() ), 255, 0 ), 16774636 }, ;
{ If( ( oBrw:cAlias )->( Deleted() ), 255, 0 ), 16770764 } ) }

sample ( Index on field Image ) :



Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: xBrowse changing row-color on groups ( index ) ?

Posted: Mon Apr 08, 2013 06:10 AM
I got it working, adding a extra field SWITCH.
At startup, I defined for each image-group .T. or .F.
like :
image1: SWITCH := .T.
Image1 : SWITCH := .T.
Image2 : SWITCH := .F.
Image3 : SWITCH := .T.

in xbrowse I used : oBrw:bClrStd := {|| { 0, IIF( (1)->SWITCH, 16774636, 16770764 ) } }
But maybe another possible solution ?



Code (fw): Select all Collapse
DBSELECTAREA(1)
INDEX ON  UPPER((1)->IMAGE)  TO "PROJECT.CDX"
DBGOTOP()
cFile := (1)->IMAGE
lSwitch := .T.
DO WHILE !EOF()
   IF (1)->IMAGE <> cFile
      cFile := (1)->IMAGE
      IF lSwitch = .T.
         lSwitch := .F.
      ELSE
         lSwitch := .T.
      ENDIF
   ENDIF
   IF NET_RLOCK( 5, 5 )
      (1)->SWITCH := lSwitch
      NET_ULOCK()
   ENDIF
   DBSKIP( +1 )
ENDDO


Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion