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