Recent

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

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1207
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?
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

Thaddy

  • Hero Member
  • *****
  • Posts: 16157
  • Censorship about opinions does not belong here.
no they should be saved in lfm or dfm format. Does not matter too much. It is just a format.
If I smell bad code it usually is bad code and that includes my own code.

Thaddy

  • Hero Member
  • *****
  • Posts: 16157
  • Censorship about opinions does not belong here.
That is called persistence. Format does not matter.....
If I smell bad code it usually is bad code and that includes my own code.

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1207
@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 »
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

vfclists

  • Hero Member
  • *****
  • Posts: 1146
    • 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 from IRC

  • Hero Member
  • *****
  • Posts: 1207
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 »
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

cdbc

  • Hero Member
  • *****
  • Posts: 1646
    • 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 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

Thaddy

  • Hero Member
  • *****
  • Posts: 16157
  • Censorship about opinions does not belong here.
handle. not name,
If I smell bad code it usually is bad code and that includes my own code.

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1207
Thanks for info  :)
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

 

TinyPortal © 2005-2018