refactoring: allow to run TOOL_MANAGER and SELECTION_TOOL without a host wxFrame

This commit is contained in:
Tomasz Włostowski
2017-11-03 20:02:06 +01:00
parent 06f3b35255
commit 781008bfa5
7 changed files with 251 additions and 142 deletions
+6 -2
View File
@@ -233,8 +233,12 @@ int ACTION_MANAGER::processHotKey( TOOL_ACTION* aAction )
if( ( hotkey & TOOL_ACTION::LEGACY_HK ) )
{
hotkey = hotkey & ~TOOL_ACTION::LEGACY_HK; // it leaves only HK_xxx identifier
EDA_DRAW_FRAME* frame = static_cast<EDA_DRAW_FRAME*>( m_toolMgr->GetEditFrame() );
EDA_HOTKEY* hk_desc = frame->GetHotKeyDescription( hotkey );
auto frame = dynamic_cast<EDA_DRAW_FRAME*>( m_toolMgr->GetEditFrame() );
EDA_HOTKEY* hk_desc = nullptr;
if( frame )
hk_desc = frame->GetHotKeyDescription( hotkey );
if( hk_desc )
{