TControl - Explicit
TControl - Explicit
Can someone explain the purpose of ExplicitTop, ExplicitLeft, ExplicitWidth and ExplicitHeight in TControl and descendants?
In particular - why are they in the .dfm?
Can someone explain the purpose of ExplicitTop, ExplicitLeft, ExplicitWidth and ExplicitHeight in TControl and descendants?
In particular - why are they in the .dfm?
from here: http://jedqc.blogspot.de/2006/02/d2006-what-on-earth-are-these-explicit.html
ReplyDeleteThe Explicit properties remember the previous bounds of a control before the Align or Anchor properties are changed from their defaults.
The only time the Explicit properties are not written is when the Align property is set back to its default value of alNone.
This is when the Explicit properties are actually used by the control to reset its bounds to what it was previously.
Enlightening, but I still loathe them.
ReplyDeleteWhat's wrong with them ?
ReplyDeleteThey exist to annoy us.
ReplyDeleteBill Meyer
ReplyDeleteWell, other than with version control, how can they annoy you ?
I don't think they are a problem even in a VCS. The coordinates don't change unless you do some serious editing of the form, so there won't be a version bump.
ReplyDeleteIf you really hate them, then click the "Do not store the Explicit* properties into the DFM" checkbox in the DDevExtensions setup.
Markus Joos When porting projects to D7 that were built in XE.
ReplyDeleteIf you just want them removed: There is an option in DDevExtensions to not write Explicit* properties.
ReplyDeletehttp://andy.jgknet.de/blog/ide-tools/ddevextensions/
• Remove Explicit* properties (default: off)
Martin Wienold I think there is an echo in here :-)
ReplyDeleteKevin McCoy Sorry, I did not expand your reply.
ReplyDeleteKevin McCoy They get added and removed every other time, so it's not that the coordinates change, as much as the properties alternate being there and not being there... very annoying!
ReplyDeletePrecisely!
ReplyDeleteAsbjørn Heid I think I said that. ;)
ReplyDeleteBill Meyer Well, they are so very annoying it cannot be mentioned enough :P
ReplyDeleteAsbjørn Heid Can't argue with that! :-)
ReplyDeleteTo me these properties serve a need (guess what, they were "vocally" requested by Delphi users), that is getting a control back to its original position if you toggle its alignment, as explained also here.
ReplyDeleteIf they are added and removed "randomly" (alternative being there and not begin there), even if you don't touch any of the related properties, that is it a bug (and maybe already reported) we should fix. If they are added according to the specs... I'm not sure I'd agree with the request of removing them completely.
They should live in the TControl objects while you are editing them, but once you save - they should be gone. IMO, there is no need to keep these between editing sessions.
ReplyDeleteLars Fosdal I disagree. While I was not one of the "vocal" proponents of the feature, I kind of like the new behavior after stumbling across it. It was a pain when you shut off alignment and your visual component went flying off into the stratosphere. I had to manually tweak the Top and Left coordinate properties to get the component back on to my form. Now they sort of implode, but stay within the boundaries of your form - much easier/faster to work on complex forms.
ReplyDeleteMarco Cantù Yeah it's primarily the buggy nature that annoys me. At least in XE3.
ReplyDeleteLars Fosdal I think you are right in this. I also think the names are terrible, as they do nothing to indicate the purpose. DesignWidth, DesignHeight, etc., would have been more clear.
ReplyDeleteAsbjørn Heid do you (or someone) know if a specific bug is logged?
ReplyDeleteEven if the names were not the best, changing them at this point would be dreadful, imho.
Marco Cantù I agree, changing them would be a Bad Thing now.
ReplyDeleteMarco Cantù I'm pretty sure I saw a QC on it. It might even have been fixed, we're still on XE3, probably for a good while. I'll do some digging.
ReplyDelete