View Single Post
Old 01-07-2013, 12:42 PM   #24
valaury3169
Enhanced Imperial Golem
 
Join Date: Jun 2008
Posts: 204
Interface Author - Click to view interfaces
Default

This is my best explanation. First, AutoStretch would have to be first because it determines whether size/location is used, or Anchors/Offsets are used. I have not specifically used the AutostretchVerticle/Horizontal, but I feel sure it is the same.

If AutoStretch is set to false, then values in the anchors and offsets are ignored and only size/location is evaluated. If it is true, then the opposite is true; size and location are ignored and the anchors and offsets are evaluated. Autostretch is used to determine if an object within the window resizes with the parent container, or is fixed regardless of how the parent is resized. Autostretch=false means the object is fixed in position and size.

To understand the anchors and offsets you have to realize that all objects have 4 sides (I know, duh ) and each side can be set separately. Starting with the top (I don't think EQ cares which is evaluated first) first you determine if you want the top edge of the object to 'hook' to the top of the parent container or to the bottom. TopAnchorToTop=true 'hooks' the top edge of the parent container. False 'hooks' it to the bottom edge.

Next you use ToAnchorOffest to determine how far away (in pixels) the edge you just hooked is away from the edge you just hooked it to.

One thing to keep in mind is that even though Autostretch may be on, you can define the anchors and offsets to make things appears as if they are fixed positioned. You often find this with buttons.

Min/Max size is probably last, as it is only used when the container is actually resized. I have never set them, so I am not sure of their exact behavior.

A couple of other things to remember; all objects are rendered bottom to top based on their order in the <pieces> list. Also remember that anchors are fixed to their parent container and not the main window. Lastly, any property that is omitted, but indicated will be defaulted to false. So, if the xml for TopAnchorToTop is not present], but Autostretch=true, then TopAnchorToTop will be false meaning it will be 'hooked' to the bottom edge. And of course as I mentioned before, TopAnchorToTop=True (capital 'T') then it is actually interpretted by EQ to be false thereby 'hooking' it to the bottom edge.

Oh, one other thing, if you try and render something 'inside-out' it will not appear at all. By inside-out I mean that the top edge is below the bottom edge or the right edge is to the left of the left edge. This is only achievable by setting AutoStretch=true.

Hopefully this isn't a recap of stuff you already knew and it is actually useful.
valaury3169 is offline   Reply With Quote