void OnHeaderRightClick( wxDataViewEvent &event );
void OnSorted( wxDataViewEvent &event );
+ void OnContextMenu( wxDataViewEvent &event );
+
void OnRightClick( wxMouseEvent &event );
void OnGoto( wxCommandEvent &event);
EVT_DATAVIEW_COLUMN_HEADER_CLICK(ID_MUSIC_CTRL, MyFrame::OnHeaderClick)
EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED(ID_MUSIC_CTRL, MyFrame::OnHeaderRightClick)
EVT_DATAVIEW_COLUMN_SORTED(ID_MUSIC_CTRL, MyFrame::OnSorted)
+
+ EVT_DATAVIEW_ITEM_CONTEXT_MENU(ID_MUSIC_CTRL, MyFrame::OnContextMenu)
EVT_RIGHT_UP(MyFrame::OnRightClick)
END_EVENT_TABLE()
// wxDataViewTreeCtrl
wxDataViewTreeCtrl *treectrl2 = new wxDataViewTreeCtrl( this, -1, wxDefaultPosition, wxSize(300,200) );
+
wxImageList *ilist = new wxImageList;
ilist->Add( wxIcon(small1_xpm) );
+ treectrl2->SetImageList( ilist );
+
parent = treectrl2->AppendContainer( wxDataViewItem(0), "Root 1", 0 );
child = treectrl2->AppendItem( parent, "Child 1", 0 );
child = treectrl2->AppendItem( parent, "Child 2", 0 );
wxLogMessage("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED, Item: %s", title );
}
+void MyFrame::OnContextMenu( wxDataViewEvent &event )
+{
+ if (!m_log)
+ return;
+
+ wxString title = m_music_model->GetTitle( event.GetItem() );
+ wxLogMessage("wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, Item: %s", title );
+}
+
void MyFrame::OnHeaderClick( wxDataViewEvent &event )
{
if(!m_log)