Textfield resize

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.
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.

Textfield resize

Postby hiflyer » Tue Jul 05, 2011 1:47 am

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 :roll:

What is your opinion on this matter?
hiflyer
regular
 
Posts: 78
Joined: Wed Jan 07, 2009 6:55 am

Re: Textfield resize

Postby renanse » Wed Jul 06, 2011 8:02 am

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.
User avatar
renanse
Site Admin
 
Posts: 2955
Joined: Tue Oct 28, 2008 6:49 pm
Location: Austin, TX

Re: Textfield resize

Postby hiflyer » Thu Jul 07, 2011 7:36 am

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?
hiflyer
regular
 
Posts: 78
Joined: Wed Jan 07, 2009 6:55 am

Re: Textfield resize

Postby renanse » Thu Jul 07, 2011 12:25 pm

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.
User avatar
renanse
Site Admin
 
Posts: 2955
Joined: Tue Oct 28, 2008 6:49 pm
Location: Austin, TX

Re: Textfield resize

Postby hiflyer » Thu Jul 07, 2011 11:58 pm

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

Postby Zippy » Sat Oct 08, 2011 1:39 pm

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

Postby renanse » Fri Oct 14, 2011 8:34 am

No, nothing new on this issue afaik (or can recall).
Gratitude is a mark of a noble soul and a refined character.
User avatar
renanse
Site Admin
 
Posts: 2955
Joined: Tue Oct 28, 2008 6:49 pm
Location: Austin, TX


Return to Extensions Development Discussions

Who is online

Users browsing this forum: No registered users and 0 guests

cron