]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/scrolwin.cpp
more bug fixes after USE_ to wxUSE_ change (now it finally seems to work)
[wxWidgets.git] / src / generic / scrolwin.cpp
index fa2bfe37407a29d39ed31255ab4c4cdd9d7ca1a9..563365f3bae2d240cefe3a9ed1f4151b6b38fbef 100644 (file)
@@ -52,6 +52,8 @@ wxScrolledWindow::wxScrolledWindow(void)
   m_yScrollLines = 0;
   m_xScrollLinesPerPage = 0;
   m_yScrollLinesPerPage = 0;
+  m_scaleX = 1.0;
+  m_scaleY = 1.0;
 }
 
 bool wxScrolledWindow::Create(wxWindow *parent, wxWindowID id,
@@ -70,6 +72,8 @@ bool wxScrolledWindow::Create(wxWindow *parent, wxWindowID id,
   m_yScrollLines = 0;
   m_xScrollLinesPerPage = 0;
   m_yScrollLinesPerPage = 0;
+  m_scaleX = 1.0;
+  m_scaleY = 1.0;
 
   return wxWindow::Create(parent, id, pos, size, style, name);
 }
@@ -96,9 +100,11 @@ void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX, int pixelsPerUnitY,
       
       m_xScrollPixelsPerLine = pixelsPerUnitX;
       m_yScrollPixelsPerLine = pixelsPerUnitY;
+      m_xScrollPosition = xPos;
+      m_yScrollPosition = yPos;
       m_xScrollLines = noUnitsX;
       m_yScrollLines = noUnitsY;
-
+      
    AdjustScrollbars();
    
    if (do_refresh && !noRefresh) Refresh();
@@ -153,14 +159,14 @@ void wxScrolledWindow::OnScroll(wxScrollEvent& event)
   if (orient == wxHORIZONTAL)
   {
     if (m_xScrollingEnabled)
-      ScrollWindow(-m_xScrollPixelsPerLine * nScrollInc, 0, NULL);
+      ScrollWindow(-m_xScrollPixelsPerLine * nScrollInc, 0, (const wxRect *) NULL);
     else
       Refresh();
   }
   else
   {
     if (m_yScrollingEnabled)
-      ScrollWindow(0, -m_yScrollPixelsPerLine * nScrollInc, NULL);
+      ScrollWindow(0, -m_yScrollPixelsPerLine * nScrollInc, (const wxRect *) NULL);
     else
       Refresh();
   }
@@ -327,7 +333,7 @@ void wxScrolledWindow::AdjustScrollbars(void)
 // Default OnSize resets scrollbars, if any
 void wxScrolledWindow::OnSize(wxSizeEvent& WXUNUSED(event))
 {
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
   if (GetAutoLayout())
     Layout();
 #endif
@@ -350,6 +356,7 @@ void wxScrolledWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
 void wxScrolledWindow::PrepareDC(wxDC& dc)
 {
        dc.SetDeviceOrigin(- m_xScrollPosition * m_xScrollPixelsPerLine, - m_yScrollPosition * m_yScrollPixelsPerLine);
+    dc.SetUserScale(m_scaleX, m_scaleY);
 }
 
 #if WXWIN_COMPATIBILITY