]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/window.mm
Fix harmless unused parameter warning in wxOSX.
[wxWidgets.git] / src / osx / cocoa / window.mm
index 8580b52b5baf2c5b34b49a071effb6a06b462b7c..a12de976819017833c66970fb46a3a21790aecdc 100644 (file)
@@ -17,6 +17,7 @@
     #include "wx/log.h"
     #include "wx/textctrl.h"
     #include "wx/combobox.h"
     #include "wx/log.h"
     #include "wx/textctrl.h"
     #include "wx/combobox.h"
+    #include "wx/radiobut.h"
 #endif
 
 #ifdef __WXMAC__
 #endif
 
 #ifdef __WXMAC__
@@ -686,8 +687,11 @@ void wxWidgetCocoaImpl::SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEve
                 
             if ( fabs(deltaX) > fabs(deltaY) )
             {
                 
             if ( fabs(deltaX) > fabs(deltaY) )
             {
+                // wx conventions for horizontal are inverted from vertical (originating from native msw behavior)
+                // right and up are positive values, left and down are negative values, while on OSX right and down
+                // are negative and left and up are positive.
                 wxevent.m_wheelAxis = wxMOUSE_WHEEL_HORIZONTAL;
                 wxevent.m_wheelAxis = wxMOUSE_WHEEL_HORIZONTAL;
-                wxevent.m_wheelRotation = (int)deltaX;
+                wxevent.m_wheelRotation = -(int)deltaX;
             }
             else
             {
             }
             else
             {
@@ -1702,6 +1706,17 @@ void wxWidgetCocoaImpl::SetVisibility( bool visible )
     [m_osxView setHidden:(visible ? NO:YES)];
 }
 
     [m_osxView setHidden:(visible ? NO:YES)];
 }
 
+double wxWidgetCocoaImpl::GetContentScaleFactor() const
+{
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+    NSWindow* tlw = [m_osxView window];
+    if ( [ tlw respondsToSelector:@selector(backingScaleFactor) ] )
+        return [tlw backingScaleFactor];
+    else
+#endif
+        return 1.0;
+}
+
 // ----------------------------------------------------------------------------
 // window animation stuff
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // window animation stuff
 // ----------------------------------------------------------------------------