PDA

View Full Version : Anchoring Woes



irpagan
June 23rd, 2015, 04:29
I am experiencing an issue with right anchoring and I am hoping someone can explain to me what is occurring so that I can fix it and move on. whenever I give the frame the entire width past 570px it truncates and no longer displays the scroll list overlapping.

My first assumption was that the list control was not getting the full window so I added
<frame name="fielddark" offset="7,5,7,5" hidereadonly = "false" /> to the list which lets me see the width of the list inside the frame. It is getting the full length minus what it needs for the scroll bar I *think*

My next assumption and probably the correct one was this was something I am doing, since I am not terribly worried about gutting anything since SVN is used to track changes and I can always revert if necessary I went back to basics. I removed everything but the delete button and set the right anchor


<windowclass name="char_weapons">
<margins control="0,0,0,2" />
<script file="campaign/scripts/char_weapon.lua" /><!-- -->
<sheetdata>
<genericcontrol name="ra">
<anchored width="0" height="0">
<top />
<right />
</anchored>
<invisible />
</genericcontrol>
<button_idelete name="idelete">
<anchored height="20" width="20">
<top offset="2" />
<right parent="ra" relation="absolute" anchor="left" offset="-2" />
</anchored>
</button_idelete>
</sheetdata>
</windowclass>

The result was interesting (see ra_delete_button.png) the control seems to be setting itself as if it was "insidetop" and not insidetopright, which adding position="insidetopright" did not change the result. Adding none of the right anchoring shorthand notation seemed to work here. Changing the relation didn't change anything either, which I didn't expect it would.

I tried left, now this seems to work alignment wise (see la_delete_button.png) except when I code the whole thing out I get no scroll bar, the lines overlap creating a terrible mess.


<!-- @comment: Window Class (char_weapons) -->
<windowclass name="char_weapons">
<margins control="0,0,0,2" />
<script file="campaign/scripts/char_weapon.lua" /><!-- -->
<sheetdata>
<genericcontrol name="la">
<anchored width="0" height="0">
<top />
<left />
</anchored>
<invisible />
</genericcontrol>

<button_idelete name="idelete">
<anchored height="20" width="20">
<top offset="2" />
<left parent="la" relation="relative" anchor="right" offset="2" />
</anchored>
</button_idelete>
</sheetdata>
</windowclass>

What is it I am doing incorrectly when trying to aling the control to the right? I had no issues with skills, so I am at a loss as to what is happening. Any advice would be greatly appreciated.

Regards,
-d0gb0y

damned
June 23rd, 2015, 06:16
cant really test just now but I think the right/best way to do this is to use -ive numbers to anchor to the right (and bottom).

irpagan
June 23rd, 2015, 14:24
I appreciate it damned, I took a stab with the morning tea this morning. First thing I did was strip out any script references or calls. Just to ensure it wasn't something buried somewhere in a script or scriptfile. Stripped off the header section, so it is just a frame with a list & scrollbar. Inside the list are two things; the anchor and the delete button.



<windowclass name="char_weapons">
<margins control="0,0,0,2" />
<sheetdata>

<genericcontrol name="ra">
<anchored width="0" height="0">
<bottom />
<right />
</anchored>
<invisible />
</genericcontrol>

<button_idelete name="idelete">
<anchored height="20" width="20">
<bottom offset="20" />
<right parent="ra" relation="relative" anchor="left" offset="0" />
</anchored>
</button_idelete>

</sheetdata>
</windowclass>


Setting it to bottom doesn't seem to change anything. It's still stuck smack in the middle - now what is curious is when I resize the frame which holds the list to 570 vs 635 it works perfectly (see 570_list.png) which I alluded to last evening but didn't really think about brain was dead. So I decide to put the frame to my max width
<frame_char name="combatframe">
<bounds>15,0,635,200</bounds>
</frame_char>and set the list to approximately the 570, which leads one to believe it is the list itself which is causing the issue (see neg90_list.png) at 570'ish it works fine. After that it starts acting up. This could be a false positive, I hesitate to say it is the control ... it has to be something else I am doing which is triggering the overlap. Skills is exactly the same width and doesn't have an issue at all I added the dark frame to confirm there us no difference (see skills.png) - the anchor is constructed in exactly the exact same way which is the first thing I thought to check when this started happening.

I even re-wrote the entire file from scratch to verify there are no hidden characters etc. All the tags appear to be formed correctly, FG doesn't complain when the file is loaded. Included the file as an attachment for anyone who wants to test and verify for themselves.

Just not sure as to what is causing the issue, scratching my head.

Regards,
-d0gb0y

irpagan
June 23rd, 2015, 14:31
Son of a ... I just solved the issue.

For some ungodly reason in the template itself I had added a column width, which is what was causing the issue. bleh - that will teach me to hyper focus. *smack always check every bloody potential input into the page.

Regards,
-d0gb0y

damned
June 23rd, 2015, 14:35
it would be good to have more doh! moments because each one means you solved something!
whatchaworkinon?

irpagan
June 23rd, 2015, 14:55
True. I've had a few lately, happy to be learning. Although ... I could do with learning a tad bit faster. ;)

I'm about 1/3 to 1/2 way through a Talislanta Fifth Edition ruleset. After weapons and armor I'll be doing the grimoire which is going to be somewhat of a challenge, I'm prepping myself by adding a weapons editor to the weapon's list. I do have the calendar extension already done - complete with moons. It's all Creative Commons. Fifth Ed. is not the most popular edition but it is the most challenging in terms of rules which is why I started there instead of with fourth. After all the coding is done then I'll start the graphics.

-d0gb0y