diff --git a/gerbview/widgets/gerbview_layer_widget.cpp b/gerbview/widgets/gerbview_layer_widget.cpp index 0058f33873..93695643f6 100644 --- a/gerbview/widgets/gerbview_layer_widget.cpp +++ b/gerbview/widgets/gerbview_layer_widget.cpp @@ -50,7 +50,7 @@ GERBER_LAYER_WIDGET::GERBER_LAYER_WIDGET( GERBVIEW_FRAME* aParent, wxWindow* aFocusOwner ) : LAYER_WIDGET( aParent, aFocusOwner ), - myframe( aParent ) + m_frame( aParent ) { m_alwaysShowActiveLayer = false; @@ -111,10 +111,10 @@ void GERBER_LAYER_WIDGET::ReFillRender() for( unsigned row=0; rowGetVisibleElementColor( renderRows[row].id ); + renderRows[row].color = m_frame->GetVisibleElementColor( renderRows[row].id ); if( renderRows[row].id ) // if not the separator - renderRows[row].state = myframe->IsElementVisible( renderRows[row].id ); + renderRows[row].state = m_frame->IsElementVisible( renderRows[row].id ); } AppendRenderRows( renderRows, arrayDim(renderRows) ); @@ -182,19 +182,19 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event ) int layer = getDecodedId( cb->GetId() ); bool loc_visible = visible; - if( force_active_layer_visible && (layer == myframe->GetActiveLayer() ) ) + if( force_active_layer_visible && (layer == m_frame->GetActiveLayer() ) ) loc_visible = true; cb->SetValue( loc_visible ); visibleLayers[ row ] = loc_visible; } - myframe->SetVisibleLayers( visibleLayers ); - myframe->GetCanvas()->Refresh(); + m_frame->SetVisibleLayers( visibleLayers ); + m_frame->GetCanvas()->Refresh(); break; case ID_SORT_GBR_LAYERS: - myframe->SortLayersByX2Attributes(); + m_frame->SortLayersByX2Attributes(); break; } } @@ -221,14 +221,14 @@ void GERBER_LAYER_WIDGET::ReFill() { int aRow = findLayerRow( layer ); bool visible = true; - COLOR4D color = myframe->GetLayerColor( GERBER_DRAW_LAYER( layer ) ); + COLOR4D color = m_frame->GetLayerColor( GERBER_DRAW_LAYER( layer ) ); wxString msg = GetImagesList()->GetDisplayName( layer, /* include layer number */ false, /* Get the full name */ true ); - if( myframe->GetCanvas() ) - visible = myframe->GetCanvas()->GetView()->IsLayerVisible( GERBER_DRAW_LAYER( layer ) ); + if( m_frame->GetCanvas() ) + visible = m_frame->GetCanvas()->GetView()->IsLayerVisible( GERBER_DRAW_LAYER( layer ) ); else - visible = myframe->IsLayerVisible( layer ); + visible = m_frame->IsLayerVisible( layer ); if( aRow >= 0 ) updateLayerRow( findLayerRow( layer ), msg ); @@ -252,15 +252,15 @@ void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor ) { // NOTE: Active layer in GerbView is stored as 0-indexed, but layer color is // stored according to the GERBER_DRAW_LAYER() offset. - myframe->SetLayerColor( GERBER_DRAW_LAYER( aLayer ), aColor ); - myframe->m_SelLayerBox->ResyncBitmapOnly(); + m_frame->SetLayerColor( GERBER_DRAW_LAYER( aLayer ), aColor ); + m_frame->m_SelLayerBox->ResyncBitmapOnly(); - KIGFX::VIEW* view = myframe->GetCanvas()->GetView(); - auto settings = myframe->GetSettingsManager()->GetColorSettings(); + KIGFX::VIEW* view = m_frame->GetCanvas()->GetView(); + auto settings = m_frame->GetSettingsManager()->GetColorSettings(); view->GetPainter()->GetSettings()->LoadColors( settings ); view->UpdateLayerColor( GERBER_DRAW_LAYER( aLayer ) ); - myframe->GetCanvas()->Refresh(); + m_frame->GetCanvas()->Refresh(); } @@ -268,21 +268,21 @@ bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer ) { // the layer change from the GERBER_LAYER_WIDGET can be denied by returning // false from this function. - int layer = myframe->GetActiveLayer(); + int layer = m_frame->GetActiveLayer(); - myframe->SetActiveLayer( aLayer, false ); - myframe->syncLayerBox(); + m_frame->SetActiveLayer( aLayer, false ); + m_frame->syncLayerBox(); - if( layer != myframe->GetActiveLayer() ) + if( layer != m_frame->GetActiveLayer() ) { if( ! OnLayerSelected() ) { auto settings = static_cast - ( myframe->GetCanvas()->GetView()->GetPainter() )->GetSettings(); - int dcodeSelected = myframe->m_DCodeSelector->GetSelectedDCodeId(); + ( m_frame->GetCanvas()->GetView()->GetPainter() )->GetSettings(); + int dcodeSelected = m_frame->m_DCodeSelector->GetSelectedDCodeId(); settings->m_dcodeHighlightValue = dcodeSelected; - myframe->GetCanvas()->GetView()->UpdateAllItems( KIGFX::COLOR ); - myframe->GetCanvas()->Refresh(); + m_frame->GetCanvas()->GetView()->UpdateAllItems( KIGFX::COLOR ); + m_frame->GetCanvas()->Refresh(); } } @@ -292,48 +292,48 @@ bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer ) void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal ) { - LSET visibleLayers = myframe->GetVisibleLayers(); + LSET visibleLayers = m_frame->GetVisibleLayers(); visibleLayers[ aLayer ] = isVisible; - myframe->SetVisibleLayers( visibleLayers ); + m_frame->SetVisibleLayers( visibleLayers ); if( isFinal ) - myframe->GetCanvas()->Refresh(); + m_frame->GetCanvas()->Refresh(); } void GERBER_LAYER_WIDGET::OnRenderColorChange( int aId, COLOR4D aColor ) { - myframe->SetVisibleElementColor( aId, aColor ); + m_frame->SetVisibleElementColor( aId, aColor ); - auto view = myframe->GetCanvas()->GetView(); - COLOR_SETTINGS* settings = myframe->GetSettingsManager()->GetColorSettings(); + auto view = m_frame->GetCanvas()->GetView(); + COLOR_SETTINGS* settings = m_frame->GetSettingsManager()->GetColorSettings(); view->GetPainter()->GetSettings()->LoadColors( settings ); view->UpdateLayerColor( aId ); view->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); view->UpdateAllItems( KIGFX::COLOR ); - myframe->GetCanvas()->Refresh(); + m_frame->GetCanvas()->Refresh(); } void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled ) { - myframe->SetElementVisibility( aId, isEnabled ); + m_frame->SetElementVisibility( aId, isEnabled ); - if( myframe->GetCanvas() ) + if( m_frame->GetCanvas() ) { if( aId == LAYER_GERBVIEW_GRID ) { - myframe->GetCanvas()->GetGAL()->SetGridVisibility( myframe->IsGridVisible() ); - myframe->GetCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); + m_frame->GetCanvas()->GetGAL()->SetGridVisibility( m_frame->IsGridVisible() ); + m_frame->GetCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); } else - myframe->GetCanvas()->GetView()->SetLayerVisible( aId, isEnabled ); + m_frame->GetCanvas()->GetView()->SetLayerVisible( aId, isEnabled ); } - myframe->GetCanvas()->Refresh(); + m_frame->GetCanvas()->Refresh(); } //----------------------------------------------- diff --git a/gerbview/widgets/gerbview_layer_widget.h b/gerbview/widgets/gerbview_layer_widget.h index fa7a91a079..3d668eb4d3 100644 --- a/gerbview/widgets/gerbview_layer_widget.h +++ b/gerbview/widgets/gerbview_layer_widget.h @@ -120,7 +120,7 @@ private: GERBER_FILE_IMAGE_LIST* GetImagesList(); - GERBVIEW_FRAME* myframe; + GERBVIEW_FRAME* m_frame; bool m_alwaysShowActiveLayer; // If true: Only shows the current active layer // even if it is changed