4 Attachment(s)
Is the "expanding rectangle" of relation="relative" anchoring a dynamic anchor?
In the Developer Guide wiki for the windowcontrol API Object, under the setAnchor() function (link) it's stated that:
"When using a relation other than absolute, an anchor rectangle is internally tracked for the target control. Any "relative" controls anchoring to it will increase this rectangle to encompass that control as well.".
Is the rectangle supposed to maintain a dynamic anchor?
What I mean by this is, if I set up a relation relative anchor on say the right side of a control, then plop in a couple windowcontrols, (icons), employing the relative anchoring, is the right anchor supposed to say, rescale the offset, so that the anchor point stays in the (absolute) same position on the form?
A picture might help. Here is a composite of screen shots. The left panel in the image is of the 5E Character Sheet. The red arrow is where I will "plop" in my controls. The panel to the right is how I want the window to look. Three different extensions have added an icon to the window.
Attachment 52577
In the above image, the ruleset definitions of the Name Title bar, have the left anchor essentially at the left edge of the window, the top anchor at the top of the window, and the right anchor at the right edge of the window with an offset that places it just to the left of the token control.
To get the desired result, my extensions redefine the anchoring of the Name Title's right anchor to include relation="relative". They also redefine the left anchor of the Inspiration Title to have relation="relative". My extensions have the relative relation also on added icon's left anchors.
So the plopping in part works great, each new control is easily placed where I want it, like ducks in a row. But the problem is, that unless I readjust the Name Title's right anchor offset for each plop, the right anchor (offset) just keeps on marching off to the right instead of staying put, just to the left of the token control.
Attachment 52576
Is this the desired behavior? What good is the expanding box if it doesn't keep it's anchor point position? Have I missed setting some property?
If this is the desired behavior, then I guess I need to reset the offset as each icon loads (in the onInit()).
Attached are the bare bone, illustrative, extensions. The two are in a single .zip file. Unzip the two folders into your extensions folder. The relevant files are the
extensions\RELATIVITY TEST A\campaign\TEST_A_record_char.xml
and the corresponding TEST B file
the third extension is my Local Dice Tower extension that I am revising (NOTE the currently published copy doesn't work, it hasn't been updated). Here's an illustration of where to put the .zip file contents.
Attachment 52574