The Code Captain 1 Posted July 9 In some of my TCollectionItem derived classes I override GetDisplayName so that the name shown in the IDE is meaningful for a user. This is very useful. Also when creating code for an event property on the TCollectionItem it uses that display name to name the method which is also very useful. In one of my TCollectionItem classes I am representing the definition of data attributes in a structured record. GetDisplayname was set to return the name of the attribute. To assist users who want to see an overall view of the definition without having to inspect each property at user request I changed the display name to the SQL definition for that attribute. This includes spaces, brackets and commas. This works and is very helpful for the users that requested it, but now the events are named based on the default display name (So instead of having something like CardCodeWriter I have something like TITIODataAttribute64Writer). Is there any way to supply a 'stub' for naming the events that's not the same as the result of the DisplayName? Share this post Link to post
Remy Lebeau 1392 Posted July 9 The only methods your TCollectionItem can override to influence the Object Inspector are GetDisplayName() and GetNamePath(). If you want to customize how your event handlers are auto-generated, you will likely need a custom property editor derived from TMethodProperty (see how TMethodProperty.Edit() is implemented in $(BDS)\source\ToolsAPI\DesignEditors.pas). Share this post Link to post
The Code Captain 1 Posted July 10 Thanks Remy - I'm looking into that now... Share this post Link to post