I have no problems with all other gadgets colored with PureColor.
Here`s a snippet of the callback:
Code: Select all
IncludePath "..\Source\"
XIncludeFile "EsGRID.pbi"
IncludePath ""
Enumeration
#head1
#head2
#main
EndEnumeration
LoadFont(#main, "Arial", 30)
Procedure.l MyCellCallBack(egrid, uMsg, *cellinfo.egridCellInfo)
Protected result
Static oldcol, oldrow
Select uMsg
Case #egrid_FormatCell
If *cellinfo\row=-1 ;Custom header.
If *cellinfo\column>=0 And *cellinfo\column<=29
*cellinfo\forecolour = #Black
*cellinfo\backcolour = #Red
*cellinfo\borderstyles=#egrid_TopThickSolid|#egrid_BottomThickSolid
;EndIf
Else
*cellinfo\backcolour=#White
EndIf
EndIf
If Not (*cellinfo\row)%2
If *cellinfo\column>=0 And *cellinfo\column<=17
*cellinfo\backcolour=#Red
Else
*cellinfo\backcolour=#White
EndIf
EndIf
Default
result = #True ;This accounts for all messages we have decided not to process.
EndSelect
ProcedureReturn result
EndProcedure
If OpenWindow(0,0,0,640,300,"EsGRID demo 1.",#PB_Window_SystemMenu|#PB_Window_MaximizeGadget|#PB_Window_Maximize|#PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
egrid_CreateGrid(1, WindowWidth(0)/4, WindowHeight(0)/8, WindowWidth(0)/2, WindowHeight(0)/2,42,0, #egrid_GridLines|#egrid_ResizeColumnsTrue|#egrid_MultiLineText)
egrid_CreateCellCallback(1, @MyCellCallBack())
egrid_SetHeaderHeight(1, 42)
egrid_SetOption(1, #egrid_SelectionBorderWidth, 2)
For b=0 To 49 ;50 columns.
egrid_AddColumn(1,b,"Col " + Str(b),100)
Next
egrid_AddRows(1,-1, 100) ;Add 100 rows.
OptionGadget(4, 4, 4, 145, 20, "Test 1")
PureCOLOR_SetGadgetColor(4, RGB(0,50,50), RGB(220,220,220)) ; without this -> no problem
Repeat
EventID = WaitWindowEvent()
Select EventID
Case #PB_Event_Gadget
EndSelect
Until EventID = #PB_Event_CloseWindow
EndIf
End
...the color will be shown, when a cell has been selected
