DataColumn.EnableCellDraw Method (Typed) |
Namespace: XSharp.VO.SDK
1CLASS ColorColumn INHERIT DataColumn 2PROTECT oValidTextColor AS Color 3PROTECT oValidBackground AS Brush 4PROTECT oInvalidTextColor AS Color 5PROTECT oInvalidBackground AS Brush 6METHOD Init( oFieldSpec ) CLASS ColorColumn 7SUPER:Init( oFieldSpec ) 8oValidTextColor := Color{ COLORWHITE } 9oValidBackground := Brush{ Color{ COLORBLUE } } 10oInvalidTextColor := Color{ COLORYELLOW } 11oInvalidBackground := Brush{ Color{ COLORRED } } 12RETURN SELF 13METHOD Init( oWindow, iCtlID, oServer ) CLASS ColorSubForm 14// some initialization code 15SELF:Browser := ColorSubForm_Browser{ SELF } 16oDBDUE_DATE := ColorColumn{ ACCOUNTS_DUE_DATE{} } 17oDBDUE_DATE:Width := 12 18oDBDUE_DATE:HyperLabel := oDCDUE_DATE:HyperLabel 19oDBDUE_DATE:Caption := "DueDate" 20SELF:Browser:AddColumn( oDBDUE_DATE ) 21oDBDUE_DATE:EnableCellDraw( #ValidDateDraw ) 22// more initialization code 23RETURN SELF 24METHOD ValidDateDraw( uValue ) CLASS ColorColumn 25IF uValue < GetPastDueDate() 26SELF:CellTextColor := oValidTextColor 27SELF:CellBackground := oValidBackground 28ELSE 29SELF:CellTextColor := oInvalidTextColor 30SELF:CellBackground := oInvalidBackground 31ENDIF 32RETURN NIL