]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
Fixed wxGridCellFloatEditor::Clone
[wxWidgets.git] / src / generic / listctrl.cpp
index 6cfc4bec2ced948126ba281d5fcea0572017d358..aeee3f956f66fa30bc52973e5dd919ca68737614 100644 (file)
     #include "wx/textctrl.h"
 #endif
 
-#include "wx/imaglist.h"
-#include "wx/listctrl.h"
+// Include wx/listctrl.h (with wxListView declaration)
+// only when wxGenericListCtrl is the only
+// implementation, and therefore wxListView needs
+// to be derived from the 'generic' version.
+
+#if defined(__WIN32__) && !defined(__WXUNIVERSAL__)
+    #include "wx/generic/listctrl.h"
+#else
+    #include "wx/listctrl.h"
+#endif
 
 #if defined(__WXGTK__)
     #include <gtk/gtk.h>
@@ -144,7 +152,7 @@ public:
     void SetItemCount(size_t count) { m_count = count; }
 
     // special case of SetItemCount(0)
-    void Clear() { m_itemsSel.Clear(); m_count = 0; }
+    void Clear() { m_itemsSel.Clear(); m_count = 0; m_defaultState = FALSE; }
 
     // must be called when a new item is inserted/added
     void OnItemAdd(size_t item) { wxFAIL_MSG( _T("TODO") ); }
@@ -2664,22 +2672,24 @@ void wxListMainWindow::RefreshAfter( size_t lineFrom )
 {
     if ( HasFlag(wxLC_REPORT) )
     {
-        size_t visibleFrom;
-        GetVisibleLinesRange(&visibleFrom, NULL);
+        size_t visibleFrom, visibleTo;
+        GetVisibleLinesRange(&visibleFrom, &visibleTo);
 
         if ( lineFrom < visibleFrom )
             lineFrom = visibleFrom;
+        else if ( lineFrom > visibleTo )
+            return;
 
         wxRect rect;
         rect.x = 0;
         rect.y = GetLineY(lineFrom);
+        CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y );
 
         wxSize size = GetClientSize();
         rect.width = size.x;
         // refresh till the bottom of the window
         rect.height = size.y - rect.y;
 
-        CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y );
         RefreshRect( rect );
     }
     else // !report
@@ -4511,7 +4521,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxGenericListCtrl, wxControl)
 
 #if !defined(__WIN32__)
-IMPLEMENT_DYNAMIC_CLASS(wxListView, wxGenericListCtrl)
+IMPLEMENT_DYNAMIC_CLASS(wxListView, wxListCtrl)
 
 IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxNotifyEvent)
 #endif