]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dataview/dataview.cpp
Resolve ambiguity between GetClientXXX() methods in wxOSX wxComboBox.
[wxWidgets.git] / samples / dataview / dataview.cpp
index ed3d828173440f534a0a6d51836a248f127bb5e9..f3c8bb2074764a82dc907c1f4a0fd3b012011234 100644 (file)
@@ -189,7 +189,7 @@ public:
         return true;
     }
 
         return true;
     }
 
-    virtual bool Activate( wxRect WXUNUSED(cell),
+    virtual bool Activate( const wxRect& WXUNUSED(cell),
                            wxDataViewModel *WXUNUSED(model),
                            const wxDataViewItem &WXUNUSED(item),
                            unsigned int WXUNUSED(col) )
                            wxDataViewModel *WXUNUSED(model),
                            const wxDataViewItem &WXUNUSED(item),
                            unsigned int WXUNUSED(col) )
@@ -198,7 +198,8 @@ public:
         return false;
     }
 
         return false;
     }
 
-    virtual bool LeftClick( wxPoint cursor, wxRect WXUNUSED(cell),
+    virtual bool LeftClick(const wxPoint& cursor,
+                           const wxRect& WXUNUSED(cell),
                            wxDataViewModel *WXUNUSED(model),
                            const wxDataViewItem &WXUNUSED(item),
                            unsigned int WXUNUSED(col) )
                            wxDataViewModel *WXUNUSED(model),
                            const wxDataViewItem &WXUNUSED(item),
                            unsigned int WXUNUSED(col) )
@@ -539,10 +540,10 @@ void MyFrame::BuildDataViewCtrl(wxPanel* parent, unsigned int nPanel, unsigned l
             m_music_model = new MyMusicTreeModel;
             m_ctrl[0]->AssociateModel( m_music_model.get() );
 
             m_music_model = new MyMusicTreeModel;
             m_ctrl[0]->AssociateModel( m_music_model.get() );
 
-#if wxUSE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP && wxUSE_UNICODE
             m_ctrl[0]->EnableDragSource( wxDF_UNICODETEXT );
             m_ctrl[0]->EnableDropTarget( wxDF_UNICODETEXT );
             m_ctrl[0]->EnableDragSource( wxDF_UNICODETEXT );
             m_ctrl[0]->EnableDropTarget( wxDF_UNICODETEXT );
-#endif // wxUSE_DRAG_AND_DROP
+#endif // wxUSE_DRAG_AND_DROP && wxUSE_UNICODE
 
             // column 0 of the view control:
 
 
             // column 0 of the view control:
 
@@ -1159,8 +1160,11 @@ void MyFrame::OnAddTreeItem(wxCommandEvent& WXUNUSED(event))
 {
     wxDataViewTreeCtrl* ctrl = (wxDataViewTreeCtrl*) m_ctrl[3];
     wxDataViewItem selected = ctrl->GetSelection();
 {
     wxDataViewTreeCtrl* ctrl = (wxDataViewTreeCtrl*) m_ctrl[3];
     wxDataViewItem selected = ctrl->GetSelection();
-    if (ctrl->IsContainer(selected))
-        ctrl->AppendItem( selected, "Item", 0 );
+    if (ctrl->IsContainer(selected)) {
+        wxDataViewItem newitem = ctrl->AppendItem( selected, "Item", 0 );
+        ctrl->Select(newitem);
+        ctrl->StartEditor(newitem, 0);
+    }
 }
 
 void MyFrame::OnAddTreeContainerItem(wxCommandEvent& WXUNUSED(event))
 }
 
 void MyFrame::OnAddTreeContainerItem(wxCommandEvent& WXUNUSED(event))