]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/window.cpp
Applied [ 1059554 ] patch for [1028659] fixes a couple of bugs with menus
[wxWidgets.git] / src / mac / carbon / window.cpp
index 84720504652ed5613fdb91fbb02c81eade27e80a..7f8e6417d83b030329774b43a75fa00ba5095801 100644 (file)
@@ -9,11 +9,12 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "window.h"
 #endif
 
-#include "wx/setup.h"
+#include "wx/wxprec.h"
+
 #include "wx/menu.h"
 #include "wx/window.h"
 #include "wx/dc.h"
@@ -2394,8 +2395,8 @@ void wxWindowMac::SetScrollbar(int orient, int pos, int thumbVisible,
             {
                 if ( !m_hScrollBar->IsShown() )
                     m_hScrollBar->Show(true) ;
-                m_hScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ;
             }
+            m_hScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ;
         }
     }
     else
@@ -2411,8 +2412,8 @@ void wxWindowMac::SetScrollbar(int orient, int pos, int thumbVisible,
             {
                 if ( !m_vScrollBar->IsShown() )
                     m_vScrollBar->Show(true) ;
-                m_vScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ;
             }
+            m_vScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ;
         }
     }
     MacRepositionScrollBars() ;
@@ -2512,29 +2513,29 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
 
 void wxWindowMac::MacOnScroll(wxScrollEvent &event )
 {
-    if ( event.m_eventObject == m_vScrollBar || event.m_eventObject == m_hScrollBar )
+    if ( event.GetEventObject() == m_vScrollBar || event.GetEventObject() == m_hScrollBar )
     {
         wxScrollWinEvent wevent;
         wevent.SetPosition(event.GetPosition());
         wevent.SetOrientation(event.GetOrientation());
-        wevent.m_eventObject = this;
-
-        if (event.m_eventType == wxEVT_SCROLL_TOP)
-            wevent.m_eventType = wxEVT_SCROLLWIN_TOP;
-        else if (event.m_eventType == wxEVT_SCROLL_BOTTOM)
-            wevent.m_eventType = wxEVT_SCROLLWIN_BOTTOM;
-        else if (event.m_eventType == wxEVT_SCROLL_LINEUP)
-            wevent.m_eventType = wxEVT_SCROLLWIN_LINEUP;
-        else if (event.m_eventType == wxEVT_SCROLL_LINEDOWN)
-            wevent.m_eventType = wxEVT_SCROLLWIN_LINEDOWN;
-        else if (event.m_eventType == wxEVT_SCROLL_PAGEUP)
-            wevent.m_eventType = wxEVT_SCROLLWIN_PAGEUP;
-        else if (event.m_eventType == wxEVT_SCROLL_PAGEDOWN)
-            wevent.m_eventType = wxEVT_SCROLLWIN_PAGEDOWN;
-        else if (event.m_eventType == wxEVT_SCROLL_THUMBTRACK)
-            wevent.m_eventType = wxEVT_SCROLLWIN_THUMBTRACK;
-        else if (event.m_eventType == wxEVT_SCROLL_THUMBRELEASE)
-            wevent.m_eventType = wxEVT_SCROLLWIN_THUMBRELEASE;
+        wevent.SetEventObject(this);
+
+        if (event.GetEventType() == wxEVT_SCROLL_TOP)
+            wevent.SetEventType( wxEVT_SCROLLWIN_TOP );
+        else if (event.GetEventType() == wxEVT_SCROLL_BOTTOM)
+            wevent.SetEventType( wxEVT_SCROLLWIN_BOTTOM );
+        else if (event.GetEventType() == wxEVT_SCROLL_LINEUP)
+            wevent.SetEventType( wxEVT_SCROLLWIN_LINEUP );
+        else if (event.GetEventType() == wxEVT_SCROLL_LINEDOWN)
+            wevent.SetEventType( wxEVT_SCROLLWIN_LINEDOWN );
+        else if (event.GetEventType() == wxEVT_SCROLL_PAGEUP)
+            wevent.SetEventType( wxEVT_SCROLLWIN_PAGEUP );
+        else if (event.GetEventType() == wxEVT_SCROLL_PAGEDOWN)
+            wevent.SetEventType( wxEVT_SCROLLWIN_PAGEDOWN );
+        else if (event.GetEventType() == wxEVT_SCROLL_THUMBTRACK)
+            wevent.SetEventType( wxEVT_SCROLLWIN_THUMBTRACK );
+        else if (event.GetEventType() == wxEVT_SCROLL_THUMBRELEASE)
+            wevent.SetEventType( wxEVT_SCROLLWIN_THUMBRELEASE );
 
         GetEventHandler()->ProcessEvent(wevent);
     }
@@ -2845,7 +2846,7 @@ bool wxWindowMac::MacDoRedraw( WXHRGN updatergnr , long time )
         {
             // paint the window itself
             wxPaintEvent event;
-            event.m_timeStamp = time ;
+            event.SetTimestamp(time);
             event.SetEventObject(this);
             handled = GetEventHandler()->ProcessEvent(event);