Commit de442033 authored by stambaughw's avatar stambaughw

Comment translation and capitalization fixes.

* Complete comment translation of PCBNew source.
* Some tooltip capitalization fixes in PCBNew toolbars.
parent de62fa09
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
#define OPTKEY_PRINT_PAGE_FRAME wxT( "PrintPageFrame" ) #define OPTKEY_PRINT_PAGE_FRAME wxT( "PrintPageFrame" )
#define OPTKEY_PRINT_MONOCHROME_MODE wxT( "PrintMonochrome" ) #define OPTKEY_PRINT_MONOCHROME_MODE wxT( "PrintMonochrome" )
/* Constantes de conversion d'unites */ /* Conversion unit constants. */
/* coeff de conversion dim en 0.1 mil -> dim en unite PS: (unite PS = pouce) */ /* Convert pcb dimension of 0.1 mil to PS units of inches. */
#define SCALE_PS .0001 #define SCALE_PS .0001
/* coeff de conversion dim en 0,1 mil -> dim en unite HPGL: */ /* Convert dimension 0.1 mil -> HPGL units: */
#define SCALE_HPGL 0.102041 #define SCALE_HPGL 0.102041
/* Plot Options : */ /* Plot Options : */
...@@ -29,7 +29,8 @@ public: ...@@ -29,7 +29,8 @@ public:
bool Exclude_Edges_Pcb; bool Exclude_Edges_Pcb;
int PlotLine_Width; int PlotLine_Width;
bool Plot_Frame_Ref; // True to plot/print frame references bool Plot_Frame_Ref; // True to plot/print frame references
bool DrawViaOnMaskLayer; // True if vias are drawn on Mask layer (ie protected by mask) bool DrawViaOnMaskLayer; // True if vias are drawn on Mask layer
// (ie protected by mask)
GRTraceMode Trace_Mode; GRTraceMode Trace_Mode;
bool Plot_Set_MIROIR; bool Plot_Set_MIROIR;
int HPGL_Pen_Num; int HPGL_Pen_Num;
...@@ -39,14 +40,14 @@ public: ...@@ -39,14 +40,14 @@ public:
int PlotPSColorOpt; // True for color Postscript output int PlotPSColorOpt; // True for color Postscript output
bool Plot_PS_Negative; // True to create a negative board ps plot bool Plot_PS_Negative; // True to create a negative board ps plot
/* Autorisation de trace des divers items en serigraphie */ /* Flags to enable or disable ploting of various PCB elements. */
bool Sel_Texte_Reference; bool Sel_Texte_Reference;
bool Sel_Texte_Valeur; bool Sel_Texte_Valeur;
bool Sel_Texte_Divers; bool Sel_Texte_Divers;
bool Sel_Texte_Invisible; bool Sel_Texte_Invisible;
bool PlotPadsOnSilkLayer; bool PlotPadsOnSilkLayer;
bool Plot_Pads_All_Layers; /* Plot pads meme n'appartenant pas a la bool Plot_Pads_All_Layers; /* Plot pads even outside the
* couche ( utile pour serigraphie) */ * Layer (useful for silkscreen) */
/* id for plot format (see enum PlotFormat in plot_common.h) */ /* id for plot format (see enum PlotFormat in plot_common.h) */
int PlotFormat; int PlotFormat;
...@@ -68,17 +69,12 @@ public: ...@@ -68,17 +69,12 @@ public:
extern PCB_Plot_Options g_pcb_plot_options; extern PCB_Plot_Options g_pcb_plot_options;
/*************************************/
/* Constantes utiles en trace GERBER */
/*************************************/
/* PLOT_RTN.CC */
void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer, void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
/* Trace 1 Texte type PCB , c.a.d autre que les textes sur modules, /* Plat PCB text type, ie other than text on modules
* prepare les parametres de trace de texte */ * prepare the plot settings of text */
void PlotDrawSegment( PLOTTER* plotter, DRAWSEGMENT* PtSegm, int masque_layer, void PlotDrawSegment( PLOTTER* plotter, DRAWSEGMENT* PtSegm, int masque_layer,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
......
This diff is collapsed.
/*******************************/ /******************/
/**** Routine de trace HPGL ****/ /**** Plot DXF ****/
/*******************************/ /******************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -12,10 +12,8 @@ ...@@ -12,10 +12,8 @@
#include "protos.h" #include "protos.h"
/*****************************************************************************/
void WinEDA_BasePcbFrame::Genere_DXF( const wxString& FullFileName, int Layer, void WinEDA_BasePcbFrame::Genere_DXF( const wxString& FullFileName, int Layer,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/*****************************************************************************/
{ {
Ki_PageDescr* currentsheet = GetScreen()->m_CurrentSheetDesc; Ki_PageDescr* currentsheet = GetScreen()->m_CurrentSheetDesc;
...@@ -34,7 +32,7 @@ void WinEDA_BasePcbFrame::Genere_DXF( const wxString& FullFileName, int Layer, ...@@ -34,7 +32,7 @@ void WinEDA_BasePcbFrame::Genere_DXF( const wxString& FullFileName, int Layer,
DXF_PLOTTER* plotter = new DXF_PLOTTER(); DXF_PLOTTER* plotter = new DXF_PLOTTER();
plotter->set_paper_size( currentsheet ); plotter->set_paper_size( currentsheet );
plotter->set_viewport( wxPoint(0,0), 1, 0 ); plotter->set_viewport( wxPoint( 0, 0 ), 1, 0 );
plotter->set_creator( wxT( "PCBNEW-DXF" ) ); plotter->set_creator( wxT( "PCBNEW-DXF" ) );
plotter->set_filename( FullFileName ); plotter->set_filename( FullFileName );
plotter->start_plot( output_file ); plotter->start_plot( output_file );
......
/*******************************/ /*******************/
/**** Routine de trace HPGL ****/ /**** Plot HPGL ****/
/*******************************/ /*******************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -12,10 +12,9 @@ ...@@ -12,10 +12,9 @@
#include "protos.h" #include "protos.h"
/*****************************************************************************/
void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer, void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/*****************************************************************************/
{ {
wxSize SheetSize; wxSize SheetSize;
wxSize BoardSize; wxSize BoardSize;
...@@ -28,7 +27,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer, ...@@ -28,7 +27,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
ClearMsgPanel(); ClearMsgPanel();
// Compute pen_dim (from g_HPGL_Pen_Diam in mils) in pcb units, // Compute pen_dim (from g_HPGL_Pen_Diam in mils) in pcb units,
// with plot scale (if Scale is 2, pen diametre is always g_HPGL_Pen_Diam // with plot scale (if Scale is 2, pen diameter is always g_HPGL_Pen_Diam
// so apparent pen diam is real pen diam / Scale // so apparent pen diam is real pen diam / Scale
int pen_diam = wxRound( (g_pcb_plot_options.HPGL_Pen_Diam * U_PCB) / g_pcb_plot_options.Scale ); int pen_diam = wxRound( (g_pcb_plot_options.HPGL_Pen_Diam * U_PCB) / g_pcb_plot_options.Scale );
...@@ -53,14 +52,14 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer, ...@@ -53,14 +52,14 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
AppendMsgPanel( _( "File" ), FullFileName, CYAN ); AppendMsgPanel( _( "File" ), FullFileName, CYAN );
if( g_pcb_plot_options.PlotScaleOpt != 1 ) if( g_pcb_plot_options.PlotScaleOpt != 1 )
Center = TRUE; // Echelle != 1 donc trace centree du PCB Center = TRUE; // Scale != 1 so center PCB plot.
// calcul en unites internes des dimensions des feuilles ( connues en 1/1000 pouce ) // Scale units from 0.0001" to HPGL plot units.
SheetSize.x = currentsheet->m_Size.x * U_PCB; SheetSize.x = currentsheet->m_Size.x * U_PCB;
SheetSize.y = currentsheet->m_Size.y * U_PCB; SheetSize.y = currentsheet->m_Size.y * U_PCB;
/* calcul des dimensions et centre du PCB */ /* Calculate the center of the PCB. */
m_Pcb->ComputeBoundaryBox(); m_Pcb->ComputeBoundaryBox();
BoardSize = m_Pcb->m_BoundaryBox.GetSize(); BoardSize = m_Pcb->m_BoundaryBox.GetSize();
BoardCenter = m_Pcb->m_BoundaryBox.Centre(); BoardCenter = m_Pcb->m_BoundaryBox.Centre();
...@@ -70,18 +69,18 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer, ...@@ -70,18 +69,18 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
double Xscale, Yscale; double Xscale, Yscale;
// Fit to 80% of the page // Fit to 80% of the page
Xscale = ( (SheetSize.x * 0.8) / BoardSize.x ); Xscale = ( ( SheetSize.x * 0.8 ) / BoardSize.x );
Yscale = ( (SheetSize.y * 0.8) / BoardSize.y ); Yscale = ( ( SheetSize.y * 0.8 ) / BoardSize.y );
scale = MIN( Xscale, Yscale ); scale = MIN( Xscale, Yscale );
} }
else else
scale = g_pcb_plot_options.Scale; scale = g_pcb_plot_options.Scale;
// Calcul du cadrage (echelle != 1 donc recadrage du trace) // Calculate the page size offset.
if( Center ) if( Center )
{ {
offset.x = BoardCenter.x - (SheetSize.x / 2) / scale; offset.x = BoardCenter.x - ( SheetSize.x / 2 ) / scale;
offset.y = BoardCenter.y - (SheetSize.y / 2) / scale; offset.y = BoardCenter.y - ( SheetSize.y / 2 ) / scale;
} }
else else
{ {
......
/*************************************/ /*************************/
/**** Pcbnew: Routine de trace PS ****/ /**** Plot Postscript ****/
/*************************************/ /*************************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -12,14 +12,12 @@ ...@@ -12,14 +12,12 @@
#include "protos.h" #include "protos.h"
/****************************************************************************/
void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
bool useA4, GRTraceMode trace_mode )
/****************************************************************************/
/* Genere un fichier POSTSCRIPT (*.ps) de trace du circuit, couche layer /* Generate a PostScript file (*. ps) of the circuit layer.
* if layer < 0: all layers * If layer < 0: all layers are plotted.
*/ */
void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
bool useA4, GRTraceMode trace_mode )
{ {
wxSize SheetSize; wxSize SheetSize;
wxSize PaperSize; wxSize PaperSize;
...@@ -45,13 +43,12 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer, ...@@ -45,13 +43,12 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
AppendMsgPanel( _( "File" ), FullFileName, CYAN ); AppendMsgPanel( _( "File" ), FullFileName, CYAN );
if( g_pcb_plot_options.PlotScaleOpt != 1 ) if( g_pcb_plot_options.PlotScaleOpt != 1 )
Center = TRUE; // Echelle != 1 donc trace centree du PCB Center = TRUE; // Scale != 1 so center plot.
// Set default line width // Set default line width
if( g_pcb_plot_options.PlotLine_Width < 1 ) if( g_pcb_plot_options.PlotLine_Width < 1 )
g_pcb_plot_options.PlotLine_Width = 1; g_pcb_plot_options.PlotLine_Width = 1;
// calcul en unites internes des dimensions des feuilles ( connues en 1/1000 pouce )
SheetSize.x = currentsheet->m_Size.x * U_PCB; SheetSize.x = currentsheet->m_Size.x * U_PCB;
SheetSize.y = currentsheet->m_Size.y * U_PCB; SheetSize.y = currentsheet->m_Size.y * U_PCB;
...@@ -69,7 +66,6 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer, ...@@ -69,7 +66,6 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
paperscale = 1; paperscale = 1;
} }
/* calcul des dimensions et centre du PCB */
m_Pcb->ComputeBoundaryBox(); m_Pcb->ComputeBoundaryBox();
BoardSize = m_Pcb->m_BoundaryBox.GetSize(); BoardSize = m_Pcb->m_BoundaryBox.GetSize();
BoardCenter = m_Pcb->m_BoundaryBox.Centre(); BoardCenter = m_Pcb->m_BoundaryBox.Centre();
...@@ -86,11 +82,10 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer, ...@@ -86,11 +82,10 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
else else
scale = g_pcb_plot_options.Scale * paperscale; scale = g_pcb_plot_options.Scale * paperscale;
// Calcul du cadrage (echelle != 1 donc recadrage du trace)
if( Center ) if( Center )
{ {
offset.x = BoardCenter.x - (PaperSize.x / 2) / scale; offset.x = BoardCenter.x - ( PaperSize.x / 2 ) / scale;
offset.y = BoardCenter.y - (PaperSize.y / 2) / scale; offset.y = BoardCenter.y - ( PaperSize.y / 2 ) / scale;
} }
else else
{ {
......
...@@ -12,20 +12,20 @@ ...@@ -12,20 +12,20 @@
#include "pcbplot.h" #include "pcbplot.h"
#include "protos.h" #include "protos.h"
/* Local functions */
static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module, static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module,
int draw_mode, int masklayer ); int draw_mode, int masklayer );
/************************************************************************************************************/
void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMaskLayer, bool aPrintMirrorMode )
/************************************************************************************************************/
/** Function PrintPage /** Function PrintPage
* Used to print the board (on printer, or when creating SVF files). * Used to print the board (on printer, or when creating SVF files).
* Print the board, but only layers allowed by aPrintMaskLayer * Print the board, but only layers allowed by aPrintMaskLayer
* ( printmasklayer is a 32 bits mask: bit n = 1 -> layer n is printed) * ( printmasklayer is a 32 bits mask: bit n = 1 -> layer n is printed)
*/ */
void WinEDA_DrawPanel::PrintPage( wxDC* aDC,
bool aPrint_Sheet_Ref,
int aPrintMaskLayer,
bool aPrintMirrorMode )
{ {
MODULE* Module; MODULE* Module;
int drawmode = GR_COPY; int drawmode = GR_COPY;
...@@ -61,14 +61,13 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa ...@@ -61,14 +61,13 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa
m_PrintIsMirrored = aPrintMirrorMode; m_PrintIsMirrored = aPrintMirrorMode;
// The OR mode is used in color mode, but be aware the backgroud *must be BLACK. // The OR mode is used in color mode, but be aware the backgroud *must be
// In print page dialog, we first plrint in BLACK, and after reprint in color, // BLACK. In the print page dialog, we first plrint in BLACK, and after
// on the black "local" backgroud, in OR mode // reprint in color, on the black "local" backgroud, in OR mode the black
// the black print is not made before, only a white page is printed // print is not made before, only a white page is printed
if( GetGRForceBlackPenState( ) == false ) if( GetGRForceBlackPenState() == false )
drawmode = GR_OR; drawmode = GR_OR;
/* Print the pcb graphic items (texts, ...) */ /* Print the pcb graphic items (texts, ...) */
GRSetDrawMode( aDC, drawmode ); GRSetDrawMode( aDC, drawmode );
for( BOARD_ITEM* item = Pcb->m_Drawings; item; item = item->Next() ) for( BOARD_ITEM* item = Pcb->m_Drawings; item; item = item->Next() )
...@@ -79,13 +78,13 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa ...@@ -79,13 +78,13 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa
case TYPE_COTATION: case TYPE_COTATION:
case TYPE_TEXTE: case TYPE_TEXTE:
case TYPE_MIRE: case TYPE_MIRE:
if( ((1<<item->GetLayer()) & aPrintMaskLayer) == 0 ) if( ( ( 1 << item->GetLayer() ) & aPrintMaskLayer ) == 0 )
break; break;
item->Draw( this, aDC, drawmode ); item->Draw( this, aDC, drawmode );
break; break;
case TYPE_MARKER_PCB: /* Trace des marqueurs */ case TYPE_MARKER_PCB:
default: default:
break; break;
} }
...@@ -97,13 +96,19 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa ...@@ -97,13 +96,19 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa
{ {
if( ( aPrintMaskLayer & pt_piste->ReturnMaskLayer() ) == 0 ) if( ( aPrintMaskLayer & pt_piste->ReturnMaskLayer() ) == 0 )
continue; continue;
if( pt_piste->Type() == TYPE_VIA ) /* VIA rencontree */ if( pt_piste->Type() == TYPE_VIA ) /* VIA encountered. */
{ {
int rayon = pt_piste->m_Width >> 1; int rayon = pt_piste->m_Width >> 1;
int color = g_DesignSettings.m_ViaColor[pt_piste->m_Shape]; int color = g_DesignSettings.m_ViaColor[pt_piste->m_Shape];
GRSetDrawMode( aDC, drawmode ); GRSetDrawMode( aDC, drawmode );
GRFilledCircle( &m_ClipBox, aDC, pt_piste->m_Start.x, pt_piste->m_Start.y, GRFilledCircle( &m_ClipBox,
rayon, 0, color, color ); aDC,
pt_piste->m_Start.x,
pt_piste->m_Start.y,
rayon,
0,
color,
color );
} }
else else
pt_piste->Draw( this, aDC, drawmode ); pt_piste->Draw( this, aDC, drawmode );
...@@ -121,38 +126,46 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa ...@@ -121,38 +126,46 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa
/* Draw filled areas (i.e. zones) */ /* Draw filled areas (i.e. zones) */
for( int ii = 0; ii < Pcb->GetAreaCount(); ii++ ) for( int ii = 0; ii < Pcb->GetAreaCount(); ii++ )
{ {
ZONE_CONTAINER* zone = Pcb->GetArea(ii); ZONE_CONTAINER* zone = Pcb->GetArea( ii );
if( ( aPrintMaskLayer & (1 << zone->GetLayer()) ) == 0 ) if( ( aPrintMaskLayer & ( 1 << zone->GetLayer() ) ) == 0 )
continue; continue;
zone->DrawFilledArea( this, aDC, drawmode ); zone->DrawFilledArea( this, aDC, drawmode );
} }
// Draw footprints, this is done at last in order to print the pad holes in white (or g_DrawBgColor) // Draw footprints, this is done at last in order to print the pad holes in
// after the tracks and zones // white (or g_DrawBgColor) after the tracks and zones
Module = (MODULE*) Pcb->m_Modules; Module = (MODULE*) Pcb->m_Modules;
for( ; Module != NULL; Module = Module->Next() ) for( ; Module != NULL; Module = Module->Next() )
{ {
Print_Module( this, aDC, Module, drawmode, aPrintMaskLayer ); Print_Module( this, aDC, Module, drawmode, aPrintMaskLayer );
} }
/* Print via holes in bg color: Not sure it is good for buried or blind vias */ /* Print via holes in bg color: Not sure it is good for buried or blind
* vias */
pt_piste = Pcb->m_Track; pt_piste = Pcb->m_Track;
int color = g_DrawBgColor; int color = g_DrawBgColor;
bool blackpenstate = GetGRForceBlackPenState( ); bool blackpenstate = GetGRForceBlackPenState();
GRForceBlackPen( false ); GRForceBlackPen( false );
GRSetDrawMode( aDC, GR_COPY ); GRSetDrawMode( aDC, GR_COPY );
for( ; pt_piste != NULL; pt_piste = pt_piste->Next() ) for( ; pt_piste != NULL; pt_piste = pt_piste->Next() )
{ {
if( ( aPrintMaskLayer & pt_piste->ReturnMaskLayer() ) == 0 ) if( ( aPrintMaskLayer & pt_piste->ReturnMaskLayer() ) == 0 )
continue; continue;
if( pt_piste->Type() == TYPE_VIA ) /* VIA rencontree */ if( pt_piste->Type() == TYPE_VIA ) /* VIA encountered. */
{ {
int rayon = pt_piste->GetDrillValue() / 2; int rayon = pt_piste->GetDrillValue() / 2;
GRFilledCircle( &m_ClipBox, aDC, pt_piste->m_Start.x, pt_piste->m_Start.y, GRFilledCircle( &m_ClipBox,
rayon, 0, color, color ); aDC,
pt_piste->m_Start.x,
pt_piste->m_Start.y,
rayon,
0,
color,
color );
} }
} }
GRForceBlackPen( blackpenstate ); GRForceBlackPen( blackpenstate );
if( aPrint_Sheet_Ref ) if( aPrint_Sheet_Ref )
...@@ -168,10 +181,8 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa ...@@ -168,10 +181,8 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa
} }
/***********************************************************/
static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC, static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC,
MODULE* Module, int draw_mode, int masklayer ) MODULE* Module, int draw_mode, int masklayer )
/***********************************************************/
{ {
D_PAD* pt_pad; D_PAD* pt_pad;
EDA_BaseStruct* PtStruct; EDA_BaseStruct* PtStruct;
...@@ -184,14 +195,18 @@ static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -184,14 +195,18 @@ static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
if( (pt_pad->m_Masque_Layer & masklayer ) == 0 ) if( (pt_pad->m_Masque_Layer & masklayer ) == 0 )
continue; continue;
// Usually we draw pads in sketch mode on non copper layers: // Usually we draw pads in sketch mode on non copper layers:
if ( (masklayer & ALL_CU_LAYERS) == 0 ) if( (masklayer & ALL_CU_LAYERS) == 0 )
{ {
int tmp_fill = ((WinEDA_BasePcbFrame*)panel->m_Parent)->m_DisplayPadFill; int tmp_fill =
( (WinEDA_BasePcbFrame*) panel->m_Parent )->m_DisplayPadFill;
// Switch in sketch mode // Switch in sketch mode
((WinEDA_BasePcbFrame*)panel->m_Parent)->m_DisplayPadFill = 0; ( (WinEDA_BasePcbFrame*) panel->m_Parent )->m_DisplayPadFill = 0;
pt_pad->Draw( panel, DC, draw_mode ); pt_pad->Draw( panel, DC, draw_mode );
((WinEDA_BasePcbFrame*)panel->m_Parent)->m_DisplayPadFill = tmp_fill; ( (WinEDA_BasePcbFrame*) panel->m_Parent )->m_DisplayPadFill =
tmp_fill;
} }
else // on copper layer, draw pads according to current options else // on copper layer, draw pads according to current options
pt_pad->Draw( panel, DC, draw_mode ); pt_pad->Draw( panel, DC, draw_mode );
...@@ -207,9 +222,9 @@ static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -207,9 +222,9 @@ static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC,
if( mlayer & masklayer ) if( mlayer & masklayer )
{ {
if( ! Module->m_Reference->m_NoShow ) if( !Module->m_Reference->m_NoShow )
Module->m_Reference->Draw( panel, DC, draw_mode ); Module->m_Reference->Draw( panel, DC, draw_mode );
if( ! Module->m_Value->m_NoShow ) if( !Module->m_Value->m_NoShow )
Module->m_Value->Draw( panel, DC, draw_mode ); Module->m_Value->Draw( panel, DC, draw_mode );
} }
...@@ -228,7 +243,7 @@ static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -228,7 +243,7 @@ static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC,
case TYPE_EDGE_MODULE: case TYPE_EDGE_MODULE:
{ {
EDGE_MODULE* edge = (EDGE_MODULE*) PtStruct; EDGE_MODULE* edge = (EDGE_MODULE*) PtStruct;
if( (g_TabOneLayerMask[edge->GetLayer()] & masklayer ) == 0 ) if( ( g_TabOneLayerMask[edge->GetLayer()] & masklayer ) == 0 )
break; break;
edge->Draw( panel, DC, draw_mode ); edge->Draw( panel, DC, draw_mode );
break; break;
......
This diff is collapsed.
/*******************************************/ /*************/
/* EDITEUR de PCB: routines d'AUTOROUTAGE: */ /* queue.cpp */
/*******************************************/ /*************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
struct PcbQueue /* search queue structure */ struct PcbQueue /* search queue structure */
{ {
struct PcbQueue *Next; struct PcbQueue* Next;
int Row; /* current row */ int Row; /* current row */
int Col; /* current column */ int Col; /* current column */
int Side; /* 0=top, 1=bottom */ int Side; /* 0=top, 1=bottom */
...@@ -24,70 +24,63 @@ struct PcbQueue /* search queue structure */ ...@@ -24,70 +24,63 @@ struct PcbQueue /* search queue structure */
}; };
static long qlen = 0; /* current queue length */ static long qlen = 0; /* current queue length */
static struct PcbQueue *Head = NULL; static struct PcbQueue* Head = NULL;
static struct PcbQueue *Tail = NULL; static struct PcbQueue* Tail = NULL;
static struct PcbQueue *Save = NULL; /* hold empty queue structs */ static struct PcbQueue* Save = NULL; /* hold empty queue structs */
/* Routines definies ici : */
void InitQueue(); void InitQueue();
void GetQueue( int *, int *, int *, int *, int * ); void GetQueue( int*, int*, int*, int*, int* );
int SetQueue( int, int, int, int, int, int, int ); int SetQueue( int, int, int, int, int, int, int );
void ReSetQueue( int, int, int, int, int, int, int ); void ReSetQueue( int, int, int, int, int, int, int );
/************************/
void FreeQueue()
/************************/
/* Free the memory used for storing all the queue */ /* Free the memory used for storing all the queue */
void FreeQueue()
{ {
struct PcbQueue *p; struct PcbQueue* p;
InitQueue(); InitQueue();
while( (p = Save) != NULL ) while( (p = Save) != NULL )
{ {
Save = p->Next; MyFree(p); Save = p->Next; MyFree( p );
} }
} }
/************************/
/* void InitQueue() */
/************************/
/* initialize the search queue */ /* initialize the search queue */
void InitQueue() void InitQueue()
{ {
struct PcbQueue *p; struct PcbQueue* p;
while( (p = Head) != NULL ) while( (p = Head) != NULL )
{ {
Head = p->Next; Head = p->Next;
p->Next = Save; Save = p; p->Next = Save; Save = p;
} }
Tail = NULL; Tail = NULL;
OpenNodes = ClosNodes = MoveNodes = MaxNodes = qlen = 0; OpenNodes = ClosNodes = MoveNodes = MaxNodes = qlen = 0;
} }
/*********************************************************/
/* void GetQueue(int *r, int *c, int *s, int *d, int *a) */
/*********************************************************/
/* get search queue item from list */ /* get search queue item from list */
void GetQueue(int *r, int *c, int *s, int *d, int *a) void GetQueue( int* r, int* c, int* s, int* d, int* a )
{ {
struct PcbQueue *p; struct PcbQueue* p;
if( (p = Head) != NULL ) /* return first item in list */ if( (p = Head) != NULL ) /* return first item in list */
{ {
*r = p->Row; *c = p->Col; *r = p->Row; *c = p->Col;
*s = p->Side; *s = p->Side;
*d = p->Dist; *a = p->ApxDist; *d = p->Dist; *a = p->ApxDist;
if ((Head = p->Next) == NULL) Tail = NULL; if( (Head = p->Next) == NULL )
Tail = NULL;
/* put node on free list */ /* put node on free list */
p->Next = Save; Save = p; p->Next = Save; Save = p;
ClosNodes++; qlen--; ClosNodes++; qlen--;
} }
else /* empty list */ else /* empty list */
{ {
*r = *c = *s = *d = *a = ILLEGAL; *r = *c = *s = *d = *a = ILLEGAL;
...@@ -95,51 +88,53 @@ struct PcbQueue *p; ...@@ -95,51 +88,53 @@ struct PcbQueue *p;
} }
/****************************************************************/
int SetQueue (int r,int c,int side,int d,int a,int r2,int c2 )
/****************************************************************/
/* add a search node to the list /* add a search node to the list
Return: * Return:
1 si OK * 1 - OK
0 si defaut allocation Memoire * 0 - Failed to allocate memory.
*/ */
int SetQueue( int r, int c, int side, int d, int a, int r2, int c2 )
{ {
struct PcbQueue *p, *q, *t; struct PcbQueue* p, * q, * t;
int i, j; int i, j;
j = 0; // gcc warning fix j = 0; // gcc warning fix
if( (p = Save) != NULL ) /* try free list first */ if( (p = Save) != NULL ) /* try free list first */
{ {
Save = p->Next; Save = p->Next;
} }
else if ((p = (struct PcbQueue *) MyMalloc(sizeof(PcbQueue))) == NULL) else if( ( p = (struct PcbQueue*) MyMalloc( sizeof(PcbQueue) ) ) == NULL )
return(0); return 0;
p->Row = r; p->Row = r;
p->Col = c; p->Col = c;
p->Side = side; p->Side = side;
i = (p->Dist = d) + (p->ApxDist = a); i = (p->Dist = d) + (p->ApxDist = a);
p->Next = NULL; p->Next = NULL;
if( (q = Head) != NULL) if( (q = Head) != NULL ) /* insert in proper position in list */
{ /* insert in proper position in list */ {
if (q->Dist + q->ApxDist > i) if( q->Dist + q->ApxDist > i ) /* insert at head */
{ /* insert at head */ {
p->Next = q; Head = p; p->Next = q; Head = p;
} }
else { /* search for proper position */ else /* search for proper position */
for (t = q, q = q->Next; q && i > (j = q->Dist + q->ApxDist); {
t = q, q = q->Next) for( t = q, q = q->Next; q && i > ( j = q->Dist + q->ApxDist );
t = q, q = q->Next )
; ;
if (q && i == j && q->Row == r2 && q->Col == c2)
if( q && i == j && q->Row == r2 && q->Col == c2 )
{ {
/* insert after q, which is a goal node */ /* insert after q, which is a goal node */
if ( (p->Next = q->Next) == NULL) Tail = p; if( ( p->Next = q->Next ) == NULL )
Tail = p;
q->Next = p; q->Next = p;
} }
else else /* insert in front of q */
{ /* insert in front of q */ {
if ((p->Next = q) == NULL) Tail = p; if( ( p->Next = q ) == NULL )
Tail = p;
t->Next = p; t->Next = p;
} }
} }
...@@ -147,34 +142,40 @@ int SetQueue (int r,int c,int side,int d,int a,int r2,int c2 ) ...@@ -147,34 +142,40 @@ int SetQueue (int r,int c,int side,int d,int a,int r2,int c2 )
else /* empty search list */ else /* empty search list */
Head = Tail = p; Head = Tail = p;
OpenNodes++; OpenNodes++;
if (++qlen > MaxNodes) MaxNodes = qlen; if( ++qlen > MaxNodes )
return(1); MaxNodes = qlen;
return 1;
} }
/******************************************************************/
void ReSetQueue (int r,int c,int s,int d,int a,int r2,int c2 )
/******************************************************************/
/* reposition node in list */ /* reposition node in list */
void ReSetQueue( int r, int c, int s, int d, int a, int r2, int c2 )
{ {
struct PcbQueue *p, *q; struct PcbQueue* p, * q;
/* first, see if it is already in the list */ /* first, see if it is already in the list */
for (q = NULL, p = Head; p; q = p, p = p->Next) { for( q = NULL, p = Head; p; q = p, p = p->Next )
if (p->Row == r && p->Col == c && p->Side == s) { {
if( p->Row == r && p->Col == c && p->Side == s )
{
/* old one to remove */ /* old one to remove */
if (q) if( q )
{ {
if ( (q->Next = p->Next) == NULL) Tail = q; if( ( q->Next = p->Next ) == NULL )
Tail = q;
} }
else if ((Head = p->Next) == NULL) Tail = NULL; else if( ( Head = p->Next ) == NULL )
p->Next = Save; Save = p; Tail = NULL;
OpenNodes--; MoveNodes++; p->Next = Save;
Save = p;
OpenNodes--;
MoveNodes++;
qlen--; qlen--;
break; break;
} }
} }
if (!p) /* not found, it has already been closed once */
if( !p ) /* not found, it has already been closed once */
ClosNodes--; /* we will close it again, but just count once */ ClosNodes--; /* we will close it again, but just count once */
/* if it was there, it's gone now; insert it at the proper position */ /* if it was there, it's gone now; insert it at the proper position */
SetQueue( r, c, s, d, a, r2, c2 ); SetQueue( r, c, s, d, a, r2, c2 );
......
This diff is collapsed.
This diff is collapsed.
/***************************************************/ /************************************/
/* set_grid.cpp - Gestion de la grille utilisateur */ /* set_grid.cpp - manage user grid. */
/***************************************************/ /************************************/
/*
Affichage et modifications des parametres de travail de PcbNew
Parametres = dimensions de la grille utilisateur
*/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -20,8 +16,7 @@ ...@@ -20,8 +16,7 @@
#include "set_grid.h" #include "set_grid.h"
/************************************************************/ void WinEDA_BasePcbFrame::InstallGridFrame( const wxPoint& pos )
void WinEDA_BasePcbFrame::InstallGridFrame(const wxPoint & pos)
{ {
WinEDA_PcbGridFrame dlg( this, pos ); WinEDA_PcbGridFrame dlg( this, pos );
...@@ -55,49 +50,58 @@ BEGIN_EVENT_TABLE( WinEDA_PcbGridFrame, wxDialog ) ...@@ -55,49 +50,58 @@ BEGIN_EVENT_TABLE( WinEDA_PcbGridFrame, wxDialog )
////@end WinEDA_PcbGridFrame event table entries ////@end WinEDA_PcbGridFrame event table entries
END_EVENT_TABLE() END_EVENT_TABLE()
/*! /*!
* WinEDA_PcbGridFrame constructors * WinEDA_PcbGridFrame constructors
*/ */
WinEDA_PcbGridFrame::WinEDA_PcbGridFrame( ) WinEDA_PcbGridFrame::WinEDA_PcbGridFrame()
{ {
} }
WinEDA_PcbGridFrame::WinEDA_PcbGridFrame( WinEDA_BasePcbFrame* parent, WinEDA_PcbGridFrame::WinEDA_PcbGridFrame( WinEDA_BasePcbFrame* parent,
const wxPoint& pos, const wxPoint& pos,
wxWindowID id, wxWindowID id,
const wxString& caption, const wxString& caption,
const wxSize& size, long style ) const wxSize& size, long style )
{ {
Create(parent, id, caption, pos, size, style); Create( parent, id, caption, pos, size, style );
} }
/*! /*!
* WinEDA_PcbGridFrame creator * WinEDA_PcbGridFrame creator
*/ */
bool WinEDA_PcbGridFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) bool WinEDA_PcbGridFrame::Create( wxWindow* parent,
wxWindowID id,
const wxString& caption,
const wxPoint& pos,
const wxSize& size,
long style )
{ {
////@begin WinEDA_PcbGridFrame member initialisation ////@begin WinEDA_PcbGridFrame member initialisation
m_UnitGrid = NULL; m_UnitGrid = NULL;
m_OptGridSizeX = NULL; m_OptGridSizeX = NULL;
m_OptGridSizeY = NULL; m_OptGridSizeY = NULL;
////@end WinEDA_PcbGridFrame member initialisation ////@end WinEDA_PcbGridFrame member initialisation
////@begin WinEDA_PcbGridFrame creation ////@begin WinEDA_PcbGridFrame 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 );
} }
////@end WinEDA_PcbGridFrame creation ////@end WinEDA_PcbGridFrame creation
return true; return true;
} }
/*! /*!
* Control creation for WinEDA_PcbGridFrame * Control creation for WinEDA_PcbGridFrame
*/ */
...@@ -109,46 +113,79 @@ void WinEDA_PcbGridFrame::CreateControls() ...@@ -109,46 +113,79 @@ void WinEDA_PcbGridFrame::CreateControls()
WinEDA_PcbGridFrame* itemDialog1 = this; WinEDA_PcbGridFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxHORIZONTAL );
itemDialog1->SetSizer(itemBoxSizer2);
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5);
wxArrayString m_UnitGridStrings;
m_UnitGridStrings.Add(_("Inches"));
m_UnitGridStrings.Add(_("mm"));
m_UnitGrid = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Grid Size Units"), wxDefaultPosition, wxDefaultSize, m_UnitGridStrings, 1, wxRA_SPECIFY_COLS );
m_UnitGrid->SetSelection(0);
itemBoxSizer3->Add(m_UnitGrid, 0, wxGROW|wxALL, 5);
itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxStaticText* itemStaticText6 = new wxStaticText( itemDialog1, wxID_STATIC, _("User Grid Size X"), wxDefaultPosition, wxDefaultSize, 0 ); itemDialog1->SetSizer( itemBoxSizer2 );
itemBoxSizer3->Add(itemStaticText6, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
m_OptGridSizeX = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* itemBoxSizer3 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer3->Add(m_OptGridSizeX, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); itemBoxSizer2->Add( itemBoxSizer3, 0, wxGROW | wxALL, 5 );
wxStaticText* itemStaticText8 = new wxStaticText( itemDialog1, wxID_STATIC, _("User Grid Size Y"), wxDefaultPosition, wxDefaultSize, 0 ); wxArrayString m_UnitGridStrings;
itemBoxSizer3->Add(itemStaticText8, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); m_UnitGridStrings.Add( _( "Inches" ) );
m_UnitGridStrings.Add( _( "mm" ) );
m_OptGridSizeY = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); m_UnitGrid = new wxRadioBox( itemDialog1, ID_RADIOBOX,
itemBoxSizer3->Add(m_OptGridSizeY, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); _( "Grid Size Units" ), wxDefaultPosition,
wxDefaultSize, m_UnitGridStrings, 1,
wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL); wxRA_SPECIFY_COLS );
itemBoxSizer2->Add(itemBoxSizer10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_UnitGrid->SetSelection( 0 );
itemBoxSizer3->Add( m_UnitGrid, 0, wxGROW | wxALL, 5 );
wxButton* itemButton11 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer3->Add( 5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
wxStaticText* itemStaticText6 = new wxStaticText( itemDialog1,
wxID_STATIC,
_( "User Grid Size X" ),
wxDefaultPosition,
wxDefaultSize,
0 );
itemBoxSizer3->Add( itemStaticText6,
0,
wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_OptGridSizeX = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T( "" ),
wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer3->Add( m_OptGridSizeX,
0,
wxGROW | wxLEFT | wxRIGHT | wxBOTTOM,
5 );
wxStaticText* itemStaticText8 = new wxStaticText( itemDialog1,
wxID_STATIC,
_( "User Grid Size Y" ),
wxDefaultPosition,
wxDefaultSize,
0 );
itemBoxSizer3->Add( itemStaticText8,
0,
wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_OptGridSizeY = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T( "" ),
wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer3->Add( m_OptGridSizeY,
0,
wxGROW | wxLEFT | wxRIGHT | wxBOTTOM,
5 );
wxBoxSizer* itemBoxSizer10 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer2->Add( itemBoxSizer10, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
wxButton* itemButton11 = new wxButton( itemDialog1, wxID_OK, _( "&OK" ),
wxDefaultPosition,
wxDefaultSize, 0 );
itemButton11->SetDefault(); itemButton11->SetDefault();
itemBoxSizer10->Add(itemButton11, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); itemBoxSizer10->Add( itemButton11, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
wxButton* itemButton12 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); wxButton* itemButton12 = new wxButton( itemDialog1, wxID_CANCEL,
itemBoxSizer10->Add(itemButton12, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); _( "&Cancel" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemBoxSizer10->Add( itemButton12, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
////@end WinEDA_PcbGridFrame content construction ////@end WinEDA_PcbGridFrame content construction
} }
/*! /*!
* Should we show tooltips? * Should we show tooltips?
*/ */
...@@ -158,6 +195,7 @@ bool WinEDA_PcbGridFrame::ShowToolTips() ...@@ -158,6 +195,7 @@ bool WinEDA_PcbGridFrame::ShowToolTips()
return true; return true;
} }
/*! /*!
* Get bitmap resources * Get bitmap resources
*/ */
...@@ -166,11 +204,13 @@ wxBitmap WinEDA_PcbGridFrame::GetBitmapResource( const wxString& name ) ...@@ -166,11 +204,13 @@ wxBitmap WinEDA_PcbGridFrame::GetBitmapResource( const wxString& name )
{ {
// Bitmap retrieval // Bitmap retrieval
////@begin WinEDA_PcbGridFrame bitmap retrieval ////@begin WinEDA_PcbGridFrame bitmap retrieval
wxUnusedVar(name); wxUnusedVar( name );
return wxNullBitmap; return wxNullBitmap;
////@end WinEDA_PcbGridFrame bitmap retrieval ////@end WinEDA_PcbGridFrame bitmap retrieval
} }
/*! /*!
* Get icon resources * Get icon resources
*/ */
...@@ -179,8 +219,9 @@ wxIcon WinEDA_PcbGridFrame::GetIconResource( const wxString& name ) ...@@ -179,8 +219,9 @@ wxIcon WinEDA_PcbGridFrame::GetIconResource( const wxString& name )
{ {
// Icon retrieval // Icon retrieval
////@begin WinEDA_PcbGridFrame icon retrieval ////@begin WinEDA_PcbGridFrame icon retrieval
wxUnusedVar(name); wxUnusedVar( name );
return wxNullIcon; return wxNullIcon;
////@end WinEDA_PcbGridFrame icon retrieval ////@end WinEDA_PcbGridFrame icon retrieval
} }
...@@ -195,6 +236,7 @@ void WinEDA_PcbGridFrame::SetGridSize( const wxRealPoint& grid ) ...@@ -195,6 +236,7 @@ void WinEDA_PcbGridFrame::SetGridSize( const wxRealPoint& grid )
m_OptGridSizeY->SetValue( msg ); m_OptGridSizeY->SetValue( msg );
} }
wxRealPoint WinEDA_PcbGridFrame::GetGridSize() wxRealPoint WinEDA_PcbGridFrame::GetGridSize()
{ {
wxRealPoint grid; wxRealPoint grid;
...@@ -207,12 +249,14 @@ wxRealPoint WinEDA_PcbGridFrame::GetGridSize() ...@@ -207,12 +249,14 @@ wxRealPoint WinEDA_PcbGridFrame::GetGridSize()
return grid; return grid;
} }
void WinEDA_PcbGridFrame::SetGridUnits( int units ) void WinEDA_PcbGridFrame::SetGridUnits( int units )
{ {
if ( units != INCHES ) if( units != INCHES )
m_UnitGrid->SetSelection( 1 ); m_UnitGrid->SetSelection( 1 );
} }
int WinEDA_PcbGridFrame::GetGridUnits() int WinEDA_PcbGridFrame::GetGridUnits()
{ {
return m_UnitGrid->GetSelection(); return m_UnitGrid->GetSelection();
......
This diff is collapsed.
/****************************/ /*******************/
/* affichage des empreintes */ /* Highlight nets. */
/****************************/ /*******************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -16,22 +16,20 @@ ...@@ -16,22 +16,20 @@
#define Pad_fill (Pad_Fill_Item.State == RUN) #define Pad_fill (Pad_Fill_Item.State == RUN)
/*********************************************************/
void WinEDA_PcbFrame::ListNetsAndSelect( wxCommandEvent& event )
/*********************************************************/
/** Function ListNetsAndSelect /** Function ListNetsAndSelect
* called by a command event * called by a command event
* displays the sorted list of nets in a dialog frame * displays the sorted list of nets in a dialog frame
* If a net is selected, it is hightlighted * If a net is selected, it is highlighted
*/ */
void WinEDA_PcbFrame::ListNetsAndSelect( wxCommandEvent& event )
{ {
NETINFO_ITEM* net; NETINFO_ITEM* net;
wxString netFilter; wxString netFilter;
int selection; int selection;
netFilter = wxT( "*" ); netFilter = wxT( "*" );
Get_Message( _( "Filter for net names:" ), _( "Net Filter" ), netFilter, this ); Get_Message( _( "Filter for net names:" ), _( "Net Filter" ),
netFilter, this );
if( netFilter.IsEmpty() ) if( netFilter.IsEmpty() )
return; return;
...@@ -87,12 +85,10 @@ void WinEDA_PcbFrame::ListNetsAndSelect( wxCommandEvent& event ) ...@@ -87,12 +85,10 @@ void WinEDA_PcbFrame::ListNetsAndSelect( wxCommandEvent& event )
} }
/**************************************************/ /* Locate track or pad and highlight the corresponding net
* Returns the Netcode, or -1 if no net located.
*/
int WinEDA_PcbFrame::Select_High_Light( wxDC* DC ) int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
/**************************************************/
/* Localise track ou pad et met en surbrillance le net correspondant
* Retourne le netcode, ou -1 si pas de net localis�*/
{ {
if( g_HightLigt_Status ) if( g_HightLigt_Status )
Hight_Light( DC ); Hight_Light( DC );
...@@ -145,14 +141,12 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC ) ...@@ -145,14 +141,12 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
} }
/*******************************************/
void WinEDA_PcbFrame::Hight_Light( wxDC* DC )
/*******************************************/
/* /*
* fonction d'appel de Surbrillance a partir du menu * Highlight command.
* Met ou supprime la surbrillance d'un net pointe par la souris *
* Show or removes the net at the current cursor position.
*/ */
void WinEDA_PcbFrame::Hight_Light( wxDC* DC )
{ {
g_HightLigt_Status = !g_HightLigt_Status; g_HightLigt_Status = !g_HightLigt_Status;
......
...@@ -15,11 +15,12 @@ ...@@ -15,11 +15,12 @@
#include "wx/statline.h" #include "wx/statline.h"
/* Variables locales */
#define LAYER_NO_CHANGE NB_LAYERS #define LAYER_NO_CHANGE NB_LAYERS
static int New_Layer[NB_LAYERS]; static int New_Layer[NB_LAYERS];
wxStaticText* layer_list[NB_LAYERS]; wxStaticText* layer_list[NB_LAYERS];
enum swap_layer_id { enum swap_layer_id {
ID_WINEDA_SWAPLAYERFRAME = 1800, ID_WINEDA_SWAPLAYERFRAME = 1800,
ID_BUTTON_0, ID_BUTTON_0,
...@@ -27,10 +28,6 @@ enum swap_layer_id { ...@@ -27,10 +28,6 @@ enum swap_layer_id {
}; };
/***********************************************/
/* classe pour la frame de selection de layers */
/***********************************************/
class WinEDA_SwapLayerFrame : public wxDialog class WinEDA_SwapLayerFrame : public wxDialog
{ {
private: private:
...@@ -46,7 +43,6 @@ private: ...@@ -46,7 +43,6 @@ private:
public: public:
// Constructor and destructor
WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ); WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent );
~WinEDA_SwapLayerFrame() { }; ~WinEDA_SwapLayerFrame() { };
...@@ -58,7 +54,7 @@ private: ...@@ -58,7 +54,7 @@ private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
/* Table des evenements pour WinEDA_SwapLayerFrame */
BEGIN_EVENT_TABLE( WinEDA_SwapLayerFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_SwapLayerFrame, wxDialog )
EVT_COMMAND_RANGE( ID_BUTTON_0, ID_BUTTON_0 + NB_LAYERS - 1, EVT_COMMAND_RANGE( ID_BUTTON_0, ID_BUTTON_0 + NB_LAYERS - 1,
wxEVT_COMMAND_BUTTON_CLICKED, wxEVT_COMMAND_BUTTON_CLICKED,
...@@ -72,7 +68,6 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) : ...@@ -72,7 +68,6 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
wxDialog( parent, -1, _( "Swap Layers:" ), wxPoint( -1, -1 ), wxDialog( parent, -1, _( "Swap Layers:" ), wxPoint( -1, -1 ),
wxDefaultSize, wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER ) wxDefaultSize, wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER )
{ {
/*************************************************************************/
BOARD* board = parent->GetBoard(); BOARD* board = parent->GetBoard();
OuterBoxSizer = NULL; OuterBoxSizer = NULL;
...@@ -357,7 +352,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event ) ...@@ -357,7 +352,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event )
if( ii != 1 ) if( ii != 1 )
return; // (Canceled dialog box returns -1 instead) return; // (Canceled dialog box returns -1 instead)
/* Modifications des pistes */ /* Change traces. */
pt_segm = GetBoard()->m_Track; pt_segm = GetBoard()->m_Track;
for( ; pt_segm != NULL; pt_segm = pt_segm->Next() ) for( ; pt_segm != NULL; pt_segm = pt_segm->Next() )
{ {
...@@ -385,7 +380,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event ) ...@@ -385,7 +380,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event )
} }
} }
/* Modifications des zones */ /* Change zones. */
for( pt_segm = GetBoard()->m_Zone; pt_segm; pt_segm = pt_segm->Next() ) for( pt_segm = GetBoard()->m_Zone; pt_segm; pt_segm = pt_segm->Next() )
{ {
GetScreen()->SetModify(); GetScreen()->SetModify();
...@@ -394,7 +389,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event ) ...@@ -394,7 +389,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event )
pt_segm->SetLayer( New_Layer[jj] ); pt_segm->SetLayer( New_Layer[jj] );
} }
/* Modifications des autres segments */ /* Change other segments. */
PtStruct = GetBoard()->m_Drawings; PtStruct = GetBoard()->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() ) for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{ {
......
/*****************************************************************/ /***********************************************/
/* tool_modeit.cpp: construction du menu de l'editeur de modules */ /* tool_modeit.cpp: footprint editor toolbars. */
/*****************************************************************/ /***********************************************/
#include "fctsys.h" #include "fctsys.h"
...@@ -22,10 +22,9 @@ ...@@ -22,10 +22,9 @@
#define LISTBOX_WIDTH 120 #define LISTBOX_WIDTH 120
#endif #endif
/***************************************************/
void WinEDA_ModuleEditFrame::ReCreateHToolbar()
/***************************************************/
/* Create the main horizontal toolbar for the footprint editor */ /* Create the main horizontal toolbar for the footprint editor */
void WinEDA_ModuleEditFrame::ReCreateHToolbar()
{ {
if( m_HToolBar != NULL ) if( m_HToolBar != NULL )
return; return;
...@@ -140,9 +139,7 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar() ...@@ -140,9 +139,7 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar()
} }
/********************************************************/
void WinEDA_ModuleEditFrame::ReCreateVToolbar() void WinEDA_ModuleEditFrame::ReCreateVToolbar()
/********************************************************/
{ {
if( m_VToolBar ) if( m_VToolBar )
return; return;
...@@ -192,14 +189,12 @@ void WinEDA_ModuleEditFrame::ReCreateVToolbar() ...@@ -192,14 +189,12 @@ void WinEDA_ModuleEditFrame::ReCreateVToolbar()
} }
/*********************************************************/
void WinEDA_ModuleEditFrame::ReCreateOptToolbar() void WinEDA_ModuleEditFrame::ReCreateOptToolbar()
/*********************************************************/
{ {
if( m_OptionsToolBar ) if( m_OptionsToolBar )
return; return;
// creation du tool bar options // Create options tool bar.
m_OptionsToolBar = new WinEDA_Toolbar( TOOLBAR_OPTION, this, m_OptionsToolBar = new WinEDA_Toolbar( TOOLBAR_OPTION, this,
ID_OPT_TOOLBAR, FALSE ); ID_OPT_TOOLBAR, FALSE );
...@@ -245,9 +240,7 @@ void WinEDA_ModuleEditFrame::ReCreateOptToolbar() ...@@ -245,9 +240,7 @@ void WinEDA_ModuleEditFrame::ReCreateOptToolbar()
} }
/*********************************************************/
void WinEDA_ModuleEditFrame::ReCreateAuxiliaryToolbar() void WinEDA_ModuleEditFrame::ReCreateAuxiliaryToolbar()
/*********************************************************/
{ {
size_t i; size_t i;
wxString msg; wxString msg;
...@@ -260,14 +253,14 @@ void WinEDA_ModuleEditFrame::ReCreateAuxiliaryToolbar() ...@@ -260,14 +253,14 @@ void WinEDA_ModuleEditFrame::ReCreateAuxiliaryToolbar()
// Set up toolbar // Set up toolbar
m_AuxiliaryToolBar->AddSeparator(); m_AuxiliaryToolBar->AddSeparator();
// Boite de selection du pas de grille // Grid selection choice box.
m_SelGridBox = new WinEDAChoiceBox( m_AuxiliaryToolBar, m_SelGridBox = new WinEDAChoiceBox( m_AuxiliaryToolBar,
ID_ON_GRID_SELECT, ID_ON_GRID_SELECT,
wxPoint( -1, -1 ), wxPoint( -1, -1 ),
wxSize( LISTBOX_WIDTH, -1 ) ); wxSize( LISTBOX_WIDTH, -1 ) );
m_AuxiliaryToolBar->AddControl( m_SelGridBox ); m_AuxiliaryToolBar->AddControl( m_SelGridBox );
// Boite de selection du Zoom // Zoom selection choice box.
m_AuxiliaryToolBar->AddSeparator(); m_AuxiliaryToolBar->AddSeparator();
m_SelZoomBox = new WinEDAChoiceBox( m_AuxiliaryToolBar, m_SelZoomBox = new WinEDAChoiceBox( m_AuxiliaryToolBar,
ID_ON_ZOOM_SELECT, ID_ON_ZOOM_SELECT,
...@@ -298,7 +291,7 @@ void WinEDA_ModuleEditFrame::ReCreateAuxiliaryToolbar() ...@@ -298,7 +291,7 @@ void WinEDA_ModuleEditFrame::ReCreateAuxiliaryToolbar()
m_AuxiliaryToolBar->Realize(); m_AuxiliaryToolBar->Realize();
} }
// mise a jour des affichages // Update tool bar to reflect setting.
m_SelGridBox->Clear(); m_SelGridBox->Clear();
for( i = 0; i < GetScreen()->m_GridList.GetCount(); i++ ) for( i = 0; i < GetScreen()->m_GridList.GetCount(); i++ )
{ {
......
/********************************************************************************/ /*************************/
/* tool_onrightclick.cpp: fonctions appel�s par le bouton droit sur un TOOL */ /* tool_onrightclick.cpp */
/********************************************************************************/ /*************************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
#include "pcbnew_id.h" #include "pcbnew_id.h"
/*****************************************************************/
void WinEDA_PcbFrame::ToolOnRightClick( wxCommandEvent& event ) void WinEDA_PcbFrame::ToolOnRightClick( wxCommandEvent& event )
/*****************************************************************/
{ {
wxPoint pos; wxPoint pos;
int id = event.GetSelection(); int id = event.GetSelection();
...@@ -49,9 +47,7 @@ void WinEDA_PcbFrame::ToolOnRightClick( wxCommandEvent& event ) ...@@ -49,9 +47,7 @@ void WinEDA_PcbFrame::ToolOnRightClick( wxCommandEvent& event )
} }
/************************************************************************/
void WinEDA_ModuleEditFrame::ToolOnRightClick( wxCommandEvent& event ) void WinEDA_ModuleEditFrame::ToolOnRightClick( wxCommandEvent& event )
/************************************************************************/
{ {
wxPoint pos; wxPoint pos;
int id = event.GetSelection(); int id = event.GetSelection();
......
This diff is collapsed.
/**************************************************************** /****************************************************************
* toolbars_update_user_interface.cpp * toolbars_update_user_interface.cpp
****************************************************************/ ****************************************************************/
/* /*
* function to update toolbars UI after changing parameters * function to update toolbars UI after changing parameters
...@@ -144,14 +144,15 @@ void WinEDA_PcbFrame::AuxiliaryToolBar_Update_UI() ...@@ -144,14 +144,15 @@ void WinEDA_PcbFrame::AuxiliaryToolBar_Update_UI()
} }
/***************************************/
void WinEDA_PcbFrame::SetToolbars()
/***************************************/
/* /*
* Active ou desactive les tools des toolbars, en fonction des commandes * Enable or disable the toolbar's controls, depending on the current
* en cours * state.
*
* @todo: All of this should be perform in appropriate wxUpdateUIEvent
* handles. This is not how it how updating user interface controls
* is handle in wxWidgets.
*/ */
void WinEDA_PcbFrame::SetToolbars()
{ {
bool state; bool state;
...@@ -187,10 +188,8 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -187,10 +188,8 @@ void WinEDA_PcbFrame::SetToolbars()
!Drc_On ); !Drc_On );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_DRC_OFF, m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_DRC_OFF,
Drc_On ? Drc_On ?
_( _( "Disable design rule checking" ) :
"DRC Off (Disable !!!), Currently: DRC is active" ) _( "Enable design rule checking" ) );
:
_( "DRC On (Currently: DRC is inactive !!!)" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_MM, m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_MM,
g_UnitMetric == MILLIMETRE ? TRUE : false ); g_UnitMetric == MILLIMETRE ? TRUE : false );
...@@ -201,13 +200,15 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -201,13 +200,15 @@ void WinEDA_PcbFrame::SetToolbars()
DisplayOpt.DisplayPolarCood ); DisplayOpt.DisplayPolarCood );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_POLAR_COORD, m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_POLAR_COORD,
DisplayOpt.DisplayPolarCood ? DisplayOpt.DisplayPolarCood ?
_( "Polar coords not show" ) : _( "Display rectangular coordinates" ) :
_( "Display polar coords" ) ); _( "Display polar coordinates" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GRID, m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GRID,
m_Draw_Grid ); m_Draw_Grid );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_GRID, m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_GRID,
m_Draw_Grid ? _( "Grid not show" ) : _( "Show grid" ) ); m_Draw_Grid ?
_( "Hide grid" ) :
_( "Show grid" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_CURSOR, m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_CURSOR,
m_CursorShape ); m_CursorShape );
...@@ -216,8 +217,8 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -216,8 +217,8 @@ void WinEDA_PcbFrame::SetToolbars()
g_Show_Ratsnest ); g_Show_Ratsnest );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_RATSNEST, m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_RATSNEST,
g_Show_Ratsnest ? g_Show_Ratsnest ?
_( "Hide general ratsnest" ) : _( "Hide board ratsnest" ) :
_( "Show general ratsnest" ) ); _( "Show board ratsnest" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST,
g_Show_Module_Ratsnest ); g_Show_Module_Ratsnest );
...@@ -239,31 +240,31 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -239,31 +240,31 @@ void WinEDA_PcbFrame::SetToolbars()
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_PADS_SKETCH, m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_PADS_SKETCH,
m_DisplayPadFill ? m_DisplayPadFill ?
_( "Show pads sketch mode" ) : _( "Show pads in outline mode" ) :
_( "Show pads filled mode" ) ); _( "Show pads in fill mode" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_VIAS_SKETCH,
!m_DisplayViaFill ); !m_DisplayViaFill );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_VIAS_SKETCH,
m_DisplayViaFill ? m_DisplayViaFill ?
_( "Show vias sketch mode" ) : _( "Show vias in outline mode" ) :
_( "Show vias filled mode" ) ); _( "Show vias in fill mode" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH,
!m_DisplayPcbTrackFill ); !m_DisplayPcbTrackFill );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH,
m_DisplayPcbTrackFill ? m_DisplayPcbTrackFill ?
_( "Show tracks sketch mode" ) : _( "Show tracks in outline mode" ) :
_( "Show tracks filled mode" ) ); _( "Show tracks in fill mode" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE,
DisplayOpt.ContrastModeDisplay ); DisplayOpt.ContrastModeDisplay );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE,
DisplayOpt.ContrastModeDisplay ? DisplayOpt.ContrastModeDisplay ?
_( "Normal contrast mode display" ) : _( "Normal contrast display mode" ) :
_( "High contrast mode display" ) ); _( "High contrast display mode" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE, m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE,
g_DesignSettings.IsElementVisible( MODULE_TEXT_NOV_VISIBLE ) ); g_DesignSettings.IsElementVisible( MODULE_TEXT_NOV_VISIBLE ) );
......
This diff is collapsed.
This diff is collapsed.
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