removed use of a DC in WinEDA_PcbFrame::LoadOnePcbFile().

This commit is contained in:
charras 2008-03-31 08:00:15 +00:00
parent 3e06ab44db
commit 5ec1359a91
4 changed files with 17 additions and 20 deletions

View File

@ -378,8 +378,8 @@ public:
void ToPostProcess( wxCommandEvent& event );
void Files_io( wxCommandEvent& event );
int LoadOnePcbFile( const wxString& FileName, wxDC* DC, bool Append );
int ReadPcbFile( wxDC* DC, FILE* File, bool Append );
int LoadOnePcbFile( const wxString& FileName, bool Append );
int ReadPcbFile( FILE* File, bool Append );
bool SavePcbFile( const wxString& FileName );
int SavePcbFormatAscii( FILE* File );
bool WriteGeneralDescrPcb( FILE* File );

View File

@ -18,14 +18,14 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
*/
{
int id = event.GetId();
wxClientDC dc( DrawPanel );
wxString msg;
DrawPanel->PrepareGraphicContext( &dc );
// If an edition is in progress, stop it
if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur )
{
wxClientDC dc( DrawPanel );
DrawPanel->PrepareGraphicContext( &dc );
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
}
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
@ -35,7 +35,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
case ID_MENU_LOAD_FILE:
case ID_LOAD_FILE:
Clear_Pcb(TRUE );
LoadOnePcbFile( wxEmptyString, &dc, FALSE );
LoadOnePcbFile( wxEmptyString,FALSE );
ReCreateAuxiliaryToolbar();
break;
@ -65,7 +65,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
break;
}
Clear_Pcb( TRUE );
LoadOnePcbFile( filename, &dc, FALSE );
LoadOnePcbFile( filename, FALSE );
GetScreen()->m_FileName = oldfilename;
SetTitle( GetScreen()->m_FileName );
ReCreateAuxiliaryToolbar();
@ -74,7 +74,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
case ID_MENU_APPEND_FILE:
case ID_APPEND_FILE:
LoadOnePcbFile( wxEmptyString, &dc, TRUE );
LoadOnePcbFile( wxEmptyString, TRUE );
break;
case ID_MENU_NEW_BOARD:
@ -98,7 +98,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
Clear_Pcb(TRUE );
wxSetWorkingDirectory( wxPathOnly( GetLastProject( id - ID_LOAD_FILE_1 ) ) );
LoadOnePcbFile( GetLastProject( id - ID_LOAD_FILE_1 ).GetData(),
&dc, FALSE );
FALSE );
ReCreateAuxiliaryToolbar();
break;
@ -121,9 +121,9 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
}
/*****************************************************************************************/
int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC * DC, bool Append )
/******************************************************************************************/
/*******************************************************************************/
int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
/*******************************************************************************/
/**
* Read a board file
@ -200,7 +200,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC * DC, bo
// Reload the corresponding configuration file:
wxSetWorkingDirectory( wxPathOnly( GetScreen()->m_FileName ) );
if( Append )
ReadPcbFile( DC, source, TRUE );
ReadPcbFile( source, TRUE );
else
{
Read_Config( GetScreen()->m_FileName );
@ -211,7 +211,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC * DC, bo
m_DisplayModEdge = DisplayOpt.DisplayModEdge;
m_DisplayPadFill = DisplayOpt.DisplayPadFill;
ReadPcbFile( DC, source, FALSE );
ReadPcbFile( source, FALSE );
}
fclose( source );
@ -229,6 +229,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC * DC, bo
build_liste_pads();
m_Pcb->Display_Infos( this );
DrawPanel->Refresh( true);
/* reset the auto save timer */
g_SaveTime = time( NULL );

View File

@ -771,7 +771,7 @@ static bool ReadSheetDescr( BASE_SCREEN* screen, FILE* File, int* LineNum )
/********************************************************************/
int WinEDA_PcbFrame::ReadPcbFile( wxDC* DC, FILE* File, bool Append )
int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
/********************************************************************/
/** ReadPcbFile
@ -1026,10 +1026,9 @@ int WinEDA_PcbFrame::ReadPcbFile( wxDC* DC, FILE* File, bool Append )
Affiche_Message( wxEmptyString );
BestZoom();
DrawPanel->ReDraw(DC, true);
#ifdef PCBNEW
Compile_Ratsnest( DC, TRUE );
Compile_Ratsnest( NULL, TRUE );
#endif
return 1;
}

View File

@ -89,10 +89,7 @@ bool WinEDA_App::OnInit()
/* Load file specified in the command line. */
if( !FFileName.IsEmpty() )
{
wxClientDC dc( m_PcbFrame->DrawPanel );
m_PcbFrame->DrawPanel->PrepareGraphicContext( &dc );
m_PcbFrame->LoadOnePcbFile( FFileName, &dc, FALSE );
m_PcbFrame->LoadOnePcbFile( FFileName, FALSE );
}
return TRUE;