Loading common/tool/context_menu.cpp +12 −4 Original line number Diff line number Diff line Loading @@ -60,8 +60,15 @@ CONTEXT_MENU::CONTEXT_MENU() m_tool = NULL; m_menu = new wxMenu(); m_handler = new CMEventHandler( this ); m_menu->Connect( wxEVT_MENU_HIGHLIGHT, wxEventHandler( CMEventHandler::onEvent ), NULL, m_handler ); m_menu->Connect( wxEVT_COMMAND_MENU_SELECTED, wxEventHandler( CMEventHandler::onEvent ), NULL, m_handler ); m_menu->Connect( wxEVT_MENU_HIGHLIGHT, wxEventHandler( CMEventHandler::onEvent ), NULL, m_handler ); m_menu->Connect( wxEVT_COMMAND_MENU_SELECTED, wxEventHandler( CMEventHandler::onEvent ), NULL, m_handler ); // Workaround for the case when mouse cursor never reaches menu (it hangs up tools using menu) wxMenuEvent menuEvent( wxEVT_MENU_HIGHLIGHT, 0, m_menu ); m_menu->AddPendingEvent( menuEvent ); m_titleSet = false; } Loading @@ -75,6 +82,7 @@ CONTEXT_MENU::~CONTEXT_MENU() void CONTEXT_MENU::SetTitle( const wxString& aTitle ) { // Unfortunately wxMenu::SetTitle() does nothing.. if( m_titleSet ) { m_menu->Delete( m_menu->FindItemByPosition( 0 ) ); // fixme: this is LAME! Loading include/tool/context_menu.h +2 −2 File changed.Contains only whitespace changes. Show changes Loading
common/tool/context_menu.cpp +12 −4 Original line number Diff line number Diff line Loading @@ -60,8 +60,15 @@ CONTEXT_MENU::CONTEXT_MENU() m_tool = NULL; m_menu = new wxMenu(); m_handler = new CMEventHandler( this ); m_menu->Connect( wxEVT_MENU_HIGHLIGHT, wxEventHandler( CMEventHandler::onEvent ), NULL, m_handler ); m_menu->Connect( wxEVT_COMMAND_MENU_SELECTED, wxEventHandler( CMEventHandler::onEvent ), NULL, m_handler ); m_menu->Connect( wxEVT_MENU_HIGHLIGHT, wxEventHandler( CMEventHandler::onEvent ), NULL, m_handler ); m_menu->Connect( wxEVT_COMMAND_MENU_SELECTED, wxEventHandler( CMEventHandler::onEvent ), NULL, m_handler ); // Workaround for the case when mouse cursor never reaches menu (it hangs up tools using menu) wxMenuEvent menuEvent( wxEVT_MENU_HIGHLIGHT, 0, m_menu ); m_menu->AddPendingEvent( menuEvent ); m_titleSet = false; } Loading @@ -75,6 +82,7 @@ CONTEXT_MENU::~CONTEXT_MENU() void CONTEXT_MENU::SetTitle( const wxString& aTitle ) { // Unfortunately wxMenu::SetTitle() does nothing.. if( m_titleSet ) { m_menu->Delete( m_menu->FindItemByPosition( 0 ) ); // fixme: this is LAME! Loading