Recent

Author Topic: When a component is created at runtime is not given a name how can it be found?  (Read 5668 times)

Joanna

  • Hero Member
  • *****
  • Posts: 1452
So after the properties are changed I’m assuming that the new properties will be saved in an inifile Or xml file for next time the program is reloaded?

Thaddy

  • Hero Member
  • *****
  • Posts: 19241
  • Glad to be alive.
no they should be saved in lfm or dfm format. Does not matter too much. It is just a format.
objects are fine constructs. You can even initialize them with constructors.

Thaddy

  • Hero Member
  • *****
  • Posts: 19241
  • Glad to be alive.
That is called persistence. Format does not matter.....
objects are fine constructs. You can even initialize them with constructors.

Joanna

  • Hero Member
  • *****
  • Posts: 1452
@thaddy isn’t the running program using an exe file not lfm file though?
If he is using an object inspector  to change properties at runtime.
« Last Edit: February 26, 2024, 08:27:42 am by Joanna »

vfclists

  • Hero Member
  • *****
  • Posts: 1165
    • HowTos Considered Harmful?
@thaddy isn’t the running program using an exe file not lfm file though?
If he is using an objector to change properties at runtime.

Yes. The program is a running executable whose properties are changed at runtime using the object inspector.

The state of changed properties is labelled then saved in LFM format to a file or a database record to be loaded when required.

The object inspector (substitute) is useful when changing a lot of the properties is envisaged by an expert, but in practice only a few of them are changed, and when it is for use by end users, an dedicated interface which works on only the necessary properties should used.

For instance if you enabled an end user to set the Top and Left properties of a control, you wouldn't enable them to set them to negative values, change the Visible property to false.

Lazarus 3.0/FPC 3.2.2

Joanna

  • Hero Member
  • *****
  • Posts: 1452
I never knew that was possible, I use inifiles for everything.
How do you implement saving to an lfm file within the program?

I’ve opened many .lfm files but I never saw much besides maybe position and the nesting of controls . It didn’t show all the things that would be in object inspector such as fonts , colors. Styles etc.
« Last Edit: February 26, 2024, 02:15:58 pm by Joanna »

cdbc

  • Hero Member
  • *****
  • Posts: 2807
    • http://www.cdbc.dk
Hi
@Joanna: Have a look here: https://www.freepascal.org/~michael/articles/ Scroll down until you see "RTTI for beginners" and download the pdf...
That's a nice little 'Treasure Trove' for you  ;)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Thaddy

  • Hero Member
  • *****
  • Posts: 19241
  • Glad to be alive.
handle. not name,
objects are fine constructs. You can even initialize them with constructors.

Joanna

  • Hero Member
  • *****
  • Posts: 1452
Thanks for info  :)

 

TinyPortal © 2005-2018