Detecting wrap in a field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Detecting wrap in a field
Hi!
Is there a message sent by a field when a line wraps? I have two fields which contain input and output file paths in a second line in a main stack very similar to LC's Menu Bar stack (the rest of the app is substacks which automatically dock under the bar). Paths of course can be quite long. If the user resizes the stack, I have these two fields set to auto-size their widths in the resizeStack handler. I was wondering if there was a simpler way to tell the stack and the fields to increase their height to accomodate wrapping in the two fields, rather than having to measure each field "manually" in the resizeStack handler.
I don't think there is, but I thought there might be a chance (at least 1 in 3, the usual case...) that I missed something.
Thanks, Walt
Is there a message sent by a field when a line wraps? I have two fields which contain input and output file paths in a second line in a main stack very similar to LC's Menu Bar stack (the rest of the app is substacks which automatically dock under the bar). Paths of course can be quite long. If the user resizes the stack, I have these two fields set to auto-size their widths in the resizeStack handler. I was wondering if there was a simpler way to tell the stack and the fields to increase their height to accomodate wrapping in the two fields, rather than having to measure each field "manually" in the resizeStack handler.
I don't think there is, but I thought there might be a chance (at least 1 in 3, the usual case...) that I missed something.
Thanks, Walt
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: Detecting wrap in a field
I don't think there is either. You can certainly monitor such an event by checking the text against the formattedWidth property.
Craig Newman
Craig Newman
Re: Detecting wrap in a field
Turns out there is a long standing Feature Request (among the many for field formatting issues), 727, to have an option for wrapping in fields of strings without whitespace, if anyone would like to add some votes. The workaround offered, to make the field unicode, seems to bring in too many other unwanted side effects to be viable.
Walt
Walt
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: Detecting wrap in a field
I'm in. It is unconscionable that whitespace is required to force a wrap. The formattedWidth ought to rule, char by char.
Craig Newman
Craig Newman
Re: Detecting wrap in a field
Plus, if I make a hard wrap routine for the field, that then leaves a CR in the string, which I then have to detect and remove when I use the field contents, which then means I have to differentiate between content returns and hard wrap returns,... etc, etc. so programmatically adding hard wrap will really not work, it must be part of the field display properties.
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: Detecting wrap in a field
I'm out of votes, but I'm in as well. I hope the team takes this into account when we finally get a new formatted field object. Not that I'm holding my breath waiting for this, but whitespace shouldn't be the only criterion for determining wrap.