Page 1 of 1

Browse and colors

Posted: Fri Feb 15, 2013 12:32 am
by c-tec
Hello,
I have color codeblocks on browse columns and I use CURSORMODE XBPBRW_CURSOR_ROW. I want that the cell with the color codeblock keep the color, actually the whole row is highlighted. Is that possible ?
regards
Rudolf

Re: Browse and colors

Posted: Fri Feb 15, 2013 12:34 am
by skiman
Yes, that would be a nice feature.

I suppose it can be done with ownerdrawing.

Re: Browse and colors

Posted: Fri Feb 15, 2013 9:24 am
by Auge_Ohr
skiman wrote:Yes, that would be a nice feature.
I suppose it can be done with ownerdrawing.
hm ... i do it with a Columne Class.

Code: Select all

******************************************
CLASS XbpColumnLocal FROM XbpColumn
******************************************
EXPORTED:
   INLINE METHOD HiliteRow( nRowPos, lHilite, lFrame, lRepaint )
   *************************************************************
   LOCAL aColor
   LOCAL RETVAR

   IF ( lHilite )                     // .AND. ( aColor:= Eval( ::colorBlock ) ) # nil
      IF ::colorBlock # NIL
         aColor:= Eval( ::colorBlock )
         IF aColor = NIL
            RETVAR := ::XbpColumn:HiliteRow( nRowPos, lHilite, lFrame, lRepaint )
         ELSE
            RETVAR := ::dataArea:setCellColor( nRowPos, aColor[ 1 ], aColor[ 2 ] )
         ENDIF
      ELSE
         RETVAR := ::XbpColumn:HiliteRow( nRowPos, lHilite, lFrame, lRepaint )
      ENDIF
   ELSE
      RETVAR := ::XbpColumn:HiliteRow( nRowPos, lHilite, lFrame, lRepaint )
   ENDIF
   RETURN RETVAR
ENDCLASS

Re: Browse and colors

Posted: Fri Feb 15, 2013 10:43 pm
by skiman
Hi Jimmy,

Simple and effective. Thanks for this code.