Change drawing of text field cells so that they can display multiple

lines of text.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29132 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
wlux 2009-12-16 22:25:59 +00:00
parent 42a97f5908
commit 82aee08d88
2 changed files with 24 additions and 5 deletions

View file

@ -1,10 +1,16 @@
2009-12-16 Wolfgang Lux <wolfgang.lux@gmail.com>
* 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 <wolfgang.lux@gmail.com> 2009-12-16 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSOpenPanel.m (-_selectTextInColumn:, _selectCellName:, * Source/NSOpenPanel.m (-_selectTextInColumn:, _selectCellName:,
-controlTextDidChange:): Do better job on validating the OK -controlTextDidChange:): Do a better job on validating the OK
button. Replaces the previous fix for bug #25471, which made it button. This makes it possible again to use the open panel for
impossible to use the open panel for choosing directories (except choosing directories. Also replaces the previous fix for bug
by entering a fake file name into the panel). #25471, which did not really work.
* Source/NSBrowser.m (-doClick:): Fix NSBrowser so that branch * Source/NSBrowser.m (-doClick:): Fix NSBrowser so that branch
cells are really deselected when multiple selection is enabled and cells are really deselected when multiple selection is enabled and

View file

@ -223,10 +223,23 @@
[self _drawBackgroundWithFrame: cellFrame inView: controlView]; [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. Attributed string that will be displayed.
*/ */
- (NSAttributedString*)_drawAttributedString - (NSAttributedString*) _drawAttributedString
{ {
NSAttributedString *attrStr; NSAttributedString *attrStr;