add userInfo in resize notifications, as added in OSX 10.5

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38812 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Doug Simons 2015-07-16 22:26:17 +00:00
parent 6433adc763
commit d905991ebe
2 changed files with 15 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2015-07-16 Doug Simons <doug.simons@testplant.com>
* Source/NSSplitView.m: Add userInfo dictionary containing the
divider number in resize notifications, as added in OSX 10.5.
2015-07-02 Doug Simons <doug.simons@testplant.com> 2015-07-02 Doug Simons <doug.simons@testplant.com>
* Source/NSTableView.m: Changed click and double-click behavior * Source/NSTableView.m: Changed click and double-click behavior

View file

@ -325,12 +325,13 @@ static NSNotificationCenter *nc = nil;
- (void) _resize: (id) v withOldSplitView: (id) prev - (void) _resize: (id) v withOldSplitView: (id) prev
withFrame: (NSRect) r fromPoint: (NSPoint) p withFrame: (NSRect) r fromPoint: (NSPoint) p
withBigRect: (NSRect) bigRect divHorizontal: (CGFloat) divHorizontal withBigRect: (NSRect) bigRect divHorizontal: (CGFloat) divHorizontal
divVertical: (CGFloat) divVertical divVertical: (CGFloat) divVertical userInfo:(NSDictionary *)userInfo
{ {
NSRect r1 = NSZeroRect; NSRect r1 = NSZeroRect;
[nc postNotificationName: NSSplitViewWillResizeSubviewsNotification [nc postNotificationName: NSSplitViewWillResizeSubviewsNotification
object: self]; object: self
userInfo: userInfo];
/* resize the subviews accordingly */ /* resize the subviews accordingly */
r = [prev frame]; r = [prev frame];
@ -387,7 +388,8 @@ static NSNotificationCenter *nc = nil;
(int)NSHeight(r1)); (int)NSHeight(r1));
[nc postNotificationName: NSSplitViewDidResizeSubviewsNotification [nc postNotificationName: NSSplitViewDidResizeSubviewsNotification
object: self]; object: self
userInfo: userInfo];
} }
@ -424,6 +426,7 @@ static NSNotificationCenter *nc = nil;
NSRect oldRect; //only one can be dragged at a time NSRect oldRect; //only one can be dragged at a time
BOOL lit = NO; BOOL lit = NO;
NSCursor *cursor; NSCursor *cursor;
NSDictionary *userInfo = nil; // userInfo for resize notifications
/* if there are less the two subviews, there is nothing to do */ /* if there are less the two subviews, there is nothing to do */
if (count < 2) if (count < 2)
@ -615,6 +618,7 @@ static NSNotificationCenter *nc = nil;
// Save the old position // Save the old position
op = p; op = p;
} }
userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:offset] forKey:@"NSSplitViewDividerIndex"];
// user is moving the knob loop until left mouse up // user is moving the knob loop until left mouse up
while ([e type] != NSLeftMouseUp) while ([e type] != NSLeftMouseUp)
@ -714,7 +718,7 @@ static NSNotificationCenter *nc = nil;
{ {
[self _resize: v withOldSplitView: prev withFrame: r fromPoint: p [self _resize: v withOldSplitView: prev withFrame: r fromPoint: p
withBigRect: bigRect divHorizontal: divHorizontal withBigRect: bigRect divHorizontal: divHorizontal
divVertical: divVertical]; divVertical: divVertical userInfo:userInfo];
[_window invalidateCursorRectsForView: self]; [_window invalidateCursorRectsForView: self];
[self setNeedsDisplay: YES]; [self setNeedsDisplay: YES];
} }
@ -740,7 +744,7 @@ static NSNotificationCenter *nc = nil;
{ {
[self _resize: v withOldSplitView: prev withFrame: r fromPoint: p [self _resize: v withOldSplitView: prev withFrame: r fromPoint: p
withBigRect: bigRect divHorizontal: divHorizontal withBigRect: bigRect divHorizontal: divHorizontal
divVertical: divVertical]; divVertical: divVertical userInfo:userInfo];
[_window invalidateCursorRectsForView: self]; [_window invalidateCursorRectsForView: self];
} }
} }