Added 'Reset Grid Origin' hot key (GAL).
This commit is contained in:
parent
b735f57fa4
commit
06637a17d6
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013 CERN
|
||||
* Copyright (C) 2013-2016 CERN
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -86,6 +86,7 @@ public:
|
|||
inline void SetPosition( const VECTOR2D& aPosition )
|
||||
{
|
||||
m_position = aPosition;
|
||||
ViewUpdate();
|
||||
}
|
||||
|
||||
inline const VECTOR2D& GetPosition() const
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013-2015 CERN
|
||||
* Copyright (C) 2013-2016 CERN
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -331,6 +331,10 @@ TOOL_ACTION COMMON_ACTIONS::gridSetOrigin( "common.Control.gridSetOrigin",
|
|||
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SET_GRID_ORIGIN ),
|
||||
"", "" );
|
||||
|
||||
TOOL_ACTION COMMON_ACTIONS::gridResetOrigin( "common.Control.gridResetOrigin",
|
||||
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_RESET_GRID_ORIGIN ),
|
||||
"", "" );
|
||||
|
||||
TOOL_ACTION COMMON_ACTIONS::gridPreset( "common.Control.gridPreset",
|
||||
AS_GLOBAL, 0,
|
||||
"", "" );
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013 CERN
|
||||
* Copyright (C) 2013-2016 CERN
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -230,6 +230,7 @@ public:
|
|||
static TOOL_ACTION gridNext;
|
||||
static TOOL_ACTION gridPrev;
|
||||
static TOOL_ACTION gridSetOrigin;
|
||||
static TOOL_ACTION gridResetOrigin;
|
||||
static TOOL_ACTION gridPreset;
|
||||
|
||||
// Track & via size control
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014 CERN
|
||||
* Copyright (C) 2014-2016 CERN
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -660,6 +660,15 @@ int PCBNEW_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
|
||||
int PCBNEW_CONTROL::GridResetOrigin( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
getModel<BOARD>()->SetGridOrigin( wxPoint( 0, 0 ) );
|
||||
m_gridOrigin->SetPosition( VECTOR2D( 0, 0 ) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int PCBNEW_CONTROL::GridPreset( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
long idx = aEvent.Parameter<long>();
|
||||
|
@ -978,6 +987,7 @@ void PCBNEW_CONTROL::SetTransitions()
|
|||
Go( &PCBNEW_CONTROL::GridNext, COMMON_ACTIONS::gridNext.MakeEvent() );
|
||||
Go( &PCBNEW_CONTROL::GridPrev, COMMON_ACTIONS::gridPrev.MakeEvent() );
|
||||
Go( &PCBNEW_CONTROL::GridSetOrigin, COMMON_ACTIONS::gridSetOrigin.MakeEvent() );
|
||||
Go( &PCBNEW_CONTROL::GridResetOrigin, COMMON_ACTIONS::gridResetOrigin.MakeEvent() );
|
||||
Go( &PCBNEW_CONTROL::GridPreset, COMMON_ACTIONS::gridPreset.MakeEvent() );
|
||||
|
||||
// Miscellaneous
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014 CERN
|
||||
* Copyright (C) 2014-2016 CERN
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -80,6 +80,7 @@ public:
|
|||
int GridNext( const TOOL_EVENT& aEvent );
|
||||
int GridPrev( const TOOL_EVENT& aEvent );
|
||||
int GridSetOrigin( const TOOL_EVENT& aEvent );
|
||||
int GridResetOrigin( const TOOL_EVENT& aEvent );
|
||||
int GridPreset( const TOOL_EVENT& aEvent );
|
||||
|
||||
// Miscellaneous
|
||||
|
|
Loading…
Reference in New Issue