DBGrid - Impact of merging Options2 and OptionsExtra into Options lazarus / 31-LCL ---------------------------------------------------------------------- valdir.marcos · 2019-09-20 12:39 About DBGrid, what would be the impact of merging Options2 and OptionsExtra into Options? ---------------------------------------------------------------------- lucamar · 2019-09-20 13:07 Well, for one thing any code depending on the enumerations being what they are, like e.g. not well thought out validity tests, would stop working right. Not really a show-stopper, but annoying if you have much code like that. ---------------------------------------------------------------------- valdir.marcos · 2019-09-20 15:23 Quote from: lucamar on September 20, 2019, 03:07:28 pmWell, for one thing any code depending on the enumerations being what they are, like e.g. not well thought out validity tests, would stop working right. Not really a show-stopper, but annoying if you have much code like that.I have no code using that, but I consider a better design if DBGrid would have only one "options" instead of three. Do you think it's worthwhile to open a feature request for that? ---------------------------------------------------------------------- lucamar · 2019-09-20 15:46 Quote from: valdir.marcos on September 20, 2019, 05:23:36 pmI have no code using that, but I consider a better design if DBGrid would have only one "options" instead of three. It's not just about your code, but about all the code ever writen using it. I guess that's why they added new properties instead of reusing the one already there: backwards (and Delphi?) compatibility. I'd also prefer just one "Options" property but I understand (more or less) why that might not be possible. QuoteDo you think it's worthwhile to open a feature request for that? Yes, if you think it's important enough. In the worst case it won't be implemented, leaving everything as it is now, so you loose nothing; on the other hand, it might be implemented and you (and everyone) win that. Although I'm rather pessimistic about it: there're probably lots of code out there depending on the properties being as they are: a change would mean that, for example, code that sets the options at run-time would have to be modified, etc. ---------------------------------------------------------------------- wp · 2019-09-20 15:59 Quote from: lucamar on September 20, 2019, 05:46:23 pma change would mean that, for example, code that sets the options at run-time would have to be modified, etc. That's the least problem because the compiler will tell you what has to be changed. Setting Options at designtime (in the object inspector), however, is much worse because the form will not longer be accepted by the IDE, you not be able to open it and must correct its lfm file outside the IDE. ---------------------------------------------------------------------- lucamar · 2019-09-20 17:14 Quote from: wp on September 20, 2019, 05:59:03 pm[...] the form will not longer be accepted by the IDE, you not be able to open it and must correct its lfm file outside the IDE. You're right; I didn't think of that. One might expect the IDE to be able to open/convert old forms but that's not guaranteed at all, and even then backwards compatibillity would be a problem, as happens now with, for example, DoubleBuffered ---------------------------------------------------------------------- valdir.marcos · 2019-09-21 13:34 Quote from: lucamar on September 20, 2019, 05:46:23 pmQuote from: valdir.marcos on September 20, 2019, 05:23:36 pmI have no code using that, but I consider a better design if DBGrid would have only one "options" instead of three.It's not just about your code, but about all the code ever writen using it. I guess that's why they added new properties instead of reusing the one already there: backwards (and Delphi?) compatibility. I'd also prefer just one "Options" property but I understand (more or less) why that might not be possible. QuoteDo you think it's worthwhile to open a feature request for that?Yes, if you think it's important enough. In the worst case it won't be implemented, leaving everything as it is now, so you loose nothing; on the other hand, it might be implemented and you (and everyone) win that. Although I'm rather pessimistic about it: there're probably lots of code out there depending on the properties being as they are: a change would mean that, for example, code that sets the options at run-time would have to be modified, etc. Quote from: wp on September 20, 2019, 05:59:03 pmQuote from: lucamar on September 20, 2019, 05:46:23 pma change would mean that, for example, code that sets the options at run-time would have to be modified, etc.That's the least problem because the compiler will tell you what has to be changed. Setting Options at designtime (in the object inspector), however, is much worse because the form will not longer be accepted by the IDE, you not be able to open it and must correct its lfm file outside the IDE. Quote from: lucamar on September 20, 2019, 07:14:39 pmQuote from: wp on September 20, 2019, 05:59:03 pm[...] the form will not longer be accepted by the IDE, you not be able to open it and must correct its lfm file outside the IDE.You're right; I didn't think of that. One might expect the IDE to be able to open/convert old forms but that's not guaranteed at all, and even then backwards compatibility would be a problem, as happens now with, for example, DoubleBufferedI understand the concerns of both of you. I think it's a minor setback in face of a better design. Using stable+fixes+trunk, I face that experience of properties missing or changed all the time. Sometimes, the results worth the effort. https://wiki.freepascal.org/Lazarus_2.2.0_release_notes#IDE_incompatib ilities https://wiki.freepascal.org/Lazarus_2.0.0_release_notes#LCL_incompatib ilities https://wiki.freepascal.org/FPC_New_Features_Trunk I am studying "/lazarus/lcl/dbgrids.pas" to provide a patch and file a feature request. Thanks for your time and help to discuss the subject.