Files
cappuccino/Tools/nib2cib/NSTextContainer.j
T
Martin Carlberg f74fed5ee0 Fixed: CPTextView now handles more options from Interface Builder
The new options are:
1. Resizable Horizontally
2. Resizable Vertically
3. Max Size

Also two options from the Text Container is recognized:
1. Tracks text view width
2. Tracks text view height

The last two are needed to allow the text view to recalculate
the size of its content if the frame size is changed.
2020-12-16 11:29:11 +01:00

69 lines
1.6 KiB
Plaintext

/*
* NSTextContainer.j
* nib2cib
*
* Created by Alexendre Wilhelm.
* Copyright 2014 The Cappuccino Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <AppKit/CPTextContainer.j>
@class Nib2Cib
@implementation CPTextContainer (NSCoding)
- (id)NS_initWithCoder:(CPCoder)aCoder
{
self = [super init];
_size = CGSizeMake([aCoder decodeIntForKey:@"NSWidth"], 1e7);
_layoutManager = [aCoder decodeObjectForKey:@"NSLayoutManager"];
[_layoutManager addTextContainer:self];
var tcFlags = [aCoder decodeIntForKey: @"NSTCFlags"];
_widthTracksTextView = (tcFlags & 0x00000001) ? YES : NO;
_heightTracksTextView = (tcFlags & 0x00000002) ? YES : NO;
return self;
}
@end
@implementation NSTextContainer : CPTextContainer
{
}
- (id)initWithCoder:(CPCoder)aCoder
{
self = [self NS_initWithCoder:aCoder];
if (self)
{
}
return self;
}
- (Class)classForKeyedArchiver
{
return [CPTextContainer class];
}
@end