]> git.saurik.com Git - wxWidgets.git/commitdiff
Implement and test _HEADER_RIGHT_CLICK event for GTK+
authorRobert Roebling <robert@roebling.de>
Fri, 14 Sep 2007 20:36:19 +0000 (20:36 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 14 Sep 2007 20:36:19 +0000 (20:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/dataview/dataview.cpp
src/gtk/dataview.cpp

index 0c51ce4a6b3fec3764fab11a3b2348011b5e99fb..42d4f0a74b3c5888ff9fa89fb50a6ef11458650a 100644 (file)
@@ -829,7 +829,9 @@ void MyFrame::OnHeaderRightClick( wxDataViewEvent &event )
     if(!m_log)
         return;
 
-    wxLogMessage("wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, Column: %d", event.GetColumn());
+    int pos = m_musicCtrl->GetColumnPosition( event.GetDataViewColumn() );
+
+    wxLogMessage("wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, Column position: %d", pos );
 }
 
 void MyFrame::OnSorted( wxDataViewEvent &event )
index ef9823bf4a33696044c06418bbf4c36216dc7b4c..7c963e709c1c64dbe2350e7e0eb5797da6486f7b 100644 (file)
@@ -1975,6 +1975,16 @@ gtk_dataview_header_button_press_callback( GtkWidget *widget,
             return FALSE;
     }
 
+    if (gdk_event->button == 3)
+    {
+        wxDataViewCtrl *dv = column->GetOwner();
+        wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, dv->GetId() );
+        event.SetDataViewColumn( column );
+        event.SetModel( dv->GetModel() );
+        if (dv->GetEventHandler()->ProcessEvent( event ))
+            return FALSE;
+    }
+
     return FALSE;
 }