PDA

View Full Version : windowlist + relative anchors issue



celestian
July 6th, 2017, 01:32
I am trying to have 2 windowlist's side by side. The purpose is one windowlist will go through all the actions and collect the initiative rollables to display, the other will run the normal cast/save/dmg/heal. My problem is when I try and put them together they seem to overlap each other only seeing the first one (I assume the other is beneath the other).

When I test using a simple label with the same anchors the label and actionsmini will place themselves left to right as needed... but when I do windowlist together it won't.

The anchor I am trying to use on both windowlist is this.


<anchored to="name" >
<top offset="0"/>
<left parent="name" anchor="right" relation="relative" offset="5" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
</anchored>


Also tried.


<anchored to="name" >
<top offset="0"/>
<left anchor="right" relation="relative" offset="5" />
</anchored>



Not sure it's helpful but here is the entire block called in the class.



<windowlist name="actionsmini_pre">
<anchored to="name" >
<top offset="0"/>
<left parent="name" anchor="right" relation="relative" offset="5" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
</anchored>
<datasource>.actions</datasource>
<class>power_action_mini_pre</class>
<noscroll />
<readonly />
<columns width="25" fillwidth="true" />
<child></child>
<child><backcolor>1A40301E</backcolor></child>
<invisible />
</windowlist>



<windowlist name="actionsmini">
<anchored to="name" >
<top offset="0"/>
<left parent="name" anchor="right" relation="relative" offset="5" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
</anchored>
<datasource>.actions</datasource>
<class>power_action_mini</class>
<noscroll />
<readonly />
<columns width="25" fillwidth="true" />
<child></child>
<child><backcolor>1A40301E</backcolor></child>
<invisible />
</windowlist>



I'm probably missing something simple (I hope). The plan is to get it looking like this (this was me testing a non-windowlist rollable before actionsmini windowlist).

https://i.imgur.com/DEQWOKy.png

Moon Wizard
July 6th, 2017, 23:36
The anchors adjust after you define them. You can't have two objects defined next to each other that both use relative left and right anchors, because they will overlap. In fact, the second one ends up with a negative width technically, since the relative anchors are adjusted by the width of the control using them in the order that the controls are defined.

In any horizontal layout, you can only logically have one control that uses both left and right relative anchors. Since, then, you are really asking FG to layout the control in the remaining space between both anchors.

So, you need to make the first list/control be a fixed width to allow everything to layout horizontally.

Regards,
JPG

celestian
July 7th, 2017, 00:03
The anchors adjust after you define them. You can't have two objects defined next to each other that both use relative left and right anchors, because they will overlap. In fact, the second one ends up with a negative width technically, since the relative anchors are adjusted by the width of the control using them in the order that the controls are defined.


That was my thoughts also but when I tried to use just 1 anchor (left and relative) on both I assumed it would work... but it didn't ;( (see the second anchor I tried mentioned).



In any horizontal layout, you can only logically have one control that uses both left and right relative anchors. Since, then, you are really asking FG to layout the control in the remaining space between both anchors.

So, you need to make the first list/control be a fixed width to allow everything to layout horizontally.


Having an issue with a static size on the left one because it could have more than just 3 items depending on how many "cast" types they have for the power. I mean doesn't make much sense to have more than 1 cast per power but... there is no restriction so I was hoping I could have a variable amount just like the action buttons.

It might just be easier if I have the memorization/initiative on the spell and not the action (cast). Then there would be a static list of items.