Commit 87c9423f authored by Maciej Suminski's avatar Maciej Suminski

PCB_EDIT_FRAME::SetActiveLayer() & GetActiveLayer() made public.

parent 0694f2fa
...@@ -134,22 +134,6 @@ protected: ...@@ -134,22 +134,6 @@ protected:
void createPopUpBlockMenu( wxMenu* menu ); void createPopUpBlockMenu( wxMenu* menu );
void createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu ); void createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu );
/**
* Function setActiveLayer
* will change the currently active layer to \a aLayer and also
* update the PCB_LAYER_WIDGET.
*/
void setActiveLayer( LAYER_NUM aLayer, bool doLayerWidgetUpdate = true );
/**
* Function getActiveLayer
* returns the active layer
*/
LAYER_NUM getActiveLayer()
{
return ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer;
}
/** /**
* Function setHighContrastLayer * Function setHighContrastLayer
* takes care of display settings for the given layer to be displayed in high contrast mode. * takes care of display settings for the given layer to be displayed in high contrast mode.
...@@ -159,7 +143,7 @@ protected: ...@@ -159,7 +143,7 @@ protected:
/** /**
* Function syncLayerWidgetLayer * Function syncLayerWidgetLayer
* updates the currently layer "selection" within the PCB_LAYER_WIDGET. * updates the currently layer "selection" within the PCB_LAYER_WIDGET.
* The currently selected layer is defined by the return value of getActiveLayer(). * The currently selected layer is defined by the return value of GetActiveLayer().
* <p> * <p>
* This function cannot be inline without including layer_widget.h in * This function cannot be inline without including layer_widget.h in
* here and we do not want to do that. * here and we do not want to do that.
...@@ -577,6 +561,22 @@ public: ...@@ -577,6 +561,22 @@ public:
*/ */
void SetTopLayer( LAYER_NUM aLayer ); void SetTopLayer( LAYER_NUM aLayer );
/**
* Function SetActiveLayer
* will change the currently active layer to \a aLayer and also
* update the PCB_LAYER_WIDGET.
*/
void SetActiveLayer( LAYER_NUM aLayer, bool doLayerWidgetUpdate = true );
/**
* Function GetActiveLayer
* returns the active layer
*/
LAYER_NUM GetActiveLayer()
{
return ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer;
}
/** /**
* Function IsElementVisible * Function IsElementVisible
* tests whether a given element category is visible. Keep this as an * tests whether a given element category is visible. Keep this as an
......
...@@ -183,7 +183,7 @@ void PCB_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event ) ...@@ -183,7 +183,7 @@ void PCB_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
if( IsCopperLayer( layer ) ) if( IsCopperLayer( layer ) )
{ {
bool loc_visible = visible; bool loc_visible = visible;
if( force_active_layer_visible && (layer == myframe->getActiveLayer() ) ) if( force_active_layer_visible && (layer == myframe->GetActiveLayer() ) )
loc_visible = true; loc_visible = true;
cb->SetValue( loc_visible ); cb->SetValue( loc_visible );
...@@ -354,7 +354,7 @@ bool PCB_LAYER_WIDGET::OnLayerSelect( LAYER_NUM aLayer ) ...@@ -354,7 +354,7 @@ bool PCB_LAYER_WIDGET::OnLayerSelect( LAYER_NUM aLayer )
{ {
// the layer change from the PCB_LAYER_WIDGET can be denied by returning // the layer change from the PCB_LAYER_WIDGET can be denied by returning
// false from this function. // false from this function.
myframe->setActiveLayer( aLayer, false ); myframe->SetActiveLayer( aLayer, false );
if( m_alwaysShowActiveCopperLayer ) if( m_alwaysShowActiveCopperLayer )
OnLayerSelected(); OnLayerSelected();
......
...@@ -53,7 +53,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack ) ...@@ -53,7 +53,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
{ {
if( g_CurrentTrackList.GetCount() > 0 ) if( g_CurrentTrackList.GetCount() > 0 )
{ {
LAYER_NUM previous_layer = getActiveLayer(); LAYER_NUM previous_layer = GetActiveLayer();
DBG( g_CurrentTrackList.VerifyListIntegrity(); ) DBG( g_CurrentTrackList.VerifyListIntegrity(); )
...@@ -86,7 +86,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack ) ...@@ -86,7 +86,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
// Correct active layer which could change if a via // Correct active layer which could change if a via
// has been erased // has been erased
setActiveLayer( previous_layer ); SetActiveLayer( previous_layer );
UpdateStatusBar(); UpdateStatusBar();
......
...@@ -228,7 +228,7 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -228,7 +228,7 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
// Apply new display options to the GAL canvas (this is faster than recaching) // Apply new display options to the GAL canvas (this is faster than recaching)
settings->LoadDisplayOptions( DisplayOpt ); settings->LoadDisplayOptions( DisplayOpt );
setHighContrastLayer( getActiveLayer() ); setHighContrastLayer( GetActiveLayer() );
m_canvas->Refresh(); m_canvas->Refresh();
break; break;
......
...@@ -39,7 +39,7 @@ DIALOG_GLOBAL_DELETION::DIALOG_GLOBAL_DELETION( PCB_EDIT_FRAME* parent ) ...@@ -39,7 +39,7 @@ DIALOG_GLOBAL_DELETION::DIALOG_GLOBAL_DELETION( PCB_EDIT_FRAME* parent )
void PCB_EDIT_FRAME::InstallPcbGlobalDeleteFrame( const wxPoint& pos ) void PCB_EDIT_FRAME::InstallPcbGlobalDeleteFrame( const wxPoint& pos )
{ {
DIALOG_GLOBAL_DELETION dlg( this ); DIALOG_GLOBAL_DELETION dlg( this );
dlg.SetCurrentLayer( getActiveLayer() ); dlg.SetCurrentLayer( GetActiveLayer() );
dlg.ShowModal(); dlg.ShowModal();
} }
......
...@@ -670,11 +670,11 @@ void PCB_EDIT_FRAME::InstallDialogLayerSetup() ...@@ -670,11 +670,11 @@ void PCB_EDIT_FRAME::InstallDialogLayerSetup()
if( dlg.ShowModal() == wxID_CANCEL ) if( dlg.ShowModal() == wxID_CANCEL )
return; return;
wxLogDebug( wxT( "Current layer selected %d." ), getActiveLayer() ); wxLogDebug( wxT( "Current layer selected %d." ), GetActiveLayer() );
// If the current active layer was removed, find the next avaiable layer to set as the // If the current active layer was removed, find the next avaiable layer to set as the
// active layer. // active layer.
if( !( GetLayerMask( getActiveLayer() ) & GetBoard()->GetEnabledLayers() ) ) if( !( GetLayerMask( GetActiveLayer() ) & GetBoard()->GetEnabledLayers() ) )
{ {
for( LAYER_NUM i = FIRST_LAYER; i < NB_LAYERS; ++i ) for( LAYER_NUM i = FIRST_LAYER; i < NB_LAYERS; ++i )
{ {
...@@ -685,14 +685,14 @@ void PCB_EDIT_FRAME::InstallDialogLayerSetup() ...@@ -685,14 +685,14 @@ void PCB_EDIT_FRAME::InstallDialogLayerSetup()
if( GetLayerMask( tmp ) & GetBoard()->GetEnabledLayers() ) if( GetLayerMask( tmp ) & GetBoard()->GetEnabledLayers() )
{ {
wxLogDebug( wxT( "Setting current layer to %d." ), getActiveLayer() ); wxLogDebug( wxT( "Setting current layer to %d." ), GetActiveLayer() );
setActiveLayer( tmp, true ); SetActiveLayer( tmp, true );
break; break;
} }
} }
} }
else else
{ {
setActiveLayer( getActiveLayer(), true ); SetActiveLayer( GetActiveLayer(), true );
} }
} }
...@@ -251,7 +251,7 @@ DIMENSION* PCB_EDIT_FRAME::EditDimension( DIMENSION* aDimension, wxDC* aDC ) ...@@ -251,7 +251,7 @@ DIMENSION* PCB_EDIT_FRAME::EditDimension( DIMENSION* aDimension, wxDC* aDC )
aDimension = new DIMENSION( GetBoard() ); aDimension = new DIMENSION( GetBoard() );
aDimension->SetFlags( IS_NEW ); aDimension->SetFlags( IS_NEW );
aDimension->SetLayer( getActiveLayer() ); aDimension->SetLayer( GetActiveLayer() );
aDimension->SetOrigin( pos ); aDimension->SetOrigin( pos );
aDimension->SetEnd( pos ); aDimension->SetEnd( pos );
......
...@@ -406,14 +406,14 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -406,14 +406,14 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
m_canvas->SetIgnoreMouseEvents( true ); m_canvas->SetIgnoreMouseEvents( true );
wxPoint dlgPosition; wxPoint dlgPosition;
wxGetMousePosition( &dlgPosition.x, &dlgPosition.y ); wxGetMousePosition( &dlgPosition.x, &dlgPosition.y );
LAYER_NUM layer = SelectLayer( getActiveLayer(), ALL_NO_CU_LAYERS, LAYER_NUM layer = SelectLayer( GetActiveLayer(), ALL_NO_CU_LAYERS,
dlgPosition ); dlgPosition );
m_canvas->SetIgnoreMouseEvents( false ); m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
if( getActiveLayer() != layer ) if( GetActiveLayer() != layer )
{ {
GetScreen()->m_Route_Layer_TOP = getActiveLayer(); GetScreen()->m_Route_Layer_TOP = GetActiveLayer();
GetScreen()->m_Route_Layer_BOTTOM = layer; GetScreen()->m_Route_Layer_BOTTOM = layer;
Other_Layer_Route( (TRACK*) GetCurItem(), &dc ); Other_Layer_Route( (TRACK*) GetCurItem(), &dc );
} }
...@@ -942,17 +942,17 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -942,17 +942,17 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_PCB_SELECT_LAYER: case ID_POPUP_PCB_SELECT_LAYER:
itmp = SelectLayer( getActiveLayer() ); itmp = SelectLayer( GetActiveLayer() );
if( itmp >= 0 ) if( itmp >= 0 )
{ {
// if user changed colors and we are in high contrast mode, then redraw // if user changed colors and we are in high contrast mode, then redraw
// because the PAD_SMD pads may change color. // because the PAD_SMD pads may change color.
if( DisplayOpt.ContrastModeDisplay && getActiveLayer() != itmp ) if( DisplayOpt.ContrastModeDisplay && GetActiveLayer() != itmp )
{ {
m_canvas->Refresh(); m_canvas->Refresh();
} }
setActiveLayer( itmp ); SetActiveLayer( itmp );
} }
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
...@@ -963,19 +963,19 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -963,19 +963,19 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_PCB_SELECT_NO_CU_LAYER: case ID_POPUP_PCB_SELECT_NO_CU_LAYER:
itmp = SelectLayer( getActiveLayer(), ALL_CU_LAYERS ); itmp = SelectLayer( GetActiveLayer(), ALL_CU_LAYERS );
if( itmp >= 0 ) if( itmp >= 0 )
setActiveLayer( itmp ); SetActiveLayer( itmp );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
break; break;
case ID_POPUP_PCB_SELECT_CU_LAYER: case ID_POPUP_PCB_SELECT_CU_LAYER:
itmp = SelectLayer( getActiveLayer(), ALL_NO_CU_LAYERS ); itmp = SelectLayer( GetActiveLayer(), ALL_NO_CU_LAYERS );
if( itmp >= 0 ) if( itmp >= 0 )
setActiveLayer( itmp ); SetActiveLayer( itmp );
break; break;
...@@ -985,7 +985,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -985,7 +985,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_TOOLBARH_PCB_SELECT_LAYER: case ID_TOOLBARH_PCB_SELECT_LAYER:
setActiveLayer( m_SelLayerBox->GetLayerSelection() ); SetActiveLayer( m_SelLayerBox->GetLayerSelection() );
if( DisplayOpt.ContrastModeDisplay ) if( DisplayOpt.ContrastModeDisplay )
m_canvas->Refresh( true ); m_canvas->Refresh( true );
...@@ -1288,7 +1288,7 @@ void PCB_EDIT_FRAME::RemoveStruct( BOARD_ITEM* Item, wxDC* DC ) ...@@ -1288,7 +1288,7 @@ void PCB_EDIT_FRAME::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
void PCB_EDIT_FRAME::SwitchLayer( wxDC* DC, LAYER_NUM layer ) void PCB_EDIT_FRAME::SwitchLayer( wxDC* DC, LAYER_NUM layer )
{ {
LAYER_NUM curLayer = getActiveLayer(); LAYER_NUM curLayer = GetActiveLayer();
// Check if the specified layer matches the present layer // Check if the specified layer matches the present layer
if( layer == curLayer ) if( layer == curLayer )
...@@ -1330,7 +1330,7 @@ void PCB_EDIT_FRAME::SwitchLayer( wxDC* DC, LAYER_NUM layer ) ...@@ -1330,7 +1330,7 @@ void PCB_EDIT_FRAME::SwitchLayer( wxDC* DC, LAYER_NUM layer )
GetScreen()->m_Route_Layer_TOP = curLayer; GetScreen()->m_Route_Layer_TOP = curLayer;
GetScreen()->m_Route_Layer_BOTTOM = layer; GetScreen()->m_Route_Layer_BOTTOM = layer;
setActiveLayer( curLayer ); SetActiveLayer( curLayer );
if( Other_Layer_Route( (TRACK*) GetScreen()->GetCurItem(), DC ) ) if( Other_Layer_Route( (TRACK*) GetScreen()->GetCurItem(), DC ) )
{ {
...@@ -1351,7 +1351,7 @@ void PCB_EDIT_FRAME::SwitchLayer( wxDC* DC, LAYER_NUM layer ) ...@@ -1351,7 +1351,7 @@ void PCB_EDIT_FRAME::SwitchLayer( wxDC* DC, LAYER_NUM layer )
// and a non-copper layer, or vice-versa? // and a non-copper layer, or vice-versa?
// ... // ...
setActiveLayer( layer ); SetActiveLayer( layer );
if( DisplayOpt.ContrastModeDisplay ) if( DisplayOpt.ContrastModeDisplay )
m_canvas->Refresh(); m_canvas->Refresh();
......
...@@ -246,7 +246,7 @@ DRAWSEGMENT* PCB_EDIT_FRAME::Begin_DrawSegment( DRAWSEGMENT* Segment, STROKE_T s ...@@ -246,7 +246,7 @@ DRAWSEGMENT* PCB_EDIT_FRAME::Begin_DrawSegment( DRAWSEGMENT* Segment, STROKE_T s
s_large = GetDesignSettings().m_DrawSegmentWidth; s_large = GetDesignSettings().m_DrawSegmentWidth;
if( getActiveLayer() == EDGE_N ) if( GetActiveLayer() == EDGE_N )
{ {
s_large = GetDesignSettings().m_EdgeSegmentWidth; s_large = GetDesignSettings().m_EdgeSegmentWidth;
} }
...@@ -255,7 +255,7 @@ DRAWSEGMENT* PCB_EDIT_FRAME::Begin_DrawSegment( DRAWSEGMENT* Segment, STROKE_T s ...@@ -255,7 +255,7 @@ DRAWSEGMENT* PCB_EDIT_FRAME::Begin_DrawSegment( DRAWSEGMENT* Segment, STROKE_T s
{ {
SetCurItem( Segment = new DRAWSEGMENT( GetBoard() ) ); SetCurItem( Segment = new DRAWSEGMENT( GetBoard() ) );
Segment->SetFlags( IS_NEW ); Segment->SetFlags( IS_NEW );
Segment->SetLayer( getActiveLayer() ); Segment->SetLayer( GetActiveLayer() );
Segment->SetWidth( s_large ); Segment->SetWidth( s_large );
Segment->SetShape( shape ); Segment->SetShape( shape );
Segment->SetAngle( 900 ); Segment->SetAngle( 900 );
......
...@@ -51,10 +51,10 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) ...@@ -51,10 +51,10 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
if( aTrack == NULL ) if( aTrack == NULL )
{ {
if( getActiveLayer() != ((PCB_SCREEN*)GetScreen())->m_Route_Layer_TOP ) if( GetActiveLayer() != ((PCB_SCREEN*)GetScreen())->m_Route_Layer_TOP )
setActiveLayer( ((PCB_SCREEN*)GetScreen())->m_Route_Layer_TOP ); SetActiveLayer( ((PCB_SCREEN*)GetScreen())->m_Route_Layer_TOP );
else else
setActiveLayer(((PCB_SCREEN*)GetScreen())->m_Route_Layer_BOTTOM ); SetActiveLayer(((PCB_SCREEN*)GetScreen())->m_Route_Layer_BOTTOM );
UpdateStatusBar(); UpdateStatusBar();
return true; return true;
...@@ -108,7 +108,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) ...@@ -108,7 +108,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
via->SetLayerPair( LAYER_N_BACK, LAYER_N_FRONT ); via->SetLayerPair( LAYER_N_BACK, LAYER_N_FRONT );
via->SetDrill( GetBoard()->GetCurrentViaDrill() ); via->SetDrill( GetBoard()->GetCurrentViaDrill() );
LAYER_NUM first_layer = getActiveLayer(); LAYER_NUM first_layer = GetActiveLayer();
LAYER_NUM last_layer; LAYER_NUM last_layer;
// prepare switch to new active layer: // prepare switch to new active layer:
...@@ -171,7 +171,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) ...@@ -171,7 +171,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
return false; return false;
} }
setActiveLayer( last_layer ); SetActiveLayer( last_layer );
TRACK* lastNonVia = g_CurrentTrackSegment; TRACK* lastNonVia = g_CurrentTrackSegment;
...@@ -193,7 +193,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) ...@@ -193,7 +193,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
*/ */
// set the layer to the new value // set the layer to the new value
track->SetLayer( getActiveLayer() ); track->SetLayer( GetActiveLayer() );
/* the start point is the via position and the end point is the cursor /* the start point is the via position and the end point is the cursor
* which also is on the via (will change when moving mouse) * which also is on the via (will change when moving mouse)
......
...@@ -263,7 +263,7 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit ...@@ -263,7 +263,7 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
break; break;
case HK_SWITCH_LAYER_TO_PREVIOUS: case HK_SWITCH_LAYER_TO_PREVIOUS:
ll = getActiveLayer(); ll = GetActiveLayer();
if( (ll <= LAYER_N_BACK) || (ll > LAYER_N_FRONT) ) if( (ll <= LAYER_N_BACK) || (ll > LAYER_N_FRONT) )
break; break;
...@@ -279,7 +279,7 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit ...@@ -279,7 +279,7 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
break; break;
case HK_SWITCH_LAYER_TO_NEXT: case HK_SWITCH_LAYER_TO_NEXT:
ll = getActiveLayer(); ll = GetActiveLayer();
if( (ll < LAYER_N_BACK) || (ll >= LAYER_N_FRONT) ) if( (ll < LAYER_N_BACK) || (ll >= LAYER_N_FRONT) )
break; break;
...@@ -397,7 +397,7 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit ...@@ -397,7 +397,7 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
break; break;
case HK_BACK_SPACE: case HK_BACK_SPACE:
if( IsCopperLayer( getActiveLayer() ) ) if( IsCopperLayer( GetActiveLayer() ) )
{ {
if( !itemCurrentlyEdited ) if( !itemCurrentlyEdited )
{ {
...@@ -622,7 +622,7 @@ bool PCB_EDIT_FRAME::OnHotkeyDeleteItem( wxDC* aDC ) ...@@ -622,7 +622,7 @@ bool PCB_EDIT_FRAME::OnHotkeyDeleteItem( wxDC* aDC )
switch( GetToolId() ) switch( GetToolId() )
{ {
case ID_TRACK_BUTT: case ID_TRACK_BUTT:
if( getActiveLayer() > LAYER_N_FRONT ) if( GetActiveLayer() > LAYER_N_FRONT )
return false; return false;
if( ItemFree ) if( ItemFree )
...@@ -983,7 +983,7 @@ bool PCB_EDIT_FRAME::OnHotkeyPlaceItem( wxDC* aDC ) ...@@ -983,7 +983,7 @@ bool PCB_EDIT_FRAME::OnHotkeyPlaceItem( wxDC* aDC )
TRACK * PCB_EDIT_FRAME::OnHotkeyBeginRoute( wxDC* aDC ) TRACK * PCB_EDIT_FRAME::OnHotkeyBeginRoute( wxDC* aDC )
{ {
if( getActiveLayer() > LAYER_N_FRONT ) if( GetActiveLayer() > LAYER_N_FRONT )
return NULL; return NULL;
bool itemCurrentlyEdited = (GetCurItem() && GetCurItem()->GetFlags()); bool itemCurrentlyEdited = (GetCurItem() && GetCurItem()->GetFlags());
......
...@@ -243,7 +243,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -243,7 +243,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( GetToolId() == ID_PCB_ARC_BUTT ) if( GetToolId() == ID_PCB_ARC_BUTT )
shape = S_ARC; shape = S_ARC;
if( IsCopperLayer( getActiveLayer() ) ) if( IsCopperLayer( GetActiveLayer() ) )
{ {
DisplayError( this, _( "Graphic not allowed on Copper layers" ) ); DisplayError( this, _( "Graphic not allowed on Copper layers" ) );
break; break;
...@@ -267,7 +267,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -267,7 +267,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
break; break;
case ID_TRACK_BUTT: case ID_TRACK_BUTT:
if( !IsCopperLayer( getActiveLayer() ) ) if( !IsCopperLayer( GetActiveLayer() ) )
{ {
DisplayError( this, _( "Tracks on Copper layers only " ) ); DisplayError( this, _( "Tracks on Copper layers only " ) );
break; break;
...@@ -325,7 +325,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -325,7 +325,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
break; break;
case ID_PCB_ADD_TEXT_BUTT: case ID_PCB_ADD_TEXT_BUTT:
if( IsLayerInList( EDGE_LAYER, getActiveLayer() ) ) if( IsLayerInList( EDGE_LAYER, GetActiveLayer() ) )
{ {
DisplayError( this, DisplayError( this,
_( "Texts not allowed on Edge Cut layer" ) ); _( "Texts not allowed on Edge Cut layer" ) );
...@@ -374,7 +374,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -374,7 +374,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
break; break;
case ID_PCB_DIMENSION_BUTT: case ID_PCB_DIMENSION_BUTT:
if( IsLayerInList( EDGE_LAYER|ALL_CU_LAYERS, getActiveLayer() ) ) if( IsLayerInList( EDGE_LAYER|ALL_CU_LAYERS, GetActiveLayer() ) )
{ {
DisplayError( this, DisplayError( this,
_( "Dimension not allowed on Copper or Edge Cut layers" ) ); _( "Dimension not allowed on Copper or Edge Cut layers" ) );
......
...@@ -842,7 +842,7 @@ void PCB_EDIT_FRAME::SetGridColor(EDA_COLOR_T aColor) ...@@ -842,7 +842,7 @@ void PCB_EDIT_FRAME::SetGridColor(EDA_COLOR_T aColor)
bool PCB_EDIT_FRAME::IsMicroViaAcceptable( void ) bool PCB_EDIT_FRAME::IsMicroViaAcceptable( void )
{ {
int copperlayercnt = GetBoard()->GetCopperLayerCount( ); int copperlayercnt = GetBoard()->GetCopperLayerCount( );
LAYER_NUM currLayer = getActiveLayer(); LAYER_NUM currLayer = GetActiveLayer();
if( !GetDesignSettings().m_MicroViasAllowed ) if( !GetDesignSettings().m_MicroViasAllowed )
return false; // Obvious.. return false; // Obvious..
...@@ -946,7 +946,7 @@ void PCB_EDIT_FRAME::SetTopLayer( LAYER_NUM aLayer ) ...@@ -946,7 +946,7 @@ void PCB_EDIT_FRAME::SetTopLayer( LAYER_NUM aLayer )
} }
void PCB_EDIT_FRAME::setActiveLayer( LAYER_NUM aLayer, bool doLayerWidgetUpdate ) void PCB_EDIT_FRAME::SetActiveLayer( LAYER_NUM aLayer, bool doLayerWidgetUpdate )
{ {
( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = aLayer; ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = aLayer;
...@@ -962,7 +962,7 @@ void PCB_EDIT_FRAME::setActiveLayer( LAYER_NUM aLayer, bool doLayerWidgetUpdate ...@@ -962,7 +962,7 @@ void PCB_EDIT_FRAME::setActiveLayer( LAYER_NUM aLayer, bool doLayerWidgetUpdate
void PCB_EDIT_FRAME::syncLayerWidgetLayer() void PCB_EDIT_FRAME::syncLayerWidgetLayer()
{ {
m_Layers->SelectLayer( getActiveLayer() ); m_Layers->SelectLayer( GetActiveLayer() );
m_Layers->OnLayerSelected(); m_Layers->OnLayerSelected();
} }
......
...@@ -105,7 +105,7 @@ void PCB_EDIT_FRAME::PrepareLayerIndicator() ...@@ -105,7 +105,7 @@ void PCB_EDIT_FRAME::PrepareLayerIndicator()
previous_Route_Layer_BOTTOM_color, previous_via_color; previous_Route_Layer_BOTTOM_color, previous_via_color;
/* get colors, and redraw bitmap button only on changes */ /* get colors, and redraw bitmap button only on changes */
active_layer_color = GetBoard()->GetLayerColor(getActiveLayer()); active_layer_color = GetBoard()->GetLayerColor(GetActiveLayer());
if( previous_active_layer_color != active_layer_color ) if( previous_active_layer_color != active_layer_color )
{ {
......
...@@ -96,7 +96,7 @@ void PCB_EDIT_FRAME::OnUpdateSelectViaSize( wxUpdateUIEvent& aEvent ) ...@@ -96,7 +96,7 @@ void PCB_EDIT_FRAME::OnUpdateSelectViaSize( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent ) void PCB_EDIT_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent )
{ {
m_SelLayerBox->SetLayerSelection( getActiveLayer() ); m_SelLayerBox->SetLayerSelection( GetActiveLayer() );
} }
......
...@@ -515,7 +515,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) ...@@ -515,7 +515,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
if( !GetBoard()->m_CurrentZoneContour ) if( !GetBoard()->m_CurrentZoneContour )
{ {
if( GetToolId() == ID_PCB_KEEPOUT_AREA_BUTT && if( GetToolId() == ID_PCB_KEEPOUT_AREA_BUTT &&
getActiveLayer() >= FIRST_NON_COPPER_LAYER ) GetActiveLayer() >= FIRST_NON_COPPER_LAYER )
{ {
DisplayError( this, DisplayError( this,
_( "Error: a keepout area is allowed only on copper layers" ) ); _( "Error: a keepout area is allowed only on copper layers" ) );
...@@ -534,7 +534,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) ...@@ -534,7 +534,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
ZONE_EDIT_T edited; ZONE_EDIT_T edited;
// Init zone params to reasonable values // Init zone params to reasonable values
zone->SetLayer( getActiveLayer() ); zone->SetLayer( GetActiveLayer() );
// Prompt user for parameters: // Prompt user for parameters:
m_canvas->SetIgnoreMouseEvents( true ); m_canvas->SetIgnoreMouseEvents( true );
...@@ -597,7 +597,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) ...@@ -597,7 +597,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
return 0; return 0;
// Switch active layer to the selected zone layer // Switch active layer to the selected zone layer
setActiveLayer( zoneInfo.m_CurrentZone_Layer ); SetActiveLayer( zoneInfo.m_CurrentZone_Layer );
SetZoneSettings( zoneInfo ); SetZoneSettings( zoneInfo );
} }
...@@ -607,7 +607,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) ...@@ -607,7 +607,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
// zone (add cutout or similar zone) // zone (add cutout or similar zone)
zoneInfo.m_CurrentZone_Layer = s_CurrentZone->GetLayer(); zoneInfo.m_CurrentZone_Layer = s_CurrentZone->GetLayer();
setActiveLayer( s_CurrentZone->GetLayer() ); SetActiveLayer( s_CurrentZone->GetLayer() );
zoneInfo << *s_CurrentZone; zoneInfo << *s_CurrentZone;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment