Textfield resize
Forum rules
Developer discussions only. Newbie questions belong in the HELP! forum. This is a forum for discussing development work on Ardor3D add-ons and extensions. Basically, anything that is Ardor3D that is not in the ardor3d-core module.
Developer discussions only. Newbie questions belong in the HELP! forum. This is a forum for discussing development work on Ardor3D add-ons and extensions. Basically, anything that is Ardor3D that is not in the ardor3d-core module.
7 posts
• Page 1 of 1
Textfield resize
I've been looking a bit at the way textfields handles resize and I have to say that I don't like the current implementation. If you keep typing a text that is longer than what can fit in the field, the field just grows making almost any layout break.
I would like UITextField to work as close to JTextField as possible where you can specify a maximum number of columns and if you enter more text than fits the text "scrolls" to the left keeping the caret at the rightmost border. I've been looking a bit at the source code to see if it would be a simple fix but I just end up doing too major changes
What is your opinion on this matter?
I would like UITextField to work as close to JTextField as possible where you can specify a maximum number of columns and if you enter more text than fits the text "scrolls" to the left keeping the caret at the rightmost border. I've been looking a bit at the source code to see if it would be a simple fix but I just end up doing too major changes
What is your opinion on this matter?
- hiflyer
- regular
- Posts: 78
- Joined: Wed Jan 07, 2009 6:55 am
Re: Textfield resize
Sounds like a bug to me... Something that should be changed. Looks like it comes down to setText and updateMinimumSizeFromContents in AbstractUITextEntryComponent. The difficulty of doing a straight up setColumns is that we allow styled text that can include different font sizes. We could base it on the main font size set on the component itself... That would make height easy enough, but we'd need some kind of font max char width to determine what columns means.
Gratitude is a mark of a noble soul and a refined character.
-

renanse - Site Admin
- Posts: 2955
- Joined: Tue Oct 28, 2008 6:49 pm
- Location: Austin, TX
Re: Textfield resize
I guess the columns could as easily be handled outside of the component. Just as long as the handling of long values is correct. The reason the swing version can do it is that they only support one font in their JTextField (they use 'm' to measure btw, but you can change the method).
Will you add it as an issue?
Will you add it as an issue?
- hiflyer
- regular
- Posts: 78
- Joined: Wed Jan 07, 2009 6:55 am
Re: Textfield resize
I guess you mean add the positioning of the text as an issue, right? I can, but it seems like the default behavior for sizing should make sense too...
Gratitude is a mark of a noble soul and a refined character.
-

renanse - Site Admin
- Posts: 2955
- Joined: Tue Oct 28, 2008 6:49 pm
- Location: Austin, TX
Re: Textfield resize
I thought of the two things as one issue actually. The text field shouldn't resize based on textlength (at least not by default. If anyone wants this then we need a plugable ResizeStrategy) and if you keep on writing when you've reached the end of the field, the text should scroll.
- hiflyer
- regular
- Posts: 78
- Joined: Wed Jan 07, 2009 6:55 am
Re: Textfield resize
Just wondering if any progress has been made on this; I'm using 0.7, and it's possible this has been fixed in svn, so I figured I'd check.
- Zippy
- newcomer
- Posts: 14
- Joined: Thu Jan 08, 2009 11:17 am
Re: Textfield resize
No, nothing new on this issue afaik (or can recall).
Gratitude is a mark of a noble soul and a refined character.
-

renanse - Site Admin
- Posts: 2955
- Joined: Tue Oct 28, 2008 6:49 pm
- Location: Austin, TX
7 posts
• Page 1 of 1
Return to Extensions Development Discussions
Who is online
Users browsing this forum: No registered users and 0 guests