aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-09-05 06:15:26 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-09-05 06:15:26 +0000
commitaa35fde684e364a9e118c1d737336abdff25350a (patch)
treef32ccfff97eb79d2d289e8242e2f5138b66a4b49 /UnitTesting
parent0cc6f9d00b5006a2b1ef2016048e0815a49f2574 (diff)
[Author: alcor]
Update Large UI with latest nib Add toolbar to prefs Add toolbar localization R=dmaclach DELTA=4125 (3054 added, 462 deleted, 609 changed)
Diffstat (limited to 'UnitTesting')
-rw-r--r--UnitTesting/GTMAppKit+UnitTesting.m41
1 files changed, 41 insertions, 0 deletions
diff --git a/UnitTesting/GTMAppKit+UnitTesting.m b/UnitTesting/GTMAppKit+UnitTesting.m
index d5aa70d..5263fa1 100644
--- a/UnitTesting/GTMAppKit+UnitTesting.m
+++ b/UnitTesting/GTMAppKit+UnitTesting.m
@@ -77,6 +77,9 @@ GTM_METHOD_CHECK(NSObject, gtm_unitTestEncodeState:);
// [inCoder encodeBool:[self isKeyWindow] forKey:@"WindowIsKey"];
[inCoder encodeBool:[self isMainWindow] forKey:@"WindowIsMain"];
[inCoder encodeObject:[self contentView] forKey:@"WindowContent"];
+ if ([self toolbar]) {
+ [inCoder encodeObject:[self toolbar] forKey:@"WindowToolbar"];
+ }
}
@end
@@ -289,6 +292,44 @@ GTM_METHOD_CHECK(NSObject, gtm_unitTestEncodeState:);
@end
+@implementation NSToolbar (GTMUnitTestingAdditions)
+
+// Encodes the state of an object in a manner suitable for comparing
+// against a master state file so we can determine whether the
+// object is in a suitable state.
+//
+// Arguments:
+// inCoder - the coder to encode our state into
+- (void)gtm_unitTestEncodeState:(NSCoder*)inCoder {
+ [super gtm_unitTestEncodeState:inCoder];
+ NSToolbarItem *item = nil;
+ NSUInteger i = 0;
+ GTM_FOREACH_OBJECT(item, [self items]) {
+ NSString *key = [NSString stringWithFormat:@"ToolbarItem %d", i];
+ [inCoder encodeObject:item forKey:key];
+ i = i + 1;
+ }
+}
+
+@end
+
+@implementation NSToolbarItem (GTMUnitTestingAdditions)
+
+// Encodes the state of an object in a manner suitable for comparing
+// against a master state file so we can determine whether the
+// object is in a suitable state.
+//
+// Arguments:
+// inCoder - the coder to encode our state into
+- (void)gtm_unitTestEncodeState:(NSCoder*)inCoder {
+ [super gtm_unitTestEncodeState:inCoder];
+ [inCoder encodeObject:[self label] forKey:@"Label"];
+ [inCoder encodeObject:[self paletteLabel] forKey:@"PaletteLabel"];
+ [inCoder encodeObject:[self toolTip] forKey:@"ToolTip"];
+}
+
+@end
+
@implementation NSMatrix (GTMUnitTestingAdditions)
// Encodes the state of an object in a manner suitable for comparing