]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/scrlwing.cpp
new VC++ project files with both dll and lib in one project
[wxWidgets.git] / src / generic / scrlwing.cpp
index 9ab5ebe316878f4320484e4ba50ad4679a321a30..bf9a58d3fab62c1df8acde8d1f9c66a7568d9171 100644 (file)
@@ -18,7 +18,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "genscrolwin.h"
 #endif
 
@@ -40,7 +40,9 @@
 
 #include "wx/scrolwin.h"
 #include "wx/panel.h"
+#if wxUSE_TIMER
 #include "wx/timer.h"
+#endif
 #include "wx/sizer.h"
 
 #ifdef __WXMSW__
 
 IMPLEMENT_CLASS(wxScrolledWindow, wxGenericScrolledWindow)
 
+/*
+       TODO PROPERTIES
+               style wxHSCROLL | wxVSCROLL
+*/
+
 // ----------------------------------------------------------------------------
 // wxScrollHelperEvtHandler: intercept the events from the window and forward
 // them to wxScrollHelper
@@ -86,6 +93,7 @@ private:
     DECLARE_NO_COPY_CLASS(wxScrollHelperEvtHandler)
 };
 
+#if wxUSE_TIMER
 // ----------------------------------------------------------------------------
 // wxAutoScrollTimer: the timer used to generate a stream of scroll events when
 // a captured mouse is held outside the window
@@ -170,6 +178,7 @@ void wxAutoScrollTimer::Notify()
         }
     }
 }
+#endif
 
 // ----------------------------------------------------------------------------
 // wxScrollHelperEvtHandler
@@ -713,7 +722,7 @@ void wxScrollHelper::AdjustScrollbars()
         oldh = h;
 
         GetTargetSize( &w, &h );
-    } while ( w != oldw && h != oldh );
+    } while ( w != oldw || h != oldh );
 
 #ifdef __WXMOTIF__
     // Sorry, some Motif-specific code to implement a backing pixmap
@@ -1067,11 +1076,13 @@ bool wxScrollHelper::SendAutoScrollEvents(wxScrollWinEvent& event) const
 
 void wxScrollHelper::StopAutoScrolling()
 {
+#if wxUSE_TIMER
     if ( m_timerAutoScroll )
     {
         delete m_timerAutoScroll;
         m_timerAutoScroll = (wxTimer *)NULL;
     }
+#endif
 }
 
 void wxScrollHelper::HandleOnMouseEnter(wxMouseEvent& event)
@@ -1133,6 +1144,7 @@ void wxScrollHelper::HandleOnMouseLeave(wxMouseEvent& event)
         if ( !m_targetWindow->HasScrollbar(orient) )
             return;
 
+#if wxUSE_TIMER
         delete m_timerAutoScroll;
         m_timerAutoScroll = new wxAutoScrollTimer
                                 (
@@ -1143,6 +1155,7 @@ void wxScrollHelper::HandleOnMouseLeave(wxMouseEvent& event)
                                     orient
                                 );
         m_timerAutoScroll->Start(50); // FIXME: make configurable
+#endif
     }
 }
 
@@ -1263,11 +1276,13 @@ wxGenericScrolledWindow::MSWWindowProc(WXUINT nMsg,
 {
     long rc = wxPanel::MSWWindowProc(nMsg, wParam, lParam);
 
+#ifndef __WXWINCE__
     // we need to process arrows ourselves for scrolling
     if ( nMsg == WM_GETDLGCODE )
     {
         rc |= DLGC_WANTARROWS;
     }
+#endif
 
     return rc;
 }