From 3a74c74c8b15da81648c60327835ea4f4224173c Mon Sep 17 00:00:00 2001 From: charras Date: Fri, 16 May 2008 11:38:35 +0000 Subject: [PATCH] eschema: Solved: bad update of toolbars (eeschema and libedit). also in kicad: see changelog --- change_log.txt | 10 ++++++++++ eeschema/controle.cpp | 3 +++ kicad/treeprj_frame.cpp | 27 ++++++++++++++++++++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/change_log.txt b/change_log.txt index 67489933f9..3bb20470dc 100644 --- a/change_log.txt +++ b/change_log.txt @@ -5,6 +5,16 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with email address. +2008-May-16 UPDATE Jean-Pierre Charras +================================================================================ ++eeschema: + Solved: bad update of toolbars (eeschema and libedit): + undo/redo buttons were not always updated after a change. + ++kicad + the project tree now (as earlier) reads subdirs list files when starting + kicad. This feature can be disabled (see treeprj_frame.cpp) + 2008-May-15 UPDATE Jean-Pierre Charras ================================================================================ +eeschema: diff --git a/eeschema/controle.cpp b/eeschema/controle.cpp index 939bf4178a..7af43efc95 100644 --- a/eeschema/controle.cpp +++ b/eeschema/controle.cpp @@ -341,6 +341,7 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPi } Affiche_Status_Box(); /* Affichage des coord curseur */ + SetToolbars(); } @@ -469,6 +470,7 @@ void WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixe } Affiche_Status_Box(); /* Affichage des coord curseur */ + SetToolbars(); } /*************************************************************************************/ @@ -596,4 +598,5 @@ void WinEDA_ViewlibFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixe } Affiche_Status_Box(); /* Affichage des coord curseur */ + SetToolbars(); } diff --git a/kicad/treeprj_frame.cpp b/kicad/treeprj_frame.cpp index f214414e07..ee82e76115 100644 --- a/kicad/treeprj_frame.cpp +++ b/kicad/treeprj_frame.cpp @@ -26,6 +26,9 @@ #include "id.h" +// Comment this if you do no want to load subdirs files in the tree project +// UnComment this to load subdirs files in the tree project +#define ADD_FILES_IN_SUBDIRS /******************************************************************/ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent, @@ -646,6 +649,28 @@ bool WinEDA_PrjFrame::AddFile( const wxString& name, wxTreeItemId& root ) #ifdef KICAD_PYTHON PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::TreeAddFile" ), PyHandler::Convert( name ) ); #endif + +#ifdef ADD_FILES_IN_SUBDIRS + // When enabled This section adds dirs and files found in the subdirs + // in this case AddFile is recursive. + if( TREE_DIRECTORY == type ) + { + const wxString sep = wxFileName().GetPathSeparator(); + wxDir dir( name ); + + wxString dir_filename; + if( dir.GetFirst( &dir_filename ) ) + { + do + { + AddFile( name + sep + dir_filename, cellule ); + } while( dir.GetNext( &dir_filename ) ); + } + + /* Sort filenames by alphabetic order */ + m_TreeProject->SortChildren( cellule ); + } +#endif return true; } @@ -687,7 +712,7 @@ void WinEDA_PrjFrame::ReCreateTreePrj() ChangeFileNameExt( Text, wxEmptyString ); - // Add at least a .scn / .brd if not existing: + // Add at least a .sch / .brd if not existing: if( !wxFileExists( Text + g_SchExtBuffer ) ) AddFile( Text + g_SchExtBuffer, m_root );