Recent

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

Joanna

  • Hero Member
  • *****
  • Posts: 1383
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: 17466
  • Ceterum censeo Trumpum esse delendum (Tnx Charlie)
no they should be saved in lfm or dfm format. Does not matter too much. It is just a format.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Thaddy

  • Hero Member
  • *****
  • Posts: 17466
  • Ceterum censeo Trumpum esse delendum (Tnx Charlie)
That is called persistence. Format does not matter.....
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Joanna

  • Hero Member
  • *****
  • Posts: 1383
@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: 1147
    • 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: 1383
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: 2264
    • 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 -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99

Thaddy

  • Hero Member
  • *****
  • Posts: 17466
  • Ceterum censeo Trumpum esse delendum (Tnx Charlie)
handle. not name,
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Joanna

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

 

TinyPortal © 2005-2018