diff --git a/include/wxBasePcbFrame.h b/include/wxBasePcbFrame.h index 1545cfda06..d8607551f8 100644 --- a/include/wxBasePcbFrame.h +++ b/include/wxBasePcbFrame.h @@ -619,7 +619,7 @@ public: */ virtual void SetActiveLayer( LAYER_ID aLayer ) { - ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = aLayer; + GetScreen()->m_Active_Layer = aLayer; } /** @@ -628,7 +628,7 @@ public: */ virtual LAYER_ID GetActiveLayer() const { - return ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer; + return GetScreen()->m_Active_Layer; } void LoadSettings( wxConfigBase* aCfg ); // override virtual diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 6b70e6fc77..a5a5f5f489 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -367,7 +367,7 @@ void PCB_BASE_FRAME::Show3D_Frame( wxCommandEvent& event ) // Note: virtual, overridden in PCB_EDIT_FRAME; void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, LAYER_ID layer ) { - LAYER_ID preslayer = ((PCB_SCREEN*)GetScreen())->m_Active_Layer; + LAYER_ID preslayer = GetActiveLayer(); DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions(); // Check if the specified layer matches the present layer @@ -583,7 +583,7 @@ BOARD_ITEM* PCB_BASE_FRAME::GetCurItem() GENERAL_COLLECTORS_GUIDE PCB_BASE_FRAME::GetCollectorsGuide() { GENERAL_COLLECTORS_GUIDE guide( m_Pcb->GetVisibleLayers(), - ( (PCB_SCREEN*)GetScreen())->m_Active_Layer ); + GetActiveLayer() ); // account for the globals guide.SetIgnoreMTextsMarkedNoShow( ! m_Pcb->IsElementVisible( MOD_TEXT_INVISIBLE )); diff --git a/pcbnew/dialogs/dialog_find.cpp b/pcbnew/dialogs/dialog_find.cpp index 559adc8611..e3acac25e0 100644 --- a/pcbnew/dialogs/dialog_find.cpp +++ b/pcbnew/dialogs/dialog_find.cpp @@ -74,7 +74,7 @@ void DIALOG_FIND::onButtonCloseClick( wxCommandEvent& aEvent ) void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent ) { - PCB_SCREEN* screen = (PCB_SCREEN*) ( parent->GetScreen() ); + PCB_SCREEN* screen = parent->GetScreen(); wxPoint pos; foundItem = NULL; @@ -144,7 +144,7 @@ void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent ) void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent ) { - PCB_SCREEN* screen = (PCB_SCREEN*) ( parent->GetScreen() ); + PCB_SCREEN* screen = parent->GetScreen(); wxPoint pos; foundItem = NULL; diff --git a/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp b/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp index 35516e1cb6..b91a3e8b06 100644 --- a/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp +++ b/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp @@ -143,7 +143,7 @@ void DIALOG_NON_COPPER_ZONES_EDITOR::Init() wxImageList* imageList = new wxImageList( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y ); m_LayerSelectionCtrl->AssignImageList( imageList, wxIMAGE_LIST_SMALL ); - int lyrSelect = ( (PCB_SCREEN*) m_parent->GetScreen() )->m_Active_Layer; + LAYER_ID lyrSelect = m_parent->GetActiveLayer(); if( m_zone ) lyrSelect = m_zone->GetLayer(); diff --git a/pcbnew/edit_pcb_text.cpp b/pcbnew/edit_pcb_text.cpp index 682db7aefe..bae9b3a202 100644 --- a/pcbnew/edit_pcb_text.cpp +++ b/pcbnew/edit_pcb_text.cpp @@ -203,7 +203,7 @@ TEXTE_PCB* PCB_EDIT_FRAME::CreateTextePcb( wxDC* aDC, TEXTE_PCB* aText ) GetBoard()->Add( textePcb ); textePcb->SetFlags( IS_NEW ); - LAYER_ID layer = ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer; + LAYER_ID layer = GetActiveLayer(); textePcb->SetLayer( layer ); diff --git a/pcbnew/editrack-part2.cpp b/pcbnew/editrack-part2.cpp index c84d9ddc4c..868e5a72e0 100644 --- a/pcbnew/editrack-part2.cpp +++ b/pcbnew/editrack-part2.cpp @@ -50,10 +50,10 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) if( aTrack == NULL ) { - if( GetActiveLayer() != ((PCB_SCREEN*)GetScreen())->m_Route_Layer_TOP ) - SetActiveLayer( ((PCB_SCREEN*)GetScreen())->m_Route_Layer_TOP ); + if( GetActiveLayer() != GetScreen()->m_Route_Layer_TOP ) + SetActiveLayer( GetScreen()->m_Route_Layer_TOP ); else - SetActiveLayer(((PCB_SCREEN*)GetScreen())->m_Route_Layer_BOTTOM ); + SetActiveLayer( GetScreen()->m_Route_Layer_BOTTOM ); UpdateStatusBar(); return true; diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 5fe317176f..fdbd6ea324 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -104,7 +104,6 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, // This frame is always show modal: SetModal( true ); - m_configPath = FOOTPRINT_WIZARD_FRAME_NAME; m_showAxis = true; // true to draw axis. // Give an icon @@ -391,8 +390,6 @@ void FOOTPRINT_WIZARD_FRAME::LoadSettings( wxConfigBase* aCfg ) { EDA_DRAW_FRAME::LoadSettings( aCfg ); - wxConfigPathChanger cpc( aCfg, m_configPath ); - aCfg->Read( PARTLIST_WIDTH_KEY, &m_pageListWidth, 100 ); aCfg->Read( PARAMLIST_WIDTH_KEY, &m_parameterGridWidth, 200 ); @@ -409,7 +406,6 @@ void FOOTPRINT_WIZARD_FRAME::SaveSettings( wxConfigBase* aCfg ) { EDA_DRAW_FRAME::SaveSettings( aCfg ); - wxConfigPathChanger cpc( aCfg, m_configPath ); aCfg->Write( PARTLIST_WIDTH_KEY, m_pageList->GetSize().x ); aCfg->Write( PARAMLIST_WIDTH_KEY, m_parameterGrid->GetSize().x ); } diff --git a/pcbnew/footprint_wizard_frame.h b/pcbnew/footprint_wizard_frame.h index 815cfa559e..b54b82a14b 100644 --- a/pcbnew/footprint_wizard_frame.h +++ b/pcbnew/footprint_wizard_frame.h @@ -51,9 +51,6 @@ private: wxGrid* m_parameterGrid; ///< The list of parameters int m_parameterGridWidth; ///< size of the grid - // Flags - wxString m_configPath; ///< subpath for configuration - // Column index to display parameters in m_parameterGrid static int m_columnPrmName; static int m_columnPrmValue; diff --git a/pcbnew/tool_pcb.cpp b/pcbnew/tool_pcb.cpp index ab14265cf6..1fb73a8493 100644 --- a/pcbnew/tool_pcb.cpp +++ b/pcbnew/tool_pcb.cpp @@ -110,7 +110,7 @@ void PCB_EDIT_FRAME::PrepareLayerIndicator() } Route_Layer_TOP_color = - g_ColorsSettings.GetLayerColor( ( ( PCB_SCREEN* ) GetScreen() )->m_Route_Layer_TOP ); + g_ColorsSettings.GetLayerColor( GetScreen()->m_Route_Layer_TOP ); if( previous_Route_Layer_TOP_color != Route_Layer_TOP_color ) { @@ -119,7 +119,7 @@ void PCB_EDIT_FRAME::PrepareLayerIndicator() } Route_Layer_BOTTOM_color = - g_ColorsSettings.GetLayerColor( ( (PCB_SCREEN*) GetScreen() )->m_Route_Layer_BOTTOM ); + g_ColorsSettings.GetLayerColor( GetScreen()->m_Route_Layer_BOTTOM ); if( previous_Route_Layer_BOTTOM_color != Route_Layer_BOTTOM_color ) { diff --git a/pcbnew/tracepcb.cpp b/pcbnew/tracepcb.cpp index f9bf65b09f..56b3a8bcb2 100644 --- a/pcbnew/tracepcb.cpp +++ b/pcbnew/tracepcb.cpp @@ -59,7 +59,7 @@ static void Trace_Pads_Only( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* Module, void FOOTPRINT_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) { - PCB_SCREEN* screen = (PCB_SCREEN*) GetScreen(); + PCB_SCREEN* screen = GetScreen(); if( !GetBoard() || !screen ) return;