Fix for nib2cib leaving cells as targets for menu items.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2009-11-30 21:28:42 -08:00
1 parent 4b71557584
commit f8a5f91687
3 files changed
+26 -2

No files matched your search

+10
View File
@@ -132,6 +132,16 @@
_objectsValues.push(parent);
});
}
var count = _objectsKeys.length;
while (count--)
{
var object = _objectsKeys[count];
if ([object respondsToSelector:@selector(swapCellsForParents:)])
[object swapCellsForParents:parentForCellUIDs];
}
}
@end
+13
View File
@@ -74,6 +74,19 @@
return self;
}
- (void)swapCellsForParents:(JSObject)parentsForCellUIDs
{
var target = [self target];
if (!target)
return;
var parent = parentsForCellUIDs[[[self target] UID]];
if (parent)
[self setTarget:parent];
}
@end
@implementation NSMenuItem : CPMenuItem
+3 -2
View File
@@ -24,6 +24,7 @@
@import "NSMenu.j"
@implementation CPPopUpButton (CPCoding)
- (id)NS_initWithCoder:(CPCoder)aCoder
@@ -32,8 +33,8 @@
{
var cell = [aCoder decodeObjectForKey:@"NSCell"];
_menu = [cell menu];
_menu = [cell menu];
// make sure it's not null/undefined
//FIXME push this check to CPPopUpButton?
_selectedIndex = [cell selectedIndex] || 0;