]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
Added wxStudio module.
[wxWidgets.git] / src / generic / listctrl.cpp
index 128c1fc02759f4fec5cecfc28a9e051d5fc511c0..693fd0e07877808adf3088b9bcd87e9e8ae5311e 100644 (file)
@@ -1709,10 +1709,9 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
     if (m_dirty) return;
     if ( !(event.Dragging() || event.ButtonDown() || event.LeftUp() || event.ButtonDClick()) ) return;
 
-    wxClientDC dc(this);
-    PrepareDC(dc);
-    wxCoord x = dc.DeviceToLogicalX( (wxCoord)event.GetX() );
-    wxCoord y = dc.DeviceToLogicalY( (wxCoord)event.GetY() );
+    int x = event.GetX();
+    int y = event.GetY();
+    CalcUnscrolledPosition( x, y, &x, &y );
 
     /* Did we actually hit an item ? */
     long hitResult = 0;
@@ -2832,6 +2831,8 @@ long wxListMainWindow::FindItem(long start, long data)
 
 long wxListMainWindow::HitTest( int x, int y, int &flags )
 {
+    CalcUnscrolledPosition( x, y, &x, &y );
+
     wxNode *node = m_lines.First();
     int count = 0;
     while (node)