do use context menu event under wxGTK, it is supported there now
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -39,6 +39,12 @@
|
|||||||
#error "menu sample requires wxUSE_MENUS=1"
|
#error "menu sample requires wxUSE_MENUS=1"
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
|
||||||
|
// not all ports have support for EVT_CONTEXT_MENU yet, don't define
|
||||||
|
// USE_CONTEXT_MENU for those which don't
|
||||||
|
#if !defined(__WXMOTIF__) && !defined(__WXPM__)
|
||||||
|
#define USE_CONTEXT_MENU
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "copy.xpm"
|
#include "copy.xpm"
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -98,7 +104,7 @@ protected:
|
|||||||
void OnUpdateSubMenuCheck(wxUpdateUIEvent& event);
|
void OnUpdateSubMenuCheck(wxUpdateUIEvent& event);
|
||||||
void OnUpdateSubMenuRadio(wxUpdateUIEvent& event);
|
void OnUpdateSubMenuRadio(wxUpdateUIEvent& event);
|
||||||
|
|
||||||
#if defined( __WXMSW__ ) || defined( __WXMAC__ )
|
#if USE_CONTEXT_MENU
|
||||||
void OnContextMenu(wxContextMenuEvent& event)
|
void OnContextMenu(wxContextMenuEvent& event)
|
||||||
{ ShowContextMenu(ScreenToClient(event.GetPosition())); }
|
{ ShowContextMenu(ScreenToClient(event.GetPosition())); }
|
||||||
#else
|
#else
|
||||||
@@ -261,7 +267,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
|||||||
|
|
||||||
EVT_UPDATE_UI(Menu_Menu_Check, MyFrame::OnUpdateCheckMenuItemUI)
|
EVT_UPDATE_UI(Menu_Menu_Check, MyFrame::OnUpdateCheckMenuItemUI)
|
||||||
|
|
||||||
#if defined( __WXMSW__ ) || defined( __WXMAC__ )
|
#if USE_CONTEXT_MENU
|
||||||
EVT_CONTEXT_MENU(MyFrame::OnContextMenu)
|
EVT_CONTEXT_MENU(MyFrame::OnContextMenu)
|
||||||
#else
|
#else
|
||||||
EVT_RIGHT_UP(MyFrame::OnRightUp)
|
EVT_RIGHT_UP(MyFrame::OnRightUp)
|
||||||
|
Reference in New Issue
Block a user