From 52555d3fcea8c87720878f18969c87fca304f981 Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Sun, 7 Dec 2014 09:58:45 +1100 Subject: Replace calls to deprecated methods with their current equivalents. --- cocoa/PlatCocoa.mm | 7 ++++--- cocoa/ScintillaView.mm | 12 +++--------- 2 files changed, 7 insertions(+), 12 deletions(-) (limited to 'cocoa') diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 28fe4dd8b..facd18c34 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -1144,7 +1144,7 @@ PRectangle Window::GetPosition() NSView* view = reinterpret_cast(idWin); win = [view window]; rect = [view convertRect: [view bounds] toView: nil]; - rect.origin = [win convertBaseToScreen:rect.origin]; + rect = [win convertRectToScreen:rect]; } else { @@ -1177,7 +1177,7 @@ void Window::SetPosition(PRectangle rc) // Moves this view inside the parent view NSRect nsrc = NSMakeRect(rc.left, rc.bottom, rc.Width(), rc.Height()); NSView* view = reinterpret_cast(idWin); - nsrc.origin = [[view window] convertScreenToBase:nsrc.origin]; + nsrc = [[view window] convertRectFromScreen:nsrc]; [view setFrame: nsrc]; } else @@ -1672,7 +1672,8 @@ PRectangle ListBoxImpl::GetDesiredRect() if (Length() > rows) { [scroller setHasVerticalScroller:YES]; - rcDesired.right += [NSScroller scrollerWidth]; + rcDesired.right += [NSScroller scrollerWidthForControlSize:NSRegularControlSize + scrollerStyle:NSScrollerStyleLegacy]; } else { diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index 020fddeae..02847acc8 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -392,14 +392,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) wParam: 0 lParam: 0]; rect = [[[self superview] superview] convertRect:rect toView:nil]; -#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_6 - if ([self.window respondsToSelector:@selector(convertRectToScreen:)]) - rect = [self.window convertRectToScreen:rect]; - else // convertRectToScreen not available on 10.6 - rect.origin = [self.window convertBaseToScreen:rect.origin]; -#else - rect.origin = [self.window convertBaseToScreen:rect.origin]; -#endif + rect = [self.window convertRectToScreen:rect]; return rect; } @@ -1182,7 +1175,8 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) */ - (void) positionSubViews { - int scrollerWidth = [NSScroller scrollerWidth]; + int scrollerWidth = [NSScroller scrollerWidthForControlSize:NSRegularControlSize + scrollerStyle:NSScrollerStyleLegacy]; NSSize size = [self frame].size; NSRect barFrame = {0, size.height - scrollerWidth, size.width, static_cast(scrollerWidth)}; -- cgit v1.2.3