PF2E Playlist
  1. #1

    Troubles with relative/current positioning

    I'm back. I need to build a form with some fields that can be hidden.
    So I decided to use relative. What you see here are not all the fields of the form, but they are the first ones. Beyond there will be those to hide and other additional fields.

    I have a label with a stringfield next to it.
    Under these another label and another stringfield. Everything works fine except for the last strigfield.
    Code:
    First label
                    <anchored to="leftanchor">
                        <top parent="leftanchor" anchor="bottom" relation="relative" />
                        <left />
                    </anchored>    
      
    First stringfield
                    <anchored to="leftanchor" width="90">
                        <top parent="leftanchor" anchor="top" relation="current"/>
                        <left parent="leftanchor" anchor="left" relation="relative" offset="70" />
                    </anchored>             
    
    Second label
                    <anchored to="leftanchor" >
                        <top parent="leftanchor" anchor="bottom" relation="relative" />
                        <left />
                    </anchored> 
    
    Second stringfield
                    <anchored to="leftanchor" width="420">
                        <top parent="leftanchor" anchor="bottom" relation="current"/>
                        <right parent="rightanchor" relation="absolute" offset="0" />
                    </anchored>
    The two labels are positioned well, one below the other. The first stringfield is also positioned well, to the right of the first label. When I use anchor="bottom" in the second stringfield the control is positioned under the second label (obviously moved to the right), while if I use anchor="top" it is positioned at the level of the first two fields.
    rightanchor is used only for right alignment. I tried without it and the problem is still there, so I guess it doesn't affect the misbehaviour.

    What am I doing wrong or what do I not understand?

  2. #2
    Instead of anchoring all of them off of the left anchor, you might try anchoring the stringfields off of the labels. Or instead of using the leftanchor as the parent, use the labels as the left parent.

    EDIT: Reading more on this in the wiki, I believe the anchor you would want is anchor="left" relation="current" for all of the stringfields. This should tie them onto the latest label.
    Last edited by DCrumb; November 27th, 2022 at 01:56.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in