diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 151e77b397..06a93babc2 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,19 @@ KiCad ChangeLog 2009 Please add newer entries at the top, list the date and your name with email address. +2009-oct-14 UPDATE Wayne Stambaugh +================================================================================ +Fix save last grid size and other minor updates. +* Create single event handler for grid size events. +* Fix all frame windows to use new grid size event handler. +* Use offset relative to ID instead of ComboBox index to save last grid size. +* Move last grid size load/save setting into WinEDA_DrawFrame. +* Add equality and assignment operators the GRID_TYPE. +* Add current grid helper methods to BASE_SCREEN. +* Add GetPins helper to LIB_COMPONENT to replace GetNextPin where applicable. +* Add AppendMsgPanel helper to WinEDA_DrawFrame. +* Improve rounding for display of coordinates when millimeter units are selected. + 2009-oct-01 UPDATE Wayne Stambaugh ================================================================================ * Component library viewer restores state between uses. diff --git a/common/about_kicad.cpp b/common/about_kicad.cpp index 9089110d17..91d6c783cd 100644 --- a/common/about_kicad.cpp +++ b/common/about_kicad.cpp @@ -8,7 +8,7 @@ #include "appl_wxstruct.h" -#define BUILD_VERSION "(20091010-unstable)" +#define BUILD_VERSION "(20091015-unstable)" #ifdef HAVE_SVN_VERSION diff --git a/common/drawframe.cpp b/common/drawframe.cpp index 6b431d40fb..f8dfbaaba9 100644 --- a/common/drawframe.cpp +++ b/common/drawframe.cpp @@ -252,7 +252,7 @@ void WinEDA_DrawFrame::OnSelectGrid( wxCommandEvent& event ) */ m_LastGridSizeId = id - ID_POPUP_GRID_LEVEL_1000; screen->m_Curseur = DrawPanel->GetScreenCenterRealPosition(); - screen->SetGrid( event.GetId() ); + screen->SetGrid( id ); Refresh(); } diff --git a/cvpcb/displayframe.cpp b/cvpcb/displayframe.cpp index d1114dad29..cba2ba49d4 100644 --- a/cvpcb/displayframe.cpp +++ b/cvpcb/displayframe.cpp @@ -61,6 +61,10 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father, SetBaseScreen( new PCB_SCREEN() ); LoadSettings(); + // Initilialize grid id to a default value if not found in config or bad: + if( (m_LastGridSizeId <= 0) || + (m_LastGridSizeId < (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) ) + m_LastGridSizeId = ID_POPUP_GRID_LEVEL_500 - ID_POPUP_GRID_LEVEL_1000; // Initialize some display options DisplayOpt.DisplayPadIsol = false; // Pad clearance has no meaning here diff --git a/eeschema/libframe.cpp b/eeschema/libframe.cpp index 179992a2e9..10e3fc12b6 100644 --- a/eeschema/libframe.cpp +++ b/eeschema/libframe.cpp @@ -161,6 +161,11 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father, SetBaseScreen( new SCH_SCREEN() ); GetScreen()->m_Center = true; LoadSettings(); + // Initilialize grid id to a default value if not found in config or bad: + if( (m_LastGridSizeId <= 0) || + (m_LastGridSizeId < (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) ) + m_LastGridSizeId = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000; + SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); diff --git a/eeschema/save_schemas.cpp b/eeschema/save_schemas.cpp index e6455b86f6..bad91d7f58 100644 --- a/eeschema/save_schemas.cpp +++ b/eeschema/save_schemas.cpp @@ -121,15 +121,6 @@ bool SCH_SCREEN::Save( FILE* aFile ) const Ki_PageDescr* PlotSheet; wxString datetime = DateAndTime( ); - bool first = true; - - BOOST_FOREACH( const CMP_LIBRARY& lib, CMP_LIBRARY::GetLibraryList() ) - { - if( ! first ) - Name += wxT( "," ); - Name += lib.GetName(); - first = false; - } // Creates header if( fprintf( aFile, "%s %s %d", EESCHEMA_FILE_STAMP, @@ -139,8 +130,12 @@ bool SCH_SCREEN::Save( FILE* aFile ) const if( fprintf( aFile, " date %s\n", CONV_TO_UTF8(datetime) ) == EOF ) return FALSE; - if( fprintf( aFile, "LIBS:%s\n", CONV_TO_UTF8( Name ) ) == EOF ) - return FALSE; + BOOST_FOREACH( const CMP_LIBRARY& lib, CMP_LIBRARY::GetLibraryList() ) + { + Name = lib.GetName(); + if( fprintf( aFile, "LIBS:%s\n", CONV_TO_UTF8( Name ) ) == EOF ) + return FALSE; + } SaveLayers( aFile ); diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index 879747b872..03eeb54e62 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -172,6 +172,11 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father, /* Get config */ LoadSettings(); + + // Initilialize grid id to a default value if not found in config or bad: + if( (m_LastGridSizeId <= 0) || + (m_LastGridSizeId < (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) ) + m_LastGridSizeId = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000; SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); diff --git a/gerbview/gerberframe.cpp b/gerbview/gerberframe.cpp index b4d420cb62..5a4be7e9ad 100644 --- a/gerbview/gerberframe.cpp +++ b/gerbview/gerberframe.cpp @@ -146,6 +146,10 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, ActiveScreen = ScreenPcb; LoadSettings(); + // Initilialize grid id to a default value if not found in config or bad: + if( (m_LastGridSizeId <= 0) || + (m_LastGridSizeId < (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) ) + m_LastGridSizeId = ID_POPUP_GRID_LEVEL_500 - ID_POPUP_GRID_LEVEL_1000; SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); ActiveScreen->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); ReCreateMenuBar(); diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index 7147094d54..8b86412185 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -175,6 +175,10 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father, ActiveScreen = GetScreen(); GetScreen()->SetCurItem( NULL ); LoadSettings(); + // Initilialize grid id to a default value if not found in config or bad: + if( (m_LastGridSizeId <= 0) || + (m_LastGridSizeId < (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) ) + m_LastGridSizeId = ID_POPUP_GRID_LEVEL_500 - ID_POPUP_GRID_LEVEL_1000; GetScreen()->AddGrid( m_UserGridSize, m_UserGridUnits, ID_POPUP_GRID_USER ); GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index cd55cfc196..2d3e604eca 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -247,6 +247,10 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, m_InternalUnits = PCB_INTERNAL_UNIT; // Unites internes = 1/10000 inch SetBaseScreen( ScreenPcb ); LoadSettings(); + // Initilialize grid id to a default value if not found in config or bad: + if( (m_LastGridSizeId <= 0) || + (m_LastGridSizeId < (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) ) + m_LastGridSizeId = ID_POPUP_GRID_LEVEL_500 - ID_POPUP_GRID_LEVEL_1000; SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); GetScreen()->AddGrid( m_UserGridSize, m_UserGridUnits, ID_POPUP_GRID_USER );