However, there it is written
Old behaviour: the default value of MaxValue was 100
So the 100 was in effect. Why is this then not kept? I mean It is a nightmare to look through all my programs now to check if my 100 as max value now suddenly became a 0.
Can the the IDE please don't automatically change set values? It is OK that the new default is set for new elements but existing elements should not be changed automatically.
This is not possible. When a property is declared with a default value and the property value is equal to the default value then the property is not written to the lfm file. So, when you open your project in the IDE and the streamer does not find this property in the lfm then the value of the property with which it was created is kept. In Laz 2.2+, the MaxValue after creation is 0, in older versions it was 100.
It is a nightmare to look through all my programs now to check if my 100 as max value now suddenly became a 0.
In all my programs the max very rarely is 100, and thus in the majority of cases it is different from the default of the old Laz versions and thus is written to the lfm. But I agree it is quite some effort to find all the changed cases in a large code base.
I also don't understand why the maximum can not be smaller than the minimum.
The current behaviour of unlimited spinning when Min <> 0 and Max = 0 appears to be a bug. Would you report it?
Not sure about the condition of Max < Min. It could also be interpreted to be intentional (although it does not appear to be very logical): The question is how the effect of a one-sided limit can be achieved, e.g. limit the MinValue, but define none for the MaxValue. Three possibilities come to my mind
- Make the MaxValue larger than the MinValue - I think this is confusing: Is the upper limit unbound? Or is the lower limit unbound?
- Add a new property FixedLimits = set of (fixedMin, fixedMax).
- Enter a "huge" value for MaxValue (e.g. MaxInt for the SpinEdit). Very simple, and looks fine.
I am not the author of these components, but I'd favour the third option.
I also tend to raise an exception when MaxValue < MinValue. But when? During streaming? This would lead to one of these nasty streaming errors which make it impossible to load a form... In the Object Inspector? But then the error will slip through at runtime. When at runtime? Could not find a good place after a quick search...
[/quote]