From 126c384dada6d317a4ba8e83727b098416d7da95 Mon Sep 17 00:00:00 2001 From: charras Date: Thu, 18 Feb 2010 20:07:29 +0000 Subject: [PATCH] Eeschema date in frame reference updated at each modification. --- common/build_version.cpp | 2 +- eeschema/annotate.cpp | 2 +- eeschema/block.cpp | 10 ++++----- eeschema/block_libedit.cpp | 2 +- eeschema/bus-wire-junction.cpp | 6 +++--- eeschema/busentry.cpp | 4 ++-- eeschema/class_drawsheet.cpp | 2 +- eeschema/class_sch_cmp_field.cpp | 2 +- eeschema/delete.cpp | 4 ++-- .../dialog_edit_component_in_schematic.cpp | 4 ++-- eeschema/dialog_edit_label.cpp | 2 +- .../dialog_edit_libentry_fields_in_lib.cpp | 2 +- eeschema/edit_component_in_lib.cpp | 4 ++-- eeschema/edit_component_in_schematic.cpp | 10 ++++----- eeschema/edit_graphic_bodyitem_text.cpp | 4 ++-- eeschema/edit_label.cpp | 6 +++--- eeschema/getpart.cpp | 6 +++--- eeschema/hotkeys.cpp | 2 +- eeschema/libedit.cpp | 2 +- eeschema/libedit_onleftclick.cpp | 2 +- eeschema/libedit_undo_redo.cpp | 4 ++-- eeschema/libeditframe.cpp | 2 +- eeschema/libeditframe.h | 9 ++++++++ eeschema/libfield.cpp | 6 +++--- eeschema/onleftclick.cpp | 2 +- eeschema/pinedit.cpp | 12 +++++------ eeschema/schedit.cpp | 4 ++-- eeschema/schematic_undo_redo.cpp | 4 ++-- eeschema/schframe.cpp | 21 +++++++++++++++++++ eeschema/sheet.cpp | 2 +- eeschema/sheetlab.cpp | 4 ++-- eeschema/symbdraw.cpp | 4 ++-- eeschema/symbedit.cpp | 4 ++-- include/wxEeschemaStruct.h | 6 ++++++ version.txt | 2 +- 35 files changed, 100 insertions(+), 64 deletions(-) diff --git a/common/build_version.cpp b/common/build_version.cpp index 57351cb774..d403049268 100644 --- a/common/build_version.cpp +++ b/common/build_version.cpp @@ -9,7 +9,7 @@ #define KICAD_BUILD_VERSION "(2010-02-17)" #endif -#define VERSION_STABILITY "RC3" +#define VERSION_STABILITY "RC3a" /** Function GetBuildVersion() * Return the build date and version diff --git a/eeschema/annotate.cpp b/eeschema/annotate.cpp index 79022c04e5..c5d1940058 100644 --- a/eeschema/annotate.cpp +++ b/eeschema/annotate.cpp @@ -228,7 +228,7 @@ void WinEDA_SchematicFrame::DeleteAnnotation( bool aCurrentSheetOnly, } } - screen->SetModify(); + OnModify( ); if( aCurrentSheetOnly ) break; screen = ScreenList.GetNext(); diff --git a/eeschema/block.cpp b/eeschema/block.cpp index b5af40e1c5..3a396e0e62 100644 --- a/eeschema/block.cpp +++ b/eeschema/block.cpp @@ -171,7 +171,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) break; } - GetScreen()->SetModify(); + OnModify( ); /* clear struct.m_Flags */ SCH_ITEM* Struct; @@ -268,7 +268,7 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) { ii = -1; DeleteItemsInList( DrawPanel, block->m_ItemsSelection ); - GetScreen()->SetModify(); + OnModify( ); } block->ClearItemsList(); TestDanglingEnds( GetScreen()->EEDrawList, DC ); @@ -395,7 +395,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) { ii = -1; DeleteItemsInList( DrawPanel, block->m_ItemsSelection ); - GetScreen()->SetModify(); + OnModify( ); } TestDanglingEnds( GetScreen()->EEDrawList, DC ); DrawPanel->Refresh(); @@ -440,7 +440,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) UR_MIRRORED_Y, mirrorPoint ); MirrorListOfItems( block->m_ItemsSelection, mirrorPoint ); - GetScreen()->SetModify(); + OnModify( ); } TestDanglingEnds( GetScreen()->EEDrawList, DC ); DrawPanel->Refresh(); @@ -578,7 +578,7 @@ void WinEDA_SchematicFrame::PasteListOfItems( wxDC* DC ) Struct = Struct->Next() ) Struct->m_Flags = 0; - GetScreen()->SetModify(); + OnModify( ); return; } diff --git a/eeschema/block_libedit.cpp b/eeschema/block_libedit.cpp index 243976d8f6..c7f8849e00 100644 --- a/eeschema/block_libedit.cpp +++ b/eeschema/block_libedit.cpp @@ -259,7 +259,7 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) break; } - GetScreen()->SetModify(); + OnModify(); DrawPanel->ManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL; diff --git a/eeschema/bus-wire-junction.cpp b/eeschema/bus-wire-junction.cpp index e0192e3935..11f9119d39 100644 --- a/eeschema/bus-wire-junction.cpp +++ b/eeschema/bus-wire-junction.cpp @@ -361,7 +361,7 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC ) SaveCopyInUndoList( s_OldWiresList, UR_WIRE_IMAGE ); s_OldWiresList = NULL; - GetScreen()->SetModify(); + OnModify( ); } @@ -537,7 +537,7 @@ SCH_JUNCTION* WinEDA_SchematicFrame::CreateNewJunctionStruct( NewJunction->SetNext( GetScreen()->EEDrawList ); GetScreen()->EEDrawList = NewJunction; - GetScreen()->SetModify(); + OnModify( ); if( PutInUndoList ) SaveCopyInUndoList( NewJunction, UR_NEW ); return NewJunction; @@ -558,7 +558,7 @@ SCH_NO_CONNECT* WinEDA_SchematicFrame::CreateNewNoConnectStruct( wxDC* DC ) NewNoConnect->SetNext( GetScreen()->EEDrawList ); GetScreen()->EEDrawList = NewNoConnect; - GetScreen()->SetModify(); + OnModify( ); SaveCopyInUndoList( NewNoConnect, UR_NEW ); return NewNoConnect; } diff --git a/eeschema/busentry.cpp b/eeschema/busentry.cpp index 7991fcdcae..851a1b9412 100644 --- a/eeschema/busentry.cpp +++ b/eeschema/busentry.cpp @@ -79,7 +79,7 @@ SCH_BUS_ENTRY* WinEDA_SchematicFrame::CreateBusEntry( wxDC* DC, RedrawOneStruct( DrawPanel, DC, BusEntry, g_XorMode ); DrawPanel->CursorOn( DC ); // Display schematic cursor - GetScreen()->SetModify(); + OnModify( ); StartMoveBusEntry( BusEntry, DC ); return BusEntry; @@ -151,7 +151,7 @@ void WinEDA_SchematicFrame::SetBusEntryShape( wxDC* DC, TestDanglingEnds( GetScreen()->EEDrawList, NULL ); RedrawOneStruct( DrawPanel, DC, BusEntry, g_XorMode ); - GetScreen()->SetModify(); + OnModify( ); } diff --git a/eeschema/class_drawsheet.cpp b/eeschema/class_drawsheet.cpp index ddb1872864..bc2d4c4c8c 100644 --- a/eeschema/class_drawsheet.cpp +++ b/eeschema/class_drawsheet.cpp @@ -252,7 +252,7 @@ void SCH_SHEET::CleanupSheet( WinEDA_SchematicFrame* aFrame, NextPinsheet = Pinsheet->Next(); if( HLabel == NULL ) // Hlabel not found: delete pinsheet { - aFrame->GetScreen()->SetModify(); + aFrame->OnModify( ); aFrame->DeleteSheetLabel( false, Pinsheet ); } Pinsheet = NextPinsheet; diff --git a/eeschema/class_sch_cmp_field.cpp b/eeschema/class_sch_cmp_field.cpp index 06725940d9..03a3a04c1f 100644 --- a/eeschema/class_sch_cmp_field.cpp +++ b/eeschema/class_sch_cmp_field.cpp @@ -420,6 +420,6 @@ void SCH_FIELD::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) Draw( frame->DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); m_Flags = 0; frame->GetScreen()->SetCurItem( NULL ); - frame->GetScreen()->SetModify(); + frame->OnModify( ); frame->SetCurrentField( NULL ); } diff --git a/eeschema/delete.cpp b/eeschema/delete.cpp index 11e037bb2b..bb96becd8e 100644 --- a/eeschema/delete.cpp +++ b/eeschema/delete.cpp @@ -318,7 +318,7 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection ) if( pickList.GetCount() ) { DeleteItemsInList( DrawPanel, pickList ); - GetScreen()->SetModify(); + OnModify( ); } } @@ -367,7 +367,7 @@ bool LocateAndDeleteItem( WinEDA_SchematicFrame* frame, wxDC* DC ) g_ItemToRepeat = NULL; DeleteStruct( frame->DrawPanel, DC, DelStruct ); frame->TestDanglingEnds( frame->GetScreen()->EEDrawList, DC ); - frame->GetScreen()->SetModify(); + frame->OnModify( ); item_deleted = TRUE; } diff --git a/eeschema/dialog_edit_component_in_schematic.cpp b/eeschema/dialog_edit_component_in_schematic.cpp index 7417871938..e054443eec 100644 --- a/eeschema/dialog_edit_component_in_schematic.cpp +++ b/eeschema/dialog_edit_component_in_schematic.cpp @@ -279,7 +279,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event m_Cmp->SetRef( m_Parent->GetSheet(), m_FieldsBuf[REFERENCE].m_Text ); - m_Parent->GetScreen()->SetModify(); + m_Parent->OnModify( ); m_Parent->TestDanglingEnds( m_Parent->GetScreen()->EEDrawList, NULL ); @@ -744,7 +744,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event ) m_Cmp->SetOrientation( CMP_NORMAL ); - m_Parent->GetScreen()->SetModify(); + m_Parent->OnModify( ); RedrawOneStruct( m_Parent->DrawPanel, &dc, m_Cmp, GR_DEFAULT_DRAWMODE ); EndModal( 1 ); diff --git a/eeschema/dialog_edit_label.cpp b/eeschema/dialog_edit_label.cpp index 7d629d1639..c2a657e131 100644 --- a/eeschema/dialog_edit_label.cpp +++ b/eeschema/dialog_edit_label.cpp @@ -224,7 +224,7 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& event ) m_CurrentText->m_Width = 0; } - m_Parent->GetScreen()->SetModify(); + m_Parent->OnModify( ); /* Make the text size as new default size if it is a new text */ if( (m_CurrentText->m_Flags & IS_NEW) != 0 ) diff --git a/eeschema/dialog_edit_libentry_fields_in_lib.cpp b/eeschema/dialog_edit_libentry_fields_in_lib.cpp index 3955632c54..45f158657c 100644 --- a/eeschema/dialog_edit_libentry_fields_in_lib.cpp +++ b/eeschema/dialog_edit_libentry_fields_in_lib.cpp @@ -249,7 +249,7 @@ alias %s already exists!\nCannot update this component" ), // copy all the fields back, and change the length of m_Fields. m_LibEntry->SetFields( m_FieldsBuf ); - m_Parent->GetScreen()->SetModify(); + m_Parent->OnModify( ); EndModal( 0 ); } diff --git a/eeschema/edit_component_in_lib.cpp b/eeschema/edit_component_in_lib.cpp index 2d36774120..e1344055b3 100644 --- a/eeschema/edit_component_in_lib.cpp +++ b/eeschema/edit_component_in_lib.cpp @@ -47,7 +47,7 @@ void WinEDA_LibeditFrame::EditComponentProperties() UpdatePartSelectList(); DisplayLibInfos(); DisplayCmpDoc(); - GetScreen()->SetModify(); + OnModify( ); } @@ -330,7 +330,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert() } component->SetConversion( m_Parent->GetShowDeMorgan() ); - m_Parent->GetScreen()->SetModify(); + m_Parent->OnModify( ); return true; } diff --git a/eeschema/edit_component_in_schematic.cpp b/eeschema/edit_component_in_schematic.cpp index 67e7f9533d..22dd97b427 100644 --- a/eeschema/edit_component_in_schematic.cpp +++ b/eeschema/edit_component_in_schematic.cpp @@ -167,7 +167,7 @@ modified!\nYou must create a new power" ) ); Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); Cmp->DisplayInfo( this ); - GetScreen()->SetModify(); + OnModify( ); } @@ -277,7 +277,7 @@ void WinEDA_SchematicFrame::RotateCmpField( SCH_FIELD* Field, wxDC* DC ) Field->m_Orient = TEXT_ORIENT_HORIZ; Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); - GetScreen()->SetModify(); + OnModify( ); } @@ -320,7 +320,7 @@ void WinEDA_SchematicFrame::EditComponentReference( SCH_COMPONENT* Cmp, 0 ), Cmp->m_Flags ? g_XorMode : GR_DEFAULT_DRAWMODE ); - GetScreen()->SetModify(); + OnModify( ); } Cmp->DisplayInfo( this ); } @@ -358,7 +358,7 @@ void WinEDA_SchematicFrame::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC ) TextField->m_Text = message; TextField->Draw( DrawPanel, DC, wxPoint( 0, 0 ), Cmp->m_Flags ? g_XorMode : GR_DEFAULT_DRAWMODE ); - GetScreen()->SetModify(); + OnModify( ); } Cmp->DisplayInfo( this ); @@ -422,7 +422,7 @@ void WinEDA_SchematicFrame::EditComponentFootprint( SCH_COMPONENT* Cmp, Cmp->GetField( FOOTPRINT )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), Cmp->m_Flags ? g_XorMode : GR_DEFAULT_DRAWMODE ); - GetScreen()->SetModify(); + OnModify( ); Cmp->DisplayInfo( this ); } diff --git a/eeschema/edit_graphic_bodyitem_text.cpp b/eeschema/edit_graphic_bodyitem_text.cpp index 04781d5722..bf07b068c3 100644 --- a/eeschema/edit_graphic_bodyitem_text.cpp +++ b/eeschema/edit_graphic_bodyitem_text.cpp @@ -241,7 +241,7 @@ void WinEDA_LibeditFrame::EditSymbolText(wxDC* DC, LIB_DRAW_ITEM* DrawItem) (LIB_TEXT*) DrawItem ); frame->ShowModal(); frame->Destroy(); - GetScreen()->SetModify(); + OnModify( ); /* Display new text. */ if( DC ) @@ -279,7 +279,7 @@ void WinEDA_LibeditFrame::RotateSymbolText(wxDC * DC) else DrawItem->m_Orient = TEXT_ORIENT_HORIZ; - GetScreen()->SetModify(); + OnModify( ); /* Redraw item with new orient */ if ( DrawPanel->ManageCurseur == NULL ) diff --git a/eeschema/edit_label.cpp b/eeschema/edit_label.cpp index 0312420103..7ad283fac0 100644 --- a/eeschema/edit_label.cpp +++ b/eeschema/edit_label.cpp @@ -62,7 +62,7 @@ void WinEDA_SchematicFrame::StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC ) GetScreen()->m_Curseur = ItemInitialPosition; DrawPanel->MouseToCursorSchema(); - GetScreen()->SetModify(); + OnModify( ); DrawPanel->ManageCurseur = ShowWhileMoving; DrawPanel->ForceCloseManageCurseur = ExitMoveTexte; GetScreen()->SetCurItem( TextStruct ); @@ -107,7 +107,7 @@ void WinEDA_SchematicFrame::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC ) break; } - GetScreen()->SetModify(); + OnModify( ); RedrawOneStruct( DrawPanel, DC, TextStruct, g_XorMode ); DrawPanel->CursorOn( DC ); } @@ -321,7 +321,7 @@ void WinEDA_SchematicFrame::ConvertTextType( SCH_TEXT* Text, { newtext->SetNext( GetScreen()->EEDrawList ); GetScreen()->EEDrawList = newtext; - GetScreen()->SetModify(); + OnModify( ); } /* now delete the old text diff --git a/eeschema/getpart.cpp b/eeschema/getpart.cpp index 80c38a8b1f..9f63260856 100644 --- a/eeschema/getpart.cpp +++ b/eeschema/getpart.cpp @@ -272,7 +272,7 @@ void WinEDA_SchematicFrame::CmpRotationMiroir( SCH_COMPONENT* DrawComponent, } TestDanglingEnds( GetScreen()->EEDrawList, DC ); - GetScreen()->SetModify(); + OnModify( ); } @@ -351,7 +351,7 @@ void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent, GR_DEFAULT_DRAWMODE ); TestDanglingEnds( GetScreen()->EEDrawList, DC ); - GetScreen()->SetModify(); + OnModify( ); } @@ -397,7 +397,7 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent, GR_DEFAULT_DRAWMODE ); TestDanglingEnds( GetScreen()->EEDrawList, DC ); - GetScreen()->SetModify(); + OnModify( ); } diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index 1bb40315d7..9c876049bf 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -325,7 +325,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, if( !ItemInEdit && screen->m_BlockLocate.m_State == STATE_NO_BLOCK ) { RefreshToolBar = LocateAndDeleteItem( this, DC ); - GetScreen()->SetModify(); + OnModify( ); GetScreen()->SetCurItem( NULL ); TestDanglingEnds( GetScreen()->EEDrawList, DC ); } diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index 8d0dc5ce63..d6c6955bc5 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -561,7 +561,7 @@ created. Aborted" ) ); g_EditPinByPinIsOn = false; m_lastDrawItem = NULL; GetScreen()->ClearUndoRedoList(); - GetScreen()->SetModify(); + OnModify( ); DrawPanel->Refresh(); } diff --git a/eeschema/libedit_onleftclick.cpp b/eeschema/libedit_onleftclick.cpp index 1049c889d4..d6418163d3 100644 --- a/eeschema/libedit_onleftclick.cpp +++ b/eeschema/libedit_onleftclick.cpp @@ -136,7 +136,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) else m_component->RemoveDrawItem( DrawEntry, DrawPanel, DC ); DrawEntry = NULL; - GetScreen()->SetModify(); + OnModify( ); break; case ID_LIBEDIT_ANCHOR_ITEM_BUTT: diff --git a/eeschema/libedit_undo_redo.cpp b/eeschema/libedit_undo_redo.cpp index 694991c309..0cd81a78b8 100644 --- a/eeschema/libedit_undo_redo.cpp +++ b/eeschema/libedit_undo_redo.cpp @@ -69,7 +69,7 @@ void WinEDA_LibeditFrame::GetComponentFromRedoList(wxCommandEvent& event) SetShowDeMorgan( m_component->HasConversion() ); DisplayLibInfos(); DisplayCmpDoc(); - GetScreen()->SetModify(); + OnModify( ); DrawPanel->Refresh(); } @@ -105,6 +105,6 @@ void WinEDA_LibeditFrame::GetComponentFromUndoList(wxCommandEvent& event) SetShowDeMorgan( m_component->HasConversion() ); DisplayLibInfos(); DisplayCmpDoc(); - GetScreen()->SetModify(); + OnModify( ); DrawPanel->Refresh(); } diff --git a/eeschema/libeditframe.cpp b/eeschema/libeditframe.cpp index 93d7ec0eba..fecf169d0e 100644 --- a/eeschema/libeditframe.cpp +++ b/eeschema/libeditframe.cpp @@ -799,7 +799,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) } m_drawItem = NULL; - GetScreen()->SetModify(); + OnModify( ); DrawPanel->CursorOn( &dc ); break; diff --git a/eeschema/libeditframe.h b/eeschema/libeditframe.h index d91de2afb9..b16838d7d9 100644 --- a/eeschema/libeditframe.h +++ b/eeschema/libeditframe.h @@ -90,6 +90,15 @@ public: void LoadSettings(); void SaveSettings(); + /** Function OnModify() + * Must be called after a schematic change + * in order to set the "modify" flag of the current screen + */ + void OnModify( ) + { + GetScreen()->SetModify(); + } + LIB_COMPONENT* GetComponent( void ) { return m_component; } CMP_LIBRARY* GetLibrary( void ) { return m_library; } diff --git a/eeschema/libfield.cpp b/eeschema/libfield.cpp index e5aa168661..797142bd63 100644 --- a/eeschema/libfield.cpp +++ b/eeschema/libfield.cpp @@ -120,7 +120,7 @@ void WinEDA_LibeditFrame::PlaceField( wxDC* DC, LIB_FIELD* Field ) &fieldText, DefaultTransformMatrix ); DrawPanel->CursorOn( DC ); - GetScreen()->SetModify(); + OnModify( ); DrawPanel->ManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL; m_drawItem = NULL; @@ -217,7 +217,7 @@ not conflict with any library entries." ), Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, drawMode, &fieldText, DefaultTransformMatrix ); - GetScreen()->SetModify(); + OnModify( ); UpdateAliasSelectList(); } @@ -234,7 +234,7 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LIB_FIELD* Field ) if( Field == NULL ) return; - GetScreen()->SetModify(); + OnModify( ); DrawPanel->CursorOff( DC ); GRSetDrawMode( DC, g_XorMode ); diff --git a/eeschema/onleftclick.cpp b/eeschema/onleftclick.cpp index b771c68a53..3f88a45dad 100644 --- a/eeschema/onleftclick.cpp +++ b/eeschema/onleftclick.cpp @@ -149,7 +149,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) case ID_SCHEMATIC_DELETE_ITEM_BUTT: LocateAndDeleteItem( this, DC ); - GetScreen()->SetModify(); + OnModify( ); GetScreen()->SetCurItem( NULL ); TestDanglingEnds( GetScreen()->EEDrawList, NULL ); DrawPanel->Refresh( TRUE ); diff --git a/eeschema/pinedit.cpp b/eeschema/pinedit.cpp index 4cd867dba2..a5f97fa41d 100644 --- a/eeschema/pinedit.cpp +++ b/eeschema/pinedit.cpp @@ -62,7 +62,7 @@ void WinEDA_LibeditFrame::OnRotatePin( wxCommandEvent& event ){ // Set the new orientation pin->SetOrientation(pin->GetOrientationCode(orientationIndex)); - GetScreen()->SetModify(); + OnModify( ); pin->DisplayInfo( this ); DrawPanel->Refresh(); @@ -158,7 +158,7 @@ void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event ) if( !pin->IsNew() ) SaveCopyInUndoList( pin->GetParent() ); - GetScreen()->SetModify(); + OnModify( ); pin->DisplayInfo( this ); DrawPanel->Refresh(); } @@ -244,7 +244,7 @@ another pin. Continue?" ) ); DrawPanel->ManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL; - GetScreen()->SetModify(); + OnModify( ); CurrentPin->m_Pos = newpos; if( CurrentPin->IsNew() ) @@ -394,7 +394,7 @@ void WinEDA_LibeditFrame::DeletePin( wxDC* DC, } } - GetScreen()->SetModify(); + OnModify( ); } @@ -539,7 +539,7 @@ void WinEDA_LibeditFrame::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id ) if( MasterPin->Type() != COMPONENT_PIN_DRAW_TYPE ) return; - GetScreen()->SetModify(); + OnModify( ); Pin = m_component->GetNextPin(); for( ; Pin != NULL; Pin = m_component->GetNextPin( Pin ) ) @@ -614,7 +614,7 @@ void WinEDA_LibeditFrame::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin ) DrawPanel->CursorOn( DC ); Pin->DisplayInfo( this ); - GetScreen()->SetModify(); + OnModify( ); } diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index 81867f7c00..a9072f233f 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -349,7 +349,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) g_ItemToRepeat = NULL; TestDanglingEnds( screen->EEDrawList, &dc ); SetSheetNumberAndCount(); - screen->SetModify(); + OnModify(); } break; @@ -370,7 +370,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_SCH_EDIT_SHEET: if( EditSheet( (SCH_SHEET*) screen->GetCurItem(), &dc ) ) - screen->SetModify(); + OnModify(); break; case ID_POPUP_IMPORT_GLABEL: diff --git a/eeschema/schematic_undo_redo.cpp b/eeschema/schematic_undo_redo.cpp index b5f2ba3e72..634097706a 100644 --- a/eeschema/schematic_undo_redo.cpp +++ b/eeschema/schematic_undo_redo.cpp @@ -438,7 +438,7 @@ void WinEDA_SchematicFrame::GetSchematicFromUndoList(wxCommandEvent& event) GetScreen()->PushCommandToRedoList( List ); // m_drawItem = NULL; - GetScreen()->SetModify(); + OnModify( ); SetSheetNumberAndCount(); ReCreateHToolbar(); SetToolbars(); @@ -471,7 +471,7 @@ void WinEDA_SchematicFrame::GetSchematicFromRedoList(wxCommandEvent& event) GetScreen()->PushCommandToUndoList( List ); // m_drawItem = NULL; - GetScreen()->SetModify(); + OnModify( ); SetSheetNumberAndCount(); ReCreateHToolbar(); SetToolbars(); diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index e6674fd636..ca80ddebf7 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -449,6 +449,27 @@ wxString WinEDA_SchematicFrame::GetUniqueFilenameForCurrentSheet() return filename; } +/** Function OnModify() + * Must be called after a schematic change + * in order to set the "modify" flag of the current screen + * and update the date in frame reference + */ +void WinEDA_SchematicFrame::OnModify( ) +{ + GetScreen()->SetModify( ); + + wxString date = GenDate(); + EDA_ScreenList s_list; + + // Set the date for each sheet + // There are 2 possibilities: + // >> change only the current sheet + // >> change all sheets. + // I believe all sheets in a project must have the same date + SCH_SCREEN* screen = s_list.GetFirst(); + for( ; screen != NULL; screen = s_list.GetNext() ) + screen->m_Date = date; +} /***************************************************************************** * Enable or disable menu entry and toolbar buttons according to current diff --git a/eeschema/sheet.cpp b/eeschema/sheet.cpp index f74140f676..2749e38dc4 100644 --- a/eeschema/sheet.cpp +++ b/eeschema/sheet.cpp @@ -260,7 +260,7 @@ void WinEDA_SchematicFrame::ReSizeSheet( SCH_SHEET* aSheet, wxDC* aDC ) return; } - GetScreen()->SetModify(); + OnModify( ); aSheet->m_Flags |= IS_RESIZED; s_OldPos.x = aSheet->m_Size.x; diff --git a/eeschema/sheetlab.cpp b/eeschema/sheetlab.cpp index b067b5ef62..a1ba069123 100644 --- a/eeschema/sheetlab.cpp +++ b/eeschema/sheetlab.cpp @@ -294,7 +294,7 @@ SCH_SHEET_PIN* WinEDA_SchematicFrame::Create_PinSheet( SCH_SHEET* Sheet, DrawPanel->ForceCloseManageCurseur = ExitPinSheet; DrawPanel->ManageCurseur( DrawPanel, DC, TRUE ); - GetScreen()->SetModify(); + OnModify( ); return NewSheetLabel; } @@ -340,7 +340,7 @@ SCH_SHEET_PIN* WinEDA_SchematicFrame::Import_PinSheet( SCH_SHEET* Sheet, return NULL; } - GetScreen()->SetModify(); + OnModify( ); NewSheetLabel = new SCH_SHEET_PIN( Sheet, wxPoint( 0, 0 ), HLabel->m_Text ); NewSheetLabel->m_Flags = IS_NEW; diff --git a/eeschema/symbdraw.cpp b/eeschema/symbdraw.cpp index 432add4a0d..28ce86c3d6 100644 --- a/eeschema/symbdraw.cpp +++ b/eeschema/symbdraw.cpp @@ -116,7 +116,7 @@ void WinEDA_LibeditFrame::EditGraphicSymbol( wxDC* DC, LIB_DRAW_ITEM* DrawItem ) if( component ) component->GetDrawItemList().sort(); - GetScreen()->SetModify(); + OnModify( ); DrawItem->DisplayInfo( this ); DrawPanel->Refresh(); @@ -915,7 +915,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) m_drawItem->m_Flags = 0; m_drawItem = NULL; - GetScreen()->SetModify(); + OnModify( ); DrawPanel->ManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL; diff --git a/eeschema/symbedit.cpp b/eeschema/symbedit.cpp index 5a6b30a20b..25acbe107a 100644 --- a/eeschema/symbedit.cpp +++ b/eeschema/symbedit.cpp @@ -106,7 +106,7 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void ) m_component->RemoveDuplicateDrawItems(); m_component->ClearSelectedItems(); - GetScreen()->SetModify(); + OnModify( ); DrawPanel->Refresh(); delete Lib; @@ -229,7 +229,7 @@ void WinEDA_LibeditFrame::PlaceAncre() wxPoint offset( -GetScreen()->m_Curseur.x, GetScreen()->m_Curseur.y ); - GetScreen()->SetModify(); + OnModify( ); m_component->SetOffset( offset ); diff --git a/include/wxEeschemaStruct.h b/include/wxEeschemaStruct.h index b06a57320d..0b94b79ae8 100644 --- a/include/wxEeschemaStruct.h +++ b/include/wxEeschemaStruct.h @@ -120,6 +120,12 @@ public: m_CurrentField = aCurrentField; } + /** Function OnModify() + * Must be called after a schematic change + * in order to set the "modify" flag of the current screen + * and update the date in frame reference + */ + void OnModify( ); SCH_SHEET_PATH* GetSheet(); diff --git a/version.txt b/version.txt index e491db8fdb..0bec5e2e4f 100644 --- a/version.txt +++ b/version.txt @@ -1,4 +1,4 @@ release version: 2010 feb 17 files (.zip,.tgz): -kicad-2010-02-17-RC3 +kicad-2010-02-17-RC3a