PDA

View Full Version : How do I make sure I'm anchored to the right in a windowclass?



SilentRuin
July 5th, 2020, 23:34
I thought anchoring to "contentanchor" was the way to be on the far right - but I stomped right over another extensions addition doing the same thing.

How are you supposed to make sure you're on the right of anything else in a windowclass - being part of the base rulesets or some past or future extension?



<anchored to="contentanchor" position="belowright" offset="10,6" width="45" height="45" />


This stomped over something another extensions addition because they did the same thing. Is there some global anchor name that is "RIGHT AS RIGHT CAN BE" ?

Moon Wizard
July 6th, 2020, 17:52
If both extensions are adding a control to the same exact location, they will be created in the same spot. That's part of how control layout works.

The "contentanchor" control is just something I used within the CoreRPG windows to provide a way to make templates to attach to using relative layout. However, all controls that want to use relative layout must define it. Any controls with absolute anchors are always fixed distance from anchor point.

You can try to anchor to right edge of window (individual right anchor with no parent tag). However, that becomes problematic for different themes which have different frame border sizes on right side.

Maybe you can coordinate with the other extension maker to come up with a common template using relative spacing that you can both use? You can look at the templates that use anchor_right to get ideas.

Regards,
JPG

SilentRuin
July 6th, 2020, 18:06
Well the other extension is that one I modified for the community in my signature so I suppose I have access. But really I want anything I personally write to be fire proof from disrupting or being disrupted by other extensions as best I can. I'll come up with something else here - think I'm just going to overlay a token window and set mine to invisible unless its activated or something. I'll mess around with it and see what is least interferring to existing ruleset and any extensions that may come along. I "get" that's impossible to really do - what I mean is that I'll make it as fire proof as reasonably doable.