Commit 15479871 authored by charras's avatar charras

some enhancements.

parent 5cd2fad8
This diff is collapsed.
...@@ -214,14 +214,14 @@ public: ...@@ -214,14 +214,14 @@ public:
wxDC* DC, const wxPoint& pos ); wxDC* DC, const wxPoint& pos );
// Pads sur modules // Pads sur modules
void AddPad( MODULE* Module, wxDC* DC ); void AddPad( MODULE* Module, bool draw );
void DeletePad( D_PAD* Pad, wxDC* DC ); void DeletePad( D_PAD* Pad, wxDC* DC );
void StartMovePad( D_PAD* Pad, wxDC* DC ); void StartMovePad( D_PAD* Pad, wxDC* DC );
void RotatePad( D_PAD* Pad, wxDC* DC ); void RotatePad( D_PAD* Pad, wxDC* DC );
void PlacePad( D_PAD* Pad, wxDC* DC ); void PlacePad( D_PAD* Pad, wxDC* DC );
void Export_Pad_Settings( D_PAD* pt_pad ); void Export_Pad_Settings( D_PAD* aPad );
void Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC ); void Import_Pad_Settings( D_PAD* aPad, bool aDraw );
void Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC ); void Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw );
// loading footprints // loading footprints
......
...@@ -82,6 +82,23 @@ void D_PAD::ComputeRayon() ...@@ -82,6 +82,23 @@ void D_PAD::ComputeRayon()
} }
/**
* Function GetBoundingBox
* returns the bounding box of this pad
* Mainly used to redraw the screen area occuped by the pad
*/
EDA_Rect D_PAD::GetBoundingBox()
{
// Calculate area:
ComputeRayon(); // calculate the radius of the area, considered as a circle
EDA_Rect area;
area.SetOrigin(m_Pos);
area.Inflate(m_Rayon, m_Rayon);
return area;
}
/*********************************************/ /*********************************************/
const wxPoint D_PAD::ReturnShapePos() const wxPoint D_PAD::ReturnShapePos()
/*********************************************/ /*********************************************/
...@@ -239,6 +256,9 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -239,6 +256,9 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
int zoom; int zoom;
int fillpad = 0; int fillpad = 0;
wxPoint shape_pos; wxPoint shape_pos;
if ( m_Flags & DO_NOT_DRAW )
return;
wxASSERT( panel ); wxASSERT( panel );
......
...@@ -172,6 +172,13 @@ public: ...@@ -172,6 +172,13 @@ public:
} }
/**
* Function GetBoundingBox
* returns the bounding box of this Footprint
* Mainly used to redraw the screen area occuped by the footprint
*/
EDA_Rect GetBoundingBox();
/** /**
* Function Compare * Function Compare
* compares two pads and return 0 if they are equal. * compares two pads and return 0 if they are equal.
......
...@@ -30,6 +30,7 @@ PCB_SCREEN::PCB_SCREEN( int idscreen ) : BASE_SCREEN( TYPESCREEN ) ...@@ -30,6 +30,7 @@ PCB_SCREEN::PCB_SCREEN( int idscreen ) : BASE_SCREEN( TYPESCREEN )
m_Type = idscreen; m_Type = idscreen;
SetGridList( g_GridList ); SetGridList( g_GridList );
SetZoomList( zoom_list ); SetZoomList( zoom_list );
m_Grid = wxSize( 500, 500 ); /* pas de la grille en 1/10000 "*/
Init(); Init();
} }
...@@ -50,7 +51,6 @@ void PCB_SCREEN::Init() ...@@ -50,7 +51,6 @@ void PCB_SCREEN::Init()
m_Route_Layer_TOP = CMP_N; /* ref couches par defaut pour vias (Cu.. Cmp) */ m_Route_Layer_TOP = CMP_N; /* ref couches par defaut pour vias (Cu.. Cmp) */
m_Route_Layer_BOTTOM = COPPER_LAYER_N; m_Route_Layer_BOTTOM = COPPER_LAYER_N;
m_Zoom = 128; /* valeur */ m_Zoom = 128; /* valeur */
m_Grid = wxSize( 500, 500 ); /* pas de la grille en 1/10000 "*/
} }
......
...@@ -663,12 +663,12 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -663,12 +663,12 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_IMPORT_PAD_SETTINGS: case ID_POPUP_PCB_IMPORT_PAD_SETTINGS:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
Import_Pad_Settings( (D_PAD*) GetCurItem(), &dc ); Import_Pad_Settings( (D_PAD*) GetCurItem(), true );
break; break;
case ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS: case ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
Global_Import_Pad_Settings( (D_PAD*) GetCurItem(), &dc ); Global_Import_Pad_Settings( (D_PAD*) GetCurItem(), true );
break; break;
case ID_POPUP_PCB_EXPORT_PAD_SETTINGS: case ID_POPUP_PCB_EXPORT_PAD_SETTINGS:
......
...@@ -442,8 +442,12 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event ) ...@@ -442,8 +442,12 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
Module = (MODULE*) CurrentPad->m_Parent; Module = (MODULE*) CurrentPad->m_Parent;
Module->m_LastEdit_Time = time( NULL ); Module->m_LastEdit_Time = time( NULL );
if( m_DC ) if( m_DC )// redraw the area where the pas was, without pad
CurrentPad->Draw( m_Parent->DrawPanel, m_DC, GR_XOR ); {
CurrentPad->m_Flags |= DO_NOT_DRAW;
m_Parent->DrawPanel->PostDirtyRect( CurrentPad->GetBoundingBox() );
CurrentPad->m_Flags &= ~DO_NOT_DRAW;
}
CurrentPad->m_PadShape = g_Pad_Master.m_PadShape; CurrentPad->m_PadShape = g_Pad_Master.m_PadShape;
CurrentPad->m_Attribut = g_Pad_Master.m_Attribut; CurrentPad->m_Attribut = g_Pad_Master.m_Attribut;
if (CurrentPad->m_Pos != g_Pad_Master.m_Pos ) if (CurrentPad->m_Pos != g_Pad_Master.m_Pos )
...@@ -529,8 +533,8 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event ) ...@@ -529,8 +533,8 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
CurrentPad->Display_Infos( m_Parent ); CurrentPad->Display_Infos( m_Parent );
if( m_DC ) if( m_DC )// redraw the area where the pas was
CurrentPad->Draw( m_Parent->DrawPanel, m_DC, GR_OR ); m_Parent->DrawPanel->PostDirtyRect( CurrentPad->GetBoundingBox() );
m_Parent->GetScreen()->SetModify(); m_Parent->GetScreen()->SetModify();
} }
......
...@@ -98,7 +98,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event ) ...@@ -98,7 +98,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
Clear_Pcb(TRUE ); Clear_Pcb(TRUE );
wxSetWorkingDirectory( wxPathOnly( GetLastProject( id - ID_LOAD_FILE_1 ) ) ); wxSetWorkingDirectory( wxPathOnly( GetLastProject( id - ID_LOAD_FILE_1 ) ) );
LoadOnePcbFile( GetLastProject( id - ID_LOAD_FILE_1 ).GetData(), LoadOnePcbFile( GetLastProject( id - ID_LOAD_FILE_1 ).GetData(),
FALSE ); false );
ReCreateAuxiliaryToolbar(); ReCreateAuxiliaryToolbar();
break; break;
...@@ -211,7 +211,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append ) ...@@ -211,7 +211,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
// Reload the corresponding configuration file: // Reload the corresponding configuration file:
wxSetWorkingDirectory( wxPathOnly( GetScreen()->m_FileName ) ); wxSetWorkingDirectory( wxPathOnly( GetScreen()->m_FileName ) );
if( Append ) if( Append )
ReadPcbFile( source, TRUE ); ReadPcbFile( source, true );
else else
{ {
Read_Config( GetScreen()->m_FileName ); Read_Config( GetScreen()->m_FileName );
...@@ -222,7 +222,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append ) ...@@ -222,7 +222,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
m_DisplayModEdge = DisplayOpt.DisplayModEdge; m_DisplayModEdge = DisplayOpt.DisplayModEdge;
m_DisplayPadFill = DisplayOpt.DisplayPadFill; m_DisplayPadFill = DisplayOpt.DisplayPadFill;
ReadPcbFile( source, FALSE ); ReadPcbFile( source, false );
} }
fclose( source ); fclose( source );
...@@ -245,18 +245,18 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append ) ...@@ -245,18 +245,18 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
/* reset the auto save timer */ /* reset the auto save timer */
g_SaveTime = time( NULL ); g_SaveTime = time( NULL );
#if 0 && defined(DEBUG) #if 0 && defined(DEBUG)
// note this freezes up pcbnew when run under the kicad project // note this freezes up pcbnew when run under the kicad project
// manager. runs fine from command prompt. This is because the kicad // manager. runs fine from command prompt. This is because the kicad
// project manager redirects stdout of the child pcbnew process to itself, // project manager redirects stdout of the child pcbnew process to itself,
// but never reads from that pipe, and that in turn eventually blocks // but never reads from that pipe, and that in turn eventually blocks
// the pcbnew program when the pipe it is writing to gets full. // the pcbnew program when the pipe it is writing to gets full.
// Output the board object tree to stdout, but please run from command prompt: // Output the board object tree to stdout, but please run from command prompt:
m_Pcb->Show( 0, std::cout ); m_Pcb->Show( 0, std::cout );
#endif #endif
return 1; return 1;
} }
...@@ -273,14 +273,14 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName ) ...@@ -273,14 +273,14 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
wxString upperTxt; wxString upperTxt;
wxString lowerTxt; wxString lowerTxt;
wxString msg; wxString msg;
bool saveok = TRUE; bool saveok = TRUE;
FILE* dest; FILE* dest;
if( FileName == wxEmptyString ) if( FileName == wxEmptyString )
{ {
msg = wxT( "*" ) + PcbExtBuffer; msg = wxT( "*" ) + PcbExtBuffer;
FullFileName = EDA_FileSelector( _( "Save board files:" ), FullFileName = EDA_FileSelector( _( "Save board files:" ),
wxEmptyString, /* Chemin par defaut */ wxEmptyString, /* Chemin par defaut */
GetScreen()->m_FileName, /* nom fichier par defaut */ GetScreen()->m_FileName, /* nom fichier par defaut */
...@@ -292,7 +292,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName ) ...@@ -292,7 +292,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
); );
if( FullFileName == wxEmptyString ) if( FullFileName == wxEmptyString )
return FALSE; return FALSE;
GetScreen()->m_FileName = FullFileName; GetScreen()->m_FileName = FullFileName;
} }
else else
...@@ -327,7 +327,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName ) ...@@ -327,7 +327,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
} }
else else
{ {
BackupFileName = wxEmptyString; BackupFileName = wxEmptyString;
saveok = FALSE; saveok = FALSE;
} }
...@@ -344,7 +344,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName ) ...@@ -344,7 +344,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
{ {
GetScreen()->m_FileName = FullFileName; GetScreen()->m_FileName = FullFileName;
SetTitle( GetScreen()->m_FileName ); SetTitle( GetScreen()->m_FileName );
SavePcbFormatAscii( dest ); SavePcbFormatAscii( dest );
fclose( dest ); fclose( dest );
} }
...@@ -364,9 +364,9 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName ) ...@@ -364,9 +364,9 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
lowerTxt += FullFileName; lowerTxt += FullFileName;
Affiche_1_Parametre( this, 1, upperTxt, lowerTxt, CYAN ); Affiche_1_Parametre( this, 1, upperTxt, lowerTxt, CYAN );
g_SaveTime = time( NULL ); /* Reset timer for the automatic saving */ g_SaveTime = time( NULL ); /* Reset timer for the automatic saving */
GetScreen()->ClrModify(); GetScreen()->ClrModify();
return TRUE; return TRUE;
} }
...@@ -38,7 +38,6 @@ class WinEDA_PadGlobalEditFrame : public wxDialog ...@@ -38,7 +38,6 @@ class WinEDA_PadGlobalEditFrame : public wxDialog
private: private:
WinEDA_BasePcbFrame* m_Parent; WinEDA_BasePcbFrame* m_Parent;
wxDC* m_DC;
D_PAD* CurrentPad; D_PAD* CurrentPad;
wxCheckBox* m_Pad_Shape_Filter; wxCheckBox* m_Pad_Shape_Filter;
wxCheckBox* m_Pad_Layer_Filter; wxCheckBox* m_Pad_Layer_Filter;
...@@ -51,8 +50,7 @@ private: ...@@ -51,8 +50,7 @@ private:
public: public:
// Constructor and destructor // Constructor and destructor
WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame * parent, WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame * parent, D_PAD * Pad );
D_PAD * Pad, wxDC * DC, const wxPoint &pos );
~WinEDA_PadGlobalEditFrame() { } ~WinEDA_PadGlobalEditFrame() { }
private: private:
...@@ -72,10 +70,8 @@ END_EVENT_TABLE() ...@@ -72,10 +70,8 @@ END_EVENT_TABLE()
/********************************************************************************/ /********************************************************************************/
WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* parent, WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* parent,
D_PAD* Pad, D_PAD* Pad ) :
wxDC* DC, wxDialog( parent, -1, _( "Pads Global Edit" ), wxDefaultPosition, wxSize( 310, 235 ),
const wxPoint& framepos ) :
wxDialog( parent, -1, _( "Pads Global Edit" ), framepos, wxSize( 310, 235 ),
DIALOG_STYLE ) DIALOG_STYLE )
/********************************************************************************/ /********************************************************************************/
{ {
...@@ -84,7 +80,6 @@ WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* paren ...@@ -84,7 +80,6 @@ WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* paren
m_Parent = parent; m_Parent = parent;
SetFont( *g_DialogFont ); SetFont( *g_DialogFont );
m_DC = DC;
Centre(); Centre();
CurrentPad = Pad; CurrentPad = Pad;
...@@ -206,26 +201,24 @@ void WinEDA_PadGlobalEditFrame::PadPropertiesAccept( wxCommandEvent& event ) ...@@ -206,26 +201,24 @@ void WinEDA_PadGlobalEditFrame::PadPropertiesAccept( wxCommandEvent& event )
/***************************************************************************/ /***************************************************************************/
void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC ) void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
/***************************************************************************/ /***************************************************************************/
/* /** Function Global_Import_Pad_Settings
* Routine de selection et de correction des dimensions des pastilles * Function to change pad caracteristics for the given footprint
* de tous les modules * or alls footprints which look like the given footprint
* - semblables a l'module de reference selectionnee, * @param aPad pad to use as pattern. The given footprint is the parent of this pad
* c.a.d de meme nom de librairie * @param aDraw: if true: redraws the footprint
* - ou sur l'module localisee, selon le menu d'appel
*/ */
{ {
D_PAD* pt_pad;
MODULE* Module_Ref, * Module; MODULE* Module_Ref, * Module;
int diag; int diag;
bool Edit_Same_Modules = FALSE; bool Edit_Same_Modules = FALSE;
if( Pad == NULL ) if( aPad == NULL )
return; return;
Module = (MODULE*) Pad->m_Parent; Module = (MODULE*) aPad->m_Parent;
if( Module == NULL ) if( Module == NULL )
{ {
...@@ -237,8 +230,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC ) ...@@ -237,8 +230,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC )
Module->Display_Infos( this ); Module->Display_Infos( this );
WinEDA_PadGlobalEditFrame* frame = new WinEDA_PadGlobalEditFrame( this, Pad, DC, WinEDA_PadGlobalEditFrame* frame = new WinEDA_PadGlobalEditFrame( this, aPad );
wxPoint( -1, -1 ) );
diag = frame->ShowModal(); diag = frame->ShowModal();
frame->Destroy(); frame->Destroy();
...@@ -266,9 +258,14 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC ) ...@@ -266,9 +258,14 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC )
Module->Display_Infos( this ); Module->Display_Infos( this );
/* Effacement du module */ /* Effacement du module */
Module->Draw( DrawPanel, DC, GR_XOR ); if ( aDraw )
{
pt_pad = (D_PAD*) Module->m_Pads; Module->m_Flags |= DO_NOT_DRAW;
DrawPanel->PostDirtyRect( Module->GetBoundingBox() );
Module->m_Flags &= ~DO_NOT_DRAW;
}
D_PAD* pt_pad = (D_PAD*) Module->m_Pads;
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext ) for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext )
{ {
/* Filtrage des modifications interdites */ /* Filtrage des modifications interdites */
...@@ -345,7 +342,8 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC ) ...@@ -345,7 +342,8 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC )
} }
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Module->Draw( DrawPanel, DC, GR_OR ); if ( aDraw )
DrawPanel->PostDirtyRect( Module->GetBoundingBox() );
} }
GetScreen()->SetModify(); GetScreen()->SetModify();
......
...@@ -145,7 +145,9 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query ) ...@@ -145,7 +145,9 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
SetCurItem( NULL ); SetCurItem( NULL );
/* Init parametres de gestion */ /* Init parametres de gestion */
wxSize gridsize = GetScreen()->GetGrid();
((PCB_SCREEN*)GetScreen())->Init(); ((PCB_SCREEN*)GetScreen())->Init();
GetScreen()->SetGrid( gridsize );
g_HightLigt_Status = 0; g_HightLigt_Status = 0;
......
...@@ -355,19 +355,6 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum ) ...@@ -355,19 +355,6 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
continue; continue;
} }
if( stricmp( Line, "GridSize" ) == 0 )
{
wxSize Grid;
Grid.x = atoi( data );
data = strtok( NULL, " =\n\r" );
if( data )
Grid.y = atoi( data );
else
Grid.y = Grid.x;
GetScreen()->SetGrid( Grid );
continue;
}
if( stricmp( Line, "ZoneGridSize" ) == 0 ) if( stricmp( Line, "ZoneGridSize" ) == 0 )
{ {
g_GridRoutingSize = atoi( data ); g_GridRoutingSize = atoi( data );
...@@ -518,23 +505,12 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard ) ...@@ -518,23 +505,12 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard )
/******************************************************************************/ /******************************************************************************/
{ {
char text[1024]; char text[1024];
int ii, jj; int ii;
fprintf( aFile, "$SETUP\n" ); fprintf( aFile, "$SETUP\n" );
sprintf( text, "InternalUnit %f INCH\n", 1.0 / PCB_INTERNAL_UNIT ); sprintf( text, "InternalUnit %f INCH\n", 1.0 / PCB_INTERNAL_UNIT );
fprintf( aFile, text ); fprintf( aFile, text );
if( aFrame->GetScreen()->m_UserGridIsON )
ii = jj = -1;
else
{
ii = aFrame->GetScreen()->GetGrid().x;
jj = aFrame->GetScreen()->GetGrid().y;
}
sprintf( text, "GridSize %d %d\n", ii, jj );
fprintf( aFile, text );
sprintf( text, "UserGridSize %lf %lf %s\n", sprintf( text, "UserGridSize %lf %lf %s\n",
aFrame->GetScreen()->m_UserGrid.x, aFrame->GetScreen()->m_UserGrid.y, aFrame->GetScreen()->m_UserGrid.x, aFrame->GetScreen()->m_UserGrid.y,
( g_UserGrid_Unit == 0 ) ? "INCH" : "mm" ); ( g_UserGrid_Unit == 0 ) ? "INCH" : "mm" );
...@@ -551,7 +527,7 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard ) ...@@ -551,7 +527,7 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard )
} }
fprintf( aFile, "TrackWidth %d\n", g_DesignSettings.m_CurrentTrackWidth ); fprintf( aFile, "TrackWidth %d\n", g_DesignSettings.m_CurrentTrackWidth );
for( ii = 0; ii < HISTORY_NUMBER; ii++ ) for( int ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
if( g_DesignSettings.m_TrackWidthHistory[ii] == 0 ) if( g_DesignSettings.m_TrackWidthHistory[ii] == 0 )
break; break;
......
...@@ -462,12 +462,12 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -462,12 +462,12 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_IMPORT_PAD_SETTINGS: case ID_POPUP_PCB_IMPORT_PAD_SETTINGS:
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( m_Pcb->m_Modules );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
Import_Pad_Settings( (D_PAD*) GetScreen()->GetCurItem(), &dc ); Import_Pad_Settings( (D_PAD*) GetScreen()->GetCurItem(), true );
break; break;
case ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS: case ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS:
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( m_Pcb->m_Modules );
Global_Import_Pad_Settings( (D_PAD*) GetScreen()->GetCurItem(), &dc ); Global_Import_Pad_Settings( (D_PAD*) GetScreen()->GetCurItem(), true );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;
......
...@@ -157,7 +157,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -157,7 +157,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
if( m_Pcb->m_Modules ) if( m_Pcb->m_Modules )
{ {
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( m_Pcb->m_Modules );
AddPad( m_Pcb->m_Modules, DC ); AddPad( m_Pcb->m_Modules, true );
} }
break; break;
......
...@@ -132,7 +132,7 @@ void WinEDA_BasePcbFrame::Export_Pad_Settings( D_PAD* pt_pad ) ...@@ -132,7 +132,7 @@ void WinEDA_BasePcbFrame::Export_Pad_Settings( D_PAD* pt_pad )
/***********************************************************************/ /***********************************************************************/
void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC ) void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* aPad, bool aDraw )
/***********************************************************************/ /***********************************************************************/
/* Met a jour les nouvelles valeurs de dimensions du pad pointe par pt_pad /* Met a jour les nouvelles valeurs de dimensions du pad pointe par pt_pad
...@@ -141,29 +141,33 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC ) ...@@ -141,29 +141,33 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC )
* - la position et les noms ne sont pas touches * - la position et les noms ne sont pas touches
*/ */
{ {
if( DC ) if( aDraw )
pt_pad->Draw( DrawPanel, DC, GR_XOR ); {
aPad->m_Flags |= DO_NOT_DRAW;
pt_pad->m_PadShape = g_Pad_Master.m_PadShape; DrawPanel->PostDirtyRect( aPad->GetBoundingBox() );
pt_pad->m_Masque_Layer = g_Pad_Master.m_Masque_Layer; aPad->m_Flags &= ~DO_NOT_DRAW;
pt_pad->m_Attribut = g_Pad_Master.m_Attribut; }
pt_pad->m_Orient = g_Pad_Master.m_Orient +
( (MODULE*) pt_pad->m_Parent )->m_Orient; aPad->m_PadShape = g_Pad_Master.m_PadShape;
pt_pad->m_Size = g_Pad_Master.m_Size; aPad->m_Masque_Layer = g_Pad_Master.m_Masque_Layer;
pt_pad->m_DeltaSize = wxSize( 0, 0 ); aPad->m_Attribut = g_Pad_Master.m_Attribut;
pt_pad->m_Offset = g_Pad_Master.m_Offset; aPad->m_Orient = g_Pad_Master.m_Orient +
pt_pad->m_Drill = g_Pad_Master.m_Drill; ( (MODULE*) aPad->m_Parent )->m_Orient;
pt_pad->m_DrillShape = g_Pad_Master.m_DrillShape; aPad->m_Size = g_Pad_Master.m_Size;
aPad->m_DeltaSize = wxSize( 0, 0 );
aPad->m_Offset = g_Pad_Master.m_Offset;
aPad->m_Drill = g_Pad_Master.m_Drill;
aPad->m_DrillShape = g_Pad_Master.m_DrillShape;
/* Traitement des cas particuliers : */ /* Traitement des cas particuliers : */
switch( g_Pad_Master.m_PadShape ) switch( g_Pad_Master.m_PadShape )
{ {
case PAD_TRAPEZOID: case PAD_TRAPEZOID:
pt_pad->m_DeltaSize = g_Pad_Master.m_DeltaSize; aPad->m_DeltaSize = g_Pad_Master.m_DeltaSize;
break; break;
case PAD_CIRCLE: case PAD_CIRCLE:
pt_pad->m_Size.y = pt_pad->m_Size.x; aPad->m_Size.y = aPad->m_Size.x;
break; break;
} }
...@@ -171,21 +175,21 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC ) ...@@ -171,21 +175,21 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC )
{ {
case PAD_SMD: case PAD_SMD:
case PAD_CONN: case PAD_CONN:
pt_pad->m_Drill = wxSize( 0, 0 ); aPad->m_Drill = wxSize( 0, 0 );
pt_pad->m_Offset.x = 0; aPad->m_Offset.x = 0;
pt_pad->m_Offset.y = 0; aPad->m_Offset.y = 0;
} }
pt_pad->ComputeRayon(); aPad->ComputeRayon();
if( DC ) if( aDraw )
pt_pad->Draw( DrawPanel, DC, GR_XOR ); DrawPanel->PostDirtyRect( aPad->GetBoundingBox() );
( (MODULE*) pt_pad->m_Parent )->m_LastEdit_Time = time( NULL ); ( (MODULE*) aPad->m_Parent )->m_LastEdit_Time = time( NULL );
} }
/***********************************************************/ /***********************************************************/
void WinEDA_BasePcbFrame::AddPad( MODULE* Module, wxDC* DC ) void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw )
/***********************************************************/ /***********************************************************/
/* Routine d'ajout d'un pad sur l'module selectionnee */ /* Routine d'ajout d'un pad sur l'module selectionnee */
{ {
...@@ -218,7 +222,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, wxDC* DC ) ...@@ -218,7 +222,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, wxDC* DC )
} }
/* Mise a jour des caract de la pastille : */ /* Mise a jour des caract de la pastille : */
Import_Pad_Settings( Pad, NULL ); Import_Pad_Settings( Pad, false );
Pad->m_Netname.Empty(); Pad->m_Netname.Empty();
Pad->m_Pos = GetScreen()->m_Curseur; Pad->m_Pos = GetScreen()->m_Curseur;
...@@ -248,7 +252,8 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, wxDC* DC ) ...@@ -248,7 +252,8 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, wxDC* DC )
/* Redessin du module */ /* Redessin du module */
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Pad->Display_Infos( this ); Pad->Display_Infos( this );
Module->Draw( DrawPanel, DC, GR_OR ); if ( draw )
DrawPanel->PostDirtyRect( Module->GetBoundingBox() );
} }
......
This diff is collapsed.
...@@ -332,7 +332,7 @@ WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) : ...@@ -332,7 +332,7 @@ WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) :
_( "Exclude contents of Edges_Pcb layer from all other layers" ) ); _( "Exclude contents of Edges_Pcb layer from all other layers" ) );
LeftBoxSizer->Add( m_Exclude_Edges_Pcb, 0, wxGROW | wxALL, 1 ); LeftBoxSizer->Add( m_Exclude_Edges_Pcb, 0, wxGROW | wxALL, 1 );
// Option d'impression du cartouche: // Option to plot page references:
if( m_Parent->m_Print_Sheet_Ref ) if( m_Parent->m_Print_Sheet_Ref )
{ {
m_Plot_Sheet_Ref = new wxCheckBox( this, ID_PRINT_REF, _( "Print sheet ref" ) ); m_Plot_Sheet_Ref = new wxCheckBox( this, ID_PRINT_REF, _( "Print sheet ref" ) );
......
This diff is collapsed.
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