diff --git a/ChangeLog b/ChangeLog index b5a22af82..ff81e1c66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,16 @@ +2009-12-16 Wolfgang Lux + + * Source/NSTextFieldCell.m (-drawInteriorWithFrame:inView:): + Override method and use drawInRect: to draw the string of the + text field so that long text can be wrapped. + 2009-12-16 Wolfgang Lux * Source/NSOpenPanel.m (-_selectTextInColumn:, _selectCellName:, - -controlTextDidChange:): Do better job on validating the OK - button. Replaces the previous fix for bug #25471, which made it - impossible to use the open panel for choosing directories (except - by entering a fake file name into the panel). + -controlTextDidChange:): Do a better job on validating the OK + button. This makes it possible again to use the open panel for + choosing directories. Also replaces the previous fix for bug + #25471, which did not really work. * Source/NSBrowser.m (-doClick:): Fix NSBrowser so that branch cells are really deselected when multiple selection is enabled and diff --git a/Source/NSTextFieldCell.m b/Source/NSTextFieldCell.m index 88c9096bc..02a85005f 100644 --- a/Source/NSTextFieldCell.m +++ b/Source/NSTextFieldCell.m @@ -223,10 +223,23 @@ [self _drawBackgroundWithFrame: cellFrame inView: controlView]; } +- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView +{ + NSRect titleRect; + + /* Make sure we are a text cell; titleRect might return an incorrect + rectangle otherwise. Note that the type could be different if the + user has set an image on us, which we just ignore (OS X does so as + well). */ + _cell.type = NSTextCellType; + titleRect = [self titleRectForBounds: cellFrame]; + [[self _drawAttributedString] drawInRect: titleRect]; +} + /* Attributed string that will be displayed. */ -- (NSAttributedString*)_drawAttributedString +- (NSAttributedString*) _drawAttributedString { NSAttributedString *attrStr;