diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index c097257c7b..9ec620b98a 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -466,7 +466,7 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event ) } else { - m_toolManager->RunAction( ACTIONS::gridPreset, true, static_cast( idx ) ); + m_toolManager->RunAction( ACTIONS::gridPreset, true, idx ); } UpdateStatusBar(); @@ -553,7 +553,7 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event ) if( id < 0 || !( id < (int)m_zoomSelectBox->GetCount() ) ) return; - m_toolManager->RunAction( ACTIONS::zoomPreset, true, static_cast( id ) ); + m_toolManager->RunAction( ACTIONS::zoomPreset, true, id ); UpdateStatusBar(); m_canvas->Refresh(); // Needed on Windows because clicking on m_zoomSelectBox remove the focus from m_canvas diff --git a/common/tool/actions.cpp b/common/tool/actions.cpp index c96f12f48b..a4e73b4eac 100644 --- a/common/tool/actions.cpp +++ b/common/tool/actions.cpp @@ -373,8 +373,10 @@ TOOL_ACTION ACTIONS::zoomTool( "common.Control.zoomTool", _( "Zoom to Selection" ), _( "Zoom to Selection" ), BITMAPS::zoom_area, AF_ACTIVATE ); -TOOL_ACTION ACTIONS::zoomPreset( "common.Control.zoomPreset", - AS_GLOBAL ); +TOOL_ACTION ACTIONS::zoomPreset( TOOL_ACTION_ARGS() + .Name( "common.Control.zoomPreset" ) + .Scope( AS_GLOBAL ) + .Parameter( static_cast( 0 ) ) ); // Default parameter is the 0th item in the list TOOL_ACTION ACTIONS::centerContents( "common.Control.centerContents", AS_GLOBAL ); @@ -541,8 +543,10 @@ TOOL_ACTION ACTIONS::gridResetOrigin( "common.Control.gridResetOrigin", 0, LEGACY_HK_NAME( "Reset Grid Origin" ), _( "Reset Grid Origin" ), "" ); -TOOL_ACTION ACTIONS::gridPreset( "common.Control.gridPreset", - AS_GLOBAL ); +TOOL_ACTION ACTIONS::gridPreset( TOOL_ACTION_ARGS() + .Name( "common.Control.gridPreset" ) + .Scope( AS_GLOBAL ) + .Parameter( static_cast( 0 ) ) ); // Default to the 1st element of the list TOOL_ACTION ACTIONS::toggleGrid( "common.Control.toggleGrid", AS_GLOBAL, 0, "", diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp index b960723707..5f73cf044d 100644 --- a/common/tool/common_tools.cpp +++ b/common/tool/common_tools.cpp @@ -103,7 +103,8 @@ int COMMON_TOOLS::SelectionTool( const TOOL_EVENT& aEvent ) // Cursor control int COMMON_TOOLS::CursorControl( const TOOL_EVENT& aEvent ) { - long type = aEvent.Parameter(); + long type = static_cast( aEvent.Parameter() ); + bool fastMove = type & ACTIONS::CURSOR_FAST_MOVE; type &= ~ACTIONS::CURSOR_FAST_MOVE; bool mirroredX = getView()->IsMirroredX(); @@ -170,7 +171,7 @@ int COMMON_TOOLS::CursorControl( const TOOL_EVENT& aEvent ) int COMMON_TOOLS::PanControl( const TOOL_EVENT& aEvent ) { - long type = aEvent.Parameter(); + ACTIONS::CURSOR_EVENT_TYPE type = aEvent.Parameter(); KIGFX::VIEW* view = getView(); VECTOR2D center = view->GetCenter(); VECTOR2D gridSize = getView()->GetGAL()->GetGridSize() * 10; @@ -383,8 +384,8 @@ int COMMON_TOOLS::CenterContents( const TOOL_EVENT& aEvent ) int COMMON_TOOLS::ZoomPreset( const TOOL_EVENT& aEvent ) { - unsigned int idx = aEvent.Parameter(); - return doZoomToPreset( (int) idx, false ); + int idx = aEvent.Parameter(); + return doZoomToPreset( idx, false ); }