]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dataview/dataview.cpp
Don't use GetThreadId() in wxMSW code.
[wxWidgets.git] / samples / dataview / dataview.cpp
index 7f872bb6d9ba22d2f693f8b6516adaccc5047681..857992884d39d4e6060bf2c970d2b6ec82d3d720 100644 (file)
@@ -41,7 +41,7 @@
 // resources
 // ----------------------------------------------------------------------------
 
-#ifndef __WXMSW__
+#ifndef wxHAS_IMAGES_IN_RESOURCES
     #include "../sample.xpm"
 #endif
 
@@ -841,6 +841,7 @@ void MyFrame::OnBeginDrag( wxDataViewEvent &event )
     wxTextDataObject *obj = new wxTextDataObject;
     obj->SetText( node->m_title );
     event.SetDataObject( obj );
+    event.SetDragFlags(wxDrag_AllowMove); // allows both copy and move
 }
 
 void MyFrame::OnDropPossible( wxDataViewEvent &event )
@@ -943,6 +944,17 @@ void MyFrame::OnShowCurrent(wxCommandEvent& WXUNUSED(event))
     {
         wxLogMessage("There is no current item.");
     }
+
+    wxDataViewColumn *col = m_ctrl[0]->GetCurrentColumn();
+    if ( col )
+    {
+        wxLogMessage("Current column: %d",
+                     m_ctrl[0]->GetColumnPosition(col));
+    }
+    else
+    {
+        wxLogMessage("There is no current column.");
+    }
 }
 
 void MyFrame::OnSetNinthCurrent(wxCommandEvent& WXUNUSED(event))
@@ -1159,7 +1171,7 @@ void MyFrame::OnAddTreeItem(wxCommandEvent& WXUNUSED(event))
     if (ctrl->IsContainer(selected)) {
         wxDataViewItem newitem = ctrl->AppendItem( selected, "Item", 0 );
         ctrl->Select(newitem);
-        ctrl->StartEditor(newitem, 0);
+        ctrl->EditItem(newitem, ctrl->GetColumn(0));
     }
 }