Child position floating with parent on "auto size"

Q&A about the latest versions
Post Reply
AeroPixel
Posts: 32
Joined: Sun Sep 20, 2009 8:54 pm

Sometimes simple things are the one I spend most time to solve: I have text field that displays titles from $(ut). I want to tight small icon on the left side of title. But since title vary in width (some are shorter, some longer) I am having problem to tight that icon to text width. Text is on "auto size". How to anchor icon, which is the child element of text field so it changes its X position according to the text width?
User avatar
Tony
Posts: 1342
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Hi Hogar,

Not sure if this is what you mean/want.

preview.png
preview.png (268.86 KiB) Viewed 2051 times

https://p2vr.s3.ap-southeast-2.amazonaw ... index.html

In this example, built-in V7 beta, a mouse enter on the buttons change the text value of a variable. The text box is set to Auto Size and I have padding around the text. The padding on the right-hand side is 60px so there is always a separation between the last character of the text and the icon. The icon is a child of the text box.

Tony
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: https://tonyredhead.com - https://redsquare.com | Pano2VR Tutorials: https://tonyredhead.com/pano2vr | instagram: https://www.instagram.com/tonyredhead/
AeroPixel
Posts: 32
Joined: Sun Sep 20, 2009 8:54 pm

Thank you Tony. Yes, that was my intention. But having just simple textbox on Auto Size and icon as it's child, it doesn't move with changing titles. I am on v6. Could it be reason?
User avatar
Tony
Posts: 1342
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Hi,

I just had a quick go in V6 and the child position isn't maintained with an auto-size text box in V6 so the solution I've shown is only in V7. I'm moving most of my projects to V7 as the development is much more efficient in the new application and it's pretty stable.

cheers,

Tony
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: https://tonyredhead.com - https://redsquare.com | Pano2VR Tutorials: https://tonyredhead.com/pano2vr | instagram: https://www.instagram.com/tonyredhead/
AeroPixel
Posts: 32
Joined: Sun Sep 20, 2009 8:54 pm

Good to know that. Thank you again Tony...
Post Reply