mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-12-03 17:51:25 +00:00
issue #600 cursor fixes
This commit is contained in:
parent
c31a2ecaf8
commit
56c1e31bdb
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 */ = {
|
||||
|
Loading…
Reference in New Issue
Block a user