mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2025-01-30 16:42:12 +00:00
Fix a few more missing NSUInteger's in NSMenu.subproj
This commit is contained in:
parent
b39f2db0f1
commit
dad8e35523
@ -162,7 +162,7 @@ static void drawSunkenBorder(NSRect rect){
|
||||
-(void)drawRect:(NSRect)rect {
|
||||
NSRect bounds=[self bounds];
|
||||
NSArray *items=[[self menu] itemArray];
|
||||
int i,count=[items count];
|
||||
NSUInteger i,count=[items count];
|
||||
NSRect previousBorderRect=NSMakeRect(0,0,0,0);
|
||||
BOOL overflow=NO;
|
||||
NSPoint mouseLoc = [[NSApp currentEvent] locationInWindow];
|
||||
@ -214,10 +214,10 @@ static void drawSunkenBorder(NSRect rect){
|
||||
}
|
||||
}
|
||||
|
||||
-(unsigned)overflowIndex {
|
||||
-(NSUInteger)overflowIndex {
|
||||
NSRect bounds=[self bounds];
|
||||
NSArray *items=[[self menu] itemArray];
|
||||
unsigned i,count=[items count];
|
||||
NSUInteger i,count=[items count];
|
||||
NSRect previousBorderRect=NSMakeRect(0,0,0,0);
|
||||
|
||||
for(i=0;i<count;i++){
|
||||
@ -238,7 +238,7 @@ static void drawSunkenBorder(NSRect rect){
|
||||
NSUInteger result=NSNotFound;
|
||||
NSRect bounds=[self bounds];
|
||||
NSArray *items=[[self menu] itemArray];
|
||||
unsigned i,count=[items count];
|
||||
NSUInteger i,count=[items count];
|
||||
NSRect previousBorderRect=NSMakeRect(0,0,0,0);
|
||||
BOOL overflow=NO;
|
||||
|
||||
@ -268,7 +268,7 @@ static void drawSunkenBorder(NSRect rect){
|
||||
NSRect branchFrame=[branch frame];
|
||||
NSRect screenVisible=[screen visibleFrame];
|
||||
NSArray *items=[[self menu] itemArray];
|
||||
unsigned i,count=[items count];
|
||||
NSUInteger i,count=[items count];
|
||||
NSRect previousBorderRect=NSMakeRect(0,0,0,0);
|
||||
NSRect itemRect=NSZeroRect;
|
||||
NSPoint topLeft=NSZeroPoint;
|
||||
|
@ -13,9 +13,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
NSMutableArray *_visibleArray;
|
||||
}
|
||||
|
||||
- (unsigned)itemIndexAtPoint:(NSPoint)point;
|
||||
- (unsigned)selectedItemIndex;
|
||||
- (void)setSelectedItemIndex:(unsigned)itemIndex;
|
||||
- (NSUInteger)itemIndexAtPoint:(NSPoint)point;
|
||||
- (NSUInteger)selectedItemIndex;
|
||||
- (void)setSelectedItemIndex:(NSUInteger)itemIndex;
|
||||
|
||||
- (NSArray *)visibleItemArray;
|
||||
- (NSMenuItem *)itemAtSelectedIndex;
|
||||
|
@ -28,16 +28,16 @@ enum {
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
-(unsigned)itemIndexAtPoint:(NSPoint)point {
|
||||
-(NSUInteger)itemIndexAtPoint:(NSPoint)point {
|
||||
NSInvalidAbstractInvocation();
|
||||
return NSNotFound;
|
||||
}
|
||||
|
||||
-(unsigned)selectedItemIndex {
|
||||
-(NSUInteger)selectedItemIndex {
|
||||
return _selectedItemIndex;
|
||||
}
|
||||
|
||||
-(void)setSelectedItemIndex:(unsigned)itemIndex {
|
||||
-(void)setSelectedItemIndex:(NSUInteger)itemIndex {
|
||||
if (_selectedItemIndex != itemIndex) {
|
||||
_selectedItemIndex=itemIndex;
|
||||
[self setNeedsDisplay:YES];
|
||||
@ -190,7 +190,7 @@ const float kMouseMovementThreshold = .001f;
|
||||
MENUDEBUG(@"found a menu: %@", checkView);
|
||||
|
||||
// Which item is the cursor on top of?
|
||||
unsigned itemIndex=[checkView itemIndexAtPoint:checkPoint];
|
||||
NSUInteger itemIndex=[checkView itemIndexAtPoint:checkPoint];
|
||||
|
||||
MENUDEBUG(@"found an item index: %u", itemIndex);
|
||||
|
||||
@ -320,10 +320,10 @@ const float kMouseMovementThreshold = .001f;
|
||||
{
|
||||
MENUDEBUG(@"Up...");
|
||||
|
||||
unsigned oldIndex = [activeMenuView selectedItemIndex];
|
||||
NSUInteger oldIndex = [activeMenuView selectedItemIndex];
|
||||
NSArray *items = [activeMenuView itemArray];
|
||||
// Look for the next enabled item by search up and wrapping around the bottom
|
||||
unsigned newIndex = 0;
|
||||
NSUInteger newIndex = 0;
|
||||
if (oldIndex != NSNotFound) {
|
||||
newIndex = oldIndex == 0 ? [items count] - 1 : oldIndex - 1;
|
||||
}
|
||||
@ -356,10 +356,10 @@ const float kMouseMovementThreshold = .001f;
|
||||
case kNSMenuKeyboardNavigationDown:
|
||||
{
|
||||
MENUDEBUG(@"Down...");
|
||||
unsigned oldIndex = [activeMenuView selectedItemIndex];
|
||||
NSUInteger oldIndex = [activeMenuView selectedItemIndex];
|
||||
NSArray *items = [activeMenuView itemArray];
|
||||
// Look for the next enabled item by search down and wrapping around to the top
|
||||
unsigned newIndex = 0;
|
||||
NSUInteger newIndex = 0;
|
||||
if (oldIndex != NSNotFound) {
|
||||
newIndex = oldIndex == [items count] -1 ? 0 : oldIndex + 1;
|
||||
}
|
||||
@ -422,10 +422,10 @@ const float kMouseMovementThreshold = .001f;
|
||||
{
|
||||
MENUDEBUG(@"Letter...");
|
||||
NSString *letterString = [[NSString stringWithCharacters: &ch length: 1] uppercaseString];
|
||||
unsigned oldIndex = [activeMenuView selectedItemIndex];
|
||||
NSUInteger oldIndex = [activeMenuView selectedItemIndex];
|
||||
NSArray *items = [activeMenuView itemArray];
|
||||
// Look for the next enabled item by search down and wrapping around to the top
|
||||
unsigned newIndex = 0;
|
||||
NSUInteger newIndex = 0;
|
||||
if (oldIndex != NSNotFound) {
|
||||
newIndex = oldIndex == [items count] -1 ? 0 : oldIndex + 1;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
}
|
||||
|
||||
- initWithMenu:(NSMenu *)menu;
|
||||
- initWithMenu:(NSMenu *)menu overflowAtIndex:(unsigned)overflowIndex;
|
||||
- initWithMenu:(NSMenu *)menu overflowAtIndex:(NSUInteger)overflowIndex;
|
||||
|
||||
- (NSMenuView *)menuView;
|
||||
|
||||
|
@ -27,7 +27,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return self;
|
||||
}
|
||||
|
||||
-initWithMenu:(NSMenu *)menu overflowAtIndex:(unsigned)overflowIndex {
|
||||
-initWithMenu:(NSMenu *)menu overflowAtIndex:(NSUInteger)overflowIndex {
|
||||
NSOverflowMenuView *view=[[NSOverflowMenuView alloc] initWithMenu:menu overflowAtIndex:overflowIndex];
|
||||
NSRect contentRect=[view frame];
|
||||
|
||||
|
@ -9,9 +9,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <AppKit/NSSubmenuView.h>
|
||||
|
||||
@interface NSOverflowMenuView : NSSubmenuView {
|
||||
unsigned _overflowIndex;
|
||||
NSUInteger _overflowIndex;
|
||||
}
|
||||
|
||||
- initWithMenu:(NSMenu *)menu overflowAtIndex:(unsigned)overflowIndex;
|
||||
- initWithMenu:(NSMenu *)menu overflowAtIndex:(NSUInteger)overflowIndex;
|
||||
|
||||
@end
|
||||
|
@ -11,7 +11,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
@implementation NSOverflowMenuView
|
||||
|
||||
-initWithMenu:(NSMenu *)menu overflowAtIndex:(unsigned)overflowIndex {
|
||||
-initWithMenu:(NSMenu *)menu overflowAtIndex:(NSUInteger)overflowIndex {
|
||||
_overflowIndex=overflowIndex;
|
||||
|
||||
return [self initWithMenu:menu];
|
||||
|
@ -271,9 +271,9 @@ static NSRect boundsToTitleAreaRect(NSRect rect){
|
||||
}
|
||||
}
|
||||
|
||||
-(unsigned)itemIndexAtPoint:(NSPoint)point {
|
||||
-(NSUInteger)itemIndexAtPoint:(NSPoint)point {
|
||||
NSArray *items=[[self menu] itemArray];
|
||||
unsigned i,count=[items count];
|
||||
NSUInteger i,count=[items count];
|
||||
NSRect check=boundsToTitleAreaRect([self bounds]);
|
||||
|
||||
for(i=0;i<count;i++){
|
||||
@ -294,7 +294,7 @@ static NSRect boundsToTitleAreaRect(NSRect rect){
|
||||
NSRect branchFrame=[branch frame];
|
||||
NSRect screenVisible=[screen visibleFrame];
|
||||
NSArray *items=[[self menu] itemArray];
|
||||
unsigned i,count=[items count];
|
||||
NSUInteger i,count=[items count];
|
||||
NSRect itemRect=boundsToTitleAreaRect([self bounds]);
|
||||
NSPoint topLeft=NSZeroPoint;
|
||||
|
||||
@ -438,4 +438,4 @@ static NSRect boundsToTitleAreaRect(NSRect rect){
|
||||
|
||||
|
||||
@end
|
||||
*/
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user