issue #600 cursor fixes

This commit is contained in:
Christopher Lloyd 2010-09-12 11:37:55 -04:00
parent c31a2ecaf8
commit 56c1e31bdb
3 changed files with 30 additions and 12 deletions

View File

@ -14,9 +14,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
@implementation NSCursor
static NSMutableArray *_cursorStack=nil;
+(void)initialize {
if(self==[NSCursor class]){
_cursorStack=[[NSMutableArray alloc] init];
}
}
+(NSCursor *)currentCursor {
NSUnimplementedMethod();
return 0;
return [_cursorStack lastObject];
}
-initWithCoder:(NSCoder *)coder {
@ -214,19 +221,30 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
-(void)pop {
NSUnimplementedMethod();
[isa pop];
}
-(void)set {
if([_cursorStack count])
[_cursorStack removeLastObject];
[_cursorStack addObject:self];
[[NSDisplay currentDisplay] setCursor:_cursor];
}
-(void)push {
NSUnimplementedMethod();
[_cursorStack addObject:self];
[[NSDisplay currentDisplay] setCursor:_cursor];
}
+(void)pop {
NSUnimplementedMethod();
if([_cursorStack count]<2)
return;
[_cursorStack removeLastObject];
NSCursor *cursor=[_cursorStack lastObject];
[[NSDisplay currentDisplay] setCursor:cursor->_cursor];
}
@end

View File

@ -25,19 +25,19 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
else if([name isEqualToString:@"IBeamCursor"])
idc=IDC_IBEAM;
else if([name isEqualToString:@"openHandCursor"])
idc=IDC_ARROW;
idc=IDC_HAND;
else if([name isEqualToString:@"pointingHandCursor"])
idc=IDC_HAND;
else if([name isEqualToString:@"resizeDownCursor"])
idc=IDC_ARROW;
idc=IDC_SIZENS;
else if([name isEqualToString:@"resizeLeftCursor"])
idc=IDC_ARROW;
idc=IDC_SIZEWE;
else if([name isEqualToString:@"resizeLeftRightCursor"])
idc=IDC_SIZEWE;
else if([name isEqualToString:@"resizeRightCursor"])
idc=IDC_ARROW;
idc=IDC_SIZEWE;
else if([name isEqualToString:@"resizeUpCursor"])
idc=IDC_ARROW;
idc=IDC_SIZENS;
else if([name isEqualToString:@"resizeUpDownCursor"])
idc=IDC_SIZENS;

View File

@ -27,14 +27,14 @@
isa = PBXContainerItemProxy;
containerPortal = FE0513E4121E06D90097BA92 /* Security.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 8DC2EF5B0486A6940098B216 /* Security.framework */;
remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
remoteInfo = "Security-Windows-i386";
};
FE0513EE121E06DF0097BA92 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FE0513E4121E06D90097BA92 /* Security.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 8DC2EF4F0486A6940098B216 /* Security-Windows-i386 */;
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
remoteInfo = "Security-Windows-i386";
};
FE1FC00911E7806100A9A87A /* PBXContainerItemProxy */ = {