2
votes

I'm currently making a new vcl component, i made some before and now experience that i done something wrong everytime. It's only a minor issue but i wonder what would be the solution.

My component has a Constant cmpVersion = 1.01; which is then shown in a 'About' published property, showing the version of the component.

In the component constructor the About property is set to the value of the constant.

All seems ok if you place the component on a form, the about property is the correct version, but if i change the version constant in the component package, reinstall the package and reopen the test application that already has the component on the form it is still showing the old version, because it was set in the constructor.

I guess the About property is saved in the test app dfm.

What is the proper way to update the About property when opening a form with the component already on it?

1
Setup the stored specifier for that property (that can prevent its value being stored in the *.dfm file). Of course, existing project will hold it, so you must do some cleanup. - Victoria
I'm wondering what the point of such a property would be. What can you do with it? - David Heffernan
@David, some components have even property editor showing a dialog box with the version. And that's for nothing but promotion. Though I'd personally like to have some unified way to specify component version in the IDE. - Victoria
Yes that what i do too, show a dialog box when clicking on the button of the About property, i know it might sound silly but i mostly add it to learn more about property editors and such and in case of someone in the company ever wondering where the component came from., thanks Victoria, i'll try with that 'stored' specifier. - Franky Brandt
You either like it that way or not David, i'm not going to argue about it, many component designers add a version in the properties editor, Fastreport, jvcl, jcl, IBobjects, EMS Advanced import/export and many more, anyway, thats not the issue i started here. - Franky Brandt

1 Answers

4
votes

Comment by Victoria contains the solution, use 'Stored = False' on the about property so it's not saved in the dfm.