VOTools for Visual Objects  
and Vulcan.NET  

bBrowser => Tips & Tricks => How to define the selection colors for color conditions    




 from bBrowser
1.4
  bBrowser 1.4 (Limited)
yes
 

How to define the selection colors for color conditions

In the class bColorCondition the following accesses are defined:
SelectedBackground
SelectedForeground
InactiveSelectedBackground
InactiveSelectedForeground

With these accesses the foreground and background colors can be defined, which are to be used, if the color condition applies to a cell and the cell is selected.

The following code fragment demonstrates the proceeding:

  METHOD PostInit() CLASS myDataWindow
  LOCAL odbsCUSTOMER   AS bDBServer
  LOCAL oCC            AS bColorCondition
  LOCAL cCondition     AS STRING

  odbsCUSTOMER := bDBServer{"CUSTOMER.DBF"}
  IF odbsCUSTOMER:Used
    self:oDCBrowser:Use(odbsCUSTOMER)

    cCondition := "Year(Today())-Year(Server:BIRTHDAY)>=40"
    oCC := bColorCondition{cCondition,;
                           odbsCUSTOMER,;
                           Color{COLORYELLOW},;
                           Brush{Color{COLORRED}}}
    oCC:SelectedForeground := Color{COLORYELLOW}
    oCC:InactiveSelectedForeground := Color{COLORYELLOW}

    self:oDCBrowser:ColorCondition:Add(oCC)

    self:oDCBrowser:Refresh()
    self:oDCBrowser:Redraw()
  ENDIF

Copyright © 2003-2015 BEFO GmbH