Revision: 15208
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15208&view=rev
Author:   hofman
Date:     2009-04-27 11:09:45 +0000 (Mon, 27 Apr 2009)

Log Message:
-----------
use NSWindow methods to convert beween window and screen coordinates

Modified Paths:
--------------
    trunk/bibdesk/BDSKOverlayWindow.m

Modified: trunk/bibdesk/BDSKOverlayWindow.m
===================================================================
--- trunk/bibdesk/BDSKOverlayWindow.m   2009-04-27 10:31:39 UTC (rev 15207)
+++ trunk/bibdesk/BDSKOverlayWindow.m   2009-04-27 11:09:45 UTC (rev 15208)
@@ -69,12 +69,8 @@
 
 - (void)parentViewFrameChanged:(NSNotification *)notification {
        NSRect viewRect = [parentView convertRect:[parentView bounds] 
toView:nil];
-       NSPoint windowOrigin = [[parentView window] frame].origin;
-       
-       viewRect.origin.x += windowOrigin.x;
-       viewRect.origin.y += windowOrigin.y;
-       
-       [self setFrame:viewRect display:YES];
+    viewRect.origin = [[parentView window] 
convertBaseToScreen:viewRect.origin];
+       [self setFrame:[self frameRectForContentRect:viewRect] display:YES];
 }
 
 - (void)parentWindowWillClose:(NSNotification *)notification {
@@ -168,12 +164,8 @@
 
 - (void)parentViewFrameChanged:(NSNotification *)notification {
        NSRect viewRect = [parentView convertRect:[parentView bounds] 
toView:nil];
-       NSPoint windowOrigin = [[parentView window] frame].origin;
-       
-       viewRect.origin.x += windowOrigin.x;
-       viewRect.origin.y += windowOrigin.y;
-       
-       [self setFrame:viewRect display:YES];
+    viewRect.origin = [[parentView window] 
convertBaseToScreen:viewRect.origin];
+       [self setFrame:[self frameRectForContentRect:viewRect] display:YES];
 }
 
 - (void)parentWindowWillClose:(NSNotification *)notification {
@@ -191,7 +183,7 @@
     NSWindow *parentWindow = [parentView window];
        
        // if the parent is a floating panel, we also should be. Otherwise we 
won't get on top.
-       [self setFloatingPanel:([parentWindow isKindOfClass:[NSPanel class]] && 
[(NSPanel *)parentWindow isFloatingPanel])];
+       [self setFloatingPanel:([parentWindow 
respondsToSelector:@selector(isFloatingPanel)] && [(NSPanel *)parentWindow 
isFloatingPanel])];
     [self setHidesOnDeactivate:[parentWindow hidesOnDeactivate]];
     [self setLevel:[parentWindow level]];
        [parentWindow addChildWindow:self ordered:NSWindowAbove];


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to