Just clicking on the NSComboBox menu item doesn't select the item clicked

This commit is contained in:
Airy ANDRE 2014-01-17 18:12:25 +01:00
parent 956d2124b9
commit c2f475aae8
2 changed files with 5 additions and 3 deletions

View File

@ -273,6 +273,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_buttonPressed=YES;
[controlView setNeedsDisplay:YES];
[window makeKeyAndOrderFront:self];
selectedIndex=[window runTrackingWithEvent:event];
[window close]; // release when closed=YES
_buttonPressed=NO;
@ -294,10 +295,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
-(NSRect)titleRectForBounds:(NSRect)rect {
// Keep some room for the button
NSRect buttonFrame = [self buttonRectForBounds:rect];
rect.size.width = NSMinX(buttonFrame) - rect.origin.x;
rect=[super titleRectForBounds:rect];
rect.size.width-=rect.size.height;
return rect;
}

View File

@ -242,7 +242,7 @@ enum {
}
[[self window] flushWindow];
event=[[self window] nextEventMatchingMask:NSLeftMouseUpMask|NSLeftMouseDraggedMask|NSKeyDownMask];
event=[[self window] nextEventMatchingMask:NSLeftMouseDownMask|NSLeftMouseUpMask|NSLeftMouseDraggedMask|NSKeyDownMask];
if ([event type] == NSKeyDown) {
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
switch (_keyboardUIState) {