]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/vscroll.cpp
Fix DrawStatusField() to work correctly with wxSB_FLAT style.
[wxWidgets.git] / src / generic / vscroll.cpp
index 530417aca39dc84bd630f1efac547552cd2054c2..a98c29da79d1a7c68a6025582cd3141c04baf68c 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        src/generic/vscroll.cpp
 // Purpose:     wxVScrolledWindow implementation
 // Author:      Vadim Zeitlin
-// Modified by: Brad Anderson
+// Modified by: Brad Anderson, David Warkentin
 // Created:     30.05.03
 // RCS-ID:      $Id$
 // Copyright:   (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
@@ -53,7 +53,7 @@ public:
 private:
     wxVarScrollHelperBase *m_scrollHelper;
 
-    DECLARE_NO_COPY_CLASS(wxVarScrollHelperEvtHandler)
+    wxDECLARE_NO_COPY_CLASS(wxVarScrollHelperEvtHandler);
 };
 
 // ============================================================================
@@ -144,7 +144,7 @@ bool wxVarScrollHelperEvtHandler::ProcessEvent(wxEvent& event)
 
 wxVarScrollHelperBase::wxVarScrollHelperBase(wxWindow *win)
 {
-    wxASSERT_MSG( win, _T("associated window can't be NULL in wxVarScrollHelperBase") );
+    wxASSERT_MSG( win, wxT("associated window can't be NULL in wxVarScrollHelperBase") );
 
 #if wxUSE_MOUSEWHEEL
     m_sumWheelRotation = 0;
@@ -155,8 +155,9 @@ wxVarScrollHelperBase::wxVarScrollHelperBase(wxWindow *win)
     m_unitFirst = 0;
 
     m_win =
-    m_targetWindow = (wxWindow *)NULL;
+    m_targetWindow = NULL;
 
+    m_physicalScrolling = true;
     m_handler = NULL;
 
     m_win = win;
@@ -331,7 +332,7 @@ size_t wxVarScrollHelperBase::GetNewScrollPosition(wxScrollWinEvent& event) cons
     }
 
     // unknown scroll event?
-    wxFAIL_MSG( _T("unknown scroll event type?") );
+    wxFAIL_MSG( wxT("unknown scroll event type?") );
     return 0;
 }
 
@@ -475,7 +476,7 @@ void wxVarScrollHelperBase::RefreshUnit(size_t unit)
 
 void wxVarScrollHelperBase::RefreshUnits(size_t from, size_t to)
 {
-    wxASSERT_MSG( from <= to, _T("RefreshUnits(): empty range") );
+    wxASSERT_MSG( from <= to, wxT("RefreshUnits(): empty range") );
 
     // clump the range to just the visible units -- it is useless to refresh
     // the other ones
@@ -592,7 +593,7 @@ bool wxVarScrollHelperBase::DoScrollToUnit(size_t unit)
     // to avoid flicker.  We can't do this if we have children because they
     // won't be scrolled
     if ( m_targetWindow->GetChildren().empty() &&
-         GetVisibleBegin() >= unitLastOld || GetVisibleEnd() <= unitFirstOld )
+         (GetVisibleBegin() >= unitLastOld || GetVisibleEnd() <= unitFirstOld) )
     {
         // the simplest case: we don't have any old units left, just redraw
         // everything
@@ -600,7 +601,12 @@ bool wxVarScrollHelperBase::DoScrollToUnit(size_t unit)
     }
     else // scroll the window
     {
+        // Avoid scrolling visible parts of the screen on Mac
+#ifdef __WXMAC__
+        if (m_physicalScrolling && m_targetWindow->IsShownOnScreen())
+#else
         if ( m_physicalScrolling )
+#endif
         {
             wxCoord dx = 0,
                     dy = GetUnitsSize(GetVisibleBegin(), unitFirstOld);
@@ -811,7 +817,7 @@ void wxVarHVScrollHelper::RefreshRowsColumns(size_t fromRow, size_t toRow,
                                              size_t fromColumn, size_t toColumn)
 {
     wxASSERT_MSG( fromRow <= toRow || fromColumn <= toColumn,
-        _T("RefreshRowsColumns(): empty range") );
+        wxT("RefreshRowsColumns(): empty range") );
 
     // clump the range to just the visible units -- it is useless to refresh
     // the other ones
@@ -959,7 +965,7 @@ bool wxVarVScrollLegacyAdaptor::ScrollPages(int pages)
 
 wxCoord wxVarVScrollLegacyAdaptor::OnGetLineHeight(size_t WXUNUSED(n)) const
 {
-    wxFAIL_MSG( _T("OnGetLineHeight() must be overridden if OnGetRowHeight() isn't!") );
+    wxFAIL_MSG( wxT("OnGetLineHeight() must be overridden if OnGetRowHeight() isn't!") );
     return -1;
 }