Implemented (for GTK+) and tested dataview_context_menu event

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2007-12-16 15:16:52 +00:00
parent 6af3eec222
commit 74dea0decf
2 changed files with 59 additions and 2 deletions

View File

@@ -518,6 +518,8 @@ public:
void OnHeaderRightClick( wxDataViewEvent &event );
void OnSorted( wxDataViewEvent &event );
void OnContextMenu( wxDataViewEvent &event );
void OnRightClick( wxMouseEvent &event );
void OnGoto( wxCommandEvent &event);
@@ -609,6 +611,8 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
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()
@@ -868,6 +872,15 @@ void MyFrame::OnCollapsed( wxDataViewEvent &event )
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)