Commit 126c384d authored by charras's avatar charras

Eeschema date in frame reference updated at each modification.

parent 71c327b2
......@@ -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
......
......@@ -228,7 +228,7 @@ void WinEDA_SchematicFrame::DeleteAnnotation( bool aCurrentSheetOnly,
}
}
screen->SetModify();
OnModify( );
if( aCurrentSheetOnly )
break;
screen = ScreenList.GetNext();
......
......@@ -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;
}
......
......@@ -259,7 +259,7 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
break;
}
GetScreen()->SetModify();
OnModify();
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
......
......@@ -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;
}
......
......@@ -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( );
}
......
......@@ -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;
......
......@@ -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 );
}
......@@ -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;
}
......
......@@ -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 );
......
......@@ -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 )
......
......@@ -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 );
}
......
......@@ -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;
}
......
......@@ -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 );
}
......@@ -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 )
......
......@@ -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
......
......@@ -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( );
}
......
......@@ -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 );
}
......
......@@ -561,7 +561,7 @@ created. Aborted" ) );
g_EditPinByPinIsOn = false;
m_lastDrawItem = NULL;
GetScreen()->ClearUndoRedoList();
GetScreen()->SetModify();
OnModify( );
DrawPanel->Refresh();
}
......
......@@ -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:
......
......@@ -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();
}
......@@ -799,7 +799,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
}
m_drawItem = NULL;
GetScreen()->SetModify();
OnModify( );
DrawPanel->CursorOn( &dc );
break;
......
......@@ -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; }
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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( );
}
......
......@@ -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:
......
......@@ -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();
......
......@@ -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
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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();
......
release version:
2010 feb 17
files (.zip,.tgz):
kicad-2010-02-17-RC3
kicad-2010-02-17-RC3a
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment