From e8cb60f9e273d97a651385c85d834b1e9a8943e9 Mon Sep 17 00:00:00 2001 From: charras Date: Fri, 23 Oct 2009 15:28:45 +0000 Subject: [PATCH] minor changes --- eeschema/edit_component_in_lib.cpp | 5 +++++ include/wxPcbStruct.h | 2 +- pcbnew/automove.cpp | 20 +++++++++----------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/eeschema/edit_component_in_lib.cpp b/eeschema/edit_component_in_lib.cpp index 3562caa2a3..82b8a7ad85 100644 --- a/eeschema/edit_component_in_lib.cpp +++ b/eeschema/edit_component_in_lib.cpp @@ -445,6 +445,11 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::BrowseAndSelectDocFile( wxCommandEvent& e wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() ); filename = wxGetApp().ReturnFilenameWithRelativePathInLibPath(FullFileName); + // Filenames are always stored in unix like mode, ie separator "\" is stored as "/" + // to ensure files are identical under unices and windows +#ifdef __WINDOWS__ + filename.Replace(wxT("\\"), wxT("/") ); +#endif m_Docfile->SetValue( filename ); } diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index bb0af69596..51f2de3b18 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -642,7 +642,7 @@ public: void ReOrientModules( const wxString& ModuleMask, int Orient, bool include_fixe ); void FixeModule( MODULE* Module, bool Fixe ); - void AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb ); + void AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb ); bool SetBoardBoundaryBoxFromEdgesOnly(); void AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC ); int RecherchePlacementModule( MODULE* Module, wxDC* DC ); diff --git a/pcbnew/automove.cpp b/pcbnew/automove.cpp index 6cd86eeb56..67f0d1887c 100644 --- a/pcbnew/automove.cpp +++ b/pcbnew/automove.cpp @@ -40,7 +40,7 @@ wxString ModulesMaskSelection = wxT( "*" ); void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) /******************************************************/ -/* Traite les selections d'outils et les commandes appelees du menu POPUP +/* Called on events (popup menus) relative to automove and autoplace footprints */ { int id = event.GetId(); @@ -55,7 +55,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) wxGetMousePosition( &pos.x, &pos.y ); - switch( id ) // Arret eventuel de la commande de déplacement en cours + switch( id ) { case ID_TOOLBARH_PCB_AUTOPLACE: case ID_TOOLBARH_PCB_AUTOROUTE: @@ -69,7 +69,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) } break; - default: // Arret de la commande de déplacement en cours + default: // Abort a current command (if any) if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur ) { @@ -84,7 +84,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) DrawGeneralRatsnest( &dc ); GetBoard()->m_Status_Pcb |= DO_NOT_SHOW_GENERAL_RASTNEST; - switch( id ) // Traitement des commandes + switch( id ) { case ID_TOOLBARH_PCB_AUTOPLACE: on_state = m_HToolBar->GetToolState( ID_TOOLBARH_PCB_AUTOPLACE ); @@ -142,11 +142,11 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) break; case ID_POPUP_PCB_AUTOMOVE_ALL_MODULES: - AutoMoveModulesOnPcb( &dc, FALSE ); + AutoMoveModulesOnPcb( FALSE ); break; case ID_POPUP_PCB_AUTOMOVE_NEW_MODULES: - AutoMoveModulesOnPcb( &dc, TRUE ); + AutoMoveModulesOnPcb( TRUE ); break; case ID_POPUP_PCB_REORIENT_ALL_MODULES: @@ -188,7 +188,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) /*****************************************************************************/ -void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb ) +void WinEDA_PcbFrame::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb ) /*****************************************************************************/ /* Routine de repartition des composants dans un rectangle de format 4 / 3, @@ -259,7 +259,6 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb ) Xsize_allowed = (int) (sqrt( surface ) * 4.0 / 3.0); - /* Placement des modules */ start = current = GetScreen()->m_Curseur; Ymax_size = 0; @@ -290,14 +289,13 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb ) PutOnGrid( &GetScreen()->m_Curseur ); - Module->Draw( DrawPanel, DC, GR_XOR ); - Place_Module( Module, DC ); /* positionne Module et recalcule cadre */ + Place_Module( Module, NULL, true ); current.x += Module->m_RealBoundaryBox.GetWidth() + pas_grille; } MyFree( BaseListeModules ); - GetScreen()->SetRefreshReq(); + DrawPanel->Refresh(); }