]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/classic/window.cpp
Now works when derived from wxTextCtrlBase, using wxScrollHelper.
[wxWidgets.git] / src / mac / classic / window.cpp
index db17efd0b379170e5dbc87dab4d7eddf735ce941..052ebd5d6af682f4eba8ea1556831ba31765afa6 100644 (file)
@@ -9,10 +9,6 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "window.h"
-#endif
-
 #include "wx/setup.h"
 #include "wx/menu.h"
 #include "wx/window.h"
@@ -68,8 +64,6 @@ wxWindowMac* gFocusWindow = NULL ;
     IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
 #endif // __WXUNIVERSAL__/__WXMAC__
 
-#if !USE_SHARED_LIBRARY
-
 BEGIN_EVENT_TABLE(wxWindowMac, wxWindowBase)
   EVT_NC_PAINT(wxWindowMac::OnNcPaint)
   EVT_ERASE_BACKGROUND(wxWindowMac::OnEraseBackground)
@@ -77,8 +71,6 @@ BEGIN_EVENT_TABLE(wxWindowMac, wxWindowBase)
   EVT_MOUSE_EVENTS(wxWindowMac::OnMouseEvent)
 END_EVENT_TABLE()
 
-#endif
-
 #define wxMAC_DEBUG_REDRAW 0
 #ifndef wxMAC_DEBUG_REDRAW
 #define wxMAC_DEBUG_REDRAW 0
@@ -1303,36 +1295,36 @@ 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);
     }
 }
 
 // Get the window with the focus
-wxWindowMac *wxWindowBase::FindFocus()
+wxWindowMac *wxWindowBase::DoFindFocus()
 {
     return gFocusWindow ;
 }
@@ -1805,7 +1797,7 @@ void wxWindowMac::MacRedraw( WXHRGN updatergnr , long time, bool erase)
             }
             
             wxPaintEvent event;
-            event.m_timeStamp = time ;
+            event.SetTimestamp(time);
             event.SetEventObject(this);
             GetEventHandler()->ProcessEvent(event);