mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-10 02:40:59 +00:00
Further key handling fixes.
Reviewed by me.
This commit is contained in:
1 parent
9bb9db760e
commit
b4abc5a99d
5 files changed
+28
-9
No files matched your search
+4
-4
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
_objectsKeys = [aCoder decodeObjectForKey:@"NSObjectsKeys"];
|
||||
_objectsValues = [aCoder decodeObjectForKey:@"NSObjectsValues"];
|
||||
|
||||
|
||||
_oidKeys = [aCoder decodeObjectForKey:@"NSOidsKeys"];
|
||||
_oidValues = [aCoder decodeObjectForKey:@"NSOidsValues"];
|
||||
|
||||
|
||||
Reference in new issue
Block a user