Added nib2cib options _allowsUndo and _usesFontPanel for CPTextView

This commit is contained in:
Alexandre Wilhelm committed 2015-03-31 16:38:47 -07:00
1 parent 42a1bca64d
commit ad4904a0ec
3 files changed
+17 -4

No files matched your search

+8 -1
View File
@@ -1773,7 +1773,9 @@ var kDelegateRespondsTo_textShouldBeginEditing
@end
var CPTextViewContainerKey = @"CPTextViewContainerKey",
var CPTextViewAllowsUndoKey = @"CPTextViewAllowsUndoKey",
CPTextViewUsesFontPanelKey = @"CPTextViewUsesFontPanelKey",
CPTextViewContainerKey = @"CPTextViewContainerKey",
CPTextViewLayoutManagerKey = @"CPTextViewLayoutManagerKey",
CPTextViewTextStorageKey = @"CPTextViewTextStorageKey",
CPTextViewInsertionPointColorKey = @"CPTextViewInsertionPointColorKey",
@@ -1801,6 +1803,9 @@ var CPTextViewContainerKey = @"CPTextViewContainerKey",
while (key = [enumerator nextObject])
[_selectedTextAttributes setObject:[selectedTextAttributes valueForKey:key] forKey:key];
[self setAllowsUndo:[aCoder decodeBoolForKey:CPTextViewAllowsUndoKey]];
[self setUsesFontPanel:[aCoder decodeBoolForKey:CPTextViewUsesFontPanelKey]];
}
return self;
@@ -1812,6 +1817,8 @@ var CPTextViewContainerKey = @"CPTextViewContainerKey",
[aCoder encodeObject:_textContainer forKey:CPTextViewContainerKey];
[aCoder encodeObject:_insertionPointColor forKey:CPTextViewInsertionPointColorKey];
[aCoder encodeObject:_selectedTextAttributes forKey:CPTextViewSelectedTextAttributesKey];
[aCoder encodeBool:_allowsUndo forKey:CPTextViewAllowsUndoKey];
[aCoder encodeBool:_usesFontPanel forKey:CPTextViewUsesFontPanelKey];
}
@end
+2
View File
@@ -37,6 +37,8 @@
[self setEditable:[aTextViewSharedData isEditable]];
[self setSelectable:[aTextViewSharedData isSelectable]];
[self setRichText:[aTextViewSharedData isRichText]];
[self setAllowsUndo:[aTextViewSharedData allowsUndo]];
[self setUsesFontPanel:[aTextViewSharedData usesFontPanel]];
[self setBackgroundColor:[aTextViewSharedData backgroundColor]];
[self setInsertionPointColor:[aTextViewSharedData insertionColor]];
+7 -3
View File
@@ -27,9 +27,11 @@
@implementation CPTextViewSharedData : CPObject
{
BOOL _allowsUndo @accessors(getter=allowsUndo);
BOOL _editable @accessors(getter=isEditable);
BOOL _richText @accessors(getter=isRichText);
BOOL _selectable @accessors(getter=isSelectable);
BOOL _usesFontPanel @accessors(getter=usesFontPanel);
CPColor _backgroundColor @accessors(getter=backgroundColor);
CPColor _insertionColor @accessors(getter=insertionColor);
CPDictionary _selectedTextAttributes @accessors(getter=selectedTextAttributes);
@@ -56,9 +58,11 @@
{
var flags = [aCoder decodeIntForKey:@"NSFlags"];
_selectable = flags & 0x00000001 ? YES : NO;
_editable = flags & 0x00000002 ? YES : NO;
_richText = flags & 0x00000004 ? YES : NO;
_allowsUndo = (flags & 0x0000400) ? YES : NO;
_editable = (flags & 0x00000002) ? YES : NO;
_richText = (flags & 0x00000004) ? YES : NO;
_selectable = (flags & 0x00000001) ? YES : NO;
_usesFontPanel = (flags & 0x00000020) ? YES : NO;
_backgroundColor = [aCoder decodeObjectForKey:@"NSBackgroundColor"];
_insertionColor = [aCoder decodeObjectForKey:@"NSInsertionColor"];