Fix dataview sample compilation with wxUSE_DRAG_AND_DROP==0.
This allows to build it under wxX11. Unfortunately it still doesn't work at all there. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -123,9 +123,11 @@ private:
|
|||||||
void OnHideAttributes( wxCommandEvent &event);
|
void OnHideAttributes( wxCommandEvent &event);
|
||||||
void OnShowAttributes( wxCommandEvent &event);
|
void OnShowAttributes( wxCommandEvent &event);
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
void OnBeginDrag( wxDataViewEvent &event );
|
void OnBeginDrag( wxDataViewEvent &event );
|
||||||
void OnDropPossible( wxDataViewEvent &event );
|
void OnDropPossible( wxDataViewEvent &event );
|
||||||
void OnDrop( wxDataViewEvent &event );
|
void OnDrop( wxDataViewEvent &event );
|
||||||
|
#endif // wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
void OnDataViewChar(wxKeyEvent& event);
|
void OnDataViewChar(wxKeyEvent& event);
|
||||||
|
|
||||||
@@ -345,9 +347,11 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
|||||||
|
|
||||||
EVT_DATAVIEW_ITEM_CONTEXT_MENU(ID_MUSIC_CTRL, MyFrame::OnContextMenu)
|
EVT_DATAVIEW_ITEM_CONTEXT_MENU(ID_MUSIC_CTRL, MyFrame::OnContextMenu)
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
EVT_DATAVIEW_ITEM_BEGIN_DRAG( ID_MUSIC_CTRL, MyFrame::OnBeginDrag )
|
EVT_DATAVIEW_ITEM_BEGIN_DRAG( ID_MUSIC_CTRL, MyFrame::OnBeginDrag )
|
||||||
EVT_DATAVIEW_ITEM_DROP_POSSIBLE( ID_MUSIC_CTRL, MyFrame::OnDropPossible )
|
EVT_DATAVIEW_ITEM_DROP_POSSIBLE( ID_MUSIC_CTRL, MyFrame::OnDropPossible )
|
||||||
EVT_DATAVIEW_ITEM_DROP( ID_MUSIC_CTRL, MyFrame::OnDrop )
|
EVT_DATAVIEW_ITEM_DROP( ID_MUSIC_CTRL, MyFrame::OnDrop )
|
||||||
|
#endif // wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
EVT_RIGHT_UP(MyFrame::OnRightClick)
|
EVT_RIGHT_UP(MyFrame::OnRightClick)
|
||||||
|
|
||||||
@@ -522,8 +526,10 @@ void MyFrame::BuildDataViewCtrl(wxPanel* parent, unsigned int nPanel, unsigned l
|
|||||||
m_music_model = new MyMusicTreeModel;
|
m_music_model = new MyMusicTreeModel;
|
||||||
m_ctrl[0]->AssociateModel( m_music_model.get() );
|
m_ctrl[0]->AssociateModel( m_music_model.get() );
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
m_ctrl[0]->EnableDragSource( wxDF_UNICODETEXT );
|
m_ctrl[0]->EnableDragSource( wxDF_UNICODETEXT );
|
||||||
m_ctrl[0]->EnableDropTarget( wxDF_UNICODETEXT );
|
m_ctrl[0]->EnableDropTarget( wxDF_UNICODETEXT );
|
||||||
|
#endif // wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
// column 0 of the view control:
|
// column 0 of the view control:
|
||||||
|
|
||||||
@@ -802,6 +808,8 @@ void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) )
|
|||||||
// MyFrame - event handlers for the first page
|
// MyFrame - event handlers for the first page
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
void MyFrame::OnBeginDrag( wxDataViewEvent &event )
|
void MyFrame::OnBeginDrag( wxDataViewEvent &event )
|
||||||
{
|
{
|
||||||
wxDataViewItem item( event.GetItem() );
|
wxDataViewItem item( event.GetItem() );
|
||||||
@@ -854,6 +862,8 @@ void MyFrame::OnDrop( wxDataViewEvent &event )
|
|||||||
wxLogMessage( "Text dropped: %s", obj.GetText() );
|
wxLogMessage( "Text dropped: %s", obj.GetText() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
void MyFrame::OnAddMozart( wxCommandEvent& WXUNUSED(event) )
|
void MyFrame::OnAddMozart( wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
m_music_model->AddToClassical( "Eine kleine Nachtmusik", "Wolfgang Mozart", 1787 );
|
m_music_model->AddToClassical( "Eine kleine Nachtmusik", "Wolfgang Mozart", 1787 );
|
||||||
|
Reference in New Issue
Block a user