Use the ACTION_ID offset when updating the layer pair bitmap.

This commit is contained in:
Jeff Young 2019-06-11 09:13:56 +01:00
parent b36f982272
commit 9f427da56f
3 changed files with 14 additions and 1 deletions

View File

@ -65,6 +65,12 @@ void ACTION_TOOLBAR::AddButton( const TOOL_ACTION& aAction )
}
void ACTION_TOOLBAR::SetToolBitmap( const TOOL_ACTION& aAction, const wxBitmap& aBitmap )
{
wxAuiToolBar::SetToolBitmap( aAction.GetId() + ACTION_ID, aBitmap );
}
void ACTION_TOOLBAR::Toggle( const TOOL_ACTION& aAction, bool aState )
{
int toolId = aAction.GetId() + ACTION_ID;

View File

@ -60,6 +60,13 @@ public:
*/
void AddButton( const TOOL_ACTION& aAction );
/**
* Function SetToolBitmap()
* Updates the bitmap of a particular tool. Not icon-based because we use it
* for the custom-drawn layer pair bitmap.
*/
void SetToolBitmap( const TOOL_ACTION& aAction, const wxBitmap& aBitmap );
/**
* Applies the default toggle action. For checked items this is check/uncheck; for
* non-checked items it's enable/disable.

View File

@ -206,7 +206,7 @@ void PCB_EDIT_FRAME::PrepareLayerIndicator()
if( m_mainToolBar )
{
m_mainToolBar->SetToolBitmap( PCB_ACTIONS::selectLayerPair.GetId(), *LayerPairBitmap );
m_mainToolBar->SetToolBitmap( PCB_ACTIONS::selectLayerPair, *LayerPairBitmap );
m_mainToolBar->Refresh();
}
}