]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
aui this really has to be BOOL and not bool
[wxWidgets.git] / src / gtk / window.cpp
index d986f1f4a658101219d9d4c66073de5373879135..c631f3b014e8dc5e0626a60e35d26254424d79bb 100644 (file)
@@ -4235,6 +4235,26 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
         gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
 
     m_clipPaintRegion = false;
         gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
 
     m_clipPaintRegion = false;
+
+    bool restoreCaret = (GetCaret() != NULL && GetCaret()->IsVisible());
+    if (restoreCaret)
+    {
+        wxRect caretRect(GetCaret()->GetPosition(), GetCaret()->GetSize());
+        if (dx > 0)
+            caretRect.width += dx;
+        else
+       {
+            caretRect.x += dx; caretRect.width -= dx;
+       }
+        if (dy > 0)
+            caretRect.height += dy;
+        else
+       {
+            caretRect.y += dy; caretRect.height -= dy;
+       }
+     
+        RefreshRect(caretRect);
+    }
 }
 
 void wxWindowGTK::GtkScrolledWindowSetBorder(GtkWidget* w, int wxstyle)
 }
 
 void wxWindowGTK::GtkScrolledWindowSetBorder(GtkWidget* w, int wxstyle)