xBrowse changing row-color on groups ( index ) ?

xBrowse changing row-color on groups ( index ) ?

Postby ukoenig » 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 ) :

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

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

Postby ukoenig » Mon Apr 08, 2013 6: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 ?

Image

Code: Select all  Expand view

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 102 guests