[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSTextField problems
From: |
Serg Stoyan |
Subject: |
Re: NSTextField problems |
Date: |
Wed, 29 Jan 2003 00:14:02 +0200 |
Hello Alexander,
> > 2) I get a:
> > -[NSLayoutManager(layout)
> > rectArrayForGlyphRange:withinSelectedGlyphRange:inTextContainer:rectCo
> > unt:]: invalid text container
> [snip]
>
> I've been able to reproduce this, and I've tracked it down to the cell
> not being tall enough for the text that's in it. In the case where I
> could reproduce it (the 'To' field in the print panel), the cell is 13.5
> points tall, but the text is 14 points tall. The easy way to fix this is
> to simply make the cell tall enough to fit the text. I'll also try to
> fix handling of glyphs that aren't laid out so it'll behave a bit more
> gracefully when this happens.
Take a look at following pictures please:
1. http://stepmaker.sourceforge.net/stepmaker/TF1.jpg - textfield is in
focus, cursor is inside.
2. http://stepmaker.sourceforge.net/stepmaker/TF2.jpg - textfield is out of
focus.
3. http://stepmaker.sourceforge.net/stepmaker/TF3.jpg - textfield after
Return (or Tab) key pressed.
On the pictures 1 and 3 bottom of the text is lower bottom side of
textfield. Isn't it a reason of exceptions? I'll look at code probably
tommorow.
> I'm not really sure what the best way to really fix it is, though. The
> typesetter and layout manager are correct in not laying out any glyphs,
> since the text actually doesn't fit in the cell. On the other hand, the
> current behavior isn't good, since it breaks very easily (if a cell
> isn't tall enough, or if someone uses larger fonts).
I think that better solution is place text centered horizontally in
textfield even if text size is bigger than texfield. For example, textfield
height is 10 pixels, text font 14 pixels. Placing text centered mean loss 2
pixels of text at top and 2 at bottom. This is looks ugly, but application
programmer will know what the problem is.
> One solution might be to add some border case handling to
> GSHorizontalTypesetter to ensure that every text container contains at
> least one line frag rect. (There is already similar code there to ensure
> that every line frag contains at least one glyph. This was necessary to
> solve a somewhat similar problem, but on a line-level and not a
> container-level.) If this works, I'll commit this (until we find a
> better solution, or find that there isn't one).
Sounds good for me.
By the way, exceptions and NSLog messages are gone while typing. Text
is visible if text fits into textfield. Thanks Alexander.
GWorkspace textfield's text still disappears after clicking on file name
(textfield is set editable).
--
Serg Stoyan
- Re: NSTextField problems, (continued)
- Re: NSTextField problems, Alexander Malmberg, 2003/01/27
- Re: NSTextField problems, Serg Stoyan, 2003/01/28
- Re: NSTextField problems, Andrew Ruder, 2003/01/28
- Re: NSTextField problems, Enrico Sersale, 2003/01/28
- Re: NSTextField problems, Alexander Malmberg, 2003/01/28
- Re: NSTextField problems, Alexander Malmberg, 2003/01/28
- Re: NSTextField problems, Enrico Sersale, 2003/01/28
- Re: NSTextField problems,
Serg Stoyan <=
- Re: NSTextField problems, Enrico Sersale, 2003/01/28
- Re: NSTextField problems, Alexander Malmberg, 2003/01/29
- Re: NSTextField problems, Enrico Sersale, 2003/01/29
- Re: NSTextField problems, Alexander Malmberg, 2003/01/29
- Re: NSTextField problems, Alexander Malmberg, 2003/01/29
- Re: NSTextField problems, Serg Stoyan, 2003/01/29