The Code Captain 1 Posted July 9 I write property and component editors for the classes I define so that they can be edited in the IDE. When editing an object in the IDE's object inspector a standard TPersistent only exposes properties which are not events. However, some TPersistents (notably anything deriving from TCollectionItem) do expose events. I would like to have events declared on TPersistent derived objects editable, but I cannot discover what I need to do in my property / component editors so that the IDE will expose them. I would very much appreciate a link to a sample component / property editor that does this. Thanks in advance! Share this post Link to post
PeterBelow 231 Posted July 9 20 minutes ago, The Code Captain said: I write property and component editors for the classes I define so that they can be edited in the IDE. When editing an object in the IDE's object inspector a standard TPersistent only exposes properties which are not events. However, some TPersistents (notably anything deriving from TCollectionItem) do expose events. I would like to have events declared on TPersistent derived objects editable, but I cannot discover what I need to do in my property / component editors so that the IDE will expose them. I would very much appreciate a link to a sample component / property editor that does this. Thanks in advance! I think all you have to is to define the events with published scope and then register the property editor for that event handler type. Share this post Link to post
The Code Captain 1 Posted July 9 (edited) Thanks @PeterBelow for the speedy response. The events are published. They are TNotifyEvent which is already handled on other objects. There is no 'Events' listed for the TPersistent derived objects (but there are for TCollectionItem derived objects and TComponent derived objects). I have tried using an editor for the TPersistent that changes how properties are enumerated (looking at how the default editor for TComponent works) but I still can't get the IDE to list any Events for something that's derived from TPersistent unless it's also derived from either TCollectionItem or TComponent. Edited July 9 by The Code Captain Share this post Link to post
Remy Lebeau 1330 Posted July 9 The IDE simply doesn't show events for a TPersistent object that is not derived from TComponent or TCollectionItem. I found various forum posts going back over 20 years with people struggling with this exact same problem and I haven't seen anyone post a working solution in that time, not even with custom editors. Share this post Link to post