Pcbnew: Allow changing layer color with left mouse button

Many users, particularly those on laptops, have no middle mouse button, and
thus have no way at all to set the layer colors.
This commit is contained in:
Simon Wells 2016-01-16 10:31:10 -05:00 committed by Chris Pavlina
parent e0beb36f1e
commit b125054afe
1 changed files with 4 additions and 3 deletions

View File

@ -422,9 +422,9 @@ void LAYER_WIDGET::insertLayerRow( int aRow, const ROW& aSpec )
// column 1 (COLUMN_COLORBM) // column 1 (COLUMN_COLORBM)
col = COLUMN_COLORBM; col = COLUMN_COLORBM;
wxBitmapButton* bmb = makeColorButton( m_LayerScrolledWindow, aSpec.color, encodeId( col, aSpec.id ) ); wxBitmapButton* bmb = makeColorButton( m_LayerScrolledWindow, aSpec.color, encodeId( col, aSpec.id ) );
bmb->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( LAYER_WIDGET::OnLeftDownLayers ), NULL, this ); bmb->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( LAYER_WIDGET::OnMiddleDownLayerColor ), NULL, this );
bmb->Connect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( LAYER_WIDGET::OnMiddleDownLayerColor ), NULL, this ); bmb->Connect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( LAYER_WIDGET::OnMiddleDownLayerColor ), NULL, this );
bmb->SetToolTip( _("Left click to select, middle click for color change, right click for menu" ) ); bmb->SetToolTip( _("Left click for color change, right click for menu" ) );
m_LayersFlexGridSizer->wxSizer::Insert( index+col, bmb, 0, flags ); m_LayersFlexGridSizer->wxSizer::Insert( index+col, bmb, 0, flags );
// column 2 (COLUMN_COLOR_LYR_CB) // column 2 (COLUMN_COLOR_LYR_CB)
@ -458,8 +458,9 @@ void LAYER_WIDGET::insertRenderRow( int aRow, const ROW& aSpec )
if( aSpec.color != -1 ) if( aSpec.color != -1 )
{ {
wxBitmapButton* bmb = makeColorButton( m_RenderScrolledWindow, aSpec.color, encodeId( col, aSpec.id ) ); wxBitmapButton* bmb = makeColorButton( m_RenderScrolledWindow, aSpec.color, encodeId( col, aSpec.id ) );
bmb->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( LAYER_WIDGET::OnMiddleDownRenderColor ), NULL, this );
bmb->Connect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( LAYER_WIDGET::OnMiddleDownRenderColor ), NULL, this ); bmb->Connect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( LAYER_WIDGET::OnMiddleDownRenderColor ), NULL, this );
bmb->SetToolTip( _( "Middle click for color change" ) ); bmb->SetToolTip( _( "Left click for color change" ) );
m_RenderFlexGridSizer->wxSizer::Insert( index+col, bmb, 0, flags ); m_RenderFlexGridSizer->wxSizer::Insert( index+col, bmb, 0, flags );
// could add a left click handler on the color button that toggles checkbox. // could add a left click handler on the color button that toggles checkbox.