Board index » delphi » Reloading form and owned component properties at runtime
Todd Sankey
![]() Delphi Developer |
Fri, 08 Dec 2000 03:00:00 GMT
|
Todd Sankey
![]() Delphi Developer |
Fri, 08 Dec 2000 03:00:00 GMT
Reloading form and owned component properties at runtimeIs it possible (read: easy) to reload all of the properties of a form and InitInheritedComponent(Self, TForm); This unfortunately does not work as the streaming system seems to want to Has anyone found or invented a better way to handle this than coming up Todd Sankey |
Andrew Stewar
![]() Delphi Developer |
Sat, 09 Dec 2000 03:00:00 GMT
Re:Reloading form and owned component properties at runtimeQuoteTodd Sankey wrote: inherit from. In it you need just a couple of methods... Procedure TPersistentForm.ReadState(Reader ?); Override; Procedure TPersistentForm.ReaderSetName(Component, Name ?); FindComponent(Name).Free; Then you can save your form by simply calling aStream.WriteComponent(aForm); and recreate it by calling aForm:= aStream.ReadComponent(Nil) as TForm; Andrew |
Todd Sanke
![]() Delphi Developer |
Sat, 09 Dec 2000 03:00:00 GMT
Re:Reloading form and owned component properties at runtimeI had investigated this approach. It definitely will work, but there are Is there a method for streaming in the properties without creating the Andrew Stewart <astew...@strobes.co.nz> wrote in article Quote> Todd Sankey wrote: |
Andrew Stewar
![]() Delphi Developer |
Sun, 10 Dec 2000 03:00:00 GMT
Re:Reloading form and owned component properties at runtimeQuoteTodd Sankey wrote: Quote> 2) I still have to do all the work of getting the form resource, creating these few lines do all that is required, and they can be reused: Function LoadPersistentForm(Const FileName:String):TForm; Procedure SavePersistentForm(Const FileName:String; Const Form:TForm); Quote> 3) While I certainly could do 2) without great difficulty, it does fairly versions of your application, since the properties are stored by name only, as text. As long as you never remove any published properties from future versions of your components you'll be okay. You can add new properties, which will be set to their default values. You may want to avoid streaming certain components on the form, such as Quote> Is there a method for streaming in the properties without creating the If the components that have major side effects in their constructors can Andrew |
1. Reload component properties at runtime
2. A DATASOURCE property in an own written component
3. DATASOURCE property in an own written component
4. Inherited properties on own component
5. Saving of component references in own properties
6. property of form <> property of component
7. How to publish a table property for own components
8. Q: Stringlist as a property in an own Component