]> git.saurik.com Git - wxWidgets.git/commitdiff
upport wxListCtrl label edit changes
authorRobert Roebling <robert@roebling.de>
Tue, 3 Jul 2007 12:10:04 +0000 (12:10 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 3 Jul 2007 12:10:04 +0000 (12:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp

index a97c0b134325936c68f6172022cdd7f4c57c4f8f..f5dfcd66b0d2b9c0917d833ea4aaa7effe26f89d 100644 (file)
@@ -2449,6 +2449,20 @@ wxRect wxListMainWindow::GetLineLabelRect(size_t line) const
     if ( !InReportView() )
         return GetLine(line)->m_gi->m_rectLabel;
 
+    int image_x = 0;
+    wxListLineData *data = GetLine(line);
+    wxListItemDataList::compatibility_iterator node = data->m_items.GetFirst();
+    if (node)
+    {
+        wxListItemData *item = node->GetData();
+        if ( item->HasImage() )
+        {
+            int ix, iy;
+            GetImageSize( item->GetImage(), ix, iy );
+            image_x = 3 + ix + IMAGE_MARGIN_IN_REPORT_MODE;
+        }
+    }
+    
     wxRect rect;
     rect.x = HEADER_OFFSET_X;
     rect.y = GetLineY(line);
@@ -3142,7 +3156,15 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
                 (hitResult == wxLIST_HITTEST_ONITEMLABEL) &&
                 HasFlag(wxLC_EDIT_LABELS) )
             {
-                m_renameTimer->Start( 100, true );
+                if (InReportView())
+                {
+                    wxRect label = GetLineLabelRect( current );
+                    if (label.Contains( x, y ))
+                        m_renameTimer->Start( 250, true );
+                        
+                }
+                else
+                    m_renameTimer->Start( 250, true );
             }
         }