[quote=171640:@Dave Jacobi]I don’t know what it could be that I’m doing differently from either of you, but I’m just not seeing the same results. Here is exactly what I’m doing, and what I’m seeing:
-Drag a TextField into an otherwise empty window, change its super to TextArea, and change its name to “field.” Then drag another TextField into the window and leave its super alone (this one is just here to serve as the start point for dragging text into “field”). Then drag a pushButton into the window, give it an Action event handler, and in that handler, put the line field.scrollPositionX = 30
.
At first, when I run this project, “field” continues to behave exactly the same as if I hadn’t changed the super. It’s almost as if Xojo hasn’t “noticed” the super change. So, both of my problems are present–I can’t drop dragged text into it, and pushing the pushButton does not actually make any scrolling happen no matter how much text is in the field.
Then, at some point (it seems to happen once I switch back to viewing the window’s layout after I’ve been in the code editor to add the line of code to the pushButton), Xojo does “notice” the super change Now the Inspector for “field” shows all the properties that a TextArea should have (like multiline), and its representation in the window editor is now drawn with a vertical scrollbar. In other words, the field has now basically “become” a TextArea rather than a TextField. Specifically, it’s become a multiline TextArea. Dropping text into the field now works. ScrollPosotionX still does nothing, but that makes sense; the text wraps, so there’s never any horizontal scrolling to be done.
Weirdly, in order to get the field to become single-line at this point, I have turn off not only the multiline property but also the styled property (took me a while of being really puzzled and frustrated before I figured this out!). When I do this, though, the field goes back to behaving exactly like it did at first; I can no longer drop dragged text into it, and if I type a bunch of text into the field and then press the pushButton, nothing happens.
You guys are definitely seeing different results from this, though, huh? In case it matters, my Mac is running OS X Version 10.9.5, and I’m using Xojo Version 2014 Release 3.2. Any theories as to what is going on here?[/quote]
OK. I have looked at that again. It seems the TextField is always multiline, no matter the setting in the IDE or in code, so it wraps internally.
The solution I found is to place it on a container control and give it a very large width like 1980 or more, then place an instance of the container control onto the window. It then accepts very long lines dropping without wrapping them.