Commit 506a73c3 authored by stambaughw's avatar stambaughw

More comment translation work.

* Translate source files D through L in pcbnew.
* Add translate tag for comments that did not translate correctly.
parent ab66f9ec
...@@ -902,7 +902,7 @@ float WinEDA_PcbFrame::Compute_Ratsnest_PlaceModule( wxDC* DC ) ...@@ -902,7 +902,7 @@ float WinEDA_PcbFrame::Compute_Ratsnest_PlaceModule( wxDC* DC )
/* Draw keep out area of a module. */ /* Draw keep out area of a module. */
/***********************************/ /***********************************/
/* ??? /* TRANSLATE
* les cellules ( du plan des Distances ) du rectangle x0,y0 a x1,y1 sont * les cellules ( du plan des Distances ) du rectangle x0,y0 a x1,y1 sont
* incrementees de la valeur Penalite * incrementees de la valeur Penalite
* celles qui sont externes au rectangle, mais internes au rectangle * celles qui sont externes au rectangle, mais internes au rectangle
......
...@@ -344,7 +344,7 @@ int Build_Work( BOARD* Pcb ) ...@@ -344,7 +344,7 @@ int Build_Work( BOARD* Pcb )
for( unsigned ii = 0; ii < Pcb->GetRatsnestsCount(); ii++ ) for( unsigned ii = 0; ii < Pcb->GetRatsnestsCount(); ii++ )
{ {
pt_rats = &Pcb->m_FullRatsnest[ii]; pt_rats = &Pcb->m_FullRatsnest[ii];
/* ??? On ne route que les chevelus actifs et routables */ /* TRANSLATE On ne route que les chevelus actifs et routables */
if( (pt_rats->m_Status & CH_ACTIF) == 0 ) if( (pt_rats->m_Status & CH_ACTIF) == 0 )
continue; continue;
if( pt_rats->m_Status & CH_UNROUTABLE ) if( pt_rats->m_Status & CH_UNROUTABLE )
......
/*********************************************/ /******************************************/
/* Edition des pistes: Routines d'effacement */ /* Edit Track: Erase Routines */
/* Effacement de segment, piste, net et zone */ /* Delete segments, tracks, and net areas */
/*********************************************/ /******************************************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -14,16 +13,12 @@ ...@@ -14,16 +13,12 @@
#include "protos.h" #include "protos.h"
/***************************************************************/ /* Removes 1 segment of track.
TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) * 2 cases:
/***************************************************************/ * If There is evidence of new track: delete new segment.
* Otherwise, delete segment under the cursor.
/* Supprime 1 segment de piste.
* 2 Cas possibles:
* Si On est en trace de nouvelle piste: Effacement du segment en
* cours de trace
* Sinon : Effacment du segment sous le curseur.
*/ */
TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
{ {
int current_net_code; int current_net_code;
...@@ -36,7 +31,8 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) ...@@ -36,7 +31,8 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
return NULL; return NULL;
} }
if( aTrack->m_Flags & IS_NEW ) // Trace in progress, erase the last segment if( aTrack->m_Flags & IS_NEW ) // Trace in progress, erase the last
// segment
{ {
if( g_CurrentTrackList.GetCount() > 0 ) if( g_CurrentTrackList.GetCount() > 0 )
{ {
...@@ -44,7 +40,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) ...@@ -44,7 +40,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
D( g_CurrentTrackList.VerifyListIntegrity(); ) D( g_CurrentTrackList.VerifyListIntegrity(); )
// effacement de la piste en cours // Delete the current trace
ShowNewTrackWhenMovingCursor( DrawPanel, DC, FALSE ); ShowNewTrackWhenMovingCursor( DrawPanel, DC, FALSE );
// delete the most recently entered // delete the most recently entered
...@@ -52,8 +48,9 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) ...@@ -52,8 +48,9 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
if( g_TwoSegmentTrackBuild ) if( g_TwoSegmentTrackBuild )
{ {
// if in 2 track mode, and the next most recent is a segment not a via, // if in 2 track mode, and the next most recent is a segment
// and the one previous to that is a via, then delete up to the via. // not a via, and the one previous to that is a via, then
// delete up to the via.
if( g_CurrentTrackList.GetCount() >= 2 if( g_CurrentTrackList.GetCount() >= 2
&& g_CurrentTrackSegment->Type() != TYPE_VIA && g_CurrentTrackSegment->Type() != TYPE_VIA
&& g_CurrentTrackSegment->Back()->Type() == TYPE_VIA ) && g_CurrentTrackSegment->Back()->Type() == TYPE_VIA )
...@@ -62,22 +59,26 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) ...@@ -62,22 +59,26 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
} }
} }
while( g_CurrentTrackSegment && g_CurrentTrackSegment->Type() == TYPE_VIA ) while( g_CurrentTrackSegment && g_CurrentTrackSegment->Type() ==
TYPE_VIA )
{ {
delete g_CurrentTrackList.PopBack(); delete g_CurrentTrackList.PopBack();
if( g_CurrentTrackSegment && g_CurrentTrackSegment->Type() != TYPE_VIA ) if( g_CurrentTrackSegment && g_CurrentTrackSegment->Type() !=
TYPE_VIA )
previous_layer = g_CurrentTrackSegment->GetLayer(); previous_layer = g_CurrentTrackSegment->GetLayer();
} }
// Rectification couche active qui a pu changer si une via // Correct active layer which could change if a via
// a ete effacee // has been erased
( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = previous_layer; ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = previous_layer;
UpdateStatusBar(); UpdateStatusBar();
if( g_TwoSegmentTrackBuild ) // We must have 2 segments or more, or 0 if( g_TwoSegmentTrackBuild ) // We must have 2 segments or more,
// or 0
{ {
if( g_CurrentTrackList.GetCount()==1 && g_CurrentTrackSegment->Type() != TYPE_VIA ) if( g_CurrentTrackList.GetCount() == 1
&& g_CurrentTrackSegment->Type() != TYPE_VIA )
{ {
delete g_CurrentTrackList.PopBack(); delete g_CurrentTrackList.PopBack();
} }
...@@ -107,9 +108,10 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) ...@@ -107,9 +108,10 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
current_net_code = aTrack->GetNet(); current_net_code = aTrack->GetNet();
DLIST<TRACK>* container = (DLIST<TRACK>*) aTrack->GetList(); DLIST<TRACK>* container = (DLIST<TRACK>*)aTrack->GetList();
wxASSERT( container ); wxASSERT( container );
container->Remove( aTrack ); container->Remove( aTrack );
// redraw the area where the track was // redraw the area where the track was
DrawPanel->PostDirtyRect( aTrack->GetBoundingBox() ); DrawPanel->PostDirtyRect( aTrack->GetBoundingBox() );
...@@ -122,9 +124,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) ...@@ -122,9 +124,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
} }
/**********************************************************/
void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* aTrack ) void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* aTrack )
/**********************************************************/
{ {
if( aTrack != NULL ) if( aTrack != NULL )
{ {
...@@ -136,18 +136,16 @@ void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* aTrack ) ...@@ -136,18 +136,16 @@ void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* aTrack )
} }
/********************************************************/
void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack ) void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack )
/********************************************************/
{ {
if( aTrack == NULL ) if( aTrack == NULL )
return; return;
if( !IsOK( this, _( "Delete NET ?" ) ) ) if( !IsOK( this, _( "Delete NET?" ) ) )
return; return;
PICKED_ITEMS_LIST itemsList; PICKED_ITEMS_LIST itemsList;
ITEM_PICKER picker(NULL,UR_DELETED); ITEM_PICKER picker( NULL, UR_DELETED );
int net_code_delete = aTrack->GetNet(); int net_code_delete = aTrack->GetNet();
/* Search the first item for the given net code */ /* Search the first item for the given net code */
...@@ -155,7 +153,7 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack ) ...@@ -155,7 +153,7 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack )
/* Remove all segments having the given net code */ /* Remove all segments having the given net code */
int ii = 0; int ii = 0;
TRACK * next_track; TRACK* next_track;
for( TRACK* segm = trackList; segm; segm = next_track, ++ii ) for( TRACK* segm = trackList; segm; segm = next_track, ++ii )
{ {
next_track = segm->Next(); next_track = segm->Next();
...@@ -163,64 +161,63 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack ) ...@@ -163,64 +161,63 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack )
break; break;
GetBoard()->m_Track.Remove( segm ); GetBoard()->m_Track.Remove( segm );
// redraw the area where the track was // redraw the area where the track was
DrawPanel->PostDirtyRect( segm->GetBoundingBox() ); DrawPanel->PostDirtyRect( segm->GetBoundingBox() );
picker.m_PickedItem = segm; picker.m_PickedItem = segm;
picker.m_PickedItemType = segm->Type(); picker.m_PickedItemType = segm->Type();
itemsList.PushItem(picker); itemsList.PushItem( picker );
} }
SaveCopyInUndoList( itemsList, UR_DELETED ); SaveCopyInUndoList( itemsList, UR_DELETED );
GetScreen()->SetModify(); GetScreen()->SetModify();
test_1_net_connexion( DC, net_code_delete ); test_1_net_connexion( DC, net_code_delete );
GetBoard()->DisplayInfo( this ); GetBoard()->DisplayInfo( this );
} }
/********************************************************************/ /* Remove 1 track:
void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm ) * The leading segment is removed and all adjacent segments
/********************************************************************/ * until a pad or a junction point of more than 2 segments is found
/* Routine de suppression de 1 piste:
* le segment pointe est supprime puis les segments adjacents
* jusqu'a un pad ou un point de jonction de plus de 2 segments
*/ */
void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm )
{ {
int segments_to_delete_count; int segments_to_delete_count;
if( pt_segm == NULL ) if( pt_segm == NULL )
return; return;
TRACK* trackList = Marque_Une_Piste( GetBoard(), pt_segm, &segments_to_delete_count, NULL, true ); TRACK* trackList = Marque_Une_Piste( GetBoard(), pt_segm,
&segments_to_delete_count, NULL, true );
if( segments_to_delete_count == 0 ) if( segments_to_delete_count == 0 )
return; return;
int net_code = pt_segm->GetNet(); int net_code = pt_segm->GetNet();
PICKED_ITEMS_LIST itemsList; PICKED_ITEMS_LIST itemsList;
ITEM_PICKER picker(NULL,UR_DELETED); ITEM_PICKER picker( NULL, UR_DELETED );
int ii = 0; int ii = 0;
TRACK* tracksegment = trackList; TRACK* tracksegment = trackList;
TRACK * next_track; TRACK* next_track;
for( ; ii < segments_to_delete_count; ii++, tracksegment = next_track ) for( ; ii < segments_to_delete_count; ii++, tracksegment = next_track )
{ {
next_track = tracksegment->Next(); next_track = tracksegment->Next();
tracksegment->SetState( BUSY, OFF ); tracksegment->SetState( BUSY, OFF );
D(printf("%s: track %p status=\"%s\"\n", __func__, tracksegment, D( printf( "%s: track %p status=\"%s\"\n", __func__, tracksegment,
CONV_TO_UTF8( TRACK::ShowState( tracksegment->GetState(-1)) ) CONV_TO_UTF8( TRACK::ShowState( tracksegment->GetState( -1 ) ) )
);) ); )
GetBoard()->m_Track.Remove( tracksegment ); GetBoard()->m_Track.Remove( tracksegment );
// redraw the area where the track was // redraw the area where the track was
DrawPanel->PostDirtyRect( tracksegment->GetBoundingBox() ); DrawPanel->PostDirtyRect( tracksegment->GetBoundingBox() );
picker.m_PickedItem = tracksegment; picker.m_PickedItem = tracksegment;
picker.m_PickedItemType = tracksegment->Type(); picker.m_PickedItemType = tracksegment->Type();
itemsList.PushItem(picker); itemsList.PushItem( picker );
} }
SaveCopyInUndoList( itemsList, UR_DELETED ); SaveCopyInUndoList( itemsList, UR_DELETED );
if ( net_code > 0 ) if( net_code > 0 )
test_1_net_connexion( DC, net_code ); test_1_net_connexion( DC, net_code );
} }
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_svg_print.cpp // Name: dialog_svg_print.cpp
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Modified by: // Modified by:
...@@ -56,16 +55,15 @@ private: ...@@ -56,16 +55,15 @@ private:
void OnSetColorModeSelected( wxCommandEvent& event ); void OnSetColorModeSelected( wxCommandEvent& event );
void SetPenWidth(); void SetPenWidth();
void PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ); void PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref );
bool DrawPage( const wxString& FullFileName, BASE_SCREEN* screen, bool aPrint_Framet_Ref ); bool DrawPage( const wxString& FullFileName, BASE_SCREEN* screen,
bool aPrint_Framet_Ref );
}; };
/*******************************************************/
void WinEDA_DrawFrame::SVG_Print( wxCommandEvent& event )
/*******************************************************/
/* Prepare les structures de donnees de gestion de l'impression /* Prepare the data structures of print management
* et affiche la fenetre de dialogue de gestion de l'impression des feuilles * And displays the dialog window management of printing sheets
*/ */
void WinEDA_DrawFrame::SVG_Print( wxCommandEvent& event )
{ {
DIALOG_SVG_PRINT frame( this ); DIALOG_SVG_PRINT frame( this );
...@@ -84,9 +82,7 @@ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( WinEDA_DrawFrame* parent ) : ...@@ -84,9 +82,7 @@ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( WinEDA_DrawFrame* parent ) :
} }
/*************************************************************/
void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event )
/*************************************************************/
{ {
SetFocus(); // Make ESC key working SetFocus(); // Make ESC key working
...@@ -99,7 +95,8 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) ...@@ -99,7 +95,8 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event )
AddUnitSymbol( *m_TextPenWidth, g_UnitMetric ); AddUnitSymbol( *m_TextPenWidth, g_UnitMetric );
m_DialogPenWidth->SetValue( m_DialogPenWidth->SetValue(
ReturnStringFromValue( g_UnitMetric, s_PrintPenMinWidth, m_Parent->m_InternalUnits ) ); ReturnStringFromValue( g_UnitMetric, s_PrintPenMinWidth,
m_Parent->m_InternalUnits ) );
m_Print_Frame_Ref_Ctrl->SetValue( s_Print_Frame_Ref ); m_Print_Frame_Ref_Ctrl->SetValue( s_Print_Frame_Ref );
...@@ -108,15 +105,22 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) ...@@ -108,15 +105,22 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event )
int mask = 1; int mask = 1;
for( int layer = 0; layer<NB_LAYERS; layer++, mask <<= 1 ) for( int layer = 0; layer<NB_LAYERS; layer++, mask <<= 1 )
{ {
m_BoxSelectLayer[layer] = new wxCheckBox( this, -1, board->GetLayerName( layer ) ); m_BoxSelectLayer[layer] =
new wxCheckBox( this, -1, board->GetLayerName( layer ) );
if( mask & s_SelectedLayers ) if( mask & s_SelectedLayers )
m_BoxSelectLayer[layer]->SetValue( true ); m_BoxSelectLayer[layer]->SetValue( true );
if( layer < 16 ) if( layer < 16 )
m_CopperLayersBoxSizer->Add( m_BoxSelectLayer[layer], 0, wxGROW | wxALL, 1 ); m_CopperLayersBoxSizer->Add( m_BoxSelectLayer[layer],
0,
wxGROW | wxALL,
1 );
else else
m_TechnicalBoxSizer->Add( m_BoxSelectLayer[layer], 0, wxGROW | wxALL, 1 ); m_TechnicalBoxSizer->Add( m_BoxSelectLayer[layer],
0,
wxGROW | wxALL,
1 );
} }
if( m_Config ) if( m_Config )
...@@ -141,11 +145,10 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) ...@@ -141,11 +145,10 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event )
} }
/***********************************/
void DIALOG_SVG_PRINT::SetPenWidth() void DIALOG_SVG_PRINT::SetPenWidth()
/***********************************/
{ {
s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth,
m_Parent->m_InternalUnits );
if( s_PrintPenMinWidth > WIDTH_MAX_VALUE ) if( s_PrintPenMinWidth > WIDTH_MAX_VALUE )
{ {
...@@ -158,13 +161,12 @@ void DIALOG_SVG_PRINT::SetPenWidth() ...@@ -158,13 +161,12 @@ void DIALOG_SVG_PRINT::SetPenWidth()
} }
m_DialogPenWidth->SetValue( m_DialogPenWidth->SetValue(
ReturnStringFromValue( g_UnitMetric, s_PrintPenMinWidth, m_Parent->m_InternalUnits ) ); ReturnStringFromValue( g_UnitMetric, s_PrintPenMinWidth,
m_Parent->m_InternalUnits ) );
} }
/***************************************************************************/
void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ) void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref )
/***************************************************************************/
{ {
wxFileName fn; wxFileName fn;
wxString msg; wxString msg;
...@@ -176,9 +178,9 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ) ...@@ -176,9 +178,9 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref )
if( aPrintAll ) if( aPrintAll )
m_PrintMaskLayer = 0xFFFFFFFF; m_PrintMaskLayer = 0xFFFFFFFF;
for ( int layer = 0; layer<NB_LAYERS; layer++ ) for( int layer = 0; layer<NB_LAYERS; layer++ )
{ {
if ( ! aPrintAll && ! m_BoxSelectLayer[layer]->GetValue( ) ) if( !aPrintAll && !m_BoxSelectLayer[layer]->GetValue() )
continue; continue;
fn = m_FileNameCtrl->GetValue(); fn = m_FileNameCtrl->GetValue();
...@@ -188,16 +190,15 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ) ...@@ -188,16 +190,15 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref )
} }
if( aPrintAll ) if( aPrintAll )
fn.SetName( fn.GetName() + wxT("-brd") ); fn.SetName( fn.GetName() + wxT( "-brd" ) );
else else
{ {
fn.SetName( fn.GetName() + wxT("-") + fn.SetName( fn.GetName() + wxT( "-" ) +
m_BoxSelectLayer[layer]->GetLabel( ) ); m_BoxSelectLayer[layer]->GetLabel() );
m_PrintMaskLayer = 1 << layer; m_PrintMaskLayer = 1 << layer;
if ( m_PrintBoardEdgesCtrl->IsChecked() ) if( m_PrintBoardEdgesCtrl->IsChecked() )
m_PrintMaskLayer |= EDGE_LAYER; m_PrintMaskLayer |= EDGE_LAYER;
} }
fn.SetExt( wxT( "svg" ) ); fn.SetExt( wxT( "svg" ) );
...@@ -209,20 +210,18 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ) ...@@ -209,20 +210,18 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref )
msg += wxT( "\n" ); msg += wxT( "\n" );
m_MessagesBox->AppendText( msg ); m_MessagesBox->AppendText( msg );
if ( aPrintAll ) if( aPrintAll )
break; break;
} }
} }
/**********************************************************************************/
bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* screen,
bool aPrint_Framet_Ref )
/***********************************************************************************/
/* /*
* Routine effective d'impression * Routine actual print
*/ */
bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
BASE_SCREEN* screen,
bool aPrint_Framet_Ref )
{ {
int tmpzoom; int tmpzoom;
wxPoint tmp_startvisu; wxPoint tmp_startvisu;
...@@ -231,7 +230,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre ...@@ -231,7 +230,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre
float dpi; float dpi;
bool success = true; bool success = true;
/* modification des cadrages et reglages locaux */ /* Change frames and local settings */
tmp_startvisu = screen->m_StartVisu; tmp_startvisu = screen->m_StartVisu;
tmpzoom = screen->GetZoom(); tmpzoom = screen->GetZoom();
old_org = screen->m_DrawOrg; old_org = screen->m_DrawOrg;
...@@ -250,16 +249,20 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre ...@@ -250,16 +249,20 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre
EDA_Rect tmp = panel->m_ClipBox; EDA_Rect tmp = panel->m_ClipBox;
GRResetPenAndBrush( &dc ); GRResetPenAndBrush( &dc );
s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth,
m_Parent->m_InternalUnits );
SetPenMinWidth( s_PrintPenMinWidth ); SetPenMinWidth( s_PrintPenMinWidth );
GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? FALSE : true ); GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? FALSE : true );
panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 ); panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 );
panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight( 0x7FFFFF0 ); panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight(
0x7FFFFF0 );
screen->m_IsPrinting = true; screen->m_IsPrinting = true;
SetLocaleTo_C_standard(); // Switch the locale to standard C (needed to print floating point numbers like 1.3) SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
// to print floating point numbers like
// 1.3)
panel->PrintPage( &dc, aPrint_Framet_Ref, m_PrintMaskLayer, false ); panel->PrintPage( &dc, aPrint_Framet_Ref, m_PrintMaskLayer, false );
SetLocaleTo_Default(); // revert to the current locale SetLocaleTo_Default(); // revert to the current locale
screen->m_IsPrinting = false; screen->m_IsPrinting = false;
...@@ -276,35 +279,27 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre ...@@ -276,35 +279,27 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre
} }
/********************************************************************/
void DIALOG_SVG_PRINT::OnButtonPrintBoardClick( wxCommandEvent& event ) void DIALOG_SVG_PRINT::OnButtonPrintBoardClick( wxCommandEvent& event )
/********************************************************************/
{ {
s_Print_Frame_Ref = m_Print_Frame_Ref_Ctrl->IsChecked( ); s_Print_Frame_Ref = m_Print_Frame_Ref_Ctrl->IsChecked();
PrintSVGDoc( true, s_Print_Frame_Ref ); PrintSVGDoc( true, s_Print_Frame_Ref );
} }
/********************************************************************/
void DIALOG_SVG_PRINT::OnButtonPrintSelectedClick( wxCommandEvent& event ) void DIALOG_SVG_PRINT::OnButtonPrintSelectedClick( wxCommandEvent& event )
/********************************************************************/
{ {
s_Print_Frame_Ref = m_Print_Frame_Ref_Ctrl->IsChecked( ); s_Print_Frame_Ref = m_Print_Frame_Ref_Ctrl->IsChecked();
PrintSVGDoc( false, s_Print_Frame_Ref ); PrintSVGDoc( false, s_Print_Frame_Ref );
} }
/******************************************************************/
void DIALOG_SVG_PRINT::OnButtonCancelClick( wxCommandEvent& event ) void DIALOG_SVG_PRINT::OnButtonCancelClick( wxCommandEvent& event )
/******************************************************************/
{ {
Close(); Close();
} }
/***********************************************************/
void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event )
/***********************************************************/
{ {
SetPenWidth(); SetPenWidth();
s_PlotBlackAndWhite = m_ModeColorOption->GetSelection(); s_PlotBlackAndWhite = m_ModeColorOption->GetSelection();
...@@ -323,12 +318,9 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) ...@@ -323,12 +318,9 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event )
} }
/*********************************************************************/
void DIALOG_SVG_PRINT::OnSetColorModeSelected( wxCommandEvent& event )
/*********************************************************************/
/* called on radiobox color/black and white selection /* called on radiobox color/black and white selection
*/ */
void DIALOG_SVG_PRINT::OnSetColorModeSelected( wxCommandEvent& event )
{ {
s_PlotBlackAndWhite = m_ModeColorOption->GetSelection(); s_PlotBlackAndWhite = m_ModeColorOption->GetSelection();
} }
...@@ -257,10 +257,10 @@ void DIALOG_MODULE_MODULE_EDITOR::Browse3DLib( wxCommandEvent& event ) ...@@ -257,10 +257,10 @@ void DIALOG_MODULE_MODULE_EDITOR::Browse3DLib( wxCommandEvent& event )
fullpath.Replace( wxT( "/" ), wxT( "\\" ) ); fullpath.Replace( wxT( "/" ), wxT( "\\" ) );
#endif #endif
fullfilename = EDA_FileSelector( _( "3D Shape:" ), fullfilename = EDA_FileSelector( _( "3D Shape:" ),
fullpath, /* Chemin par defaut */ fullpath,
wxEmptyString, /* nom fichier par defaut */ wxEmptyString,
g_Shapes3DExtBuffer, /* extension par defaut */ g_Shapes3DExtBuffer,
mask, /* Masque d'affichage */ mask,
this, this,
wxFD_OPEN, wxFD_OPEN,
TRUE TRUE
......
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
// Name: dialog_general_options.cpp // Name: dialog_general_options.cpp
// Author: jean-pierre Charras // Author: jean-pierre Charras
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/* functions relatives to the dialogs opened from the main menu : /* functions relatives to the dialogs opened from the main menu :
Preferences/general * Preferences/general
Preferences/display * Preferences/display
*/ */
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
...@@ -18,20 +19,17 @@ ...@@ -18,20 +19,17 @@
#include "pcbnew_id.h" #include "pcbnew_id.h"
/***********************************************************************************/ Dialog_GeneralOptions::Dialog_GeneralOptions( WinEDA_PcbFrame* parent,
Dialog_GeneralOptions::Dialog_GeneralOptions( WinEDA_PcbFrame* parent, wxDC* DC ) : wxDC* DC ) :
DialogGeneralOptionsBoardEditor_base( parent ) DialogGeneralOptionsBoardEditor_base( parent )
/***********************************************************************************/
{ {
m_Parent = parent; m_Parent = parent;
m_DC = DC; m_DC = DC;
init(); init();
} }
/********************************************************************/
void Dialog_GeneralOptions::init() void Dialog_GeneralOptions::init()
/********************************************************************/
{ {
SetFocus(); SetFocus();
...@@ -43,17 +41,18 @@ void Dialog_GeneralOptions::init() ...@@ -43,17 +41,18 @@ void Dialog_GeneralOptions::init()
wxString timevalue; wxString timevalue;
timevalue << g_TimeOut / 60; timevalue << g_TimeOut / 60;
m_SaveTime->SetValue( timevalue ); m_SaveTime->SetValue( timevalue );
/* /*
int layer_count[] = {1,2,4,6,8,10,12,14,16}; * int layer_count[] = {1,2,4,6,8,10,12,14,16};
m_LayerNumber->SetSelection(1); * m_LayerNumber->SetSelection(1);
for ( unsigned ii = 0; ii < sizeof(layer_count); ii++ ) * for ( unsigned ii = 0; ii < sizeof(layer_count); ii++ )
{ * {
if ( g_DesignSettings.m_CopperLayerCount != layer_count[ii] ) * if ( g_DesignSettings.m_CopperLayerCount != layer_count[ii] )
continue; * continue;
m_LayerNumber->SetSelection(ii); * m_LayerNumber->SetSelection(ii);
break; * break;
} * }
*/ */
m_MaxShowLinks->SetValue( g_MaxLinksShowed ); m_MaxShowLinks->SetValue( g_MaxLinksShowed );
m_DrcOn->SetValue( Drc_On ); m_DrcOn->SetValue( Drc_On );
...@@ -76,39 +75,34 @@ void Dialog_GeneralOptions::init() ...@@ -76,39 +75,34 @@ void Dialog_GeneralOptions::init()
} }
/*****************************************************************/
void Dialog_GeneralOptions::OnCancelClick( wxCommandEvent& event ) void Dialog_GeneralOptions::OnCancelClick( wxCommandEvent& event )
/*****************************************************************/
{ {
event.Skip(); event.Skip();
} }
/**************************************************************************/
void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event ) void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
/**************************************************************************/
{ {
int ii; int ii;
DisplayOpt.DisplayPolarCood = DisplayOpt.DisplayPolarCood =
(m_PolarDisplay->GetSelection() == 0) ? FALSE : true; ( m_PolarDisplay->GetSelection() == 0 ) ? FALSE : true;
ii = g_UnitMetric; ii = g_UnitMetric;
g_UnitMetric = (m_UnitsSelection->GetSelection() == 0) ? 0 : 1; g_UnitMetric = ( m_UnitsSelection->GetSelection() == 0 ) ? 0 : 1;
if( ii != g_UnitMetric ) if( ii != g_UnitMetric )
m_Parent->ReCreateAuxiliaryToolbar(); m_Parent->ReCreateAuxiliaryToolbar();
m_Parent->m_CursorShape = m_CursorShape->GetSelection(); m_Parent->m_CursorShape = m_CursorShape->GetSelection();
g_TimeOut = 60 * m_SaveTime->GetValue(); g_TimeOut = 60 * m_SaveTime->GetValue();
/* Mise a jour de la combobox d'affichage de la couche active */ /* Updating the combobox to display the active layer. */
g_MaxLinksShowed = m_MaxShowLinks->GetValue(); g_MaxLinksShowed = m_MaxShowLinks->GetValue();
Drc_On = m_DrcOn->GetValue(); Drc_On = m_DrcOn->GetValue();
if( g_Show_Ratsnest != m_ShowGlobalRatsnest->GetValue() ) if( g_Show_Ratsnest != m_ShowGlobalRatsnest->GetValue() )
{ {
g_Show_Ratsnest = m_ShowGlobalRatsnest->GetValue(); g_Show_Ratsnest = m_ShowGlobalRatsnest->GetValue();
m_Parent->Ratsnest_On_Off( m_DC ); m_Parent->Ratsnest_On_Off( m_DC );
m_Parent->RedrawActiveWindow( m_DC, true); m_Parent->RedrawActiveWindow( m_DC, true );
} }
g_Show_Module_Ratsnest = m_ShowModuleRatsnest->GetValue(); g_Show_Module_Ratsnest = m_ShowModuleRatsnest->GetValue();
g_AutoDeleteOldTrack = m_TrackAutodel->GetValue(); g_AutoDeleteOldTrack = m_TrackAutodel->GetValue();
...@@ -126,14 +120,12 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event ) ...@@ -126,14 +120,12 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
#include "dialog_graphic_items_options.cpp" #include "dialog_graphic_items_options.cpp"
/*****************************************************************/
void WinEDA_PcbFrame::InstallPcbOptionsFrame( const wxPoint& pos, void WinEDA_PcbFrame::InstallPcbOptionsFrame( const wxPoint& pos,
wxDC* DC, int id ) wxDC* DC, int id )
/*****************************************************************/
{ {
switch( id ) switch( id )
{ {
case ID_PCB_DRAWINGS_WIDTHS_SETUP: case ID_PCB_DRAWINGS_WIDTHS_SETUP:
{ {
WinEDA_GraphicItemsOptionsDialog dlg( this ); WinEDA_GraphicItemsOptionsDialog dlg( this );
...@@ -142,29 +134,24 @@ void WinEDA_PcbFrame::InstallPcbOptionsFrame( const wxPoint& pos, ...@@ -142,29 +134,24 @@ void WinEDA_PcbFrame::InstallPcbOptionsFrame( const wxPoint& pos,
break; break;
default: default:
wxMessageBox(wxT("InstallPcbOptionsFrame() id error")); wxMessageBox( wxT( "InstallPcbOptionsFrame() id error" ) );
break; break;
} }
} }
/*******************************************************************/
void WinEDA_ModuleEditFrame::InstallOptionsFrame( const wxPoint& pos ) void WinEDA_ModuleEditFrame::InstallOptionsFrame( const wxPoint& pos )
/*******************************************************************/
{ {
WinEDA_GraphicItemsOptionsDialog dlg( this ); WinEDA_GraphicItemsOptionsDialog dlg( this );
dlg.ShowModal(); dlg.ShowModal();
} }
/*****************************************************************/
void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
/*****************************************************************/
/* Must be called on a click on the left toolbar (options toolbar /* Must be called on a click on the left toolbar (options toolbar
* Update variables according to the tools states * Update variables according to the tools states
*/ */
void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
...@@ -177,7 +164,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -177,7 +164,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
case ID_TB_OPTIONS_SHOW_GRID: case ID_TB_OPTIONS_SHOW_GRID:
m_Draw_Grid = m_OptionsToolBar->GetToolState( id ); m_Draw_Grid = m_OptionsToolBar->GetToolState( id );
DrawPanel->Refresh( ); DrawPanel->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_RATSNEST: case ID_TB_OPTIONS_SHOW_RATSNEST:
...@@ -186,7 +173,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -186,7 +173,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
wxClientDC dc( DrawPanel ); wxClientDC dc( DrawPanel );
DrawPanel->PrepareGraphicContext( &dc ); DrawPanel->PrepareGraphicContext( &dc );
Ratsnest_On_Off( &dc ); Ratsnest_On_Off( &dc );
RedrawActiveWindow( &dc, true); RedrawActiveWindow( &dc, true );
} }
break; break;
...@@ -201,7 +188,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -201,7 +188,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
if( id == ID_TB_OPTIONS_SELECT_UNIT_INCH ) if( id == ID_TB_OPTIONS_SELECT_UNIT_INCH )
g_UnitMetric = INCHES; g_UnitMetric = INCHES;
m_TrackAndViasSizesList_Changed = true; m_TrackAndViasSizesList_Changed = true;
UpdateStatusBar(); /* Reaffichage des coord curseur */ UpdateStatusBar();
ReCreateAuxiliaryToolbar(); ReCreateAuxiliaryToolbar();
DisplayUnitsMsg(); DisplayUnitsMsg();
break; break;
...@@ -209,7 +196,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -209,7 +196,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
case ID_TB_OPTIONS_SHOW_POLAR_COORD: case ID_TB_OPTIONS_SHOW_POLAR_COORD:
Affiche_Message( wxEmptyString ); Affiche_Message( wxEmptyString );
DisplayOpt.DisplayPolarCood = m_OptionsToolBar->GetToolState( id ); DisplayOpt.DisplayPolarCood = m_OptionsToolBar->GetToolState( id );
UpdateStatusBar(); /* Reaffichage des coord curseur */ UpdateStatusBar();
break; break;
case ID_TB_OPTIONS_SELECT_CURSOR: case ID_TB_OPTIONS_SELECT_CURSOR:
...@@ -222,17 +209,17 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -222,17 +209,17 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
case ID_TB_OPTIONS_SHOW_ZONES: case ID_TB_OPTIONS_SHOW_ZONES:
DisplayOpt.DisplayZonesMode = 0; DisplayOpt.DisplayZonesMode = 0;
DrawPanel->Refresh( ); DrawPanel->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_ZONES_DISABLE: case ID_TB_OPTIONS_SHOW_ZONES_DISABLE:
DisplayOpt.DisplayZonesMode = 1; DisplayOpt.DisplayZonesMode = 1;
DrawPanel->Refresh( ); DrawPanel->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY: case ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY:
DisplayOpt.DisplayZonesMode = 2; DisplayOpt.DisplayZonesMode = 2;
DrawPanel->Refresh( ); DrawPanel->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_PADS_SKETCH: case ID_TB_OPTIONS_SHOW_PADS_SKETCH:
...@@ -244,7 +231,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -244,7 +231,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
{ {
m_DisplayPadFill = DisplayOpt.DisplayPadFill = true; m_DisplayPadFill = DisplayOpt.DisplayPadFill = true;
} }
DrawPanel->Refresh( ); DrawPanel->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_VIAS_SKETCH: case ID_TB_OPTIONS_SHOW_VIAS_SKETCH:
...@@ -256,29 +243,32 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -256,29 +243,32 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
{ {
m_DisplayViaFill = DisplayOpt.DisplayViaFill = true; m_DisplayViaFill = DisplayOpt.DisplayViaFill = true;
} }
DrawPanel->Refresh( ); DrawPanel->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH: case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH:
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill =
!m_OptionsToolBar->GetToolState( id ); !m_OptionsToolBar->GetToolState( id );
DrawPanel->Refresh( ); DrawPanel->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE: case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE:
DisplayOpt.ContrastModeDisplay = DisplayOpt.ContrastModeDisplay =
m_OptionsToolBar->GetToolState( id ); m_OptionsToolBar->GetToolState( id );
DrawPanel->Refresh( ); DrawPanel->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE: case ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE:
g_DesignSettings.SetElementVisibility( MODULE_TEXT_NOV_VISIBLE, g_DesignSettings.SetElementVisibility( MODULE_TEXT_NOV_VISIBLE,
m_OptionsToolBar->GetToolState( id )); m_OptionsToolBar->GetToolState( id ) );
DrawPanel->Refresh( ); DrawPanel->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1: case ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1:
#if !defined(KICAD_AUIMANAGER) #if !defined(KICAD_AUIMANAGER)
if( m_OptionsToolBar->GetToolState( id ) ) // show aux V toolbar (Microwave tool) if( m_OptionsToolBar->GetToolState( id ) ) // show aux V toolbar
// (Microwave tool)
ReCreateAuxVToolbar(); ReCreateAuxVToolbar();
else else
{ {
...@@ -291,7 +281,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -291,7 +281,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
OnSize( SizeEv ); OnSize( SizeEv );
} }
#else #else
m_auimgr.GetPane(wxT("m_AuxVToolBar")).Show( m_OptionsToolBar->GetToolState( id ) ); m_auimgr.GetPane( wxT( "m_AuxVToolBar" ) ).Show( m_OptionsToolBar->GetToolState( id ) );
m_auimgr.Update(); m_auimgr.Update();
#endif #endif
break; break;
...@@ -303,5 +293,4 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -303,5 +293,4 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
} }
SetToolbars(); SetToolbars();
} }
This diff is collapsed.
...@@ -15,7 +15,7 @@ static wxString Current_PadNetName; ...@@ -15,7 +15,7 @@ static wxString Current_PadNetName;
#define NBSHAPES 4 #define NBSHAPES 4
int CodeShape[NBSHAPES] = /* forme des pads */ int CodeShape[NBSHAPES] = /* Pad shapes. */
{ {
PAD_CIRCLE, PAD_OVAL, PAD_RECT, PAD_TRAPEZOID PAD_CIRCLE, PAD_OVAL, PAD_RECT, PAD_TRAPEZOID
}; };
...@@ -409,7 +409,7 @@ void DIALOG_PAD_PROPERTIES::SetPadLayersList( long layer_mask ) ...@@ -409,7 +409,7 @@ void DIALOG_PAD_PROPERTIES::SetPadLayersList( long layer_mask )
void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event ) void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
/*************************************************************************/ /*************************************************************************/
/* Met a jour les differents parametres pour le composant en cours d'dition /* Updates the different parameters for the component being edited.
*/ */
{ {
long PadLayerMask; long PadLayerMask;
......
This diff is collapsed.
/******************************************************/ /**************************************/
/* edit.cpp: fonctions generales de l'edition du PCB */ /* edit.cpp: edit PCB implementation. */
/******************************************************/ /**************************************/
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
...@@ -25,12 +25,8 @@ static void Process_Move_Item( WinEDA_PcbFrame* frame, ...@@ -25,12 +25,8 @@ static void Process_Move_Item( WinEDA_PcbFrame* frame,
EDA_BaseStruct* DrawStruct, wxDC* DC ); EDA_BaseStruct* DrawStruct, wxDC* DC );
/*********************************************************************/ /* Handles the selection of command events. */
void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
/*********************************************************************/
/* Traite les selections d'outils et les commandes appelees du menu POPUP
*/
{ {
int id = event.GetId(); int id = event.GetId();
wxPoint pos; wxPoint pos;
...@@ -136,7 +132,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -136,7 +132,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
SetCursor( DrawPanel->m_PanelCursor = DrawPanel->m_PanelDefaultCursor ); SetCursor( DrawPanel->m_PanelCursor = DrawPanel->m_PanelDefaultCursor );
break; break;
default: // Finish (abort ) the command default: // Finish (abort) the command
if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur ) if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur )
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc ); DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
...@@ -555,7 +551,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -555,7 +551,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
GetBoard()->m_Zone.DeleteAll(); // remove zone segments used to fill zones. GetBoard()->m_Zone.DeleteAll(); // remove zone segments used to fill zones.
for( int ii = 0; ii < GetBoard()->GetAreaCount(); ii++ ) for( int ii = 0; ii < GetBoard()->GetAreaCount(); ii++ )
{ {
// Remove filled aresa in zone // Remove filled areas in zone
ZONE_CONTAINER* zone_container = GetBoard()->GetArea( ii ); ZONE_CONTAINER* zone_container = GetBoard()->GetArea( ii );
zone_container->m_FilledPolysList.clear();; zone_container->m_FilledPolysList.clear();;
} }
...@@ -969,10 +965,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -969,10 +965,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
} }
/****************************************************************/
static void Process_Move_Item( WinEDA_PcbFrame* frame, static void Process_Move_Item( WinEDA_PcbFrame* frame,
EDA_BaseStruct* DrawStruct, wxDC* DC ) EDA_BaseStruct* DrawStruct, wxDC* DC )
/****************************************************************/
{ {
if( DrawStruct == NULL ) if( DrawStruct == NULL )
return; return;
...@@ -996,9 +990,7 @@ static void Process_Move_Item( WinEDA_PcbFrame* frame, ...@@ -996,9 +990,7 @@ static void Process_Move_Item( WinEDA_PcbFrame* frame,
} }
/***************************************************************/
void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC ) void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
/***************************************************************/
{ {
if( Item == NULL ) if( Item == NULL )
return; return;
...@@ -1071,7 +1063,7 @@ void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC ) ...@@ -1071,7 +1063,7 @@ void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
default: default:
{ {
wxString Line; wxString Line;
Line.Printf( wxT( "Remove: StructType %d Inattendu" ), Line.Printf( wxT( "Remove: item type %d unknown." ),
Item->Type() ); Item->Type() );
DisplayError( this, Line ); DisplayError( this, Line );
} }
...@@ -1080,9 +1072,7 @@ void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC ) ...@@ -1080,9 +1072,7 @@ void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
} }
/****************************************************************/
void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer ) void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
/*****************************************************************/
{ {
int preslayer = GetScreen()->m_Active_Layer; int preslayer = GetScreen()->m_Active_Layer;
...@@ -1115,8 +1105,8 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer ) ...@@ -1115,8 +1105,8 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
// layers are also capable of being selected. // layers are also capable of being selected.
else else
{ {
if( (layer != COPPER_LAYER_N) && (layer != LAYER_CMP_N) if( ( layer != COPPER_LAYER_N ) && ( layer != LAYER_CMP_N )
&& (layer >= GetBoard()->m_BoardSettings->GetCopperLayerCount() - 1) ) && ( layer >= GetBoard()->m_BoardSettings->GetCopperLayerCount() - 1 ) )
{ {
// Uncomment following command (and line 17) to beep // Uncomment following command (and line 17) to beep
// the speaker. (Doing that would provide feedback to // the speaker. (Doing that would provide feedback to
...@@ -1132,7 +1122,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer ) ...@@ -1132,7 +1122,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
// See if we are drawing a segment; if so, add a via? // See if we are drawing a segment; if so, add a via?
if( m_ID_current_state == ID_TRACK_BUTT && current != NULL ) if( m_ID_current_state == ID_TRACK_BUTT && current != NULL )
{ {
if( current->Type() == TYPE_TRACK && (current->m_Flags & IS_NEW) ) if( current->Type() == TYPE_TRACK && ( current->m_Flags & IS_NEW ) )
{ {
// Want to set the routing layers so that it switches properly - // Want to set the routing layers so that it switches properly -
// see the implementation of Other_Layer_Route - the working // see the implementation of Other_Layer_Route - the working
......
...@@ -13,23 +13,23 @@ ...@@ -13,23 +13,23 @@
#include "protos.h" #include "protos.h"
/* Local functions */
static void Move_Texte_Pcb( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); static void Move_Texte_Pcb( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
static void Abort_Edit_Pcb_Text( WinEDA_DrawPanel* Panel, wxDC* DC ); static void Abort_Edit_Pcb_Text( WinEDA_DrawPanel* Panel, wxDC* DC );
/* variables : */
static TEXTE_PCB s_TextCopy( (BOARD_ITEM*) NULL ); /* copy of the edited text static TEXTE_PCB s_TextCopy( (BOARD_ITEM*) NULL ); /* copy of the edited text
* (used to undo/redo/abort a complex edition command * (used to undo/redo/abort
* a complex edition command
*/ */
/*************************************************************/
void Abort_Edit_Pcb_Text( WinEDA_DrawPanel* Panel, wxDC* DC )
/*************************************************************/
/* /*
* Routine de sortie du menu edit texte Pcb * Abort current text edit progress.
* Si un texte est selectionne, ses coord initiales sont regenerees *
* If a text is selected, its initial coord are regenerated
*/ */
void Abort_Edit_Pcb_Text( WinEDA_DrawPanel* Panel, wxDC* DC )
{ {
Panel->ManageCurseur = NULL; Panel->ManageCurseur = NULL;
Panel->ForceCloseManageCurseur = NULL; Panel->ForceCloseManageCurseur = NULL;
...@@ -55,13 +55,10 @@ void Abort_Edit_Pcb_Text( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -55,13 +55,10 @@ void Abort_Edit_Pcb_Text( WinEDA_DrawPanel* Panel, wxDC* DC )
} }
/*********************************************************************/
void WinEDA_PcbFrame::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
/*********************************************************************/
/* /*
* Place the current text being moving * Place the current text being moving
*/ */
void WinEDA_PcbFrame::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
{ {
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
...@@ -81,7 +78,8 @@ void WinEDA_PcbFrame::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) ...@@ -81,7 +78,8 @@ void WinEDA_PcbFrame::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
} }
if( TextePcb->m_Flags == IS_MOVED ) // If moved only if( TextePcb->m_Flags == IS_MOVED ) // If moved only
SaveCopyInUndoList( TextePcb, UR_MOVED, TextePcb->m_Pos - s_TextCopy.m_Pos ); SaveCopyInUndoList( TextePcb, UR_MOVED,
TextePcb->m_Pos - s_TextCopy.m_Pos );
else else
{ {
// Restore initial params // Restore initial params
...@@ -96,12 +94,9 @@ void WinEDA_PcbFrame::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) ...@@ -96,12 +94,9 @@ void WinEDA_PcbFrame::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
} }
/***********************************************************************/ /* Initialize parameters to move a pcb text
void WinEDA_PcbFrame::StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC )
/***********************************************************************/
/* Initialise parameters to move a pcb text
*/ */
void WinEDA_PcbFrame::StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC )
{ {
if( TextePcb == NULL ) if( TextePcb == NULL )
return; return;
...@@ -120,31 +115,24 @@ void WinEDA_PcbFrame::StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC ) ...@@ -120,31 +115,24 @@ void WinEDA_PcbFrame::StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC )
} }
/*************************************************************************/ /* Move PCB text following the cursor. */
static void Move_Texte_Pcb( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) static void Move_Texte_Pcb( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/*************************************************************************/
/* Routine deplacant le texte PCB suivant le curseur de la souris */
{ {
TEXTE_PCB* TextePcb = (TEXTE_PCB*) panel->GetScreen()->GetCurItem(); TEXTE_PCB* TextePcb = (TEXTE_PCB*) panel->GetScreen()->GetCurItem();
if( TextePcb == NULL ) if( TextePcb == NULL )
return; return;
/* effacement du texte : */
if( erase ) if( erase )
TextePcb->Draw( panel, DC, GR_XOR ); TextePcb->Draw( panel, DC, GR_XOR );
TextePcb->m_Pos = panel->GetScreen()->m_Curseur; TextePcb->m_Pos = panel->GetScreen()->m_Curseur;
/* Redessin du Texte */
TextePcb->Draw( panel, DC, GR_XOR ); TextePcb->Draw( panel, DC, GR_XOR );
} }
/**********************************************************************/
void WinEDA_PcbFrame::Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) void WinEDA_PcbFrame::Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
/**********************************************************************/
{ {
if( TextePcb == NULL ) if( TextePcb == NULL )
return; return;
...@@ -159,18 +147,16 @@ void WinEDA_PcbFrame::Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) ...@@ -159,18 +147,16 @@ void WinEDA_PcbFrame::Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
} }
/*******************************************************/
TEXTE_PCB* WinEDA_PcbFrame::Create_Texte_Pcb( wxDC* DC ) TEXTE_PCB* WinEDA_PcbFrame::Create_Texte_Pcb( wxDC* DC )
/*******************************************************/
{ {
TEXTE_PCB* TextePcb; TEXTE_PCB* TextePcb;
TextePcb = new TEXTE_PCB( GetBoard() ); TextePcb = new TEXTE_PCB( GetBoard() );
/* Chainage de la nouvelle structure en debut de liste */ /* Add text to the board item list. */
GetBoard()->Add( TextePcb ); GetBoard()->Add( TextePcb );
/* Mise a jour des caracteristiques */ /* Update text properties. */
TextePcb->m_Flags = IS_NEW; TextePcb->m_Flags = IS_NEW;
TextePcb->SetLayer( ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer ); TextePcb->SetLayer( ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer );
TextePcb->m_Mirror = false; TextePcb->m_Mirror = false;
...@@ -194,9 +180,7 @@ TEXTE_PCB* WinEDA_PcbFrame::Create_Texte_Pcb( wxDC* DC ) ...@@ -194,9 +180,7 @@ TEXTE_PCB* WinEDA_PcbFrame::Create_Texte_Pcb( wxDC* DC )
} }
/***********************************************************************/
void WinEDA_PcbFrame::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) void WinEDA_PcbFrame::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
/***********************************************************************/
{ {
int angle = 900; int angle = 900;
int drawmode = GR_XOR; int drawmode = GR_XOR;
...@@ -204,13 +188,13 @@ void WinEDA_PcbFrame::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) ...@@ -204,13 +188,13 @@ void WinEDA_PcbFrame::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
if( TextePcb == NULL ) if( TextePcb == NULL )
return; return;
/* effacement du texte : */ /* Erase previous text. */
TextePcb->Draw( DrawPanel, DC, GR_XOR ); TextePcb->Draw( DrawPanel, DC, GR_XOR );
TextePcb->m_Orient += angle; TextePcb->m_Orient += angle;
NORMALIZE_ANGLE( TextePcb->m_Orient ); NORMALIZE_ANGLE( TextePcb->m_Orient );
/* Redessin du Texte */ /* Redraw text in new position. */
TextePcb->Draw( DrawPanel, DC, drawmode ); TextePcb->Draw( DrawPanel, DC, drawmode );
TextePcb->DisplayInfo( this ); TextePcb->DisplayInfo( this );
if( TextePcb->m_Flags == 0 ) // i.e. not edited, or moved if( TextePcb->m_Flags == 0 ) // i.e. not edited, or moved
......
/******************************************************/ /***********************************/
/* Edition des contours du pcb: Routines */ /* Edit segments and edges of PCB. */
/* d'effacement et d'edition de segments et contours */ /***********************************/
/* du type PCB, draw, edgePCB */
/******************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -15,21 +13,18 @@ ...@@ -15,21 +13,18 @@
#include "protos.h" #include "protos.h"
/* Routines Locales */
static void Exit_EditEdge( WinEDA_DrawPanel* Panel, wxDC* DC ); static void Exit_EditEdge( WinEDA_DrawPanel* Panel, wxDC* DC );
static void Montre_Position_NewSegment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); static void Montre_Position_NewSegment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
/* Variables locales : */
static wxPoint s_InitialPosition; // position originelle du curseur souris (fct deplacement)
static wxPoint s_LastPosition; // position courante du curseur souris
/****************************************************************************/ static wxPoint s_InitialPosition; // Initial cursor position.
void WinEDA_PcbFrame::Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ) static wxPoint s_LastPosition; // Current cursor position.
/****************************************************************************/
/* Routine de preparation du deplacement d'un element graphique type DRAWSEGMENT
*/ /* Start move of a graphic element type DRAWSEGMENT */
void WinEDA_PcbFrame::Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC )
{ {
if( drawitem == NULL ) if( drawitem == NULL )
return; return;
...@@ -44,13 +39,10 @@ void WinEDA_PcbFrame::Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ) ...@@ -44,13 +39,10 @@ void WinEDA_PcbFrame::Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC )
} }
/*********************************************************************/
void WinEDA_PcbFrame::Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC )
/*********************************************************************/
/* /*
* Routine de placement de l'element graphique type DRAWSEGMENT en cours de deplacement * Place graphic element of type DRAWSEGMENT.
*/ */
void WinEDA_PcbFrame::Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC )
{ {
if( drawitem == NULL ) if( drawitem == NULL )
return; return;
...@@ -64,14 +56,12 @@ void WinEDA_PcbFrame::Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ) ...@@ -64,14 +56,12 @@ void WinEDA_PcbFrame::Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC )
drawitem->m_Flags = 0; drawitem->m_Flags = 0;
} }
/*
/************************************************************************/ * Redraw segment during cursor movement.
*/
static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/************************************************************************/
/* redessin du contour du Segment Edge lors des deplacements de la souris */
{ {
DRAWSEGMENT* Segment = (DRAWSEGMENT*) DRAWSEGMENT* Segment = (DRAWSEGMENT*) panel->GetScreen()->GetCurItem();
panel->GetScreen()->GetCurItem();
int t_fill = DisplayOpt.DisplayDrawItems; int t_fill = DisplayOpt.DisplayDrawItems;
if( Segment == NULL ) if( Segment == NULL )
...@@ -79,7 +69,6 @@ static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -79,7 +69,6 @@ static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
DisplayOpt.DisplayDrawItems = SKETCH; DisplayOpt.DisplayDrawItems = SKETCH;
/* efface ancienne position */
if( erase ) if( erase )
Segment->Draw( panel, DC, GR_XOR ); Segment->Draw( panel, DC, GR_XOR );
...@@ -94,9 +83,7 @@ static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -94,9 +83,7 @@ static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
} }
/**************************************************************************/
void WinEDA_PcbFrame::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC ) void WinEDA_PcbFrame::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC )
/**************************************************************************/
{ {
EDA_BaseStruct* PtStruct; EDA_BaseStruct* PtStruct;
int track_fill_copy = DisplayOpt.DisplayDrawItems; int track_fill_copy = DisplayOpt.DisplayDrawItems;
...@@ -104,9 +91,9 @@ void WinEDA_PcbFrame::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC ) ...@@ -104,9 +91,9 @@ void WinEDA_PcbFrame::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC )
if( Segment == NULL ) if( Segment == NULL )
return; return;
if( Segment->m_Flags & IS_NEW ) // Trace en cours, on peut effacer le dernier segment if( Segment->m_Flags & IS_NEW ) // Trace in progress.
{ {
/* effacement du segment en cours de trace */ /* Delete current segment. */
DisplayOpt.DisplayDrawItems = SKETCH; DisplayOpt.DisplayDrawItems = SKETCH;
Segment->Draw( DrawPanel, DC, GR_XOR ); Segment->Draw( DrawPanel, DC, GR_XOR );
PtStruct = Segment->Back(); PtStruct = Segment->Back();
...@@ -116,7 +103,7 @@ void WinEDA_PcbFrame::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC ) ...@@ -116,7 +103,7 @@ void WinEDA_PcbFrame::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC )
DisplayOpt.DisplayDrawItems = track_fill_copy; DisplayOpt.DisplayDrawItems = track_fill_copy;
SetCurItem( NULL ); SetCurItem( NULL );
} }
else if( Segment->m_Flags == 0) else if( Segment->m_Flags == 0 )
{ {
Segment->Draw( DrawPanel, DC, GR_XOR ); Segment->Draw( DrawPanel, DC, GR_XOR );
Segment->m_Flags = 0; Segment->m_Flags = 0;
...@@ -128,13 +115,11 @@ void WinEDA_PcbFrame::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC ) ...@@ -128,13 +115,11 @@ void WinEDA_PcbFrame::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC )
} }
/******************************************************************************/
void WinEDA_PcbFrame::Delete_Drawings_All_Layer( int aLayer ) void WinEDA_PcbFrame::Delete_Drawings_All_Layer( int aLayer )
/******************************************************************************/
{ {
if( aLayer <= LAST_COPPER_LAYER ) if( aLayer <= LAST_COPPER_LAYER )
{ {
DisplayError( this, _( "Copper layer global delete not allowed!" ), 20 ); DisplayError( this, _( "Copper layer global delete not allowed!" ) );
return; return;
} }
...@@ -160,14 +145,15 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( int aLayer ) ...@@ -160,14 +145,15 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( int aLayer )
{ {
item->UnLink(); item->UnLink();
picker.m_PickedItem = item; picker.m_PickedItem = item;
pickList.PushItem(picker); pickList.PushItem( picker );
} }
break; break;
default: default:
{ {
wxString msg; wxString msg;
msg.Printf( wxT("Delete_Drawings_All_Layer() error: unknown type %d"), item->Type()); msg.Printf( wxT("Delete_Drawings_All_Layer() error: unknown type %d"),
item->Type() );
wxMessageBox( msg ); wxMessageBox( msg );
break; break;
} }
...@@ -182,9 +168,7 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( int aLayer ) ...@@ -182,9 +168,7 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( int aLayer )
} }
/*************************************************************/
static void Exit_EditEdge( WinEDA_DrawPanel* Panel, wxDC* DC ) static void Exit_EditEdge( WinEDA_DrawPanel* Panel, wxDC* DC )
/*************************************************************/
{ {
DRAWSEGMENT* Segment = (DRAWSEGMENT*) Panel->GetScreen()->GetCurItem(); DRAWSEGMENT* Segment = (DRAWSEGMENT*) Panel->GetScreen()->GetCurItem();
...@@ -208,17 +192,14 @@ static void Exit_EditEdge( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -208,17 +192,14 @@ static void Exit_EditEdge( WinEDA_DrawPanel* Panel, wxDC* DC )
} }
Panel->ManageCurseur = NULL; Panel->ManageCurseur = NULL;
Panel->ForceCloseManageCurseur = NULL; Panel->ForceCloseManageCurseur = NULL;
((WinEDA_PcbFrame*)Panel->m_Parent)->SetCurItem( NULL ); ( (WinEDA_PcbFrame*) Panel->m_Parent )->SetCurItem( NULL );
} }
/**********************************************************************/ /* Initialize the drawing of a segment of type other than trace.
*/
DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment, DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment,
int shape, wxDC* DC ) int shape, wxDC* DC )
/**********************************************************************/
/* Routine d'initialisation du trace d'un segment de type autre que piste
*/
{ {
int s_large; int s_large;
int angle = 0; int angle = 0;
...@@ -233,7 +214,7 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment, ...@@ -233,7 +214,7 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment,
if( shape == S_ARC ) if( shape == S_ARC )
angle = 900; angle = 900;
if( Segment == NULL ) /* debut reel du trace */ if( Segment == NULL ) /* Create new trace. */
{ {
SetCurItem( Segment = new DRAWSEGMENT( GetBoard() ) ); SetCurItem( Segment = new DRAWSEGMENT( GetBoard() ) );
Segment->m_Flags = IS_NEW; Segment->m_Flags = IS_NEW;
...@@ -245,8 +226,8 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment, ...@@ -245,8 +226,8 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment,
DrawPanel->ManageCurseur = Montre_Position_NewSegment; DrawPanel->ManageCurseur = Montre_Position_NewSegment;
DrawPanel->ForceCloseManageCurseur = Exit_EditEdge; DrawPanel->ForceCloseManageCurseur = Exit_EditEdge;
} }
else /* trace en cours : les coord du point d'arrivee ont ete mises else /* TRANSLATE trace en cours : les coord du point d'arrivee ont
* a jour par la routine Montre_Position_NewSegment*/ * ete mises a jour par la routine Montre_Position_NewSegment*/
{ {
if( Segment->m_Start != Segment->m_End ) if( Segment->m_Start != Segment->m_End )
{ {
...@@ -284,16 +265,14 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment, ...@@ -284,16 +265,14 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment,
} }
/***************************************************************/
void WinEDA_PcbFrame::End_Edge( DRAWSEGMENT* Segment, wxDC* DC ) void WinEDA_PcbFrame::End_Edge( DRAWSEGMENT* Segment, wxDC* DC )
/***************************************************************/
{ {
if( Segment == NULL ) if( Segment == NULL )
return; return;
Segment->Draw( DrawPanel, DC, GR_OR ); Segment->Draw( DrawPanel, DC, GR_OR );
/* Effacement si Longueur nulle */ /* Delete if segment length is zero. */
if( Segment->m_Start == Segment->m_End) if( Segment->m_Start == Segment->m_End )
Segment ->DeleteStructure(); Segment ->DeleteStructure();
else else
...@@ -301,7 +280,7 @@ void WinEDA_PcbFrame::End_Edge( DRAWSEGMENT* Segment, wxDC* DC ) ...@@ -301,7 +280,7 @@ void WinEDA_PcbFrame::End_Edge( DRAWSEGMENT* Segment, wxDC* DC )
Segment->m_Flags = 0; Segment->m_Flags = 0;
GetBoard()->Add( Segment ); GetBoard()->Add( Segment );
GetScreen()->SetModify(); GetScreen()->SetModify();
SaveCopyInUndoList(Segment, UR_NEW ); SaveCopyInUndoList( Segment, UR_NEW );
} }
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
...@@ -310,11 +289,10 @@ void WinEDA_PcbFrame::End_Edge( DRAWSEGMENT* Segment, wxDC* DC ) ...@@ -310,11 +289,10 @@ void WinEDA_PcbFrame::End_Edge( DRAWSEGMENT* Segment, wxDC* DC )
} }
/************************************************************/ /* Redraw segment during cursor movement
*/
static void Montre_Position_NewSegment( WinEDA_DrawPanel* panel, static void Montre_Position_NewSegment( WinEDA_DrawPanel* panel,
wxDC* DC, bool erase ) wxDC* DC, bool erase )
/************************************************************/
/* redessin du contour du Segment Edge lors des deplacements de la souris */
{ {
DRAWSEGMENT* Segment = (DRAWSEGMENT*) DRAWSEGMENT* Segment = (DRAWSEGMENT*)
panel->GetScreen()->GetCurItem(); panel->GetScreen()->GetCurItem();
...@@ -325,16 +303,15 @@ static void Montre_Position_NewSegment( WinEDA_DrawPanel* panel, ...@@ -325,16 +303,15 @@ static void Montre_Position_NewSegment( WinEDA_DrawPanel* panel,
DisplayOpt.DisplayDrawItems = SKETCH; DisplayOpt.DisplayDrawItems = SKETCH;
/* efface ancienne position */
if( erase ) if( erase )
Segment->Draw( panel, DC, GR_XOR ); Segment->Draw( panel, DC, GR_XOR );
if( Segments_45_Only && (Segment->m_Shape == S_SEGMENT ) ) if( Segments_45_Only && ( Segment->m_Shape == S_SEGMENT ) )
{ {
Calcule_Coord_Extremite_45( Segment->m_Start.x, Segment->m_Start.y, Calcule_Coord_Extremite_45( Segment->m_Start.x, Segment->m_Start.y,
&Segment->m_End.x, &Segment->m_End.y ); &Segment->m_End.x, &Segment->m_End.y );
} }
else /* ici l'angle d'inclinaison est quelconque */ else /* here the angle is arbitrary */
{ {
Segment->m_End = panel->GetScreen()->m_Curseur; Segment->m_End = panel->GetScreen()->m_Curseur;
} }
......
/************************************************/ /************************************************/
/* Module editor: Dialog box for editing module */ /* Module editor: Dialog box for editing module */
/* properties and carateristics */ /* properties and characteristics */
/************************************************/ /************************************************/
#include "fctsys.h" #include "fctsys.h"
...@@ -14,12 +14,11 @@ ...@@ -14,12 +14,11 @@
#include "dialog_edit_module_for_BoardEditor.h" #include "dialog_edit_module_for_BoardEditor.h"
/*******************************************************************/
void WinEDA_PcbFrame::InstallModuleOptionsFrame( MODULE* Module, wxDC* DC )
/*******************************************************************/
/* Fonction relai d'installation de la frame d'dition des proprietes /*
* du module*/ * Show module property dialog.
*/
void WinEDA_PcbFrame::InstallModuleOptionsFrame( MODULE* Module, wxDC* DC )
{ {
if( Module == NULL ) if( Module == NULL )
return; return;
...@@ -54,13 +53,10 @@ void WinEDA_PcbFrame::InstallModuleOptionsFrame( MODULE* Module, wxDC* DC ) ...@@ -54,13 +53,10 @@ void WinEDA_PcbFrame::InstallModuleOptionsFrame( MODULE* Module, wxDC* DC )
} }
/*******************************************************************/
void WinEDA_ModuleEditFrame::Place_Ancre( MODULE* pt_mod )
/*******************************************************************/
/* /*
* Repositionne l'ancre sous le curseur souris * Position anchor under the cursor.
*/ */
void WinEDA_ModuleEditFrame::Place_Ancre( MODULE* pt_mod )
{ {
wxPoint moveVector; wxPoint moveVector;
EDA_BaseStruct* PtStruct; EDA_BaseStruct* PtStruct;
...@@ -73,19 +69,19 @@ void WinEDA_ModuleEditFrame::Place_Ancre( MODULE* pt_mod ) ...@@ -73,19 +69,19 @@ void WinEDA_ModuleEditFrame::Place_Ancre( MODULE* pt_mod )
pt_mod->m_Pos = GetScreen()->m_Curseur; pt_mod->m_Pos = GetScreen()->m_Curseur;
/* Mise a jour des coord relatives des elements: /* Update the relative coordinates:
* les coordonnees relatives sont relatives a l'ancre, pour orient 0. * The coordinates are relative to the anchor point.
* il faut donc recalculer deltaX et deltaY en orientation 0 */ * Calculate deltaX and deltaY from the anchor. */
RotatePoint( &moveVector, -pt_mod->m_Orient ); RotatePoint( &moveVector, -pt_mod->m_Orient );
/* Mise a jour des coord relatives des pads */ /* Update the pad coordinates. */
pt_pad = (D_PAD*) pt_mod->m_Pads; pt_pad = (D_PAD*) pt_mod->m_Pads;
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() ) for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
{ {
pt_pad->m_Pos0 += moveVector; pt_pad->m_Pos0 += moveVector;
} }
/* Mise a jour des coord relatives contours .. */ /* Update the draw element coordinates. */
PtStruct = pt_mod->m_Drawings; PtStruct = pt_mod->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() ) for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{ {
...@@ -113,9 +109,7 @@ void WinEDA_ModuleEditFrame::Place_Ancre( MODULE* pt_mod ) ...@@ -113,9 +109,7 @@ void WinEDA_ModuleEditFrame::Place_Ancre( MODULE* pt_mod )
} }
/**********************************************************************/
void WinEDA_ModuleEditFrame::RemoveStruct( EDA_BaseStruct* Item ) void WinEDA_ModuleEditFrame::RemoveStruct( EDA_BaseStruct* Item )
/**********************************************************************/
{ {
if( Item == NULL ) if( Item == NULL )
return; return;
...@@ -154,7 +148,7 @@ void WinEDA_ModuleEditFrame::RemoveStruct( EDA_BaseStruct* Item ) ...@@ -154,7 +148,7 @@ void WinEDA_ModuleEditFrame::RemoveStruct( EDA_BaseStruct* Item )
default: default:
{ {
wxString Line; wxString Line;
Line.Printf( wxT( " Remove: StructType %d Inattendu" ), Line.Printf( wxT( " Remove: draw item type %d unknown." ),
Item->Type() ); Item->Type() );
DisplayError( this, Line ); DisplayError( this, Line );
} }
......
This diff is collapsed.
This diff is collapsed.
/*************************************************************/ /********************/
/* Edition des Modules: Routines de modification des textes */ /* Edi module text. */
/* sur les MODULES */ /********************/
/*************************************************************/
/* Fichier EDTXTMOD.CPP */
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -16,30 +13,31 @@ ...@@ -16,30 +13,31 @@
#include "protos.h" #include "protos.h"
/* Routines Locales */ static void Show_MoveTexte_Module( WinEDA_DrawPanel* panel,
static void Show_MoveTexte_Module( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); wxDC* DC,
bool erase );
static void AbortMoveTextModule( WinEDA_DrawPanel* Panel, wxDC* DC ); static void AbortMoveTextModule( WinEDA_DrawPanel* Panel, wxDC* DC );
/* local variables */
wxPoint MoveVector; // Move vector for move edge, exported to dialog_edit mod_text.cpp
static wxPoint TextInitialPosition; // Mouse cursor inital position for undo/abort move command
static int TextInitialOrientation; // module text inital orientation for undo/abort move+rot command+rot
wxPoint MoveVector; // Move vector for move edge, exported
// to dialog_edit mod_text.cpp
static wxPoint TextInitialPosition; // Mouse cursor initial position for
// undo/abort move command
static int TextInitialOrientation; // module text initial orientation for
// undo/abort move+rot command+rot
/******************************************************************************/
TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC )
/******************************************************************************/
/* Add a new graphical text to the active module (footprint) /* Add a new graphical text to the active module (footprint)
* Note there always are 2 texts: reference and value. * Note there always are 2 texts: reference and value.
* New texts have the member TEXTE_MODULE.m_Type set to TEXT_is_DIVERS * New texts have the member TEXTE_MODULE.m_Type set to TEXT_is_DIVERS
*/ */
TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC )
{ {
TEXTE_MODULE* Text; TEXTE_MODULE* Text;
Text = new TEXTE_MODULE( Module ); Text = new TEXTE_MODULE( Module );
/* Chainage de la nouvelle structure en tete de liste drawings */ /* Add the new text object to the beginning of the draw item list. */
if( Module ) if( Module )
Module->m_Drawings.PushFront( Text ); Module->m_Drawings.PushFront( Text );
...@@ -48,7 +46,8 @@ TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC ) ...@@ -48,7 +46,8 @@ TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC )
Text->m_Text = wxT( "text" ); Text->m_Text = wxT( "text" );
ModuleTextWidth = Clamp_Text_PenSize( ModuleTextWidth, ModuleTextWidth = Clamp_Text_PenSize( ModuleTextWidth,
MIN(ModuleTextSize.x, ModuleTextSize.y), true ); MIN( ModuleTextSize.x,
ModuleTextSize.y ), true );
Text->m_Size = ModuleTextSize; Text->m_Size = ModuleTextSize;
Text->m_Width = ModuleTextWidth; Text->m_Width = ModuleTextWidth;
Text->m_Pos = GetScreen()->m_Curseur; Text->m_Pos = GetScreen()->m_Curseur;
...@@ -67,20 +66,20 @@ TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC ) ...@@ -67,20 +66,20 @@ TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC )
} }
/**************************************************************************/ /* Rotate text 90 degrees.
*/
void WinEDA_BasePcbFrame::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC ) void WinEDA_BasePcbFrame::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC )
/**************************************************************************/
/* Rotation de 90 du texte d'un module */
{ {
if( Text == NULL ) if( Text == NULL )
return; return;
MODULE* module = (MODULE*) Text->GetParent(); MODULE* module = (MODULE*) Text->GetParent();
if( module && module->m_Flags == 0 && Text->m_Flags == 0 ) // simple rot command if( module && module->m_Flags == 0 && Text->m_Flags == 0 ) // prepare undo
{ // prepare undo command // command
{
if( this->m_Ident == PCB_FRAME ) if( this->m_Ident == PCB_FRAME )
SaveCopyInUndoList( module,UR_CHANGED ); SaveCopyInUndoList( module, UR_CHANGED );
} }
// we expect MoveVector to be (0,0) if there is no move in progress // we expect MoveVector to be (0,0) if there is no move in progress
...@@ -90,9 +89,7 @@ void WinEDA_BasePcbFrame::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC ) ...@@ -90,9 +89,7 @@ void WinEDA_BasePcbFrame::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC )
while( Text->m_Orient >= 1800 ) while( Text->m_Orient >= 1800 )
Text->m_Orient -= 1800; Text->m_Orient -= 1800;
/* Redessin du Texte */
Text->Draw( DrawPanel, DC, GR_XOR, MoveVector ); Text->Draw( DrawPanel, DC, GR_XOR, MoveVector );
Text->DisplayInfo( this ); Text->DisplayInfo( this );
if( module ) if( module )
...@@ -101,13 +98,10 @@ void WinEDA_BasePcbFrame::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC ) ...@@ -101,13 +98,10 @@ void WinEDA_BasePcbFrame::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC )
} }
/**************************************************************************/
void WinEDA_BasePcbFrame::DeleteTextModule( TEXTE_MODULE* Text )
/**************************************************************************/
/* /*
* Supprime 1 texte sur module (si ce n'est pas la rfrence ou la valeur) * Deletes text in module (if not the reference or value)
*/ */
void WinEDA_BasePcbFrame::DeleteTextModule( TEXTE_MODULE* Text )
{ {
MODULE* Module; MODULE* Module;
...@@ -119,8 +113,6 @@ void WinEDA_BasePcbFrame::DeleteTextModule( TEXTE_MODULE* Text ) ...@@ -119,8 +113,6 @@ void WinEDA_BasePcbFrame::DeleteTextModule( TEXTE_MODULE* Text )
if( Text->m_Type == TEXT_is_DIVERS ) if( Text->m_Type == TEXT_is_DIVERS )
{ {
DrawPanel->PostDirtyRect( Text->GetBoundingBox() ); DrawPanel->PostDirtyRect( Text->GetBoundingBox() );
/* liberation de la memoire : */
Text->DeleteStructure(); Text->DeleteStructure();
GetScreen()->SetModify(); GetScreen()->SetModify();
Module->m_LastEdit_Time = time( NULL ); Module->m_LastEdit_Time = time( NULL );
...@@ -128,13 +120,12 @@ void WinEDA_BasePcbFrame::DeleteTextModule( TEXTE_MODULE* Text ) ...@@ -128,13 +120,12 @@ void WinEDA_BasePcbFrame::DeleteTextModule( TEXTE_MODULE* Text )
} }
/*************************************************************/
static void AbortMoveTextModule( WinEDA_DrawPanel* Panel, wxDC* DC )
/*************************************************************/
/* /*
* Routine de sortie du menu edit texte module * Abort text move in progress.
* Si un texte est selectionne, ses coord initiales sont regenerees *
* If a text is selected, its initial coordinates are regenerated.
*/ */
static void AbortMoveTextModule( WinEDA_DrawPanel* Panel, wxDC* DC )
{ {
BASE_SCREEN* screen = Panel->GetScreen(); BASE_SCREEN* screen = Panel->GetScreen();
TEXTE_MODULE* Text = (TEXTE_MODULE*) screen->GetCurItem(); TEXTE_MODULE* Text = (TEXTE_MODULE*) screen->GetCurItem();
...@@ -152,7 +143,7 @@ static void AbortMoveTextModule( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -152,7 +143,7 @@ static void AbortMoveTextModule( WinEDA_DrawPanel* Panel, wxDC* DC )
// If the text was moved (the move does not change internal data) // If the text was moved (the move does not change internal data)
// it could be rotated while moving. So set old value for orientation // it could be rotated while moving. So set old value for orientation
if ( (Text->m_Flags & IS_MOVED) ) if( (Text->m_Flags & IS_MOVED) )
Text->m_Orient = TextInitialOrientation; Text->m_Orient = TextInitialOrientation;
/* Redraw the text */ /* Redraw the text */
...@@ -168,12 +159,9 @@ static void AbortMoveTextModule( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -168,12 +159,9 @@ static void AbortMoveTextModule( WinEDA_DrawPanel* Panel, wxDC* DC )
} }
/****************************************************************************/ /* Start a text move.
void WinEDA_BasePcbFrame::StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC )
/****************************************************************************/
/* Routine d'initialisation du deplacement d'un texte sur module
*/ */
void WinEDA_BasePcbFrame::StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC )
{ {
MODULE* Module; MODULE* Module;
...@@ -200,31 +188,28 @@ void WinEDA_BasePcbFrame::StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC ) ...@@ -200,31 +188,28 @@ void WinEDA_BasePcbFrame::StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC )
} }
/*************************************************************************/ /* Place the text a the cursor position when the left mouse button is clicked.
void WinEDA_BasePcbFrame::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC )
/*************************************************************************/
/* Routine complementaire a StartMoveTexteModule().
* Place le texte en cours de deplacement
*/ */
void WinEDA_BasePcbFrame::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC )
{ {
if( Text != NULL ) if( Text != NULL )
{ {
DrawPanel->PostDirtyRect( Text->GetBoundingBox() ); DrawPanel->PostDirtyRect( Text->GetBoundingBox() );
/* mise a jour des coordonnes relatives a l'ancre */ /* Update the coordinates for anchor. */
MODULE* Module = (MODULE*) Text->GetParent(); MODULE* Module = (MODULE*) Text->GetParent();
if( Module ) if( Module )
{ {
// Prepare undo command (a rotation can be made while moving) // Prepare undo command (a rotation can be made while moving)
EXCHG(Text->m_Orient, TextInitialOrientation); EXCHG( Text->m_Orient, TextInitialOrientation );
if( m_Ident == PCB_FRAME ) if( m_Ident == PCB_FRAME )
SaveCopyInUndoList(Module, UR_CHANGED); SaveCopyInUndoList( Module, UR_CHANGED );
else else
SaveCopyInUndoList(Module, UR_MODEDIT); SaveCopyInUndoList( Module, UR_MODEDIT );
EXCHG(Text->m_Orient, TextInitialOrientation); EXCHG( Text->m_Orient, TextInitialOrientation );
Text->m_Pos = GetScreen()->m_Curseur; // Set the new position for text // Set the new position for text.
Text->m_Pos = GetScreen()->m_Curseur;
wxPoint textRelPos = Text->m_Pos - Module->m_Pos; wxPoint textRelPos = Text->m_Pos - Module->m_Pos;
RotatePoint( &textRelPos, -Module->m_Orient ); RotatePoint( &textRelPos, -Module->m_Orient );
Text->m_Pos0 = textRelPos; Text->m_Pos0 = textRelPos;
...@@ -233,7 +218,7 @@ void WinEDA_BasePcbFrame::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC ) ...@@ -233,7 +218,7 @@ void WinEDA_BasePcbFrame::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC )
Module->m_LastEdit_Time = time( NULL ); Module->m_LastEdit_Time = time( NULL );
GetScreen()->SetModify(); GetScreen()->SetModify();
/* Redessin du Texte */ /* Redraw text. */
DrawPanel->PostDirtyRect( Text->GetBoundingBox() ); DrawPanel->PostDirtyRect( Text->GetBoundingBox() );
} }
else else
...@@ -248,9 +233,8 @@ void WinEDA_BasePcbFrame::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC ) ...@@ -248,9 +233,8 @@ void WinEDA_BasePcbFrame::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC )
} }
/********************************************************************************/ static void Show_MoveTexte_Module( WinEDA_DrawPanel* panel, wxDC* DC,
static void Show_MoveTexte_Module( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) bool erase )
/********************************************************************************/
{ {
BASE_SCREEN* screen = panel->GetScreen(); BASE_SCREEN* screen = panel->GetScreen();
TEXTE_MODULE* Text = (TEXTE_MODULE*) screen->GetCurItem(); TEXTE_MODULE* Text = (TEXTE_MODULE*) screen->GetCurItem();
...@@ -258,7 +242,7 @@ static void Show_MoveTexte_Module( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ...@@ -258,7 +242,7 @@ static void Show_MoveTexte_Module( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
if( Text == NULL ) if( Text == NULL )
return; return;
/* Undraw the text : */ /* Undraw the text */
if( erase ) if( erase )
Text->Draw( panel, DC, GR_XOR, MoveVector ); Text->Draw( panel, DC, GR_XOR, MoveVector );
......
This diff is collapsed.
/***************************************************/ /********************************************/
/* PCBNEW - Gestion des Recherches (fonction Find) */ /* PCBNEW - Find dialog box implementation. */
/***************************************************/ /********************************************/
/* Fichier find.cpp */
/*
* Affichage et modifications des parametres de travail de PcbNew
* Parametres = dimensions des via, pistes, isolements, options...
*/
#include "fctsys.h" #include "fctsys.h"
...@@ -25,14 +18,12 @@ ...@@ -25,14 +18,12 @@
#include "find.h" #include "find.h"
/*Local Variables */
static wxString s_OldStringFound; static wxString s_OldStringFound;
static int s_ItemCount, s_MarkerCount; static int s_ItemCount, s_MarkerCount;
/*********************************************************************/
void WinEDA_PcbFrame::InstallFindFrame( const wxPoint& pos, wxDC* DC ) void WinEDA_PcbFrame::InstallFindFrame( const wxPoint& pos, wxDC* DC )
/*********************************************************************/
{ {
WinEDA_PcbFindFrame* frame = new WinEDA_PcbFindFrame( this, DC, pos ); WinEDA_PcbFindFrame* frame = new WinEDA_PcbFindFrame( this, DC, pos );
...@@ -41,11 +32,9 @@ void WinEDA_PcbFrame::InstallFindFrame( const wxPoint& pos, wxDC* DC ) ...@@ -41,11 +32,9 @@ void WinEDA_PcbFrame::InstallFindFrame( const wxPoint& pos, wxDC* DC )
} }
/*******************************************************/
void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event ) void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
/********************************************************/
{ {
PCB_SCREEN* screen = (PCB_SCREEN*)(m_Parent->GetScreen()); PCB_SCREEN* screen = (PCB_SCREEN*) ( m_Parent->GetScreen() );
wxPoint locate_pos; wxPoint locate_pos;
wxString msg; wxString msg;
bool FindMarker = FALSE; bool FindMarker = FALSE;
...@@ -59,6 +48,7 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event ) ...@@ -59,6 +48,7 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
case ID_FIND_MARKER: case ID_FIND_MARKER:
s_MarkerCount = 0; s_MarkerCount = 0;
// fall thru // fall thru
case ID_FIND_NEXT_MARKER: case ID_FIND_NEXT_MARKER:
...@@ -68,7 +58,8 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event ) ...@@ -68,7 +58,8 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
s_OldStringFound = m_NewText->GetValue(); s_OldStringFound = m_NewText->GetValue();
m_Parent->DrawPanel->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y ); m_Parent->DrawPanel->GetViewStart( &screen->m_StartVisu.x,
&screen->m_StartVisu.y );
if( FindMarker ) if( FindMarker )
{ {
...@@ -82,9 +73,12 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event ) ...@@ -82,9 +73,12 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
else else
{ {
int StartCount = 0; int StartCount = 0;
for( MODULE* module = m_Parent->GetBoard()->m_Modules; module; module = module->Next() ) for( MODULE* module = m_Parent->GetBoard()->m_Modules;
module;
module = module->Next() )
{ {
if( WildCompareString( s_OldStringFound, module->GetReference().GetData(), FALSE ) ) if( WildCompareString( s_OldStringFound,
module->GetReference().GetData(), FALSE ) )
{ {
StartCount++; StartCount++;
if( StartCount > s_ItemCount ) if( StartCount > s_ItemCount )
...@@ -95,7 +89,8 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event ) ...@@ -95,7 +89,8 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
break; break;
} }
} }
if( WildCompareString( s_OldStringFound, module->m_Value->m_Text.GetData(), FALSE ) ) if( WildCompareString( s_OldStringFound,
module->m_Value->m_Text.GetData(), FALSE ) )
{ {
StartCount++; StartCount++;
if( StartCount > s_ItemCount ) if( StartCount > s_ItemCount )
...@@ -153,17 +148,13 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFindFrame, wxDialog ) ...@@ -153,17 +148,13 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFindFrame, wxDialog )
////@begin WinEDA_PcbFindFrame event table entries ////@begin WinEDA_PcbFindFrame event table entries
EVT_BUTTON( ID_FIND_ITEM, WinEDA_PcbFindFrame::OnFindItemClick ) EVT_BUTTON( ID_FIND_ITEM, WinEDA_PcbFindFrame::OnFindItemClick )
EVT_BUTTON( ID_FIND_NEXT_ITEM, WinEDA_PcbFindFrame::OnFindNextItemClick ) EVT_BUTTON( ID_FIND_NEXT_ITEM, WinEDA_PcbFindFrame::OnFindNextItemClick )
EVT_BUTTON( ID_FIND_MARKER, WinEDA_PcbFindFrame::OnFindMarkerClick ) EVT_BUTTON( ID_FIND_MARKER, WinEDA_PcbFindFrame::OnFindMarkerClick )
EVT_BUTTON( ID_FIND_NEXT_MARKER, WinEDA_PcbFindFrame::OnFindNextMarkerClick ) EVT_BUTTON( ID_FIND_NEXT_MARKER, WinEDA_PcbFindFrame::OnFindNextMarkerClick )
////@end WinEDA_PcbFindFrame event table entries ////@end WinEDA_PcbFindFrame event table entries
END_EVENT_TABLE() END_EVENT_TABLE()
/*! /*!
* WinEDA_PcbFindFrame constructors * WinEDA_PcbFindFrame constructors
*/ */
...@@ -203,18 +194,20 @@ bool WinEDA_PcbFindFrame::Create( wxWindow* parent, ...@@ -203,18 +194,20 @@ bool WinEDA_PcbFindFrame::Create( wxWindow* parent,
{ {
////@begin WinEDA_PcbFindFrame member initialisation ////@begin WinEDA_PcbFindFrame member initialisation
m_NewText = NULL; m_NewText = NULL;
////@end WinEDA_PcbFindFrame member initialisation ////@end WinEDA_PcbFindFrame member initialisation
////@begin WinEDA_PcbFindFrame creation ////@begin WinEDA_PcbFindFrame creation
SetExtraStyle(wxWS_EX_BLOCK_EVENTS); SetExtraStyle( wxWS_EX_BLOCK_EVENTS );
wxDialog::Create( parent, id, caption, pos, size, style ); wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls(); CreateControls();
if (GetSizer()) if( GetSizer() )
{ {
GetSizer()->SetSizeHints(this); GetSizer()->SetSizeHints( this );
} }
Centre(); Centre();
////@end WinEDA_PcbFindFrame creation ////@end WinEDA_PcbFindFrame creation
return true; return true;
} }
...@@ -231,36 +224,74 @@ void WinEDA_PcbFindFrame::CreateControls() ...@@ -231,36 +224,74 @@ void WinEDA_PcbFindFrame::CreateControls()
WinEDA_PcbFindFrame* itemDialog1 = this; WinEDA_PcbFindFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxVERTICAL );
itemDialog1->SetSizer(itemBoxSizer2);
itemDialog1->SetSizer( itemBoxSizer2 );
wxStaticText* itemStaticText3 = new wxStaticText( itemDialog1, wxID_STATIC, _("Item to find:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add(itemStaticText3, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); wxStaticText* itemStaticText3 = new wxStaticText( itemDialog1,
wxID_STATIC,
m_NewText = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); _( "Item to find:" ),
itemBoxSizer2->Add(m_NewText, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); wxDefaultPosition,
wxDefaultSize,
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL); 0 );
itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); itemBoxSizer2->Add( itemStaticText3,
0,
wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL); wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
itemBoxSizer5->Add(itemBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5); 5 );
wxButton* itemButton7 = new wxButton( itemDialog1, ID_FIND_ITEM, _("Find Item"), wxDefaultPosition, wxDefaultSize, 0 ); m_NewText = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T( "" ),
wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add( m_NewText, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer( wxHORIZONTAL );
itemBoxSizer2->Add( itemBoxSizer5,
0,
wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT |
wxBOTTOM,
5 );
wxBoxSizer* itemBoxSizer6 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer5->Add( itemBoxSizer6,
0,
wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT,
5 );
wxButton* itemButton7 =
new wxButton( itemDialog1, ID_FIND_ITEM, _( "Find Item" ),
wxDefaultPosition, wxDefaultSize, 0 );
itemButton7->SetDefault(); itemButton7->SetDefault();
itemBoxSizer6->Add(itemButton7, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); itemBoxSizer6->Add( itemButton7, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
wxButton* itemButton8 = new wxButton( itemDialog1, ID_FIND_NEXT_ITEM, _("Find Next Item"), wxDefaultPosition, wxDefaultSize, 0 ); wxButton* itemButton8 =
itemBoxSizer6->Add(itemButton8, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); new wxButton( itemDialog1, ID_FIND_NEXT_ITEM, _( "Find Next Item" ),
wxDefaultPosition, wxDefaultSize,
wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); 0 );
itemBoxSizer5->Add(itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5); itemBoxSizer6->Add( itemButton8,
0,
wxButton* itemButton10 = new wxButton( itemDialog1, ID_FIND_MARKER, _("Find Marker"), wxDefaultPosition, wxDefaultSize, 0 ); wxGROW | wxLEFT | wxRIGHT | wxBOTTOM,
itemBoxSizer9->Add(itemButton10, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); 5 );
wxButton* itemButton11 = new wxButton( itemDialog1, ID_FIND_NEXT_MARKER, _("Find Next Marker"), wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* itemBoxSizer9 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer9->Add(itemButton11, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); itemBoxSizer5->Add( itemBoxSizer9,
0,
wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT,
5 );
wxButton* itemButton10 =
new wxButton( itemDialog1, ID_FIND_MARKER, _( "Find Marker" ),
wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( itemButton10, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
wxButton* itemButton11 = new wxButton( itemDialog1,
ID_FIND_NEXT_MARKER,
_( "Find Next Marker" ),
wxDefaultPosition,
wxDefaultSize,
0 );
itemBoxSizer9->Add( itemButton11,
0,
wxGROW | wxLEFT | wxRIGHT | wxBOTTOM,
5 );
////@end WinEDA_PcbFindFrame content construction ////@end WinEDA_PcbFindFrame content construction
} }
...@@ -284,8 +315,9 @@ wxBitmap WinEDA_PcbFindFrame::GetBitmapResource( const wxString& name ) ...@@ -284,8 +315,9 @@ wxBitmap WinEDA_PcbFindFrame::GetBitmapResource( const wxString& name )
{ {
// Bitmap retrieval // Bitmap retrieval
////@begin WinEDA_PcbFindFrame bitmap retrieval ////@begin WinEDA_PcbFindFrame bitmap retrieval
wxUnusedVar(name); wxUnusedVar( name );
return wxNullBitmap; return wxNullBitmap;
////@end WinEDA_PcbFindFrame bitmap retrieval ////@end WinEDA_PcbFindFrame bitmap retrieval
} }
...@@ -298,8 +330,9 @@ wxIcon WinEDA_PcbFindFrame::GetIconResource( const wxString& name ) ...@@ -298,8 +330,9 @@ wxIcon WinEDA_PcbFindFrame::GetIconResource( const wxString& name )
{ {
// Icon retrieval // Icon retrieval
////@begin WinEDA_PcbFindFrame icon retrieval ////@begin WinEDA_PcbFindFrame icon retrieval
wxUnusedVar(name); wxUnusedVar( name );
return wxNullIcon; return wxNullIcon;
////@end WinEDA_PcbFindFrame icon retrieval ////@end WinEDA_PcbFindFrame icon retrieval
} }
......
/*************************************************************************/ /************************************************************************/
/* Functions to create drill data used to create aFiles and report aFiles */ /* Functions to create drill data used to create files and report files */
/*************************************************************************/ /************************************************************************/
#include "fctsys.h" #include "fctsys.h"
...@@ -21,17 +21,13 @@ using namespace std; ...@@ -21,17 +21,13 @@ using namespace std;
#include "class_board_design_settings.h" #include "class_board_design_settings.h"
#include "gendrill.h" #include "gendrill.h"
/**********************************************************************************/
void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
Ki_PageDescr* aSheet, Ki_PageDescr* aSheet,
std::vector<HOLE_INFO> aHoleListBuffer, std::vector<HOLE_INFO> aHoleListBuffer,
std::vector<DRILL_TOOL> aToolListBuffer, std::vector<DRILL_TOOL> aToolListBuffer,
bool aUnit_Drill_is_Inch, int format, bool aUnit_Drill_is_Inch, int format,
const wxPoint& auxoffset ) const wxPoint& auxoffset )
/**********************************************************************************/
/* Genere le plan de percage (Drill map)
*/
{ {
int x, y; int x, y;
int plotX, plotY, TextWidth; int plotX, plotY, TextWidth;
...@@ -47,15 +43,15 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, ...@@ -47,15 +43,15 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
SetLocaleTo_C_standard(); // Use the standard notation for float numbers SetLocaleTo_C_standard(); // Use the standard notation for float numbers
/* calcul des dimensions et centre du PCB */ /* Calculate dimensions and center of PCB */
aPcb->ComputeBoundaryBox(); aPcb->ComputeBoundaryBox();
dX = aPcb->m_BoundaryBox.GetWidth(); dX = aPcb->m_BoundaryBox.GetWidth();
dY = aPcb->m_BoundaryBox.GetHeight(); dY = aPcb->m_BoundaryBox.GetHeight();
BoardCentre = aPcb->m_BoundaryBox.Centre(); BoardCentre = aPcb->m_BoundaryBox.Centre();
// Calcul de l'echelle du dessin du PCB, // Calculate the scale for the format type, scale 1 in HPGL, drawing on
// Echelle 1 en HPGL, dessin sur feuille A4 en PS, + texte description des symboles // an A4 sheet in PS, + text description of symbols
switch( format ) switch( format )
{ {
case PLOT_FORMAT_GERBER: case PLOT_FORMAT_GERBER:
...@@ -65,7 +61,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, ...@@ -65,7 +61,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
plotter->set_viewport( offset, scale, 0 ); plotter->set_viewport( offset, scale, 0 );
break; break;
case PLOT_FORMAT_HPGL: /* Calcul des echelles de conversion format HPGL */ case PLOT_FORMAT_HPGL: /* Scale for HPGL format. */
{ {
offset.x = 0; offset.x = 0;
offset.y = 0; offset.y = 0;
...@@ -94,7 +90,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, ...@@ -94,7 +90,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
offset.x = BoardCentre.x - (SheetSize.x / 2) / scale; offset.x = BoardCentre.x - (SheetSize.x / 2) / scale;
offset.y = BoardCentre.y - (SheetSize.y / 2) / scale; offset.y = BoardCentre.y - (SheetSize.y / 2) / scale;
offset.y += SheetSize.y / 8; /* decalage pour legende */ offset.y += SheetSize.y / 8; /* offset to legend */
PS_PLOTTER* ps_plotter = new PS_PLOTTER; PS_PLOTTER* ps_plotter = new PS_PLOTTER;
plotter = ps_plotter; plotter = ps_plotter;
ps_plotter->set_paper_size( SheetPS ); ps_plotter->set_paper_size( SheetPS );
...@@ -132,7 +128,8 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, ...@@ -132,7 +128,8 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
switch( PtStruct->Type() ) switch( PtStruct->Type() )
{ {
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
PlotDrawSegment( plotter, (DRAWSEGMENT*) PtStruct, EDGE_LAYER, FILLED ); PlotDrawSegment( plotter, (DRAWSEGMENT*) PtStruct, EDGE_LAYER,
FILLED );
break; break;
case TYPE_TEXTE: case TYPE_TEXTE:
...@@ -163,22 +160,23 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, ...@@ -163,22 +160,23 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
// Plot board outlines and drill map // Plot board outlines and drill map
Gen_Drill_PcbMap( aPcb, plotter, aHoleListBuffer, aToolListBuffer ); Gen_Drill_PcbMap( aPcb, plotter, aHoleListBuffer, aToolListBuffer );
/* Impression de la liste des symboles utilises */ /* Print a list of symbols used. */
CharSize = 800; /* text size in 1/10000 mils */ CharSize = 800; /* text size in 1/10000 mils */
double CharScale = 1.0 / scale; /* real scale will be CharScale * scale_x, double CharScale = 1.0 / scale; /* real scale will be CharScale
* because the global plot scale is scale_x */ * scale_x, because the global
* plot scale is scale_x */
TextWidth = (int) ( (CharSize * CharScale) / 10 ); // Set text width (thickness) TextWidth = (int) ( (CharSize * CharScale) / 10 ); // Set text width (thickness)
intervalle = (int) ( CharSize * CharScale ) + TextWidth; intervalle = (int) ( CharSize * CharScale ) + TextWidth;
/* Trace des informations */ /* Trace information. */
plotX = aPcb->m_BoundaryBox.GetX() + 200 * CharScale; plotX = aPcb->m_BoundaryBox.GetX() + 200 * CharScale;
plotY = aPcb->m_BoundaryBox.GetBottom() + intervalle; plotY = aPcb->m_BoundaryBox.GetBottom() + intervalle;
/* Plot title "Info" */ /* Plot title "Info" */
wxString Text = wxT( "Drill Map:" ); wxString Text = wxT( "Drill Map:" );
plotter->text( wxPoint( plotX, plotY ), BLACK, plotter->text( wxPoint( plotX, plotY ), BLACK, Text, 0,
Text, wxSize( (int) ( CharSize * CharScale ),
0, wxSize( (int) ( CharSize * CharScale ), (int) ( CharSize * CharScale ) ), (int) ( CharSize * CharScale ) ),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
TextWidth, false, false ); TextWidth, false, false );
...@@ -195,7 +193,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, ...@@ -195,7 +193,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
y = plotY + CharSize * CharScale; y = plotY + CharSize * CharScale;
plotter->marker( wxPoint( x, y ), plot_diam, ii ); plotter->marker( wxPoint( x, y ), plot_diam, ii );
/* Trace de la legende associee */ /* Trace the legends. */
// List the diameter of each drill in the selected Drill Unit, // List the diameter of each drill in the selected Drill Unit,
// and then its diameter in the other Drill Unit. // and then its diameter in the other Drill Unit.
...@@ -246,17 +244,14 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, ...@@ -246,17 +244,14 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
} }
/****************************************************************************************/
void Gen_Drill_PcbMap( BOARD* aPcb, PLOTTER* plotter,
std::vector<HOLE_INFO>& aHoleListBuffer,
std::vector<DRILL_TOOL>& aToolListBuffer )
/****************************************************************************************/
/** Creates the drill map aFile in HPGL or POSTSCRIPT format /** Creates the drill map aFile in HPGL or POSTSCRIPT format
* @param aPcb BOARD * @param aPcb BOARD
* @param aHoleListBuffer = std::vector<HOLE_INFO> list of holes descriptors * @param aHoleListBuffer = std::vector<HOLE_INFO> list of holes descriptors
* @param aToolListBuffer = std::vector<DRILL_TOOL> drill list buffer * @param aToolListBuffer = std::vector<DRILL_TOOL> drill list buffer
*/ */
void Gen_Drill_PcbMap( BOARD* aPcb, PLOTTER* plotter,
std::vector<HOLE_INFO>& aHoleListBuffer,
std::vector<DRILL_TOOL>& aToolListBuffer )
{ {
wxPoint pos; wxPoint pos;
...@@ -291,17 +286,14 @@ void Gen_Drill_PcbMap( BOARD* aPcb, PLOTTER* plotter, ...@@ -291,17 +286,14 @@ void Gen_Drill_PcbMap( BOARD* aPcb, PLOTTER* plotter,
} }
/**************************************************************************************************/
void GenDrillReportFile( FILE* aFile, BOARD* aPcb, const wxString& aBoardFilename,
bool aUnit_Drill_is_Inch,
std::vector<HOLE_INFO>& aHoleListBuffer,
std::vector<DRILL_TOOL>& aToolListBuffer
)
/*************************************************************************************************/
/* /*
* Create a list of drill values and drill count * Create a list of drill values and drill count
*/ */
void GenDrillReportFile( FILE* aFile, BOARD* aPcb,
const wxString& aBoardFilename,
bool aUnit_Drill_is_Inch,
std::vector<HOLE_INFO>& aHoleListBuffer,
std::vector<DRILL_TOOL>& aToolListBuffer )
{ {
unsigned TotalHoleCount; unsigned TotalHoleCount;
char line[1024]; char line[1024];
...@@ -313,7 +305,8 @@ void GenDrillReportFile( FILE* aFile, BOARD* aPcb, const wxString& aBoardFilenam ...@@ -313,7 +305,8 @@ void GenDrillReportFile( FILE* aFile, BOARD* aPcb, const wxString& aBoardFilenam
fprintf( aFile, "Drill report for %s\n", CONV_TO_UTF8( aBoardFilename ) ); fprintf( aFile, "Drill report for %s\n", CONV_TO_UTF8( aBoardFilename ) );
fprintf( aFile, "Created on %s\n", DateAndTime( line ) ); fprintf( aFile, "Created on %s\n", DateAndTime( line ) );
// List which Drill Unit option had been selected for the associated drill aFile. // List which Drill Unit option had been selected for the associated
// drill aFile.
if( aUnit_Drill_is_Inch ) if( aUnit_Drill_is_Inch )
fputs( "Selected Drill Unit: Imperial (\")\n\n", aFile ); fputs( "Selected Drill Unit: Imperial (\")\n\n", aFile );
else else
...@@ -405,8 +398,10 @@ void GenDrillReportFile( FILE* aFile, BOARD* aPcb, const wxString& aBoardFilenam ...@@ -405,8 +398,10 @@ void GenDrillReportFile( FILE* aFile, BOARD* aPcb, const wxString& aBoardFilenam
if( layer2 >= LAYER_CMP_N ) // no more layer pair to consider if( layer2 >= LAYER_CMP_N ) // no more layer pair to consider
break; break;
layer1++; layer2++; // use next layer pair layer1++; layer2++; // use next layer pair
if( layer2 == g_DesignSettings.GetCopperLayerCount() - 1 ) // The last layer is reached
layer2 = LAYER_CMP_N; // the last layer is always the component layer if( layer2 == g_DesignSettings.GetCopperLayerCount() - 1 )
layer2 = LAYER_CMP_N; // the last layer is always the
// component layer
} }
gen_through_holes = false; gen_through_holes = false;
} }
......
This diff is collapsed.
This diff is collapsed.
/*************************/ /*************/
/* Edition des Pastilles */ /* Edit pads */
/*************************/ /*************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -49,9 +49,7 @@ private: ...@@ -49,9 +49,7 @@ private:
wxCheckBox* m_Pad_Orient_Change; wxCheckBox* m_Pad_Orient_Change;
public: public:
WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* parent, D_PAD* Pad );
// Constructor and destructor
WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame * parent, D_PAD * Pad );
~WinEDA_PadGlobalEditFrame() { } ~WinEDA_PadGlobalEditFrame() { }
private: private:
...@@ -62,19 +60,20 @@ private: ...@@ -62,19 +60,20 @@ private:
}; };
BEGIN_EVENT_TABLE( WinEDA_PadGlobalEditFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_PadGlobalEditFrame, wxDialog )
EVT_BUTTON( ID_CHANGE_CURRENT_MODULE, WinEDA_PadGlobalEditFrame::PadPropertiesAccept ) EVT_BUTTON( ID_CHANGE_CURRENT_MODULE,
EVT_BUTTON( ID_CHANGE_ID_MODULES, WinEDA_PadGlobalEditFrame::PadPropertiesAccept ) WinEDA_PadGlobalEditFrame::PadPropertiesAccept )
EVT_BUTTON( ID_CHANGE_GET_PAD_SETTINGS, WinEDA_PadGlobalEditFrame::PadPropertiesAccept ) EVT_BUTTON( ID_CHANGE_ID_MODULES,
EVT_BUTTON( wxID_CANCEL, WinEDA_PadGlobalEditFrame::OnCancelClick ) WinEDA_PadGlobalEditFrame::PadPropertiesAccept )
EVT_BUTTON( ID_CHANGE_GET_PAD_SETTINGS,
WinEDA_PadGlobalEditFrame::PadPropertiesAccept )
EVT_BUTTON( wxID_CANCEL, WinEDA_PadGlobalEditFrame::OnCancelClick )
END_EVENT_TABLE() END_EVENT_TABLE()
WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame(
/********************************************************************************/ WinEDA_BasePcbFrame* parent,
WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* parent,
D_PAD* Pad ) : D_PAD* Pad ) :
wxDialog( parent, -1, _( "Edit Pads Global" ), wxDefaultPosition, wxSize( 310, 235 ), wxDialog( parent, -1, _( "Edit Pads Global" ), wxDefaultPosition,
DIALOG_STYLE ) wxSize( 310, 235 ), DIALOG_STYLE )
/********************************************************************************/
{ {
wxPoint pos; wxPoint pos;
wxButton* Button; wxButton* Button;
...@@ -84,7 +83,7 @@ WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* paren ...@@ -84,7 +83,7 @@ WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* paren
CurrentPad = Pad; CurrentPad = Pad;
/* Creation des boutons de commande */ /* Create command buttons. */
pos.x = 150; pos.x = 150;
pos.y = 10; pos.y = 10;
Button = new wxButton( this, ID_CHANGE_GET_PAD_SETTINGS, Button = new wxButton( this, ID_CHANGE_GET_PAD_SETTINGS,
...@@ -101,7 +100,7 @@ WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* paren ...@@ -101,7 +100,7 @@ WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* paren
pos.y += Button->GetDefaultSize().y + 10; pos.y += Button->GetDefaultSize().y + 10;
Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ), pos ); Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ), pos );
// Selection des filtres de selection des pads : // Pad filter selection.
pos.x = 5; pos.x = 5;
pos.y = 5; pos.y = 5;
new wxStaticBox( this, -1, _( "Pad Filter :" ), pos, wxSize( 130, 75 ) ); new wxStaticBox( this, -1, _( "Pad Filter :" ), pos, wxSize( 130, 75 ) );
...@@ -144,26 +143,22 @@ WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* paren ...@@ -144,26 +143,22 @@ WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* paren
m_Pad_Drill_Change->SetValue( Pad_Drill_Change ); m_Pad_Drill_Change->SetValue( Pad_Drill_Change );
pos.y += 18; pos.y += 18;
m_Pad_Orient_Change = new wxCheckBox( this, -1, _( "Change Orientation" ), pos ); m_Pad_Orient_Change = new wxCheckBox( this, -1, _( "Change Orientation" ),
pos );
m_Pad_Orient_Change->SetValue( Pad_Orient_Change ); m_Pad_Orient_Change->SetValue( Pad_Orient_Change );
} }
/**********************************************************************/ void WinEDA_PadGlobalEditFrame::OnCancelClick( wxCommandEvent& WXUNUSED( event ) )
void WinEDA_PadGlobalEditFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) )
/**********************************************************************/
{ {
EndModal( -1 ); EndModal( -1 );
} }
/*************************************************************************/ /* Update the parameters for the component being edited.
void WinEDA_PadGlobalEditFrame::PadPropertiesAccept( wxCommandEvent& event )
/*************************************************************************/
/* Met a jour les differents parametres pour le composant en cours d'dition
*/ */
void WinEDA_PadGlobalEditFrame::PadPropertiesAccept( wxCommandEvent& event )
{ {
int returncode = 0; int returncode = 0;
...@@ -192,16 +187,14 @@ void WinEDA_PadGlobalEditFrame::PadPropertiesAccept( wxCommandEvent& event ) ...@@ -192,16 +187,14 @@ void WinEDA_PadGlobalEditFrame::PadPropertiesAccept( wxCommandEvent& event )
} }
/***************************************************************************/
void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
/***************************************************************************/
/** Function Global_Import_Pad_Settings /** Function Global_Import_Pad_Settings
* Function to change pad caracteristics for the given footprint * Function to change pad caracteristics for the given footprint
* or alls footprints which look like the given footprint * or alls footprints which look like the given footprint
* @param aPad pad to use as pattern. The given footprint is the parent of this pad * @param aPad pad to use as pattern. The given footprint is the parent of
* this pad
* @param aDraw: if true: redraws the footprint * @param aDraw: if true: redraws the footprint
*/ */
void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
{ {
MODULE* Module_Ref, * Module; MODULE* Module_Ref, * Module;
int diag; int diag;
...@@ -214,7 +207,8 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -214,7 +207,8 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
if( Module == NULL ) if( Module == NULL )
{ {
DisplayError( this, wxT( "Global_Import_Pad_Settings() Error: NULL module" ) ); DisplayError( this,
wxT( "Global_Import_Pad_Settings() Error: NULL module" ) );
return; return;
} }
...@@ -222,7 +216,8 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -222,7 +216,8 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
Module->DisplayInfo( this ); Module->DisplayInfo( this );
WinEDA_PadGlobalEditFrame* frame = new WinEDA_PadGlobalEditFrame( this, aPad ); WinEDA_PadGlobalEditFrame* frame = new WinEDA_PadGlobalEditFrame( this,
aPad );
diag = frame->ShowModal(); diag = frame->ShowModal();
frame->Destroy(); frame->Destroy();
...@@ -232,10 +227,10 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -232,10 +227,10 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
if( diag == 1 ) if( diag == 1 )
Edit_Same_Modules = TRUE; Edit_Same_Modules = TRUE;
/* Recherche et copie du nom librairie de reference: */ /* Search and copy the name of library reference. */
Module_Ref = Module; Module_Ref = Module;
/* Mise a jour des modules ou du module */ /* Update the modules or module. */
Module = (MODULE*) m_Pcb->m_Modules; Module = (MODULE*) m_Pcb->m_Modules;
for( ; Module != NULL; Module = Module->Next() ) for( ; Module != NULL; Module = Module->Next() )
...@@ -249,8 +244,8 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -249,8 +244,8 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
Module->DisplayInfo( this ); Module->DisplayInfo( this );
/* Effacement du module */ /* Erase module */
if ( aDraw ) if( aDraw )
{ {
Module->m_Flags |= DO_NOT_DRAW; Module->m_Flags |= DO_NOT_DRAW;
DrawPanel->PostDirtyRect( Module->GetBoundingBox() ); DrawPanel->PostDirtyRect( Module->GetBoundingBox() );
...@@ -260,7 +255,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -260,7 +255,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
D_PAD* pt_pad = (D_PAD*) Module->m_Pads; D_PAD* pt_pad = (D_PAD*) Module->m_Pads;
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() ) for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
{ {
/* Filtrage des modifications interdites */ /* Filters changes prohibited. */
if( Pad_Shape_Filter ) if( Pad_Shape_Filter )
{ {
if( pt_pad->m_PadShape != g_Pad_Master.m_PadShape ) if( pt_pad->m_PadShape != g_Pad_Master.m_PadShape )
...@@ -269,7 +264,8 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -269,7 +264,8 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
if( Pad_Orient_Filter ) if( Pad_Orient_Filter )
{ {
if( (pt_pad->m_Orient - Module->m_Orient) != g_Pad_Master.m_Orient ) if( (pt_pad->m_Orient - Module->m_Orient) !=
g_Pad_Master.m_Orient )
continue; continue;
} }
...@@ -278,10 +274,11 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -278,10 +274,11 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
if( pt_pad->m_Masque_Layer != g_Pad_Master.m_Masque_Layer ) if( pt_pad->m_Masque_Layer != g_Pad_Master.m_Masque_Layer )
continue; continue;
else else
m_Pcb->m_Status_Pcb &= ~( LISTE_RATSNEST_ITEM_OK | CONNEXION_OK); m_Pcb->m_Status_Pcb &=
~( LISTE_RATSNEST_ITEM_OK | CONNEXION_OK);
} }
/* Modif des caracteristiques: */ /* Change characteristics.: */
if( Pad_Shape_Change ) if( Pad_Shape_Change )
{ {
pt_pad->m_Attribut = g_Pad_Master.m_Attribut; pt_pad->m_Attribut = g_Pad_Master.m_Attribut;
...@@ -308,7 +305,6 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -308,7 +305,6 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
pt_pad->m_Orient = g_Pad_Master.m_Orient + Module->m_Orient; pt_pad->m_Orient = g_Pad_Master.m_Orient + Module->m_Orient;
} }
/* Traitement des cas particuliers : */
if( g_Pad_Master.m_PadShape != PAD_TRAPEZOID ) if( g_Pad_Master.m_PadShape != PAD_TRAPEZOID )
{ {
pt_pad->m_DeltaSize.x = 0; pt_pad->m_DeltaSize.x = 0;
...@@ -334,7 +330,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -334,7 +330,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
} }
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
if ( aDraw ) if( aDraw )
DrawPanel->PostDirtyRect( Module->GetBoundingBox() ); DrawPanel->PostDirtyRect( Module->GetBoundingBox() );
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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