Using a Scroll Area for a Text Box Element

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
User avatar
Hopki
Gnome
Posts: 12999
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
If you want consistency in your skins and have thumbnail menus or other menus that use the scroll area element, you of course can modify what the track and thumb look like.
But with a text box you are very much at the hands of the browser, yes you can use CSS but this does not work in all browsers, for example, Firefox on the Mac.
And of course, on iOS, you do not see the scroll bar at all.

So why not use the scroll area for the text box?

text.gif
text.gif (606.52 KiB) Viewed 20553 times

Well if you did you would bump into the problem that the scroll area set to auto-size would not resize the inner area of the scroll element as you changed the amount of text.
On project open, it would look at the text box and calculate the inner size and that would be it. If the amount of text changed then the scroll area would not be able to recalculate the new size.

However...
This is simple to address, referring to the attached project there is a text box set to auto size in a scroll area.
There are two buttons that set the text to the Text Box using the Set Value action.
Then have two added actions and the order of actions is important.

1) Remove the text box in the scroll area

1.png
1.png (27.5 KiB) Viewed 20553 times

2) Set the new text

2.png
2.png (28.91 KiB) Viewed 20553 times

3) Add the text box back to the scroll are at its new size so the scroll area can recalculate the correct inner size.

3.png
3.png (25.56 KiB) Viewed 20553 times


The Text Box element has a 5px padding so it's not pushed up against the sides of the scroll area.
Attachments
Archive.zip
(13.32 KiB) Downloaded 308 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
Post Reply