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?

Comments

  1. from here: http://jedqc.blogspot.de/2006/02/d2006-what-on-earth-are-these-explicit.html
    The 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.

    ReplyDelete
  2. Enlightening, but I still loathe them.

    ReplyDelete
  3. Bill Meyer
    Well, other than with version control, how can they annoy you ?

    ReplyDelete
  4. 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.

    If you really hate them, then click the "Do not store the Explicit* properties into the DFM" checkbox in the DDevExtensions setup.

    ReplyDelete
  5. Markus Joos When porting projects to D7 that were built in XE.

    ReplyDelete
  6. If you just want them removed: There is an option in DDevExtensions to not write Explicit* properties.

    http://andy.jgknet.de/blog/ide-tools/ddevextensions/
    • Remove Explicit* properties (default: off)

    ReplyDelete
  7. Martin Wienold I think there is an echo in here :-)

    ReplyDelete
  8. Kevin McCoy Sorry, I did not expand your reply.

    ReplyDelete
  9. Kevin 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!

    ReplyDelete
  10. Asbjørn Heid I think I said that. ;)

    ReplyDelete
  11. Bill Meyer Well, they are so very annoying it cannot be mentioned enough :P

    ReplyDelete
  12. Asbjørn Heid Can't argue with that! :-)

    ReplyDelete
  13. To 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.
    If 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.

    ReplyDelete
  14. 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.

    ReplyDelete
  15. Lars 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.

    ReplyDelete
  16. Marco Cantù Yeah it's primarily the buggy nature that annoys me. At least in XE3.

    ReplyDelete
  17. Lars 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.

    ReplyDelete
  18. Asbjørn Heid do you (or someone) know if a specific bug is logged?

    Even if the names were not the best, changing them at this point would be dreadful, imho.

    ReplyDelete
  19. Marco Cantù I agree, changing them would be a Bad Thing now.

    ReplyDelete
  20. Marco 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

Post a Comment