Edson: in my situation I need exactly - delete all attributes. Thank you for 'magic function' FreeHighlighterAttributes - exactly what I need. Honestly I ask myself - why not called simple - 'Clear' - first name the user(developer) will looking for, if will need to clear all attributes. And then, when not find - go to documentation(or forum) to discover FreeHighlighterAttributes )). In my inherited highlighter class I define method 'Clear' with only one instruction with this procedure.
Bay the way - think way not good to naming property AttrCount - CountAttr look more pretty. When user will writing some code and type dot(and helper list appeared) - no need to remember 'Count of what?' - enough to know that need 'count of something' , and when begin type 'count...' in helper list he see - 'of cause - CountAttr'. I use this naming rule all my life and it's very, very comfort to use. Maybe in Lazarus already exist another naming agreement(I don't know) - only say what I think to make Lazarus better.
Martin_fr: thank you for advises, but when I write finally code with Edson method it also work when I remove
SetAttributesOnChange(@DefHighlightChange);I don't know why but work).
Thanks for all your answers.
Oops, almost forgot...
I would like to know too: Why would you need to delete an specific attribute?
at this time I write search engine which will highlight founded words. So, what if you want to change background of word on mouse over? But really my task - absolutely not mater, as wrote Ray Konopka in his book(not pretend at quote): "You can't even imagine for which purpose user can use your component".