An enhancement for the CustomFilterCallback
Posted: Fri Aug 21, 2009 7:51 am
Could an optional parameter be added to the CustomFilterCallback? This could be used to store the pointer to a structure containing custom information about what's being drawn. Without this, the only way seems to be global variables.
I think that would be very useful.
Thanks either way for v4.4 (which is brilliant!),
Seymour.
Code: Select all
Structure MYPAINTExtraInformation
age.i
name.s
weight.i
height.i
EndStructure
Procedure.i MYPAINT(x.i,y.i,topcolor.i,bottomcolor.i,pointer.i)
*extra.MYPAINTExtraInformation = pointer
If *extra\name = "Dave"
ProcedureReturn #Red
Else
ProcedureReturn #Green
EndIf
EndProcedure
DrawingMode(#PB_2DDrawing_CustomFilter)
more.MYPAINTExtraInformation
more\name = "Dave"
more\height = 185
CustomFilterCallback(@MYPAINT(),@more)
Thanks either way for v4.4 (which is brilliant!),
Seymour.