Loading common/tool/tool_dispatcher.cpp +9 −5 Original line number Original line Diff line number Diff line Loading @@ -237,10 +237,17 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) int mods = decodeModifiers( ke ); int mods = decodeModifiers( ke ); if( type == wxEVT_KEY_UP ) if( type == wxEVT_KEY_UP ) { if( key == WXK_ESCAPE ) evt = TOOL_EVENT( TC_Command, TA_CancelTool ); else evt = TOOL_EVENT( TC_Keyboard, TA_KeyUp, key | mods ); evt = TOOL_EVENT( TC_Keyboard, TA_KeyUp, key | mods ); } else else { evt = TOOL_EVENT( TC_Keyboard, TA_KeyDown, key | mods ); evt = TOOL_EVENT( TC_Keyboard, TA_KeyDown, key | mods ); } } } if( evt ) if( evt ) m_toolMgr->ProcessEvent( *evt ); m_toolMgr->ProcessEvent( *evt ); Loading @@ -263,8 +270,5 @@ void TOOL_DISPATCHER::DispatchWxCommand( wxCommandEvent &aEvent ) } } if( activateTool ) if( activateTool ) { m_toolMgr->InvokeTool( toolName ); TOOL_EVENT evt( TC_Command, TA_ActivateTool, toolName ); m_toolMgr->ProcessEvent( evt ); } } } common/tool/tool_manager.cpp +12 −3 Original line number Original line Diff line number Diff line Loading @@ -98,6 +98,9 @@ void TOOL_MANAGER::InvokeTool( TOOL_ID aToolId ) if( tool && tool->GetType() == TOOL_Interactive ) if( tool && tool->GetType() == TOOL_Interactive ) static_cast<TOOL_INTERACTIVE*>( tool )->Reset(); static_cast<TOOL_INTERACTIVE*>( tool )->Reset(); TOOL_EVENT evt( TC_Command, TA_ActivateTool, tool->GetName() ); ProcessEvent( evt ); } } Loading @@ -105,8 +108,8 @@ void TOOL_MANAGER::InvokeTool( const std::string& aName ) { { TOOL_BASE* tool = FindTool( aName ); TOOL_BASE* tool = FindTool( aName ); if( tool && tool->GetType() == TOOL_Interactive ) if( tool ) static_cast<TOOL_INTERACTIVE*>( tool )->Reset(); InvokeTool( tool->GetId() ); } } Loading Loading @@ -169,7 +172,10 @@ void TOOL_MANAGER::dispatchInternal( TOOL_EVENT& aEvent ) st->waitEvents.clear(); st->waitEvents.clear(); st->cofunc->Resume(); st->cofunc->Resume(); if( !st->cofunc->Running() ) if( !st->cofunc->Running() ) { delete st->cofunc; delete st->cofunc; st->cofunc = NULL; } } } } } else else Loading @@ -194,7 +200,10 @@ void TOOL_MANAGER::dispatchInternal( TOOL_EVENT& aEvent ) st->cofunc->Call( aEvent ); st->cofunc->Call( aEvent ); if( !st->cofunc->Running() ) if( !st->cofunc->Running() ) { delete st->cofunc; delete st->cofunc; st->cofunc = NULL; } } } } } } } Loading Loading
common/tool/tool_dispatcher.cpp +9 −5 Original line number Original line Diff line number Diff line Loading @@ -237,10 +237,17 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) int mods = decodeModifiers( ke ); int mods = decodeModifiers( ke ); if( type == wxEVT_KEY_UP ) if( type == wxEVT_KEY_UP ) { if( key == WXK_ESCAPE ) evt = TOOL_EVENT( TC_Command, TA_CancelTool ); else evt = TOOL_EVENT( TC_Keyboard, TA_KeyUp, key | mods ); evt = TOOL_EVENT( TC_Keyboard, TA_KeyUp, key | mods ); } else else { evt = TOOL_EVENT( TC_Keyboard, TA_KeyDown, key | mods ); evt = TOOL_EVENT( TC_Keyboard, TA_KeyDown, key | mods ); } } } if( evt ) if( evt ) m_toolMgr->ProcessEvent( *evt ); m_toolMgr->ProcessEvent( *evt ); Loading @@ -263,8 +270,5 @@ void TOOL_DISPATCHER::DispatchWxCommand( wxCommandEvent &aEvent ) } } if( activateTool ) if( activateTool ) { m_toolMgr->InvokeTool( toolName ); TOOL_EVENT evt( TC_Command, TA_ActivateTool, toolName ); m_toolMgr->ProcessEvent( evt ); } } }
common/tool/tool_manager.cpp +12 −3 Original line number Original line Diff line number Diff line Loading @@ -98,6 +98,9 @@ void TOOL_MANAGER::InvokeTool( TOOL_ID aToolId ) if( tool && tool->GetType() == TOOL_Interactive ) if( tool && tool->GetType() == TOOL_Interactive ) static_cast<TOOL_INTERACTIVE*>( tool )->Reset(); static_cast<TOOL_INTERACTIVE*>( tool )->Reset(); TOOL_EVENT evt( TC_Command, TA_ActivateTool, tool->GetName() ); ProcessEvent( evt ); } } Loading @@ -105,8 +108,8 @@ void TOOL_MANAGER::InvokeTool( const std::string& aName ) { { TOOL_BASE* tool = FindTool( aName ); TOOL_BASE* tool = FindTool( aName ); if( tool && tool->GetType() == TOOL_Interactive ) if( tool ) static_cast<TOOL_INTERACTIVE*>( tool )->Reset(); InvokeTool( tool->GetId() ); } } Loading Loading @@ -169,7 +172,10 @@ void TOOL_MANAGER::dispatchInternal( TOOL_EVENT& aEvent ) st->waitEvents.clear(); st->waitEvents.clear(); st->cofunc->Resume(); st->cofunc->Resume(); if( !st->cofunc->Running() ) if( !st->cofunc->Running() ) { delete st->cofunc; delete st->cofunc; st->cofunc = NULL; } } } } } else else Loading @@ -194,7 +200,10 @@ void TOOL_MANAGER::dispatchInternal( TOOL_EVENT& aEvent ) st->cofunc->Call( aEvent ); st->cofunc->Call( aEvent ); if( !st->cofunc->Running() ) if( !st->cofunc->Running() ) { delete st->cofunc; delete st->cofunc; st->cofunc = NULL; } } } } } } } Loading