]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
reset the old disabled image list even if there is no new one (bug 1604374)
[wxWidgets.git] / src / generic / listctrl.cpp
index 40a79102d5a9defeaaacebcd9cf5965bfe4a9fc6..d96d2cbff239390e70c53ef3d38a24d4e8f17bd1 100644 (file)
@@ -2964,6 +2964,9 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
         m_textctrlWrapper->AcceptChangesAndFinish();
 #endif // __WXMAC__
 
+    if ( event.LeftDown() )
+        SetFocus();
+    
     event.SetEventObject( GetParent() );
     if ( GetParent()->GetEventHandler()->ProcessEvent( event) )
         return;
@@ -4501,10 +4504,13 @@ void wxListMainWindow::EnsureVisible( long index )
     MoveToItem((size_t)index);
 }
 
-long wxListMainWindow::FindItem(long start, const wxString& str, bool WXUNUSED(partial) )
+long wxListMainWindow::FindItem(long start, const wxString& str, bool partial )
 {
+    if (str.empty())
+        return wxNOT_FOUND;
+        
     long pos = start;
-    wxString tmp = str;
+    wxString str_upper = str.Upper();
     if (pos < 0)
         pos = 0;
 
@@ -4512,8 +4518,17 @@ long wxListMainWindow::FindItem(long start, const wxString& str, bool WXUNUSED(p
     for ( size_t i = (size_t)pos; i < count; i++ )
     {
         wxListLineData *line = GetLine(i);
-        if ( line->GetText(0) == tmp )
-            return i;
+        wxString line_upper = line->GetText(0).Upper();
+        if (!partial)
+        {
+            if (line_upper == str_upper )
+                return i;
+        }
+        else
+        {
+            if (line_upper.find(str_upper) == 0)
+                return i;
+        }
     }
 
     return wxNOT_FOUND;
@@ -5213,6 +5228,16 @@ wxColour wxGenericListCtrl::GetItemBackgroundColour( long item ) const
     return info.GetBackgroundColour();
 }
 
+int wxGenericListCtrl::GetScrollPos( int orient ) const
+{
+    return m_mainWin->GetScrollPos( orient );
+}
+
+void wxGenericListCtrl::SetScrollPos( int orient, int pos, bool refresh )
+{
+    m_mainWin->SetScrollPos( orient, pos, refresh );
+}
+
 void wxGenericListCtrl::SetItemFont( long item, const wxFont &f )
 {
     wxListItem info;