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:
Wolfgang Lux 2009-12-16 22:25:59 +00:00
parent 93c18dfe7d
commit f3c7d70152
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>
* 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

View file

@ -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;