Update call signature for SwitchLayer

We don't use DC anymore
This commit is contained in:
Seth Hillbrand 2021-12-09 10:14:11 -08:00
parent 77fbb495f2
commit 9884f40952
5 changed files with 19 additions and 9 deletions

View File

@ -351,7 +351,12 @@ public:
PCB_LAYER_ID SelectOneLayer( PCB_LAYER_ID aDefaultLayer, LSET aNotAllowedLayersMask = LSET(),
wxPoint aDlgPosition = wxDefaultPosition );
virtual void SwitchLayer( wxDC* DC, PCB_LAYER_ID layer );
/**
* Change the active layer in the frame
*
* @param aLayer New layer to make active
*/
virtual void SwitchLayer( PCB_LAYER_ID aLayer );
virtual void SetActiveLayer( PCB_LAYER_ID aLayer ) { GetScreen()->m_Active_Layer = aLayer; }
virtual PCB_LAYER_ID GetActiveLayer() const { return GetScreen()->m_Active_Layer; }

View File

@ -75,7 +75,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
}
void PCB_EDIT_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
void PCB_EDIT_FRAME::SwitchLayer( PCB_LAYER_ID layer )
{
PCB_LAYER_ID curLayer = GetActiveLayer();
auto displ_opts = GetDisplayOptions();

View File

@ -576,7 +576,7 @@ EDA_3D_VIEWER_FRAME* PCB_BASE_FRAME::CreateAndShow3D_Frame()
}
void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
void PCB_BASE_FRAME::SwitchLayer( PCB_LAYER_ID layer )
{
PCB_LAYER_ID preslayer = GetActiveLayer();
auto& displ_opts = GetDisplayOptions();

View File

@ -548,7 +548,12 @@ public:
*/
void OnEditItemRequest( BOARD_ITEM* aItem ) override;
void SwitchLayer( wxDC* DC, PCB_LAYER_ID layer ) override;
/**
* Change the active layer in the editor
*
* @param layer New layer to make active
*/
void SwitchLayer( PCB_LAYER_ID layer ) override;
/**
* Modify one track segment width or one via diameter (using DRC control).

View File

@ -354,7 +354,7 @@ int PCB_CONTROL::RatsnestModeCycle( const TOOL_EVENT& aEvent )
int PCB_CONTROL::LayerSwitch( const TOOL_EVENT& aEvent )
{
m_frame->SwitchLayer( nullptr, aEvent.Parameter<PCB_LAYER_ID>() );
m_frame->SwitchLayer( aEvent.Parameter<PCB_LAYER_ID>() );
return 0;
}
@ -380,7 +380,7 @@ int PCB_CONTROL::LayerNext( const TOOL_EVENT& aEvent )
}
wxCHECK( IsCopperLayer( layer ), 0 );
editFrame->SwitchLayer( nullptr, ToLAYER_ID( layer ) );
editFrame->SwitchLayer( ToLAYER_ID( layer ) );
return 0;
}
@ -410,7 +410,7 @@ int PCB_CONTROL::LayerPrev( const TOOL_EVENT& aEvent )
wxCHECK( IsCopperLayer( layer ), 0 );
editFrame->SwitchLayer( nullptr, ToLAYER_ID( layer ) );
editFrame->SwitchLayer( ToLAYER_ID( layer ) );
return 0;
}
@ -422,9 +422,9 @@ int PCB_CONTROL::LayerToggle( const TOOL_EVENT& aEvent )
PCB_SCREEN* screen = m_frame->GetScreen();
if( currentLayer == screen->m_Route_Layer_TOP )
m_frame->SwitchLayer( nullptr, screen->m_Route_Layer_BOTTOM );
m_frame->SwitchLayer( screen->m_Route_Layer_BOTTOM );
else
m_frame->SwitchLayer( nullptr, screen->m_Route_Layer_TOP );
m_frame->SwitchLayer( screen->m_Route_Layer_TOP );
return 0;
}