Make gerbview compilable and working (does not use now layers and layer masks from Pcbnew).
Export to Pcbnew is broken, but it is a very rarely used feature. It will be fixed later.
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include <class_gbr_layer_box_selector.h>
|
||||
|
||||
#include <gerbview.h>
|
||||
#include <gerbview_frame.h>
|
||||
#include <class_GERBER.h>
|
||||
#include <layer_widget.h>
|
||||
#include <class_gerbview_layer_widget.h>
|
||||
@@ -166,10 +167,10 @@ void GERBER_LAYER_WIDGET::onRightDownLayers( wxMouseEvent& event )
|
||||
|
||||
void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
|
||||
{
|
||||
int rowCount;
|
||||
int menuId = event.GetId();
|
||||
bool visible = (menuId == ID_SHOW_ALL_LAYERS) ? true : false;;
|
||||
LSET visibleLayers = NO_LAYERS;
|
||||
int rowCount;
|
||||
int menuId = event.GetId();
|
||||
bool visible = (menuId == ID_SHOW_ALL_LAYERS) ? true : false;;
|
||||
long visibleLayers = 0;
|
||||
bool force_active_layer_visible;
|
||||
|
||||
m_alwaysShowActiveLayer = ( menuId == ID_ALWAYS_SHOW_NO_LAYERS_BUT_ACTIVE );
|
||||
@@ -186,7 +187,7 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
|
||||
for( int row=0; row < rowCount; ++row )
|
||||
{
|
||||
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, 3 );
|
||||
LAYER_NUM layer = getDecodedId( cb->GetId() );
|
||||
int layer = getDecodedId( cb->GetId() );
|
||||
bool loc_visible = visible;
|
||||
|
||||
if( force_active_layer_visible && (layer == myframe->getActiveLayer() ) )
|
||||
@@ -195,9 +196,9 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
|
||||
cb->SetValue( loc_visible );
|
||||
|
||||
if( loc_visible )
|
||||
visibleLayers |= GetLayerSet( row );
|
||||
visibleLayers |= 1 << row;
|
||||
else
|
||||
visibleLayers &= ~GetLayerSet( row );
|
||||
visibleLayers &= ~( 1 << row );
|
||||
}
|
||||
|
||||
myframe->SetVisibleLayers( visibleLayers );
|
||||
@@ -224,7 +225,7 @@ void GERBER_LAYER_WIDGET::ReFill()
|
||||
{
|
||||
ClearLayerRows();
|
||||
|
||||
for( LAYER_NUM layer = FIRST_LAYER; layer < NB_GERBER_LAYERS; ++layer )
|
||||
for( int layer = 0; layer < GERBER_DRAWLAYERS_COUNT; ++layer )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _("Layer %d"), layer+1 );
|
||||
@@ -244,11 +245,11 @@ void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, EDA_COLOR_T aColor )
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
bool GERBER_LAYER_WIDGET::OnLayerSelect( LAYER_NUM aLayer )
|
||||
bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer )
|
||||
{
|
||||
// the layer change from the GERBER_LAYER_WIDGET can be denied by returning
|
||||
// false from this function.
|
||||
LAYER_NUM layer = myframe->getActiveLayer( );
|
||||
int layer = myframe->getActiveLayer( );
|
||||
myframe->setActiveLayer( aLayer, false );
|
||||
myframe->syncLayerBox();
|
||||
|
||||
@@ -261,14 +262,14 @@ bool GERBER_LAYER_WIDGET::OnLayerSelect( LAYER_NUM aLayer )
|
||||
return true;
|
||||
}
|
||||
|
||||
void GERBER_LAYER_WIDGET::OnLayerVisible( LAYER_NUM aLayer, bool isVisible, bool isFinal )
|
||||
void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal )
|
||||
{
|
||||
LSET visibleLayers = myframe->GetVisibleLayers();
|
||||
long visibleLayers = myframe->GetVisibleLayers();
|
||||
|
||||
if( isVisible )
|
||||
visibleLayers |= GetLayerSet( aLayer );
|
||||
visibleLayers |= 1 << aLayer;
|
||||
else
|
||||
visibleLayers &= ~GetLayerSet( aLayer );
|
||||
visibleLayers &= ~( 1 << aLayer );
|
||||
|
||||
myframe->SetVisibleLayers( visibleLayers );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user