Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder 2 Preview » View Thread |
Messages 1 to 9 of 9 total |
.Loaded; or equivalent |
Sun, May 10 2015 8:22 PM | Permanent Link |
MarkB | I need to perform an action after a component's properties are completely streamed in from the form file at run time. I'd like for it to be at the TComponent level
.AfterLoad looked like what I needed but it doesn't seem to be called like I had hoped. Is there a method I can override which is called that I can override which is like Delphi's .Loaded method? |
Sun, May 10 2015 8:48 PM | Permanent Link |
MarkB | MarkB wrote:
I need to perform an action after a component's properties are completely streamed in from the form file at run time. I'd like for it to be at the TComponent level .AfterLoad looked like what I needed but it doesn't seem to be called like I had hoped. Is there a method I can override which is called that I can override which is like Delphi's .Loaded method? Just to make sure what I was attempting worked, I added my own .loaded method here: procedure TPersistent.LoadProperties(AReader: TReader); begin try while (not AReader.EndOfObject) do begin if (not LoadProperty(AReader)) then AReader.SkipProperty; if (not AReader.MoreProperties) then Break; end; finally Loaded; <<======= end; end; But if there is an existing method which is better that would be great. |
Sun, May 10 2015 8:53 PM | Permanent Link |
Raul Team Elevate | On 5/10/2015 8:22 PM, MarkB wrote:
> I need to perform an action after a component's properties are completely streamed in from the form file at run time. I'd like for it to be at the TComponent level > .AfterLoad looked like what I needed but it doesn't seem to be called like I had hoped. > Is there a method I can override which is called that I can override which is like Delphi's .Loaded method? Without additional info it's hard to suggest things but i'd suggest start with InitializeProperties or Initialized Raul |
Sun, May 10 2015 9:02 PM | Permanent Link |
MarkB | Raul wrote:
On 5/10/2015 8:22 PM, MarkB wrote: > I need to perform an action after a component's properties are completely streamed in from the form file at run time. I'd like for it to be at the TComponent level > .AfterLoad looked like what I needed but it doesn't seem to be called like I had hoped. > Is there a method I can override which is called that I can override which is like Delphi's .Loaded method? Without additional info it's hard to suggest things but i'd suggest start with InitializeProperties or Initialized Raul I looked at that but it looks like those are called in the TComponent constructor before properties are streamed in. |
Mon, May 11 2015 4:04 AM | Permanent Link |
Matthew Jones | MarkB wrote:
> I need to perform an action after a component's properties are > completely streamed in from the form file at run time. I'd like for > it to be at the TComponent level > > .AfterLoad looked like what I needed but it doesn't seem to be called > like I had hoped. > > Is there a method I can override which is called that I can override > which is like Delphi's .Loaded method? Didn't Tim just say that the final version has a way to tell? I can't find the reference instantly. |
Mon, May 11 2015 7:26 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Mark,
<< I need to perform an action after a component's properties are completely streamed in from the form file at run time. I'd like for it to be at the TComponent level .AfterLoad looked like what I needed but it doesn't seem to be called like I had hoped. >> Why is this ? This is how it gets called: procedure TPersistent.Load(AReader: TReader); begin BeforeLoad; try if AReader.IsArray then LoadArray(AReader) else LoadObject(AReader); AfterLoad; <<<<<<<<<<<<<<<<<<<<<<<< except on E: Exception do LoadError(E); end; end; ------------ Tim Young Elevate Software www.elevatesoft.com |
Mon, May 11 2015 9:26 AM | Permanent Link |
MarkB | Tim Young [Elevate Software] wrote:
Mark, << I need to perform an action after a component's properties are completely streamed in from the form file at run time. I'd like for it to be at the TComponent level .AfterLoad looked like what I needed but it doesn't seem to be called like I had hoped. >> Why is this ? This is how it gets called: procedure TPersistent.Load(AReader: TReader); begin BeforeLoad; try if AReader.IsArray then LoadArray(AReader) else LoadObject(AReader); AfterLoad; <<<<<<<<<<<<<<<<<<<<<<<< except on E: Exception do LoadError(E); end; end; ------------ Tim Young Elevate Software www.elevatesoft.com This is at the TComponent/TPersistent level, not the form level. When a Form loads the components that it contains, Load is never called for the component, just LoadProperty/LoadProperties Thus, AfterLoad is not called for each individual component on the form. |
Mon, May 11 2015 1:21 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Mark,
<< When a Form loads the components that it contains, Load is never called for the component, just LoadProperty/LoadProperties Thus, AfterLoad is not called for each individual component on the form. >> This is a "buglet" in the way that the controls/components are being loaded. I'll make sure that this is fixed, and that will allow you to use the built-in methods. Tim Young Elevate Software www.elevatesoft.com |
Mon, May 11 2015 2:17 PM | Permanent Link |
MarkB | <<"Tim Young [Elevate Software]" wrote:
Mark, << When a Form loads the components that it contains, Load is never called for the component, just LoadProperty/LoadProperties Thus, AfterLoad is not called for each individual component on the form. >> This is a "buglet" in the way that the controls/components are being loaded. I'll make sure that this is fixed, and that will allow you to use the built-in methods. Tim Young Elevate Software www.elevatesoft.com>> Great! Thank you. |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |