Adding locking to the context menu for modules

Locking submenu was activated only for tracks and via but it makes sense
(and is probably expected) when right-clicking on modules as well.
This commit is contained in:
Seth Hillbrand 2018-05-02 08:34:13 -07:00
parent 73eab29802
commit 76d3b6f04a
3 changed files with 14 additions and 1 deletions

View File

@ -134,6 +134,14 @@ const KICAD_T GENERAL_COLLECTOR::Tracks[] = {
};
const KICAD_T GENERAL_COLLECTOR::LockableItems[] = {
PCB_MODULE_T,
PCB_TRACE_T,
PCB_VIA_T,
EOT
};
const KICAD_T GENERAL_COLLECTOR::Zones[] = {
PCB_ZONE_AREA_T,
EOT

View File

@ -304,6 +304,11 @@ public:
*/
static const KICAD_T Tracks[];
/**
* A scan list for TRACKS, VIAS, MODULES
*/
static const KICAD_T LockableItems[];
/**
* Constructor GENERALCOLLECTOR
*/

View File

@ -311,7 +311,7 @@ bool PCB_EDITOR_CONTROL::Init()
SELECTION_CONDITIONS::OnlyType( PCB_ZONE_AREA_T ) );
menu.AddMenu( lockMenu.get(), false,
SELECTION_CONDITIONS::OnlyTypes( GENERAL_COLLECTOR::Tracks ) );
SELECTION_CONDITIONS::OnlyTypes( GENERAL_COLLECTOR::LockableItems ) );
}
DRAWING_TOOL* drawingTool = m_toolMgr->GetTool<DRAWING_TOOL>();