Merged 47994 from trunk. WARNING: changes runtime behavior:

Implement transformation between the wxDisplay coordinate system and the Cocoa screen coordinate system.
Use this to fix TLW initial positioning/sizing (including wxTopLevelWindow, wxFrame, and wxDialog)
Use this to implement wxWindow::DoScreenToClient and DoClientToScreen
Copyright 2007 Software 2000 Ltd.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@47995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott
2007-08-10 04:47:49 +00:00
parent 94d815b39e
commit 3ea8f7f2af
5 changed files with 239 additions and 39 deletions

View File

@@ -80,6 +80,7 @@ protected:
static wxCocoaNSWindowHash sm_cocoaHash;
virtual void CocoaReplaceView(WX_NSView oldView, WX_NSView newView);
static unsigned int NSWindowStyleForWxStyle(long style);
static NSRect MakeInitialNSWindowContentRect(const wxPoint& pos, const wxSize& size, unsigned int cocoaStyleMask);
static wxTopLevelWindowCocoa *sm_cocoaDeactivateWindow;
// ------------------------------------------------------------------------

View File

@@ -18,6 +18,22 @@
#import <Foundation/NSGeometry.h>
#endif //def __OBJC__
// We can only import Foundation/NSGeometry.h from Objective-C code but it's
// nice to be able to use NSPoint and NSRect in the declarations of helper
// methods so we must define them as opaque structs identically to the way
// they are defined by the real header.
// NOTE: We specifically use these regardless of C++ or Objective-C++ mode so
// the compiler will complain if we got the definitions wrong. In regular
// C++ mode there is no way to know if we got the definitons right so
// we depend on at least one Objective-C++ file including this header.
#if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
typedef struct CGPoint NSPoint;
typedef struct CGRect NSRect;
#else
typedef struct _NSPoint NSPoint;
typedef struct _NSRect NSRect;
#endif
DECLARE_WXCOCOA_OBJC_CLASS(NSAffineTransform);
class wxWindowCocoaHider;
@@ -142,6 +158,8 @@ protected:
NSPoint CocoaTransformWxToBounds(NSPoint pointWx);
NSRect CocoaTransformWxToBounds(NSRect rectWx);
#endif //def __OBJC__
static wxPoint OriginInWxDisplayCoordinatesForRectInCocoaScreenCoordinates(NSRect windowFrame);
static NSPoint OriginInCocoaScreenCoordinatesForRectInWxDisplayCoordinates(wxCoord x, wxCoord y, wxCoord width, wxCoord height, bool keepOriginVisible);
// ------------------------------------------------------------------------
// Implementation
// ------------------------------------------------------------------------