Hi everyone!
I'm creating a new control for PascalSCADA that will mimic a functionality of other engineering software in Lazarus. Lazarus has a similar feature (Frames). Knowing this, I started from TFrame, trying to specialize it to get new functions, but in this way, I'm doing something wrong in the process.
What I did:
1) Created the specialized TFrame class with the desired properties.
1. TFaceplateFrame = class(TFrame)
2. private
3. ffaceplatetag: TPLCStruct;
4. protected
5. procedure setfaceplateTag(AValue: TPLCStruct);
6. published
7. property FaceplatePLCTag: TPLCStruct read ffaceplatetag write
setfaceplateTag;
8. end;2) Registered a Lazarus project file descriptor using the function RegisterProjectFileDescriptor. The class TFaceplateFrameFileDescriptor inherits from TFileDescPascalUnitWithResource. Below is the constructor of the file descriptor:
1. constructor TFaceplateFrameFileDescriptor.Create;
2. begin
3. inherited Create;
4. Name := 'FaceplateFrame'; // do not translate this
5. ResourceClass := TFaceplateFrame;
6. RequiredPackages := 'pascalscada_hmi';
7. UseCreateFormStatements := True;
8. end;What I expect:
After doing the previous steps, when I create a new TFaceplateFrame (using Lazarus menu File -> New, then choosing FaceplateFrame), the property FaceplatePLCTag should be visible on newly created TFaceplateFrame instances, in the TFaceplateFrame designer or even in TFaceplateFrame instances inside forms.
This happens on a freshly created TFaceplateFrame, but if I close and reopen the project, the FaceplatePLCTag property of my FaceplateFrame instances is lost and does not appear in the Object Inspector anymore.
Can someone tell me what I am doing wrong? Any help is appreciated.
