mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-28 19:08:50 +00:00
Fix for nib2cib leaving cells as targets for menu items.
Reviewed by me.
This commit is contained in:
1 parent
4b71557584
commit
f8a5f91687
3 files changed
+26
-2
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user