Set the TextConatainer to track its view

again. But switch this of if the view is scrollable.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7997 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2000-11-03 00:22:15 +00:00
parent 83c9ff711e
commit 1cfbd9caf3

View file

@ -59,7 +59,7 @@
#include <AppKit/NSLayoutManager.h>
#define HUGE 1e99
#define HUGE 1e7
static NSNotificationCenter *nc;
@ -884,9 +884,16 @@ NSRange MakeRangeFromAbs (unsigned a1, unsigned a2)
- (void)setHorizontallyResizable: (BOOL)flag
{
[_textContainer setWidthTracksTextView: !flag];
_tf.is_horizontally_resizable = flag;
}
- (void) setVerticallyResizable: (BOOL)flag
{
[_textContainer setHeightTracksTextView: !flag];
_tf.is_vertically_resizable = flag;
}
- (void)setMaxSize: (NSSize)newMaxSize
{
_maxSize = newMaxSize;
@ -897,11 +904,6 @@ NSRange MakeRangeFromAbs (unsigned a1, unsigned a2)
_minSize = newMinSize;
}
- (void) setVerticallyResizable: (BOOL)flag
{
_tf.is_vertically_resizable = flag;
}
- (void) sizeToFit
{
// if we are a field editor we don't have to handle the size.
@ -1314,7 +1316,6 @@ NSRange MakeRangeFromAbs (unsigned a1, unsigned a2)
{
NSRange drawnRange = [_layoutManager glyphRangeForBoundingRect: rect
inTextContainer: [self textContainer]];
if (_tf.draws_background)
{
[_layoutManager drawBackgroundForGlyphRange: drawnRange
@ -1558,6 +1559,8 @@ NSRange MakeRangeFromAbs (unsigned a1, unsigned a2)
//[self setSelectedRange: NSMakeRange (0, 0)];
[aTextContainer setTextView: (NSTextView*)self];
[aTextContainer setWidthTracksTextView: YES];
[aTextContainer setHeightTracksTextView: YES];
[self sizeToFit];
return self;