]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/datavgen.cpp
Some code renaming to avoid confusion. Test editable column in sample.
[wxWidgets.git] / src / generic / datavgen.cpp
index ffe43b2b1ee989d17fe99bd629d634b912b9c53f..3ca5d64b8708f53de0c6d234f83621b911181145 100644 (file)
@@ -1693,8 +1693,8 @@ void wxDataViewMainWindow::OnRenameTimer()
     GetOwner()->CalcScrolledPosition( labelRect.x, labelRect.y,
                                      &labelRect.x, &labelRect.y);
 
-    // TODO get wxDataViewItem from m_currentRow
-    m_currentCol->GetRenderer()->StartEditing( m_currentRow, labelRect );
+    wxDataViewItem item = GetItemByRow( m_currentRow );
+    m_currentCol->GetRenderer()->StartEditing( item, labelRect );
 }
 
 //------------------------------------------------------------------
@@ -2755,13 +2755,13 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
         {
             if (cell->GetMode() == wxDATAVIEW_CELL_ACTIVATABLE)
             {
+                wxDataViewItem item = GetItemByRow(current);
                 wxVariant value;
-                model->GetValue( value, col->GetModelColumn(), current );
+                model->GetValue( value, item, col->GetModelColumn() );
                 cell->SetValue( value );
                 wxRect cell_rect( xpos, current * m_lineHeight,
                                   col->GetWidth(), m_lineHeight );
-                 wxDataViewItem dataitem = GetItemByRow(current);
-                cell->Activate( cell_rect, model, dataitem, col->GetModelColumn() );
+                cell->Activate( cell_rect, model, item, col->GetModelColumn() );
             }
             return;
         }