Navigation:  Classes > bDataColumn >

bDataColumn:ColorCondition

Print this Topic    Previous pageReturn to chapter overviewNext page

Purpose

List of color conditions that are to be considered when drawing column values.

Class

bDataColumn

Type

Access

Data Type

bColorConditionList

Description

With the list of color conditions, column values can be drawn in different foreground and background colors. A column can contain several color conditions. The list of color conditions is an object of the class bColorConditionList. New color conditions can be added by bDataColumn:ColorCondition:Add(). Whether color conditions are defined can be checked with the method bDataColumn:ExistColorConditions().

 

All values with no color conditions set are drawn with the foreground and background color of the bBrowserColumn:DataView object.

 

So that changes that were made in the list of color conditions are shown immediately in the bBrowser, all values of the column must be re-read using the method bBrowser:Refresh(). This is only necessary if the column is inside the visible area of the browser.

Samples

In the following sample a color condition is defined in which all customers born before 1960 are displayed with a red foreground.

 

LOCAL odbsCUSTOMER    AS DBServer

LOCAL oBrowser        AS bBrowser

LOCAL oColumn         AS bDataColumn

LOCAL oColorCondition AS bColorCondition

 

// create browser and show it

odbsCUSTOMER := DBServer{"CUSTOMER"}

oBrowser := bBrowser{oOwner,;

                                         1000,;

                                         Point{0, 0},;

                                         Dimension{300, 250}}

oBrowser:Use(odbsCUSTOMER)

oBrowser:Show()

 

// Determine column 'BIRTHDAY'

oColumn := oBrowser:GetColumn(#BIRTHDAY)

IF !EMPTY(oColumn)

   // define color condition and add it to the column

   oColorCondition := bColorCondition{"Server:BIRTHDAY<CToD('01/01/60')",;

                                      odbsCUSTOMER,;

                                      Color{COLORRED}}

   oColumn:ColorCondition:Add(oColorCondition)

ENDIF

 

// IMPORTANT!!!

// -> Reread data

oBrowser:Refresh()

See Also

bBrowser:ColorCondition

bBrowser:IsColumnVisible()

bBrowser:Refresh()

bBrowserColumn:DataView

bDataColumn:ExistColorConditions()

 


Page url: http://www.YOURSERVER.com/index.html?bdatacolumn_colorcondition.htm