[Lazarus] How to create hints in the IDE

Bernd Kreuss prof7bit at googlemail.com
Mon Jul 26 01:07:50 CEST 2010


Mattias Gaertner wrote:
>> +        case LowerCase(LeftStr(TVNode.Text, 7)) of
>> +          'functio' : CodePos.X += 9;
> 
> Does that work in fpc 2.4.2?

Haven't tried it. Why should it not work? What was missing in 2.4.2?

Actually I was hoping somebody would come up with a better solution for
this rather ugly hack (at least I don't like it myself). But
theoretically it should always work. The text in the nodes of the tree
view *always* starts with function, procedure, etc., never directly with
an identifier, additional spaces are removed. and the code position
always points to the beginning of the declaration. The only declarations
in the actual code that do *not* start with an identifier should be
class procedure, procedure, class function, function, constructor,
destructor and property and nothing else so from the logic it should work.

Should it fail for whatever reason (the above reasoning might be wrong)
then it simply falls back to producing the old hint that has always been
there.




More information about the Lazarus mailing list