]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/datavgen.cpp
Correct the direction passed to wxDataObject in wxGTK clipboard code.
[wxWidgets.git] / src / generic / datavgen.cpp
index 818889d59ae6e5d71804810d99f896d513df603f..1de15c7da8a20714bf4dfab7c79283ead1223188 100644 (file)
@@ -2234,7 +2234,7 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent,
         // collapsed) item in a tree model. So it's not an error if we don't know
         // about this item, just return without doing anything then.
         if ( !parentNode )
-            return false;
+            return true;
 
         wxCHECK_MSG( parentNode->HasChildren(), false, "parent node doesn't have children?" );
         const wxDataViewTreeNodes& parentsChildren = parentNode->GetChildNodes();
@@ -2265,7 +2265,7 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent,
             if ( parentNode->GetChildNodes().empty() )
                 parentNode->SetHasChildren(GetModel()->IsContainer(parent));
 
-            return false;
+            return true;
         }
 
         // Delete the item from wxDataViewTreeNode representation:
@@ -3583,7 +3583,17 @@ void wxDataViewMainWindow::OnChar( wxKeyEvent &event )
             {
                 if( !m_selection.empty() )
                 {
-                    const wxDataViewItem item = GetItemByRow(m_selection[0]);
+                    // Mimic Windows 7 behavior: edit the item that has focus
+                    // if it is selected and the first selected item if focus
+                    // is out of selection.
+                    int sel;
+                    if ( m_selection.Index(m_currentRow) != wxNOT_FOUND )
+                        sel = m_currentRow;
+                    else
+                        sel = m_selection[0];
+
+
+                    const wxDataViewItem item = GetItemByRow(sel);
 
                     // Edit the current column. If not column is focused
                     // (typically because the user has full row selected), try