Commit 6bd3fea1 authored by charras's avatar charras

wxProcess::open does not work under windows (the process stays in background...

wxProcess::open does not work under windows (the process stays in background mode), wxExecute is still used under windows
Minor other changes
parent ba92f94f
...@@ -246,9 +246,13 @@ void* MyMalloc( size_t nb_octets ) ...@@ -246,9 +246,13 @@ void* MyMalloc( size_t nb_octets )
bool ProcessExecute( const wxString& aCommandLine, int aFlags ) bool ProcessExecute( const wxString& aCommandLine, int aFlags )
{ {
#ifdef __WINDOWS__
wxExecute(aCommandLine);
return true;
#else
wxProcess* process = wxProcess::Open( aCommandLine, aFlags ); wxProcess* process = wxProcess::Open( aCommandLine, aFlags );
return process != NULL; return process != NULL;
#endif
} }
......
...@@ -934,7 +934,7 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM * DrawStruct ) ...@@ -934,7 +934,7 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM * DrawStruct )
/* Cette stucture est rattachee a une feuille, et n'est pas /* Cette stucture est rattachee a une feuille, et n'est pas
* accessible par la liste globale directement */ * accessible par la liste globale directement */
frame->SaveCopyInUndoList( (SCH_ITEM*) ( (Hierarchical_PIN_Sheet_Struct*) DrawStruct )->m_Parent, IS_CHANGED ); frame->SaveCopyInUndoList( (SCH_ITEM*) ( (Hierarchical_PIN_Sheet_Struct*) DrawStruct )->m_Parent, IS_CHANGED );
frame->DeleteSheetLabel( DC, (Hierarchical_PIN_Sheet_Struct*) DrawStruct ); frame->DeleteSheetLabel( DC ? true : false , (Hierarchical_PIN_Sheet_Struct*) DrawStruct );
return; return;
} }
...@@ -965,10 +965,6 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM * DrawStruct ) ...@@ -965,10 +965,6 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM * DrawStruct )
if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE ) if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE )
{ {
frame->SaveCopyInUndoList( DrawStruct, IS_DELETED ); // Currently In TEST frame->SaveCopyInUndoList( DrawStruct, IS_DELETED ); // Currently In TEST
// SAFE_DELETE(DrawStruct);
//no undo/redo for this (for now), it is on both the EEDrawList and m_SubSheet arrays,
//hence the undo logic would have to be extended for this.
} }
else else
frame->SaveCopyInUndoList( DrawStruct, IS_DELETED ); frame->SaveCopyInUndoList( DrawStruct, IS_DELETED );
......
...@@ -240,16 +240,16 @@ void DrawSheetStruct::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) ...@@ -240,16 +240,16 @@ void DrawSheetStruct::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
/********************************************************************/ /********************************************************************/
void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC ) void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* aFrame, bool aRedraw )
/********************************************************************/ /********************************************************************/
/* Delete pinsheets which are not corresponding to a hierarchal label /* Delete pinsheets which are not corresponding to a hierarchal label
* if DC != NULL, redraw Sheet * if aRedraw != NULL, redraw Sheet
*/ */
{ {
Hierarchical_PIN_Sheet_Struct* Pinsheet, * NextPinsheet; Hierarchical_PIN_Sheet_Struct* Pinsheet, * NextPinsheet;
if( !IsOK( frame, _( "Ok to cleanup this sheet" ) ) ) if( !IsOK( aFrame, _( "Ok to cleanup this sheet" ) ) )
return; return;
Pinsheet = m_Label; Pinsheet = m_Label;
...@@ -272,11 +272,15 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC ) ...@@ -272,11 +272,15 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC )
NextPinsheet = Pinsheet->Next(); NextPinsheet = Pinsheet->Next();
if( HLabel == NULL ) // Hlabel not found: delete pinsheet if( HLabel == NULL ) // Hlabel not found: delete pinsheet
{ {
frame->GetScreen()->SetModify(); aFrame->GetScreen()->SetModify();
frame->DeleteSheetLabel( DC, Pinsheet ); aFrame->DeleteSheetLabel( false, Pinsheet );
} }
Pinsheet = NextPinsheet; Pinsheet = NextPinsheet;
} }
if( aRedraw )
aFrame->DrawPanel->PostDirtyRect( GetBoundingBox() );
} }
......
...@@ -108,7 +108,7 @@ public: ...@@ -108,7 +108,7 @@ public:
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ); void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
DrawSheetStruct* GenCopy(); DrawSheetStruct* GenCopy();
void Display_Infos( WinEDA_DrawFrame* frame ); void Display_Infos( WinEDA_DrawFrame* frame );
void CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC ); void CleanupSheet( WinEDA_SchematicFrame* frame, bool aRedraw );
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 ); int draw_mode, int Color = -1 );
EDA_Rect GetBoundingBox(); EDA_Rect GetBoundingBox();
......
...@@ -270,7 +270,6 @@ void DrawMarkerStruct::Show( int nestLevel, std::ostream& os ) ...@@ -270,7 +270,6 @@ void DrawMarkerStruct::Show( int nestLevel, std::ostream& os )
bool DrawMarkerStruct::Save( FILE* aFile ) const bool DrawMarkerStruct::Save( FILE* aFile ) const
{ {
bool success = true; bool success = true;
wxString msg;
if( fprintf( aFile, "Kmarq %c %-4d %-4d \"%s\" F=%X\n", if( fprintf( aFile, "Kmarq %c %-4d %-4d \"%s\" F=%X\n",
int( m_Type ) + 'A', int( m_Type ) + 'A',
......
...@@ -286,7 +286,7 @@ void Write_GENERIC_NetList( WinEDA_SchematicFrame* frame, ...@@ -286,7 +286,7 @@ void Write_GENERIC_NetList( WinEDA_SchematicFrame* frame,
fprintf( tmpfile, "\n$BeginComponent\n" ); fprintf( tmpfile, "\n$BeginComponent\n" );
fprintf( tmpfile, "TimeStamp=%8.8lX\n", Component->m_TimeStamp ); fprintf( tmpfile, "TimeStamp=%8.8lX\n", Component->m_TimeStamp );
fprintf( tmpfile, "Footprint=%s\n", CONV_TO_UTF8( FootprintName ) ); fprintf( tmpfile, "Footprint=%s\n", CONV_TO_UTF8( FootprintName ) );
Line = wxT( "Reference=" ) + Component->GetPath(sheet) + wxT( "\n" ); Line = wxT( "Reference=" ) + Component->GetRef(sheet) + wxT( "\n" );
Line.Replace( wxT( " " ), wxT( "_" ) ); Line.Replace( wxT( " " ), wxT( "_" ) );
fprintf( tmpfile, CONV_TO_UTF8( Line ) ); fprintf( tmpfile, CONV_TO_UTF8( Line ) );
......
...@@ -383,7 +383,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -383,7 +383,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_CLEANUP_SHEET: case ID_POPUP_SCH_CLEANUP_SHEET:
( (DrawSheetStruct*) ( (DrawSheetStruct*)
screen->GetCurItem() )->CleanupSheet( this, &dc ); screen->GetCurItem() )->CleanupSheet( this, true );
break; break;
case ID_POPUP_SCH_EDIT_PINSHEET: case ID_POPUP_SCH_EDIT_PINSHEET:
......
/****************************************************************/ /**************************************************************************/
/* sheetlab.cpp module pour creation /editin des Sheet labels */ /* sheetlab.cpp create and edit the Hierarchical_PIN_Sheet_Struct items */
/****************************************************************/ /**************************************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -408,21 +408,18 @@ Hierarchical_PIN_Sheet_Struct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheet ...@@ -408,21 +408,18 @@ Hierarchical_PIN_Sheet_Struct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheet
/**************************************************************/ /**************************************************************/
void WinEDA_SchematicFrame::DeleteSheetLabel( wxDC* DC, void WinEDA_SchematicFrame::DeleteSheetLabel( bool aRedraw,
Hierarchical_PIN_Sheet_Struct* SheetLabelToDel ) Hierarchical_PIN_Sheet_Struct* aSheetLabelToDel )
/**************************************************************/ /**************************************************************/
/* /*
* Routine de suppression de 1 Structure type (Hierarchical_PIN_Sheet_Struct. * Routine de suppression de 1 Structure type (Hierarchical_PIN_Sheet_Struct.
* Cette Structure ne peut etre mise en pile "undelete" car il ne serait pas * Cette Structure ne peut etre mise en pile "undelete" car il ne serait pas
* possible de la ratacher a la 'DrawSheetStruct' d'origine * possible de la rattacher a la 'DrawSheetStruct' d'origine
* si DC != NULL, effacement a l'ecran du dessin * si aRedraw == true, effacement a l'ecran du dessin
*/ */
{ {
if( DC ) DrawSheetStruct* parent = (DrawSheetStruct*) aSheetLabelToDel->m_Parent;
RedrawOneStruct( DrawPanel, DC, SheetLabelToDel, g_XorMode );
DrawSheetStruct* parent = (DrawSheetStruct*) SheetLabelToDel->m_Parent;
wxASSERT( parent ); wxASSERT( parent );
wxASSERT( parent->Type() == DRAW_SHEET_STRUCT_TYPE ); wxASSERT( parent->Type() == DRAW_SHEET_STRUCT_TYPE );
...@@ -438,19 +435,23 @@ void WinEDA_SchematicFrame::DeleteSheetLabel( wxDC* DC, ...@@ -438,19 +435,23 @@ void WinEDA_SchematicFrame::DeleteSheetLabel( wxDC* DC,
Hierarchical_PIN_Sheet_Struct* label = parent->m_Label; Hierarchical_PIN_Sheet_Struct* label = parent->m_Label;
for( ; label; prev=label, label=label->Next() ) for( ; label; prev=label, label=label->Next() )
{ {
if( label == SheetLabelToDel ) if( label == aSheetLabelToDel )
{ {
if( prev ) if( prev )
prev->Pnext = label->Next(); prev->Pnext = label->Next();
else else
parent->m_Label = label->Next(); parent->m_Label = label->Next();
delete SheetLabelToDel; delete aSheetLabelToDel;
break; break;
} }
} }
if( aRedraw )
DrawPanel->PostDirtyRect( parent->GetBoundingBox() );
#if 0 && defined(DEBUG) #if 0 && defined(DEBUG)
std::cout << "\n\nafter deleting:\n" << std::flush; std::cout << "\n\nafter deleting:\n" << std::flush;
parent->Show( 0, std::cout ); parent->Show( 0, std::cout );
......
...@@ -216,7 +216,7 @@ private: ...@@ -216,7 +216,7 @@ private:
Hierarchical_PIN_Sheet_Struct* Import_PinSheet( DrawSheetStruct* Sheet, wxDC* DC ); Hierarchical_PIN_Sheet_Struct* Import_PinSheet( DrawSheetStruct* Sheet, wxDC* DC );
public: public:
void DeleteSheetLabel( wxDC* DC, Hierarchical_PIN_Sheet_Struct* SheetLabelToDel ); void DeleteSheetLabel( bool aRedraw, Hierarchical_PIN_Sheet_Struct* aSheetLabelToDel );
private: private:
......
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