Array of TPersistant Objects for Design Time lazarus / 21-General ---------------------------------------------------------------------- SandyG · 2024-06-15 22:57 Not sure if this is possible, I have an object that inherits from TPersistant. This works as a custom class that can be edited in the property inspector. Normal stuff. The question is it possible to have an ARRAY of these object and still have the design time property inspector work? I can get it to compile just fine but will crash  Lazarus when I install the component (even with a fresh project not yet using the component, as soon as I add it to the form it crashes the works) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // lots of code removed   TDTCustomThemedGauge = class(TDTBaseAnalogDevice)  private    FLedArray: Array[0..7] of TDTRangeCheckLedSettings; // want to have an array of these in the property inspector at design time, this inherits from TPersistent ...    Procedure SetLedArray(AIndex: Integer; AValue: TDTRangeCheckLedSettings);    Function GetLedArray(AIndex: Integer): TDTRangeCheckLedSettings;     { Private declarations }  protected    { Protected declarations }    Property LedArray[AIndex: Integer]:TDTRangeCheckLedSettings Read GetLedArray Write SetLedArray;   public    { Public declarations }...  end; ... Procedure TDTCustomThemedGauge.SetLedArray(AIndex:Integer; AValue: TDTRangeCheckLedSettings);begin  FLedArray[AIndex] := AValue; // OK for a descendant of a TPersistent or have to do it member var by member var??end; Function TDTCustomThemedGauge.GetLedArray(AIndex:Integer): TDTRangeCheckLedSettings;begin  Result := FLedArray[AIndex];end;... Can something like this be done or is it out of scope for the way the design time property inspector works. Sandy ---------------------------------------------------------------------- jamie · 2024-06-16 00:39 I think I have an idea of what you want. Please look at the THeaderCOntrol on the common controls tab and look at its sources. It has a Section Property that gives you a TreeView structure of header items added in the OI. You can examine how the OI manages this. ---------------------------------------------------------------------- SandyG · 2024-06-16 14:59 Thanks, I'll take a look. Sandy ---------------------------------------------------------------------- alpine · 2024-06-16 17:02 QuoteThe question is it possible to have an ARRAY of these object and still have the design time property inspector work?Use TOwnedCollection instead. That's the way the object inspector works. ---------------------------------------------------------------------- SandyG · 2024-06-26 02:08 Just starting to get back at this, Why TOwnedCollection, I see in the THeaderControl using TCollection? Sandy ---------------------------------------------------------------------- alpine · 2024-06-26 07:59 Quote from: SandyG on June 26, 2024, 04:08:00 amJust starting to get back at this, Why TOwnedCollection, I see in the THeaderControl using TCollection? Sandy Same, but you should override GetOwner function to return the owner component. In the TOwnedCollection you can give it to the constructor.