Further key handling fixes.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2009-06-15 12:33:16 -07:00
1 parent 9bb9db760e
commit b4abc5a99d
5 files changed
+28 -9

No files matched your search

+4 -4
View File
@@ -267,13 +267,13 @@ var _CPMenuBarVisible = NO,
- (void)insertItem:(CPMenuItem)aMenuItem atIndex:(unsigned)anIndex
{
var menu = [aMenuItem menu];
if (menu)
if (menu != self)
if (menu !== self)
[CPException raise:CPInternalInconsistencyException reason:@"Attempted to insert item into menu that was already in another menu."];
else
return;
[aMenuItem setMenu:self];
[_items insertObject:aMenuItem atIndex:anIndex];
@@ -1735,7 +1735,7 @@ var _CPMenuBarWindowBackgroundColor = nil,
return frame;
}
- (CPView)menuItemAtPoint:(CGPoint)aPoint
- (CPMenuItem)menuItemAtPoint:(CGPoint)aPoint
{
var items = [_menu itemArray],
count = items.length;
+3 -3
View File
@@ -670,13 +670,13 @@ CPTexturedBackgroundWindowMask
{
if ([_delegate respondsToSelector:@selector(windowWillClose:)])
[_delegate windowWillClose:self];
[_bridge order:CPWindowOut window:self relativeTo:nil];
if ([CPApp keyWindow] == self)
{
[self resignKeyWindow];
CPApp._keyWindow = nil;
}
}
+19
View File
@@ -33,6 +33,25 @@ var _CPCibWindowTemplateMinSizeKey = @"_CPCibWindowTemplateMinSizeK
BOOL _windowIsFullBridge;
}
- (id)init
{
self = [super init];
if (self)
{
_windowClass = @"CPWindow";
_windowRect = CGRectMake(0.0, 0.0, 400.0, 200.0);
_windowStyleMask = CPTitledWindowMask | CPClosableWindowMask | CPMiniaturizableWindowMask | CPResizableWindowMask;
_windowTitle = @"Window";
_windowView = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, 400.0, 200.0)];
_windowIsFullBridge = NO;
}
return self;
}
- (id)initWithCoder:(CPCoder)aCoder
{
self = [super init];
+1 -1
View File
@@ -394,7 +394,7 @@ var CPDOMWindowGetFrame = function(_DOMWindow)
//might be mac only, we should investigate futher later.
var KeyCodesToPrevent = {},
CharacterKeysToPrevent = {},
KeyCodesWithoutKeyPressEvents = { '8':1, '9':1, '37':1, '38':1, '39':1, '40':1, '46':1, '33':1, '34':1 };
KeyCodesWithoutKeyPressEvents = { '8':1, '9':1, '16':1, '37':1, '38':1, '39':1, '40':1, '46':1, '33':1, '34':1 };
var CTRL_KEY_CODE = 17;
+1 -1
View File
@@ -87,7 +87,7 @@
_objectsKeys = [aCoder decodeObjectForKey:@"NSObjectsKeys"];
_objectsValues = [aCoder decodeObjectForKey:@"NSObjectsValues"];
_oidKeys = [aCoder decodeObjectForKey:@"NSOidsKeys"];
_oidValues = [aCoder decodeObjectForKey:@"NSOidsValues"];