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 )
bool ProcessExecute( const wxString& aCommandLine, int aFlags )
{
#ifdef __WINDOWS__
wxExecute(aCommandLine);
return true;
#else
wxProcess* process = wxProcess::Open( aCommandLine, aFlags );
return process != NULL;
#endif
}
......
......@@ -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
* accessible par la liste globale directement */
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;
}
......@@ -965,10 +965,6 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM * DrawStruct )
if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE )
{
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
frame->SaveCopyInUndoList( DrawStruct, IS_DELETED );
......
......@@ -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
* if DC != NULL, redraw Sheet
* if aRedraw != NULL, redraw Sheet
*/
{
Hierarchical_PIN_Sheet_Struct* Pinsheet, * NextPinsheet;
if( !IsOK( frame, _( "Ok to cleanup this sheet" ) ) )
if( !IsOK( aFrame, _( "Ok to cleanup this sheet" ) ) )
return;
Pinsheet = m_Label;
......@@ -272,11 +272,15 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC )
NextPinsheet = Pinsheet->Next();
if( HLabel == NULL ) // Hlabel not found: delete pinsheet
{
frame->GetScreen()->SetModify();
frame->DeleteSheetLabel( DC, Pinsheet );
aFrame->GetScreen()->SetModify();
aFrame->DeleteSheetLabel( false, Pinsheet );
}
Pinsheet = NextPinsheet;
}
if( aRedraw )
aFrame->DrawPanel->PostDirtyRect( GetBoundingBox() );
}
......
......@@ -108,7 +108,7 @@ public:
void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
DrawSheetStruct* GenCopy();
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,
int draw_mode, int Color = -1 );
EDA_Rect GetBoundingBox();
......
......@@ -270,7 +270,6 @@ void DrawMarkerStruct::Show( int nestLevel, std::ostream& os )
bool DrawMarkerStruct::Save( FILE* aFile ) const
{
bool success = true;
wxString msg;
if( fprintf( aFile, "Kmarq %c %-4d %-4d \"%s\" F=%X\n",
int( m_Type ) + 'A',
......
......@@ -286,7 +286,7 @@ void Write_GENERIC_NetList( WinEDA_SchematicFrame* frame,
fprintf( tmpfile, "\n$BeginComponent\n" );
fprintf( tmpfile, "TimeStamp=%8.8lX\n", Component->m_TimeStamp );
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( "_" ) );
fprintf( tmpfile, CONV_TO_UTF8( Line ) );
......
......@@ -383,7 +383,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_CLEANUP_SHEET:
( (DrawSheetStruct*)
screen->GetCurItem() )->CleanupSheet( this, &dc );
screen->GetCurItem() )->CleanupSheet( this, true );
break;
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 "gr_basic.h"
......@@ -408,21 +408,18 @@ Hierarchical_PIN_Sheet_Struct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheet
/**************************************************************/
void WinEDA_SchematicFrame::DeleteSheetLabel( wxDC* DC,
Hierarchical_PIN_Sheet_Struct* SheetLabelToDel )
void WinEDA_SchematicFrame::DeleteSheetLabel( bool aRedraw,
Hierarchical_PIN_Sheet_Struct* aSheetLabelToDel )
/**************************************************************/
/*
* 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
* possible de la ratacher a la 'DrawSheetStruct' d'origine
* si DC != NULL, effacement a l'ecran du dessin
* possible de la rattacher a la 'DrawSheetStruct' d'origine
* si aRedraw == true, effacement a l'ecran du dessin
*/
{
if( DC )
RedrawOneStruct( DrawPanel, DC, SheetLabelToDel, g_XorMode );
DrawSheetStruct* parent = (DrawSheetStruct*) SheetLabelToDel->m_Parent;
DrawSheetStruct* parent = (DrawSheetStruct*) aSheetLabelToDel->m_Parent;
wxASSERT( parent );
wxASSERT( parent->Type() == DRAW_SHEET_STRUCT_TYPE );
......@@ -438,19 +435,23 @@ void WinEDA_SchematicFrame::DeleteSheetLabel( wxDC* DC,
Hierarchical_PIN_Sheet_Struct* label = parent->m_Label;
for( ; label; prev=label, label=label->Next() )
{
if( label == SheetLabelToDel )
if( label == aSheetLabelToDel )
{
if( prev )
prev->Pnext = label->Next();
else
parent->m_Label = label->Next();
delete SheetLabelToDel;
delete aSheetLabelToDel;
break;
}
}
if( aRedraw )
DrawPanel->PostDirtyRect( parent->GetBoundingBox() );
#if 0 && defined(DEBUG)
std::cout << "\n\nafter deleting:\n" << std::flush;
parent->Show( 0, std::cout );
......
......@@ -216,7 +216,7 @@ private:
Hierarchical_PIN_Sheet_Struct* Import_PinSheet( DrawSheetStruct* Sheet, wxDC* DC );
public:
void DeleteSheetLabel( wxDC* DC, Hierarchical_PIN_Sheet_Struct* SheetLabelToDel );
void DeleteSheetLabel( bool aRedraw, Hierarchical_PIN_Sheet_Struct* aSheetLabelToDel );
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