* Headers/AppKit/NSPopover.h: correct delegate method

for popoverShouldClose:
	* Headers/AppKit/NSWindow.h: add convertRectToScreen: and
	convertRectFromScreen: methods.
	* Source/NSPopover.m: Correct delegate method for popoverShouldClose:.
	Changes to align popover window with rect it is being placed relative
	to.
	* Source/NSWindow.m: implementation of convertRectToScreen: and
	convertRectFromScreen: methods.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36577 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
gcasa 2013-04-24 09:25:56 +00:00
parent 3c28ba9b1a
commit 93e8ef8ada
5 changed files with 133 additions and 7 deletions

View file

@ -2374,6 +2374,33 @@ titleWithRepresentedFilename(NSString *representedFilename)
return basePoint;
}
/**
* Converts aRect from the coordinate system of the screen
* to the coordinate system of the window.
*/
- (NSRect) convertRectFromScreen: (NSRect)aRect
{
NSRect result = aRect;
NSPoint origin = result.origin;
NSPoint newOrigin = [self convertScreenToBase: origin];
result.origin = newOrigin;
return result;
}
/**
* Converts aRect from the window coordinate system to a rect in
* the screen coordinate system.
*/
- (NSRect) convertRectToScreen: (NSRect)aRect
{
NSRect result = aRect;
NSPoint origin = result.origin;
NSPoint newOrigin = [self convertBaseToScreen: origin];
result.origin = newOrigin;
return result;
}
/*
* Managing the display
*/