Commit 3c7df7b7 authored by stambaughw's avatar stambaughw

Complete comment translation of gerbview source.

parent 8b3ffe74
This diff is collapsed.
/********************************************************/ /****************/
/* Routines generales de gestion des commandes usuelles */ /* controle.cpp */
/********************************************************/ /****************/
/* fichier controle.cpp */
/*
* Routines d'affichage grille, Boite de coordonnees, Curseurs, marqueurs ...
*/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -17,25 +11,13 @@ ...@@ -17,25 +11,13 @@
#include "protos.h" #include "protos.h"
/**********************************************************************/
BOARD_ITEM* WinEDA_GerberFrame::GerberGeneralLocateAndDisplay() BOARD_ITEM* WinEDA_GerberFrame::GerberGeneralLocateAndDisplay()
/**********************************************************************/
{ {
return Locate( CURSEUR_OFF_GRILLE ); return Locate( CURSEUR_OFF_GRILLE );
} }
/****************************************************************/
void WinEDA_GerberFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) void WinEDA_GerberFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
/****************************************************************/
/* traitement des touches de fonctions utilisees ds tous les menus
* Zoom
* Redessin d'ecran
* Cht Unites
* Cht couches
* Remise a 0 de l'origine des coordonnees relatives
*/
{ {
wxRealPoint delta; wxRealPoint delta;
wxPoint curpos, oldpos; wxPoint curpos, oldpos;
...@@ -68,25 +50,25 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -68,25 +50,25 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
switch( g_KeyPressed ) switch( g_KeyPressed )
{ {
case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_NUMPAD8:
case WXK_UP: case WXK_UP:
Mouse.y -= wxRound(delta.y); Mouse.y -= wxRound(delta.y);
DrawPanel->MouseTo( Mouse ); DrawPanel->MouseTo( Mouse );
break; break;
case WXK_NUMPAD2: /* Deplacement curseur vers le bas */ case WXK_NUMPAD2:
case WXK_DOWN: case WXK_DOWN:
Mouse.y += wxRound(delta.y); Mouse.y += wxRound(delta.y);
DrawPanel->MouseTo( Mouse ); DrawPanel->MouseTo( Mouse );
break; break;
case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */ case WXK_NUMPAD4:
case WXK_LEFT: case WXK_LEFT:
Mouse.x -= wxRound(delta.x); Mouse.x -= wxRound(delta.x);
DrawPanel->MouseTo( Mouse ); DrawPanel->MouseTo( Mouse );
break; break;
case WXK_NUMPAD6: /* Deplacement curseur vers la droite */ case WXK_NUMPAD6:
case WXK_RIGHT: case WXK_RIGHT:
Mouse.x += wxRound(delta.x); Mouse.x += wxRound(delta.x);
DrawPanel->MouseTo( Mouse ); DrawPanel->MouseTo( Mouse );
...@@ -97,10 +79,8 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -97,10 +79,8 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
break; break;
} }
/* Recalcul de la position du curseur schema */
GetScreen()->m_Curseur = curpos; GetScreen()->m_Curseur = curpos;
/* Placement sur la grille generale */
PutOnGrid( &GetScreen()->m_Curseur ); PutOnGrid( &GetScreen()->m_Curseur );
if( oldpos != GetScreen()->m_Curseur ) if( oldpos != GetScreen()->m_Curseur )
...@@ -129,5 +109,5 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -129,5 +109,5 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
} }
SetToolbars(); SetToolbars();
UpdateStatusBar(); /* Affichage des coord curseur */ UpdateStatusBar();
} }
This diff is collapsed.
/*********************************************/ /*********************************************/
/* Edition des pistes: Routines d'effacement */ /* Edit Track: Erase Routines */
/* Effacement de segment, piste, net et zone */ /* Drop the segment, track, and net area */
/*********************************************/ /*********************************************/
#include "fctsys.h" #include "fctsys.h"
...@@ -10,16 +10,10 @@ ...@@ -10,16 +10,10 @@
#include "gerbview.h" #include "gerbview.h"
#include "protos.h" #include "protos.h"
/* Routines externes : */
/* Routines Locales */ void WinEDA_GerberFrame::Delete_DCode_Items( wxDC* DC,
int dcode_value,
/* Variables locales */ int layer_number )
/****************************************************************************************/
void WinEDA_GerberFrame::Delete_DCode_Items( wxDC* DC, int dcode_value, int layer_number )
/****************************************************************************************/
{ {
if( dcode_value < FIRST_DCODE ) // No tool selected if( dcode_value < FIRST_DCODE ) // No tool selected
return; return;
...@@ -42,28 +36,26 @@ void WinEDA_GerberFrame::Delete_DCode_Items( wxDC* DC, int dcode_value, int laye ...@@ -42,28 +36,26 @@ void WinEDA_GerberFrame::Delete_DCode_Items( wxDC* DC, int dcode_value, int laye
} }
/*****************************************************************/ /* Removes 1 segment of track.
TRACK* WinEDA_GerberFrame::Delete_Segment( wxDC* DC, TRACK* Track ) *
/*****************************************************************/ * If There is evidence of new track: erase segment
* Otherwise: Delete segment under the cursor.
/* Supprime 1 segment de piste.
* 2 Cas possibles:
* Si On est en trace de nouvelle piste: Effacement du segment en
* cours de trace
* Sinon : Effacment du segment sous le curseur.
*/ */
TRACK* WinEDA_GerberFrame::Delete_Segment( wxDC* DC, TRACK* Track )
{ {
if( Track == NULL ) if( Track == NULL )
return NULL; return NULL;
if( Track->m_Flags & IS_NEW ) // Trace en cours, on peut effacer le dernier segment if( Track->m_Flags & IS_NEW ) // Trace in progress, delete the last
// segment
{ {
if( g_CurrentTrackList.GetCount() > 0 ) if( g_CurrentTrackList.GetCount() > 0 )
{ {
// modification du trace // Change track.
delete g_CurrentTrackList.PopBack(); delete g_CurrentTrackList.PopBack();
if( g_CurrentTrackList.GetCount() && g_CurrentTrackSegment->Type() == TYPE_VIA ) if( g_CurrentTrackList.GetCount()
&& g_CurrentTrackSegment->Type() == TYPE_VIA )
{ {
delete g_CurrentTrackList.PopBack(); delete g_CurrentTrackList.PopBack();
} }
...@@ -85,12 +77,11 @@ TRACK* WinEDA_GerberFrame::Delete_Segment( wxDC* DC, TRACK* Track ) ...@@ -85,12 +77,11 @@ TRACK* WinEDA_GerberFrame::Delete_Segment( wxDC* DC, TRACK* Track )
} }
return NULL; return NULL;
} // Fin traitement si trace en cours }
Trace_Segment( DrawPanel, DC, Track, GR_XOR ); Trace_Segment( DrawPanel, DC, Track, GR_XOR );
DLIST<TRACK>* container = (DLIST<TRACK>*) Track->GetList(); DLIST<TRACK>* container = (DLIST<TRACK>*)Track->GetList();
wxASSERT( container ); wxASSERT( container );
container->Remove( Track ); container->Remove( Track );
......
/******************************************************/ /***********************************/
/* edit.cpp: fonctions generales de l'edition du PCB */ /* edit.cpp: PCB editing functions */
/******************************************************/ /***********************************/
#include "fctsys.h" #include "fctsys.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
...@@ -13,21 +13,17 @@ ...@@ -13,21 +13,17 @@
#include "protos.h" #include "protos.h"
/* Process the command triggered by the left button of the mouse when a tool
/************************************************************************/ * is already selected.
void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
/************************************************************************/
/* Traite les commandes declench�e par le bouton gauche de la souris,
* quand un outil est deja selectionn�
*/ */
void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem(); BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem();
wxString msg; wxString msg;
if( m_ID_current_state == 0 ) if( m_ID_current_state == 0 )
{ {
if( DrawStruct && DrawStruct->m_Flags ) // Commande "POPUP" en cours if( DrawStruct && DrawStruct->m_Flags )
{ {
msg.Printf( wxT( "WinEDA_GerberFrame::ProcessCommand err: Struct %d, m_Flags = %X" ), msg.Printf( wxT( "WinEDA_GerberFrame::ProcessCommand err: Struct %d, m_Flags = %X" ),
(unsigned) DrawStruct->Type(), (unsigned) DrawStruct->Type(),
...@@ -70,12 +66,9 @@ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -70,12 +66,9 @@ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
} }
/********************************************************************************/ /* Handles the selection of tools, menu, and popup menu commands.
void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
/********************************************************************************/
/* Traite les selections d'outils et les commandes appelees du menu POPUP
*/ */
void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
int layer = GetScreen()->m_Active_Layer; int layer = GetScreen()->m_Active_Layer;
...@@ -89,7 +82,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -89,7 +82,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
pos.y += 20; pos.y += 20;
switch( id ) // Arret eventuel de la commande de d�placement en cours switch( id )
{ {
case wxID_CUT: case wxID_CUT:
case wxID_COPY: case wxID_COPY:
...@@ -108,7 +101,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -108,7 +101,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
{ {
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc ); DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
} }
/* ne devrait pas etre execute, sauf bug */ /* Should not be executed, except bug */
if( GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE ) if( GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE )
{ {
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
...@@ -121,7 +114,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -121,7 +114,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
SetCursor( DrawPanel->m_PanelCursor = DrawPanel->m_PanelDefaultCursor ); SetCursor( DrawPanel->m_PanelCursor = DrawPanel->m_PanelDefaultCursor );
break; break;
default: // Arret dea commande de d�placement en cours default:
if( DrawPanel->ManageCurseur if( DrawPanel->ManageCurseur
&& DrawPanel->ForceCloseManageCurseur ) && DrawPanel->ForceCloseManageCurseur )
{ {
...@@ -131,7 +124,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -131,7 +124,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
} }
switch( id ) // Traitement des commandes switch( id )
{ {
case ID_EXIT: case ID_EXIT:
Close( TRUE ); Close( TRUE );
...@@ -147,10 +140,12 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -147,10 +140,12 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_GET_TOOLS: case ID_GET_TOOLS:
// InstallToolsFrame(this, wxPoint(-1,-1) ); // InstallToolsFrame(this, wxPoint(-1,-1) );
break; break;
case ID_FIND_ITEMS: case ID_FIND_ITEMS:
// InstallFindFrame(this, pos); // InstallFindFrame(this, pos);
break; break;
...@@ -249,7 +244,8 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -249,7 +244,8 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS: case ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS:
if( gerber_layer ) if( gerber_layer )
Delete_DCode_Items( &dc, gerber_layer->m_Selected_Tool, ((PCB_SCREEN*)GetScreen())->m_Active_Layer ); Delete_DCode_Items( &dc, gerber_layer->m_Selected_Tool,
( (PCB_SCREEN*) GetScreen() )->m_Active_Layer );
break; break;
default: default:
...@@ -261,12 +257,9 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -261,12 +257,9 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
} }
/**************************************************************************/ /* Called on a double click of left mouse button.
void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
/**************************************************************************/
/* Called on a double click:
*/ */
void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
{ {
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem(); EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem();
wxClientDC dc( DrawPanel ); wxClientDC dc( DrawPanel );
...@@ -281,7 +274,7 @@ void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -281,7 +274,7 @@ void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
DrawStruct = GerberGeneralLocateAndDisplay(); DrawStruct = GerberGeneralLocateAndDisplay();
} }
break; // end case 0 break;
default: default:
break; break;
......
...@@ -15,19 +15,13 @@ ...@@ -15,19 +15,13 @@
#include "class_board_design_settings.h" #include "class_board_design_settings.h"
#include "protos.h" #include "protos.h"
/* Routines Locales : */
static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, static int SavePcbFormatAscii( WinEDA_GerberFrame* frame,
FILE* File, int* LayerLookUpTable ); FILE* File, int* LayerLookUpTable );
/* Variables Locales */
/************************************************************************/
void WinEDA_GerberFrame::ExportDataInPcbnewFormat( wxCommandEvent& event )
/************************************************************************/
/* Export data in pcbnew format /* Export data in pcbnew format
*/ */
void WinEDA_GerberFrame::ExportDataInPcbnewFormat( wxCommandEvent& event )
{ {
int ii = 0; int ii = 0;
bool no_used_layers = true; // Changed to false if any used layer found bool no_used_layers = true; // Changed to false if any used layer found
...@@ -42,7 +36,8 @@ void WinEDA_GerberFrame::ExportDataInPcbnewFormat( wxCommandEvent& event ) ...@@ -42,7 +36,8 @@ void WinEDA_GerberFrame::ExportDataInPcbnewFormat( wxCommandEvent& event )
if( no_used_layers ) if( no_used_layers )
{ {
DisplayInfoMessage( this, _( "None of the Gerber layers contain any data" ) ); DisplayInfoMessage( this,
_( "None of the Gerber layers contain any data" ) );
return; return;
} }
...@@ -54,10 +49,10 @@ void WinEDA_GerberFrame::ExportDataInPcbnewFormat( wxCommandEvent& event ) ...@@ -54,10 +49,10 @@ void WinEDA_GerberFrame::ExportDataInPcbnewFormat( wxCommandEvent& event )
msg = wxT( "*" ) + PcbExt; msg = wxT( "*" ) + PcbExt;
FullFileName = EDA_FileSelector( _( "Board file name:" ), FullFileName = EDA_FileSelector( _( "Board file name:" ),
wxEmptyString, /* Chemin par defaut */ wxEmptyString,
wxEmptyString, /* nom fichier par defaut */ wxEmptyString,
PcbExt, /* extension par defaut */ PcbExt,
msg, /* Masque d'affichage */ msg,
this, this,
wxFD_SAVE, wxFD_SAVE,
FALSE FALSE
...@@ -87,9 +82,7 @@ void WinEDA_GerberFrame::ExportDataInPcbnewFormat( wxCommandEvent& event ) ...@@ -87,9 +82,7 @@ void WinEDA_GerberFrame::ExportDataInPcbnewFormat( wxCommandEvent& event )
} }
/***************************************************************/
static int WriteSetup( FILE* File, BOARD* Pcb ) static int WriteSetup( FILE* File, BOARD* Pcb )
/***************************************************************/
{ {
char text[1024]; char text[1024];
...@@ -97,22 +90,21 @@ static int WriteSetup( FILE* File, BOARD* Pcb ) ...@@ -97,22 +90,21 @@ static int WriteSetup( FILE* File, BOARD* Pcb )
sprintf( text, "InternalUnit %f INCH\n", 1.0 / PCB_INTERNAL_UNIT ); sprintf( text, "InternalUnit %f INCH\n", 1.0 / PCB_INTERNAL_UNIT );
fprintf( File, "%s", text ); fprintf( File, "%s", text );
Pcb->m_BoardSettings->SetCopperLayerCount( g_DesignSettings.GetCopperLayerCount( ) ); Pcb->m_BoardSettings->SetCopperLayerCount(
fprintf( File, "Layers %d\n", g_DesignSettings.GetCopperLayerCount( ) ); g_DesignSettings.GetCopperLayerCount() );
fprintf( File, "Layers %d\n", g_DesignSettings.GetCopperLayerCount() );
fprintf( File, "$EndSETUP\n\n" ); fprintf( File, "$EndSETUP\n\n" );
return 1; return 1;
} }
/******************************************************/
static bool WriteGeneralDescrPcb( BOARD* Pcb, FILE* File ) static bool WriteGeneralDescrPcb( BOARD* Pcb, FILE* File )
/******************************************************/
{ {
int NbLayers; int NbLayers;
/* Print the copper layer count */ /* Print the copper layer count */
NbLayers = Pcb->m_BoardSettings->GetCopperLayerCount( ); NbLayers = Pcb->m_BoardSettings->GetCopperLayerCount();
fprintf( File, "$GENERAL\n" ); fprintf( File, "$GENERAL\n" );
fprintf( File, "LayerCount %d\n", NbLayers ); fprintf( File, "LayerCount %d\n", NbLayers );
...@@ -128,17 +120,14 @@ static bool WriteGeneralDescrPcb( BOARD* Pcb, FILE* File ) ...@@ -128,17 +120,14 @@ static bool WriteGeneralDescrPcb( BOARD* Pcb, FILE* File )
} }
/*******************************************************************/
static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile,
int* LayerLookUpTable )
/*******************************************************************/
/* Routine to save the board /* Routine to save the board
* @param frame = pointer to the main frame * @param frame = pointer to the main frame
* @param File = FILE * pointer to an already opened file * @param File = FILE * pointer to an already opened file
* @param LayerLookUpTable = look up table: pcbnew layer for each gerber layer * @param LayerLookUpTable = look up table: pcbnew layer for each gerber layer
* @return 1 if OK, 0 if fail * @return 1 if OK, 0 if fail
*/ */
static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile,
int* LayerLookUpTable )
{ {
char line[256]; char line[256];
TRACK* track; TRACK* track;
...@@ -170,13 +159,15 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile, ...@@ -170,13 +159,15 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile,
{ {
double cx = track->m_Param; double cx = track->m_Param;
double cy = track->GetSubNet(); double cy = track->GetSubNet();
double a = atan2( track->m_Start.y-cy, track->m_Start.x-cx ); double a = atan2( track->m_Start.y - cy,
double b = atan2( track->m_End.y-cy, track->m_End.x-cx ); track->m_Start.x - cx );
double b = atan2( track->m_End.y - cy, track->m_End.x - cx );
drawitem->m_Shape = S_ARC; drawitem->m_Shape = S_ARC;
drawitem->m_Angle = (int)fmod( (a-b)/M_PI*1800.0+3600.0, 3600.0 ); drawitem->m_Angle = (int) fmod(
drawitem->m_Start.x = (int)cx; (a - b) / M_PI * 1800.0 + 3600.0, 3600.0 );
drawitem->m_Start.y = (int)cy; drawitem->m_Start.x = (int) cx;
drawitem->m_Start.y = (int) cy;
} }
pcb->Add( drawitem ); pcb->Add( drawitem );
...@@ -190,9 +181,10 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile, ...@@ -190,9 +181,10 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile,
|| track->m_Shape == S_SPOT_RECT || track->m_Shape == S_SPOT_RECT
|| track->m_Shape == S_SPOT_OVALE ) || track->m_Shape == S_SPOT_OVALE )
{ {
newtrack = new SEGVIA( (const SEGVIA&) *track ); newtrack = new SEGVIA( (const SEGVIA &) * track );
// A spot is found, and can be a via: change it to via, and delete other // A spot is found, and can be a via: change it to via, and
// delete other
// spots at same location // spots at same location
newtrack->m_Shape = VIA_THROUGH; newtrack->m_Shape = VIA_THROUGH;
...@@ -200,10 +192,13 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile, ...@@ -200,10 +192,13 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile,
newtrack->SetDrillDefault(); newtrack->SetDrillDefault();
// Compute the via position from track position ( Via position is the // Compute the via position from track position ( Via position
// is the
// position of the middle of the track segment ) // position of the middle of the track segment )
newtrack->m_Start.x = (newtrack->m_Start.x + newtrack->m_End.x) / 2; newtrack->m_Start.x =
newtrack->m_Start.y = (newtrack->m_Start.y + newtrack->m_End.y) / 2; (newtrack->m_Start.x + newtrack->m_End.x) / 2;
newtrack->m_Start.y =
(newtrack->m_Start.y + newtrack->m_End.y) / 2;
newtrack->m_End = newtrack->m_Start; newtrack->m_End = newtrack->m_Start;
} }
else // a true TRACK else // a true TRACK
...@@ -240,8 +235,9 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile, ...@@ -240,8 +235,9 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile,
} }
} }
// Switch the locale to standard C (needed to print floating point numbers like 1.3) // Switch the locale to standard C (needed to print floating point numbers
SetLocaleTo_C_standard( ); // like 1.3)
SetLocaleTo_C_standard();
// write the PCB heading // write the PCB heading
fprintf( aFile, "PCBNEW-BOARD Version %d date %s\n\n", g_CurrentVersionPCB, fprintf( aFile, "PCBNEW-BOARD Version %d date %s\n\n", g_CurrentVersionPCB,
...@@ -255,7 +251,7 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile, ...@@ -255,7 +251,7 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile,
// the destructor should destroy all owned sub-objects // the destructor should destroy all owned sub-objects
delete pcb; delete pcb;
SetLocaleTo_Default( ); // revert to the current locale SetLocaleTo_Default(); // revert to the current locale
wxEndBusyCursor(); wxEndBusyCursor();
return 1; return 1;
} }
/******************************************************/ /*************/
/* Files.cp: Lecture / Sauvegarde des fichiers gerber */ /* files.cpp */
/******************************************************/ /*************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
#include "protos.h" #include "protos.h"
/* Routines locales */ static void LoadDCodeFile( WinEDA_GerberFrame* frame,
static void LoadDCodeFile( WinEDA_GerberFrame* frame, const wxString& FullFileName, wxDC* DC ); const wxString& FullFileName,
wxDC* DC );
void WinEDA_GerberFrame::OnFileHistory( wxCommandEvent& event ) void WinEDA_GerberFrame::OnFileHistory( wxCommandEvent& event )
...@@ -33,13 +34,9 @@ void WinEDA_GerberFrame::OnFileHistory( wxCommandEvent& event ) ...@@ -33,13 +34,9 @@ void WinEDA_GerberFrame::OnFileHistory( wxCommandEvent& event )
} }
} }
/***************
***************************************/
void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
/********************************************************/
/* Gestion generale des commandes de lecture de fichiers /* File commands. */
*/ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
...@@ -106,19 +103,16 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event ) ...@@ -106,19 +103,16 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
} }
/*******************************************************************************************/
bool
WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName,
wxDC* DC,
int mode )
/*******************************************************************************************/
/* /*
* Lecture d'un fichier PCB, le nom etant dans PcbNameBuffer.s * Load a PCB file.
* retourne: *
* 0 si fichier non lu ( annulation de commande ... ) * Returns:
* 1 si OK * 0 if file not read (cancellation of order ...)
* 1 if OK
*/ */
bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName,
wxDC* DC,
int mode )
{ {
wxString filetypes; wxString filetypes;
wxFileName filename = FullFileName; wxFileName filename = FullFileName;
...@@ -130,28 +124,28 @@ WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName, ...@@ -130,28 +124,28 @@ WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName,
wxString current_path = filename.GetPath(); wxString current_path = filename.GetPath();
/* Standard gerber filetypes */ /* Standard gerber filetypes */
filetypes += _("Gerber files (.gbr .gbx .lgr .ger .pho)| \ filetypes += _( "Gerber files (.gbr .gbx .lgr .ger .pho)| \
*.gbr;*.GBR;*.gbx;*.GBX;*.lgr;*.LGR;*.ger;*.GER;*.pho;*.PHO|"); .gbr;*.GBR;*.gbx;*.GBX;*.lgr;*.LGR;*.ger;*.GER;*.pho;*.PHO|" );
/* Special gerber filetypes */ /* Special gerber filetypes */
filetypes += _("Top layer (*.GTL)|*.GTL;*.gtl|"); filetypes += _( "Top layer (*.GTL)|*.GTL;*.gtl|" );
filetypes += _("Bottom layer (*.GBL)|*.GBL;*.gbl|"); filetypes += _( "Bottom layer (*.GBL)|*.GBL;*.gbl|" );
filetypes += _("Bottom solder resist (*.GBS)|*.GBS;*.gbs|"); filetypes += _( "Bottom solder resist (*.GBS)|*.GBS;*.gbs|" );
filetypes += _("Top solder resist (*.GTS)|*.GTS;*.gts|"); filetypes += _( "Top solder resist (*.GTS)|*.GTS;*.gts|" );
filetypes += _("Bottom overlay (*.GBO)|*.GBO;*.gbo|"); filetypes += _( "Bottom overlay (*.GBO)|*.GBO;*.gbo|" );
filetypes += _("Top overlay (*.GTO)|*.GTO;*.gto|"); filetypes += _( "Top overlay (*.GTO)|*.GTO;*.gto|" );
filetypes += _("Bottom paste (*.GBP)|*.GBP;*.gbp|"); filetypes += _( "Bottom paste (*.GBP)|*.GBP;*.gbp|" );
filetypes += _("Top paste (*.GTP)|*.GTP;*.gtp|"); filetypes += _( "Top paste (*.GTP)|*.GTP;*.gtp|" );
filetypes += _("Keep-out layer (*.GKO)|*.GKO;*.gko|"); filetypes += _( "Keep-out layer (*.GKO)|*.GKO;*.gko|" );
filetypes += _("Mechanical layers (*.GMx)|*.GM1;*.gm1;*.GM2;*.gm2;*.GM3;*.gm3|"); filetypes += _( "Mechanical layers (*.GMx)|*.GM1;*.gm1;*.GM2;*.gm2;*.GM3;*.gm3|" );
filetypes += _("Top Pad Master (*.GPT)|*.GPT;*.gpt|"); filetypes += _( "Top Pad Master (*.GPT)|*.GPT;*.gpt|" );
filetypes += _("Bottom Pad Master (*.GPB)|*.GPB;*.gpb|"); filetypes += _( "Bottom Pad Master (*.GPB)|*.GPB;*.gpb|" );
/* All filetypes */ /* All filetypes */
filetypes += AllFilesWildcard; filetypes += AllFilesWildcard;
/* Get current path if emtpy */ /* Get current path if emtpy */
if ( current_path.IsEmpty() ) if( current_path.IsEmpty() )
current_path = wxGetCwd(); current_path = wxGetCwd();
wxFileDialog dlg( this, wxFileDialog dlg( this,
...@@ -182,16 +176,16 @@ WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName, ...@@ -182,16 +176,16 @@ WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName,
} }
/**********************************************************************************************/
static void LoadDCodeFile( WinEDA_GerberFrame* frame, const wxString& FullFileName, wxDC* DC )
/**********************************************************************************************/
/* /*
* Lecture d'un fichier PCB, le nom etant dans PcbNameBuffer.s * Read a PCB file.
* retourne: *
* 0 si fichier non lu ( annulation de commande ... ) * Returns:
* 1 si OK * 0 if file not read (cancellation of order ...)
* 1 if OK
*/ */
static void LoadDCodeFile( WinEDA_GerberFrame* frame,
const wxString& FullFileName,
wxDC* DC )
{ {
wxString wildcard; wxString wildcard;
wxFileName fn = FullFileName; wxFileName fn = FullFileName;
...@@ -201,11 +195,12 @@ static void LoadDCodeFile( WinEDA_GerberFrame* frame, const wxString& FullFileNa ...@@ -201,11 +195,12 @@ static void LoadDCodeFile( WinEDA_GerberFrame* frame, const wxString& FullFileNa
if( !fn.IsOk() ) if( !fn.IsOk() )
{ {
wildcard.Printf( _( "Gerber DCODE files (%s)|*.%s" ), wildcard.Printf( _( "Gerber DCODE files (%s)|*.%s" ),
GetChars( g_PenFilenameExt ), GetChars( g_PenFilenameExt )); GetChars( g_PenFilenameExt ),
GetChars( g_PenFilenameExt ) );
wildcard += AllFilesWildcard; wildcard += AllFilesWildcard;
fn = frame->GetScreen()->m_FileName; fn = frame->GetScreen()->m_FileName;
fn.SetExt( g_PenFilenameExt ); fn.SetExt( g_PenFilenameExt );
wxFileDialog dlg( ( wxWindow* )frame, _( "Load GERBER DCODE File" ), wxFileDialog dlg( (wxWindow*) frame, _( "Load GERBER DCODE File" ),
fn.GetPath(), fn.GetFullName(), wildcard, fn.GetPath(), fn.GetFullName(), wildcard,
wxFD_OPEN | wxFD_FILE_MUST_EXIST ); wxFD_OPEN | wxFD_FILE_MUST_EXIST );
...@@ -221,12 +216,10 @@ static void LoadDCodeFile( WinEDA_GerberFrame* frame, const wxString& FullFileNa ...@@ -221,12 +216,10 @@ static void LoadDCodeFile( WinEDA_GerberFrame* frame, const wxString& FullFileNa
} }
/*******************************************************************************/ /* Save the file in ASCII PCB.
bool WinEDA_GerberFrame::SaveGerberFile( const wxString& FullFileName, wxDC* DC )
/*******************************************************************************/
/* Sauvegarde du fichier PCB en format ASCII
*/ */
bool WinEDA_GerberFrame::SaveGerberFile( const wxString& FullFileName,
wxDC* DC )
{ {
wxString wildcard; wxString wildcard;
wxFileName fn = FullFileName; wxFileName fn = FullFileName;
...@@ -236,7 +229,8 @@ bool WinEDA_GerberFrame::SaveGerberFile( const wxString& FullFileName, wxDC* DC ...@@ -236,7 +229,8 @@ bool WinEDA_GerberFrame::SaveGerberFile( const wxString& FullFileName, wxDC* DC
fn = GetScreen()->m_FileName; fn = GetScreen()->m_FileName;
wildcard.Printf( _( "Gerber DCODE files (%s)|*.%s" ), wildcard.Printf( _( "Gerber DCODE files (%s)|*.%s" ),
GetChars( g_PenFilenameExt ), GetChars( g_PenFilenameExt )); GetChars( g_PenFilenameExt ),
GetChars( g_PenFilenameExt ) );
wxFileDialog dlg( this, _( "Save Gerber File" ), fn.GetPath(), wxFileDialog dlg( this, _( "Save Gerber File" ), fn.GetPath(),
fn.GetFullName(), wildcard, fn.GetFullName(), wildcard,
......
/******************************************************************/ /*******************/
/* gerberframe.cpp - fonctions des classes du type WinEDA_GerberFrame */ /* gerberframe.cpp */
/******************************************************************/ /*******************/
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation #pragma implementation
...@@ -94,7 +94,6 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) ...@@ -94,7 +94,6 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
EVT_KICAD_CHOICEBOX( ID_TOOLBARH_GERBER_SELECT_TOOL, EVT_KICAD_CHOICEBOX( ID_TOOLBARH_GERBER_SELECT_TOOL,
WinEDA_GerberFrame::Process_Special_Functions ) WinEDA_GerberFrame::Process_Special_Functions )
// Vertical toolbar: // Vertical toolbar:
EVT_TOOL( ID_NO_SELECT_BUTT, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( ID_NO_SELECT_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_TRACK_BUTT, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( ID_TRACK_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
...@@ -102,7 +101,6 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) ...@@ -102,7 +101,6 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
EVT_TOOL( ID_PCB_DELETE_ITEM_BUTT, EVT_TOOL( ID_PCB_DELETE_ITEM_BUTT,
WinEDA_GerberFrame::Process_Special_Functions ) WinEDA_GerberFrame::Process_Special_Functions )
// Annulation de commande en cours
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
WinEDA_GerberFrame::Process_Special_Functions ) WinEDA_GerberFrame::Process_Special_Functions )
...@@ -116,11 +114,6 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) ...@@ -116,11 +114,6 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
END_EVENT_TABLE() END_EVENT_TABLE()
/****************/
/* Constructeur */
/****************/
WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
...@@ -131,7 +124,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, ...@@ -131,7 +124,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
m_FrameName = wxT( "GerberFrame" ); m_FrameName = wxT( "GerberFrame" );
m_Draw_Axis = true; // true to show X and Y axis on screen m_Draw_Axis = true; // true to show X and Y axis on screen
m_Draw_Sheet_Ref = FALSE; // TRUE pour avoir le cartouche dessin� m_Draw_Sheet_Ref = FALSE; // TRUE for reference drawings.
if( DrawPanel ) if( DrawPanel )
DrawPanel->m_Block_Enable = TRUE; DrawPanel->m_Block_Enable = TRUE;
...@@ -146,6 +139,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, ...@@ -146,6 +139,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
ActiveScreen = ScreenPcb; ActiveScreen = ScreenPcb;
LoadSettings(); LoadSettings();
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
...@@ -153,36 +147,37 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, ...@@ -153,36 +147,37 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
ReCreateHToolbar(); ReCreateHToolbar();
ReCreateVToolbar(); ReCreateVToolbar();
ReCreateOptToolbar(); ReCreateOptToolbar();
#if defined(KICAD_AUIMANAGER) #if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow(this); m_auimgr.SetManagedWindow( this );
wxAuiPaneInfo horiz; wxAuiPaneInfo horiz;
horiz.Gripper(false); horiz.Gripper( false );
horiz.DockFixed(true); horiz.DockFixed( true );
horiz.Movable(false); horiz.Movable( false );
horiz.Floatable(false); horiz.Floatable( false );
horiz.CloseButton(false); horiz.CloseButton( false );
horiz.CaptionVisible(false); horiz.CaptionVisible( false );
wxAuiPaneInfo vert(horiz); wxAuiPaneInfo vert( horiz );
vert.TopDockable(false).BottomDockable(false); vert.TopDockable( false ).BottomDockable( false );
horiz.LeftDockable(false).RightDockable(false); horiz.LeftDockable( false ).RightDockable( false );
m_auimgr.AddPane(m_HToolBar, m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top().Row(0)); wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().Row( 0 ) );
m_auimgr.AddPane(m_VToolBar, m_auimgr.AddPane( m_VToolBar,
wxAuiPaneInfo(vert).Name(wxT("m_VToolBar")).Right()); wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right() );
m_auimgr.AddPane(m_OptionsToolBar, m_auimgr.AddPane( m_OptionsToolBar,
wxAuiPaneInfo(vert).Name(wxT("m_OptionsToolBar")).Left()); wxAuiPaneInfo( vert ).Name( wxT( "m_OptionsToolBar" ) ).Left() );
m_auimgr.AddPane(DrawPanel, m_auimgr.AddPane( DrawPanel,
wxAuiPaneInfo().Name(wxT("DrawFrame")).CentrePane()); wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
m_auimgr.AddPane(MsgPanel, m_auimgr.AddPane( MsgPanel,
wxAuiPaneInfo(horiz).Name(wxT("MsgPanel")).Bottom()); wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() );
m_auimgr.Update(); m_auimgr.Update();
#endif #endif
...@@ -194,13 +189,10 @@ WinEDA_GerberFrame::~WinEDA_GerberFrame() ...@@ -194,13 +189,10 @@ WinEDA_GerberFrame::~WinEDA_GerberFrame()
SetBaseScreen( ScreenPcb ); SetBaseScreen( ScreenPcb );
extern PARAM_CFG_BASE* ParamCfgList[]; extern PARAM_CFG_BASE* ParamCfgList[];
wxGetApp().SaveCurrentSetupValues( ParamCfgList ); wxGetApp().SaveCurrentSetupValues( ParamCfgList );
} }
/***********************************************************/
void WinEDA_GerberFrame::OnCloseWindow( wxCloseEvent& Event ) void WinEDA_GerberFrame::OnCloseWindow( wxCloseEvent& Event )
/***********************************************************/
{ {
PCB_SCREEN* screen = ScreenPcb; PCB_SCREEN* screen = ScreenPcb;
...@@ -221,7 +213,8 @@ void WinEDA_GerberFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -221,7 +213,8 @@ void WinEDA_GerberFrame::OnCloseWindow( wxCloseEvent& Event )
} }
} }
#endif #endif
while( screen ) // suppression flag modify pour eviter d'autres message
while( screen ) // Modify delete flag to prevent further message.
{ {
screen->ClrModify(); screen->ClrModify();
screen = screen->Next(); screen = screen->Next();
...@@ -234,13 +227,10 @@ void WinEDA_GerberFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -234,13 +227,10 @@ void WinEDA_GerberFrame::OnCloseWindow( wxCloseEvent& Event )
} }
/*******************************************/
void WinEDA_GerberFrame::SetToolbars()
/*******************************************/
/** Function SetToolbars() /** Function SetToolbars()
* Set the tools state for the toolbars, accordint to display options * Set the tools state for the toolbars, according to display options
*/ */
void WinEDA_GerberFrame::SetToolbars()
{ {
int layer = ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer; int layer = ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer;
GERBER* gerber = g_GERBER_List[layer]; GERBER* gerber = g_GERBER_List[layer];
...@@ -318,16 +308,15 @@ void WinEDA_GerberFrame::SetToolbars() ...@@ -318,16 +308,15 @@ void WinEDA_GerberFrame::SetToolbars()
} }
DisplayUnitsMsg(); DisplayUnitsMsg();
#if defined(KICAD_AUIMANAGER) #if defined(KICAD_AUIMANAGER)
if(m_auimgr.GetManagedWindow()) if( m_auimgr.GetManagedWindow() )
m_auimgr.Update(); m_auimgr.Update();
#endif #endif
} }
/*************************************/
int WinEDA_GerberFrame::BestZoom() int WinEDA_GerberFrame::BestZoom()
/*************************************/
{ {
double x, y; double x, y;
wxSize size; wxSize size;
...@@ -340,5 +329,5 @@ int WinEDA_GerberFrame::BestZoom() ...@@ -340,5 +329,5 @@ int WinEDA_GerberFrame::BestZoom()
GetScreen()->GetGridSize().y ) / (double) size.y; GetScreen()->GetGridSize().y ) / (double) size.y;
GetScreen()->m_Curseur = GetBoard()->m_BoundaryBox.Centre(); GetScreen()->m_Curseur = GetBoard()->m_BoundaryBox.Centre();
return wxRound( MAX( x, y ) * (double)GetScreen()->m_ZoomScalar ); return wxRound( MAX( x, y ) * (double) GetScreen()->m_ZoomScalar );
} }
...@@ -26,7 +26,7 @@ wxString g_PenFilenameExt; ...@@ -26,7 +26,7 @@ wxString g_PenFilenameExt;
int g_DCodesColor; int g_DCodesColor;
int g_Default_GERBER_Format; int g_Default_GERBER_Format;
int g_Plot_Spot_Mini; /* Diametre mini de l'ouverture pour */ int g_Plot_Spot_Mini; /* Diameter of the opening mini-track for GERBER. */
int g_DisplayPolygonsModeSketch; int g_DisplayPolygonsModeSketch;
GERBER* g_GERBER_List[32]; GERBER* g_GERBER_List[32];
...@@ -47,9 +47,10 @@ bool WinEDA_App::OnInit() ...@@ -47,9 +47,10 @@ bool WinEDA_App::OnInit()
ActiveScreen = ScreenPcb; ActiveScreen = ScreenPcb;
// read current setup and reopen last directory if no filename to open in command line // read current setup and reopen last directory if no filename to open in
// command line
bool reopenLastUsedDirectory = argc == 1; bool reopenLastUsedDirectory = argc == 1;
GetSettings(reopenLastUsedDirectory); GetSettings( reopenLastUsedDirectory );
extern PARAM_CFG_BASE* ParamCfgList[]; extern PARAM_CFG_BASE* ParamCfgList[];
wxGetApp().ReadCurrentSetupValues( ParamCfgList ); wxGetApp().ReadCurrentSetupValues( ParamCfgList );
...@@ -62,9 +63,10 @@ bool WinEDA_App::OnInit() ...@@ -62,9 +63,10 @@ bool WinEDA_App::OnInit()
g_DrawBgColor = BLACK; g_DrawBgColor = BLACK;
Read_Hotkey_Config( frame, false ); /* Must be called before creating the main frame Read_Hotkey_Config( frame, false ); /* Must be called before creating the
* in order to display the real hotkeys * main frame in order to display the
* in menus or tool tips */ * real hotkeys in menus or tool tips
*/
frame = new WinEDA_GerberFrame( NULL, wxT( "GerbView" ), frame = new WinEDA_GerberFrame( NULL, wxT( "GerbView" ),
wxPoint( 0, 0 ), wxPoint( 0, 0 ),
...@@ -75,8 +77,10 @@ bool WinEDA_App::OnInit() ...@@ -75,8 +77,10 @@ bool WinEDA_App::OnInit()
frame->SetBoard( new BOARD( NULL, frame ) ); frame->SetBoard( new BOARD( NULL, frame ) );
// Initialize some display options // Initialize some display options
DisplayOpt.DisplayPadIsol = false; // Pad clearance has no meaning here DisplayOpt.DisplayPadIsol = false; // Pad clearance has no meaning
DisplayOpt.ShowTrackClearanceMode = 0; // tracks and vias clearance has no meaning here // here
DisplayOpt.ShowTrackClearanceMode = 0; // tracks and vias clearance has no
// meaning here
SetTopWindow( frame ); // Set GerbView mainframe on top SetTopWindow( frame ); // Set GerbView mainframe on top
frame->Show( TRUE ); // Show GerbView mainframe frame->Show( TRUE ); // Show GerbView mainframe
......
This diff is collapsed.
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
/** gerbview_config.cpp : Gerbview configuration*/ /** gerbview_config.cpp : Gerbview configuration*/
/************************************************/ /************************************************/
/* Functions to handle Gerbview configuration */
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
...@@ -27,9 +25,7 @@ const wxString GerbviewProjectFileExt( wxT( "cnf" ) ); ...@@ -27,9 +25,7 @@ const wxString GerbviewProjectFileExt( wxT( "cnf" ) );
const wxString GerbviewProjectFileWildcard( _( "GerbView project files (.cnf)|*.cnf" ) ); const wxString GerbviewProjectFileWildcard( _( "GerbView project files (.cnf)|*.cnf" ) );
/*************************************************************/
void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event ) void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
/*************************************************************/
{ {
int id = event.GetId(); int id = event.GetId();
wxPoint pos; wxPoint pos;
...@@ -45,7 +41,7 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event ) ...@@ -45,7 +41,7 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
DisplayColorSetupFrame( this, pos ); DisplayColorSetupFrame( this, pos );
break; break;
case ID_CONFIG_REQ: // Creation de la fenetre de configuration case ID_CONFIG_REQ:
{ {
InstallConfigFrame( pos ); InstallConfigFrame( pos );
break; break;
...@@ -91,7 +87,7 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event ) ...@@ -91,7 +87,7 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
HandleHotkeyConfigMenuSelection( this, id ); HandleHotkeyConfigMenuSelection( this, id );
break; break;
case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST: // Display Current hotkey list for gerbview case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST:
DisplayHotkeyList( this, s_Gerbview_Hokeys_Descr ); DisplayHotkeyList( this, s_Gerbview_Hokeys_Descr );
break; break;
...@@ -102,22 +98,16 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event ) ...@@ -102,22 +98,16 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
} }
/*****************************************************/ /* Read configuration, if it has not already read.
bool Read_Config() * 1 - bed gerbview.cnf
/*****************************************************/ * 2 - if no bed is path> gerbview.exe> / gerbview.cnf
* 3 - If not found: init variables to default values
/* lit la configuration, si elle n'a pas deja etee lue
* 1 - lit gerbview.cnf
* 2 - si non trouve lit <chemin de gerbview.exe>/gerbview.cnf
* 3 - si non trouve: init des variables aux valeurs par defaut
*
* Retourne un pointeur su le message d'erreur a afficher
*/ */
bool Read_Config()
{ {
wxGetApp().ReadProjectConfig( wxT( "gerbview.cnf" ), GROUP, ParamCfgList, wxGetApp().ReadProjectConfig( wxT( "gerbview.cnf" ), GROUP, ParamCfgList,
FALSE ); FALSE );
/* Inits autres variables */
if( g_PhotoFilenameExt.IsEmpty() ) if( g_PhotoFilenameExt.IsEmpty() )
g_PhotoFilenameExt = wxT( "pho" ); g_PhotoFilenameExt = wxT( "pho" );
if( g_DrillFilenameExt.IsEmpty() ) if( g_DrillFilenameExt.IsEmpty() )
...@@ -129,13 +119,7 @@ bool Read_Config() ...@@ -129,13 +119,7 @@ bool Read_Config()
} }
/******************************************/
void WinEDA_GerberFrame::Update_config() void WinEDA_GerberFrame::Update_config()
/******************************************/
/*
* creation du fichier de config
*/
{ {
wxFileName fn = wxFileName( wxEmptyString, wxT( "gerbview" ), wxFileName fn = wxFileName( wxEmptyString, wxT( "gerbview" ),
GerbviewProjectFileExt ); GerbviewProjectFileExt );
...@@ -147,21 +131,17 @@ void WinEDA_GerberFrame::Update_config() ...@@ -147,21 +131,17 @@ void WinEDA_GerberFrame::Update_config()
if( dlg.ShowModal() == wxID_CANCEL ) if( dlg.ShowModal() == wxID_CANCEL )
return; return;
/* ecriture de la configuration */
wxGetApp().WriteProjectConfig( dlg.GetPath(), GROUP, ParamCfgList ); wxGetApp().WriteProjectConfig( dlg.GetPath(), GROUP, ParamCfgList );
} }
/***************************************************************/
bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose )
/***************************************************************/
/* /*
* Read the hotkey files config for pcbnew and module_edit * Read the hotkey files config for pcbnew and module_edit
*/ */
bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose )
{ {
wxString FullFileName = ReturnHotkeyConfigFilePath( wxString FullFileName =
g_ConfigFileLocationChoice ); ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice );
FullFileName += HOTKEY_FILENAME; FullFileName += HOTKEY_FILENAME;
FullFileName += wxT("."); FullFileName += wxT(".");
......
This diff is collapsed.
/**********************************************/ /****************************************/
/* GERBVIEW : Routines d'initialisation globale */ /******* initpcb.cpp ********************/
/******* Fichier INITPCB.C ********************/ /****************************************/
/**********************************************/
#include "fctsys.h" #include "fctsys.h"
...@@ -12,16 +11,8 @@ ...@@ -12,16 +11,8 @@
#include "gerbview.h" #include "gerbview.h"
#include "protos.h" #include "protos.h"
/* Routines Locales */
/********************************************************/
bool WinEDA_GerberFrame::Clear_Pcb( bool query ) bool WinEDA_GerberFrame::Clear_Pcb( bool query )
/********************************************************/
/* Realise les init des pointeurs et variables
* Si Item == NULL, il n'y aura pas de confirmation
*/
{ {
int layer; int layer;
...@@ -30,9 +21,10 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query ) ...@@ -30,9 +21,10 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
if( query ) if( query )
{ {
if( GetBoard()->m_Drawings || GetBoard()->m_Track || GetBoard()->m_Zone ) if( GetBoard()->m_Drawings || GetBoard()->m_Track
|| GetBoard()->m_Zone )
{ {
if( !IsOK( this, _( "Current Data will be lost ?" ) ) ) if( !IsOK( this, _( "Current data will be lost?" ) ) )
return FALSE; return FALSE;
} }
} }
...@@ -43,21 +35,18 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query ) ...@@ -43,21 +35,18 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
GetBoard()->m_Zone.DeleteAll(); GetBoard()->m_Zone.DeleteAll();
/* init pointeurs et variables */
for( layer = 0; layer < 32; layer++ ) for( layer = 0; layer < 32; layer++ )
{ {
if( g_GERBER_List[layer] ) if( g_GERBER_List[layer] )
g_GERBER_List[layer]->InitToolTable(); g_GERBER_List[layer]->InitToolTable();
} }
/* remise a 0 ou a une valeur initiale des variables de la structure */
GetBoard()->m_BoundaryBox.SetOrigin( 0, 0 ); GetBoard()->m_BoundaryBox.SetOrigin( 0, 0 );
GetBoard()->m_BoundaryBox.SetSize( 0, 0 ); GetBoard()->m_BoundaryBox.SetSize( 0, 0 );
GetBoard()->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
GetBoard()->m_NbNodes = 0; GetBoard()->m_NbNodes = 0;
GetBoard()->m_NbNoconnect = 0; GetBoard()->m_NbNoconnect = 0;
/* Init parametres de gestion des ecrans PAD et PCB */
SetBaseScreen( ActiveScreen = ScreenPcb ); SetBaseScreen( ActiveScreen = ScreenPcb );
GetScreen()->Init(); GetScreen()->Init();
...@@ -65,11 +54,9 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query ) ...@@ -65,11 +54,9 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
} }
/*********************************************************/
void WinEDA_GerberFrame::Erase_Zones( bool query ) void WinEDA_GerberFrame::Erase_Zones( bool query )
/*********************************************************/
{ {
if( query && !IsOK( this, _( "Delete zones ?" ) ) ) if( query && !IsOK( this, _( "Delete zones?" ) ) )
return; return;
GetBoard()->m_Zone.DeleteAll(); GetBoard()->m_Zone.DeleteAll();
...@@ -78,9 +65,7 @@ void WinEDA_GerberFrame::Erase_Zones( bool query ) ...@@ -78,9 +65,7 @@ void WinEDA_GerberFrame::Erase_Zones( bool query )
} }
/************************************************************************/
void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query ) void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query )
/************************************************************************/
{ {
int layer = GetScreen()->m_Active_Layer; int layer = GetScreen()->m_Active_Layer;
...@@ -103,7 +88,7 @@ void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query ) ...@@ -103,7 +88,7 @@ void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query )
break; break;
default: default:
DisplayError( this, wxT( "Type Draw inconnu/inattendu" ) ); DisplayError( this, wxT( "Draw type unknown." ) );
break; break;
} }
} }
...@@ -112,24 +97,23 @@ void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query ) ...@@ -112,24 +97,23 @@ void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query )
} }
/******************************************************************/ /* Delete track segments.
void WinEDA_GerberFrame::Erase_Pistes( int masque_type, bool query ) * masque_type mask options selection:
/******************************************************************/
/* Efface les segments de piste, selon les autorisations affichees
* masque_type = masque des options de selection:
* SEGM_FIXE, SEGM_AR * SEGM_FIXE, SEGM_AR
* Si un des bits est a 1, il n'y a pas effacement du segment de meme bit a 1 * If a bit is 1, segment is not erased.
*/ */
void WinEDA_GerberFrame::Erase_Pistes( int masque_type, bool query )
{ {
TRACK* pt_segm; TRACK* pt_segm;
BOARD_ITEM* PtNext; BOARD_ITEM* PtNext;
if( query && !IsOK( this, _( "Delete Tracks?" ) ) ) if( query && !IsOK( this, _( "Delete tracks?" ) ) )
return; return;
/* Marquage des pistes a effacer */ /* Mark tracks to clear. */
for( pt_segm = GetBoard()->m_Track; pt_segm != NULL; pt_segm = (TRACK*) PtNext ) for( pt_segm = GetBoard()->m_Track;
pt_segm != NULL;
pt_segm = (TRACK*) PtNext )
{ {
PtNext = pt_segm->Next(); PtNext = pt_segm->Next();
if( pt_segm->GetState( SEGM_FIXE | SEGM_AR ) & masque_type ) if( pt_segm->GetState( SEGM_FIXE | SEGM_AR ) & masque_type )
...@@ -141,14 +125,12 @@ void WinEDA_GerberFrame::Erase_Pistes( int masque_type, bool query ) ...@@ -141,14 +125,12 @@ void WinEDA_GerberFrame::Erase_Pistes( int masque_type, bool query )
} }
/*****************************************************************/
void WinEDA_GerberFrame::Erase_Textes_Pcb( bool query ) void WinEDA_GerberFrame::Erase_Textes_Pcb( bool query )
/*****************************************************************/
{ {
BOARD_ITEM* PtStruct; BOARD_ITEM* PtStruct;
BOARD_ITEM* PtNext; BOARD_ITEM* PtNext;
if( query && !IsOK( this, _( "Delete Pcb Texts" ) ) ) if( query && !IsOK( this, _( "Delete pcb text?" ) ) )
return; return;
PtStruct = GetBoard()->m_Drawings; PtStruct = GetBoard()->m_Drawings;
...@@ -163,20 +145,20 @@ void WinEDA_GerberFrame::Erase_Textes_Pcb( bool query ) ...@@ -163,20 +145,20 @@ void WinEDA_GerberFrame::Erase_Textes_Pcb( bool query )
} }
/*********************************************************/
void WinEDA_GerberFrame::Erase_Current_Layer( bool query ) void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
/*********************************************************/
{ {
int layer = GetScreen()->m_Active_Layer; int layer = GetScreen()->m_Active_Layer;
wxString msg; wxString msg;
msg.Printf( _( "Delete Layer %d" ), layer + 1 ); msg.Printf( _( "Delete layer %d?" ), layer + 1 );
if( query && !IsOK( this, msg ) ) if( query && !IsOK( this, msg ) )
return; return;
/* Delete tracks (spots and lines) */ /* Delete tracks (spots and lines) */
TRACK* PtNext; TRACK* PtNext;
for( TRACK* pt_segm = GetBoard()->m_Track; pt_segm != NULL; pt_segm = (TRACK*) PtNext ) for( TRACK* pt_segm = GetBoard()->m_Track;
pt_segm != NULL;
pt_segm = (TRACK*) PtNext )
{ {
PtNext = pt_segm->Next(); PtNext = pt_segm->Next();
if( pt_segm->GetLayer() != layer ) if( pt_segm->GetLayer() != layer )
...@@ -193,6 +175,7 @@ void WinEDA_GerberFrame::Erase_Current_Layer( bool query ) ...@@ -193,6 +175,7 @@ void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
continue; continue;
zone->DeleteStructure(); zone->DeleteStructure();
} }
ScreenPcb->SetModify(); ScreenPcb->SetModify();
ScreenPcb->SetRefreshReq(); ScreenPcb->SetRefreshReq();
} }
/**********************************************/ /****************/
/* Routine de selection de couches pour trace */ /* lay2plot.cpp */
/**********************************************/ /****************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -10,14 +10,8 @@ ...@@ -10,14 +10,8 @@
#include "protos.h" #include "protos.h"
/* Variables locales : */ /* Routine to plot the pcb, by selected layers. */
/* Routines Locales */
/*******************************************************************************/
void Print_PcbItems(BOARD * Pcb, wxDC *DC, int drawmode, int printmasklayer) void Print_PcbItems(BOARD * Pcb, wxDC *DC, int drawmode, int printmasklayer)
/*******************************************************************************/
/* routine de trace du pcb, avec selection des couches */
{ {
DISPLAY_OPTIONS save_opt; DISPLAY_OPTIONS save_opt;
TRACK * pt_piste; TRACK * pt_piste;
...@@ -33,7 +27,6 @@ void Print_PcbItems(BOARD * Pcb, wxDC *DC, int drawmode, int printmasklayer) ...@@ -33,7 +27,6 @@ void Print_PcbItems(BOARD * Pcb, wxDC *DC, int drawmode, int printmasklayer)
DisplayOpt.DisplayDrawItems = FILLED; DisplayOpt.DisplayDrawItems = FILLED;
DisplayOpt.DisplayZonesMode = 0; DisplayOpt.DisplayZonesMode = 0;
/* trace des pistes */
pt_piste = Pcb->m_Track; pt_piste = Pcb->m_Track;
for( ; pt_piste != NULL ; pt_piste = pt_piste->Next() ) for( ; pt_piste != NULL ; pt_piste = pt_piste->Next() )
{ {
...@@ -43,6 +36,3 @@ void Print_PcbItems(BOARD * Pcb, wxDC *DC, int drawmode, int printmasklayer) ...@@ -43,6 +36,3 @@ void Print_PcbItems(BOARD * Pcb, wxDC *DC, int drawmode, int printmasklayer)
DisplayOpt = save_opt; DisplayOpt = save_opt;
} }
This diff is collapsed.
/******************************************************/ /********************/
/* edit.cpp: fonctions generales de l'edition du PCB */ /* onrightclick.cpp */
/******************************************************/ /********************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -11,27 +11,28 @@ ...@@ -11,27 +11,28 @@
#include "pcbplot.h" #include "pcbplot.h"
#include "protos.h" #include "protos.h"
/********************************************************************************/
bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
/********************************************************************************/
/* Prepare the right-click pullup menu. /* Prepare the right-click pullup menu.
* The menu already has a list of zoom commands. * The menu already has a list of zoom commands.
*/ */
bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos,
wxMenu* PopMenu )
{ {
BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem(); BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem();
wxString msg; wxString msg;
bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE); bool BlockActive =
(GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
DrawPanel->m_CanStartBlock = -1; // Ne pas engager un debut de bloc sur validation menu // Do not initiate a start block validation on menu.
DrawPanel->m_CanStartBlock = -1;
// Simple localisation des elements si possible // Simple location of elements where possible.
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) if( ( DrawStruct == NULL ) || ( DrawStruct->m_Flags == 0 ) )
{ {
DrawStruct = GerberGeneralLocateAndDisplay(); DrawStruct = GerberGeneralLocateAndDisplay();
} }
// Si commande en cours: affichage fin de commande // If command in progress, end command.
if( m_ID_current_state ) if( m_ID_current_state )
{ {
if( DrawStruct && DrawStruct->m_Flags ) if( DrawStruct && DrawStruct->m_Flags )
...@@ -46,16 +47,21 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ...@@ -46,16 +47,21 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
{ {
if( BlockActive ) if( BlockActive )
{ {
PopMenu->Append( ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ) ); PopMenu->Append( ID_POPUP_CANCEL_CURRENT_COMMAND,
PopMenu->Append( ID_POPUP_ZOOM_BLOCK, _( "Zoom Block (drag middle mouse)" ) ); _( "Cancel Block" ) );
PopMenu->Append( ID_POPUP_ZOOM_BLOCK,
_( "Zoom Block (drag middle mouse)" ) );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
PopMenu->Append( ID_POPUP_PLACE_BLOCK, _( "Place Block" ) ); PopMenu->Append( ID_POPUP_PLACE_BLOCK, _( "Place Block" ) );
PopMenu->Append( ID_POPUP_COPY_BLOCK, _( "Copy Block (shift mouse)" ) ); PopMenu->Append( ID_POPUP_COPY_BLOCK,
PopMenu->Append( ID_POPUP_DELETE_BLOCK, _( "Delete Block (ctrl + drag mouse)" ) ); _( "Copy Block (shift mouse)" ) );
PopMenu->Append( ID_POPUP_DELETE_BLOCK,
_( "Delete Block (ctrl + drag mouse)" ) );
PopMenu->Append( ID_POPUP_MIRROR_X_BLOCK, _( "Mirror Block" ) ); PopMenu->Append( ID_POPUP_MIRROR_X_BLOCK, _( "Mirror Block" ) );
} }
else else
PopMenu->Append( ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ) ); PopMenu->Append( ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel" ) );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
} }
} }
...@@ -63,7 +69,8 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ...@@ -63,7 +69,8 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
if( BlockActive ) if( BlockActive )
return true; return true;
PopMenu->Append( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, _( "Delete Dcode items" ) ); PopMenu->Append( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS,
_( "Delete Dcode items" ) );
if( DrawStruct == NULL ) if( DrawStruct == NULL )
return true; return true;
...@@ -81,8 +88,7 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ...@@ -81,8 +88,7 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
default: default:
msg.Printf( msg.Printf( wxT( "WinEDA_GerberFrame::OnRightClick Error: illegal or unknown DrawType %d" ),
wxT( "WinEDA_GerberFrame::OnRightClick Error: illegal or unknown DrawType %d" ),
DrawStruct->Type() ); DrawStruct->Type() );
DisplayError( this, msg ); DisplayError( this, msg );
break; break;
......
/********************************************/ /************************/
/* GERBVIEW - Gestion des Options et Reglages */
/********************************************/
/* File options.cpp */ /* File options.cpp */
/************************/
/* /*
* Set the display options for Gerbview * Set the display options for Gerbview
...@@ -21,13 +19,10 @@ ...@@ -21,13 +19,10 @@
#include <wx/spinctrl.h> #include <wx/spinctrl.h>
/*****************************************************************/
void WinEDA_GerberFrame::OnSelectOptionToolbar( wxCommandEvent& event )
/*****************************************************************/
/** Function OnSelectOptionToolbar /** Function OnSelectOptionToolbar
* called to validate current choices * called to validate current choices
*/ */
void WinEDA_GerberFrame::OnSelectOptionToolbar( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
...@@ -120,9 +115,7 @@ void WinEDA_GerberFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -120,9 +115,7 @@ void WinEDA_GerberFrame::OnSelectOptionToolbar( wxCommandEvent& event )
} }
/******************************************************/
class WinEDA_GerberGeneralOptionsFrame : public wxDialog class WinEDA_GerberGeneralOptionsFrame : public wxDialog
/******************************************************/
{ {
private: private:
...@@ -132,7 +125,6 @@ private: ...@@ -132,7 +125,6 @@ private:
wxRadioBox* m_CursorShape; wxRadioBox* m_CursorShape;
wxRadioBox* m_GerberDefaultScale; wxRadioBox* m_GerberDefaultScale;
// Constructor and destructor
public: public:
WinEDA_GerberGeneralOptionsFrame( WinEDA_BasePcbFrame* parent, WinEDA_GerberGeneralOptionsFrame( WinEDA_BasePcbFrame* parent,
const wxPoint& pos ); const wxPoint& pos );
...@@ -145,25 +137,19 @@ private: ...@@ -145,25 +137,19 @@ private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
/* Events table for WinEDA_GerberGeneralOptionsFrame */
BEGIN_EVENT_TABLE( WinEDA_GerberGeneralOptionsFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_GerberGeneralOptionsFrame, wxDialog )
EVT_BUTTON( wxID_OK, WinEDA_GerberGeneralOptionsFrame::OnOkClick ) EVT_BUTTON( wxID_OK, WinEDA_GerberGeneralOptionsFrame::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_GerberGeneralOptionsFrame::OnCancelClick ) EVT_BUTTON( wxID_CANCEL, WinEDA_GerberGeneralOptionsFrame::OnCancelClick )
END_EVENT_TABLE() END_EVENT_TABLE()
/**********************************************************************************************/
WinEDA_GerberGeneralOptionsFrame::WinEDA_GerberGeneralOptionsFrame( WinEDA_GerberGeneralOptionsFrame::WinEDA_GerberGeneralOptionsFrame(
WinEDA_BasePcbFrame* parent, WinEDA_BasePcbFrame* parent,
const const wxPoint& framepos ) :
wxPoint& framepos ) :
wxDialog( parent, -1, _( "Gerbview Options" ), wxDialog( parent, -1, _( "Gerbview Options" ),
framepos, wxSize( 300, 240 ), framepos, wxSize( 300, 240 ),
wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT ) wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT )
/**********************************************************************************************/
/** WinEDA_GerberGeneralOptionsFrame Constructor
*/
{ {
m_Parent = parent; m_Parent = parent;
...@@ -228,18 +214,14 @@ WinEDA_GerberGeneralOptionsFrame::WinEDA_GerberGeneralOptionsFrame( ...@@ -228,18 +214,14 @@ WinEDA_GerberGeneralOptionsFrame::WinEDA_GerberGeneralOptionsFrame(
} }
/************************************************************************/
void WinEDA_GerberGeneralOptionsFrame::OnCancelClick( void WinEDA_GerberGeneralOptionsFrame::OnCancelClick(
wxCommandEvent& WXUNUSED(event) ) wxCommandEvent& WXUNUSED(event) )
/************************************************************************/
{ {
EndModal( -1 ); EndModal( -1 );
} }
/*****************************************************************************/
void WinEDA_GerberGeneralOptionsFrame::OnOkClick( wxCommandEvent& event ) void WinEDA_GerberGeneralOptionsFrame::OnOkClick( wxCommandEvent& event )
/*****************************************************************************/
{ {
DisplayOpt.DisplayPolarCood = DisplayOpt.DisplayPolarCood =
(m_PolarDisplay->GetSelection() == 0) ? FALSE : TRUE; (m_PolarDisplay->GetSelection() == 0) ? FALSE : TRUE;
...@@ -253,7 +235,7 @@ void WinEDA_GerberGeneralOptionsFrame::OnOkClick( wxCommandEvent& event ) ...@@ -253,7 +235,7 @@ void WinEDA_GerberGeneralOptionsFrame::OnOkClick( wxCommandEvent& event )
/*******************************************/ /*******************************************/
/* Dialog frame to select deisplay options */ /* Dialog frame to select display options */
/*******************************************/ /*******************************************/
class WinEDA_LookFrame : public wxDialog class WinEDA_LookFrame : public wxDialog
{ {
...@@ -268,7 +250,6 @@ private: ...@@ -268,7 +250,6 @@ private:
public: public:
// Constructor and destructor
WinEDA_LookFrame( WinEDA_BasePcbFrame* parent, const wxPoint& pos ); WinEDA_LookFrame( WinEDA_BasePcbFrame* parent, const wxPoint& pos );
~WinEDA_LookFrame() {}; ~WinEDA_LookFrame() {};
...@@ -279,20 +260,17 @@ private: ...@@ -279,20 +260,17 @@ private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
/* Construction de la table des evenements pour WinEDA_LookFrame */
BEGIN_EVENT_TABLE( WinEDA_LookFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_LookFrame, wxDialog )
EVT_BUTTON( wxID_OK, WinEDA_LookFrame::OnOkClick ) EVT_BUTTON( wxID_OK, WinEDA_LookFrame::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_LookFrame::OnCancelClick ) EVT_BUTTON( wxID_CANCEL, WinEDA_LookFrame::OnCancelClick )
END_EVENT_TABLE() END_EVENT_TABLE()
/*******************************************************************************/
WinEDA_LookFrame::WinEDA_LookFrame( WinEDA_BasePcbFrame* parent, WinEDA_LookFrame::WinEDA_LookFrame( WinEDA_BasePcbFrame* parent,
const wxPoint& framepos ) : const wxPoint& framepos ) :
wxDialog( parent, -1, _( "Gerbview Draw Options" ), framepos, wxDialog( parent, -1, _( "Gerbview Draw Options" ), framepos,
wxSize( 350, 200 ), wxSize( 350, 200 ),
wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT ) wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT )
/*******************************************************************************/
{ {
m_Parent = parent; m_Parent = parent;
...@@ -362,20 +340,13 @@ WinEDA_LookFrame::WinEDA_LookFrame( WinEDA_BasePcbFrame* parent, ...@@ -362,20 +340,13 @@ WinEDA_LookFrame::WinEDA_LookFrame( WinEDA_BasePcbFrame* parent,
} }
/**************************************************************/
void WinEDA_LookFrame::OnCancelClick( wxCommandEvent& WXUNUSED(event) ) void WinEDA_LookFrame::OnCancelClick( wxCommandEvent& WXUNUSED(event) )
/**************************************************************/
{ {
EndModal( -1 ); EndModal( -1 );
} }
/*************************************************************/
void WinEDA_LookFrame::OnOkClick( wxCommandEvent& event ) void WinEDA_LookFrame::OnOkClick( wxCommandEvent& event )
/*************************************************************/
/* Met a jour les options
*/
{ {
if( m_OptDisplayLines->GetSelection() == 1 ) if( m_OptDisplayLines->GetSelection() == 1 )
DisplayOpt.DisplayPcbTrackFill = TRUE; DisplayOpt.DisplayPcbTrackFill = TRUE;
...@@ -412,9 +383,7 @@ void WinEDA_LookFrame::OnOkClick( wxCommandEvent& event ) ...@@ -412,9 +383,7 @@ void WinEDA_LookFrame::OnOkClick( wxCommandEvent& event )
} }
/***************************************************************************/
void WinEDA_GerberFrame::InstallGerberOptionsFrame( const wxPoint& pos, int id ) void WinEDA_GerberFrame::InstallGerberOptionsFrame( const wxPoint& pos, int id )
/***************************************************************************/
{ {
switch( id ) switch( id )
{ {
......
/************************************************/ /***************/
/* Menu General de Trace (PLOT) fichier PLOT.CC */ /* pcbplot.cpp */
/************************************************/ /***************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -15,13 +15,9 @@ ...@@ -15,13 +15,9 @@
PCB_Plot_Options g_pcb_plot_options; PCB_Plot_Options g_pcb_plot_options;
/* variables locale : */ /**************************************************************/
/* void WinEDA_BasePcbFrame::ToPlotter(wxCommandEvent& event) */
/* Routines Locales */ /***************************************************************/
/**************************************************************/
/* void WinEDA_BasePcbFrame::ToPlotter(wxCommandEvent& event) */
/***************************************************************/
void WinEDA_BasePcbFrame::ToPlotter(wxCommandEvent& event) void WinEDA_BasePcbFrame::ToPlotter(wxCommandEvent& event)
{ {
......
...@@ -13,11 +13,13 @@ ...@@ -13,11 +13,13 @@
#define OPTKEY_PRINT_SCALE wxT( "PrintScale" ) #define OPTKEY_PRINT_SCALE wxT( "PrintScale" )
/* Plot Options : */ /* Plot Options : */
struct PCB_Plot_Options { struct PCB_Plot_Options
{
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)
int Plot_Mode; int Plot_Mode;
bool Plot_Set_MIROIR; bool Plot_Set_MIROIR;
bool Sel_Rotate_Window; bool Sel_Rotate_Window;
...@@ -25,18 +27,18 @@ struct PCB_Plot_Options { ...@@ -25,18 +27,18 @@ struct PCB_Plot_Options {
int HPGL_Pen_Speed; int HPGL_Pen_Speed;
int HPGL_Pen_Diam; int HPGL_Pen_Diam;
int HPGL_Pen_Recouvrement; int HPGL_Pen_Recouvrement;
bool HPGL_Org_Centre; // TRUE si en HPGL, l'origine le centre de la feuille bool HPGL_Org_Centre; // TRUE if, HPGL originally the center of the node
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 */ /* Settings to trace the various items in silkscreen. */
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 /* Plot pads even outside the layer (useful for silkscreen) */
couche ( utile pour serigraphie) */ bool Plot_Pads_All_Layers;
/* 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;
...@@ -49,4 +51,3 @@ struct PCB_Plot_Options { ...@@ -49,4 +51,3 @@ struct PCB_Plot_Options {
extern PCB_Plot_Options g_pcb_plot_options; extern PCB_Plot_Options g_pcb_plot_options;
#endif // ifndef PCBPLOT_H #endif // ifndef PCBPLOT_H
/********************************************************/ /**********************/
/**** Routine de lecture et visu d'un fichier GERBER ****/ /**** readgerb.cpp ****/
/********************************************************/ /**********************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -11,112 +11,104 @@ ...@@ -11,112 +11,104 @@
#include "pcbplot.h" #include "pcbplot.h"
#include "protos.h" #include "protos.h"
/* Format Gerber : NOTES : /* Format Gerber: NOTES:
* Fonctions preparatoires: * Functions history:
* Gn = * Gn =
* G01 interpolation lineaire ( trace de droites ) * G01 linear interpolation (right trace)
* G02,G20,G21 Interpolation circulaire , sens trigo < 0 * G02, G20, G21 Circular interpolation, meaning trig <0
* G03,G30,G31 Interpolation circulaire , sens trigo > 0 * G03, G30, G31 Circular interpolation, meaning trigo> 0
* G04 commentaire * G04 review
* G06 Interpolation parabolique * G06 parabolic interpolation
* G07 Interpolation cubique * G07 Cubic Interpolation
* G10 interpolation lineaire ( echelle 10x ) * G10 linear interpolation (scale x10)
* G11 interpolation lineaire ( echelle 0.1x ) * G11 linear interpolation (0.1x range)
* G12 interpolation lineaire ( echelle 0.01x ) * G12 linear interpolation (0.01x scale)
* G52 plot symbole reference par Dnn code * G52 plot symbol reference code by Dnn
* G53 plot symbole reference par Dnn ; symbole tourne de -90 degres * G53 plot symbol reference by Dnn; symbol rotates from -90 degrees
* G54 Selection d'outil * G54 Selection Tool
* G55 Mode exposition photo * G55 Fashion photo exhibition
* G56 plot symbole reference par Dnn A code * G56 plot symbol reference code for DNN
* G57 affiche le symbole reference sur la console * G57 displays the symbol link to the console
* G58 plot et affiche le symbole reference sur la console * G58 plot displays the symbol and link to the console
* G60 interpolation lineaire ( echelle 100x ) * G60 linear interpolation (scale x100)
* G70 Unites = Inches * G70 Units = Inches
* G71 Unites = Millimetres * G71 Units = Millimeters
* G74 supprime interpolation circulaire sur 360 degre, revient a G01 * G74 circular interpolation removes 360 degree, has returned G01
* G75 Active interpolation circulaire sur 360 degre * G75 Active circular interpolation on 360 degree
* G90 Mode Coordonnees absolues * G90 mode absolute coordinates
* G91 Mode Coordonnees Relatives * G91 Fashion Related Contacts
* *
* Coordonnees X,Y * X, Y coordinates
* X,Y sont suivies de + ou - et de m+n chiffres (non separes) * X and Y are followed by + or - and m + n digits (not separated)
* m = partie entiere * m = integer part
* n = partie apres la virgule * n = part after the comma
* formats classiques : m = 2, n = 3 (format 2.3) * Classic formats: m = 2, n = 3 (size 2.3)
* m = 3, n = 4 (format 3.4) * m = 3, n = 4 (size 3.4)
* ex: * eg
* G__ X00345Y-06123 D__* * G__ X00345Y-06123 * D__
* *
* Outils et D_CODES * Tools and D_CODES
* numero d'outil ( identification des formes ) * Tool number (identification of shapes)
* 1 a 99 (classique) * 1 to 99 (Classical)
* 1 a 999 * 1 to 999
* D_CODES: * D_CODES:
* *
* D01 ... D9 = codes d'action: * D01 ... D9 = action codes:
* D01 = activation de lumiere (baisser de plume) lors du d�placement * D01 = activating light (lower pen) when placement
* D02 = extinction de lumiere (lever de plume) lors du d�placement * D02 = light extinction (lift pen) when placement
* D03 = Flash * D03 = Flash
* D09 = VAPE Flash * D09 = VAPE Flash
* D51 = precede par G54 -> Select VAPE * D51 = G54 preceded by -> Select VAPE
* *
* D10 ... D255 = Indentification d'outils ( d'ouvertures ) * D10 ... D255 = Identification Tool (Opening)
* Ne sont pas tj dans l'ordre ( voir tableau dans PCBPLOT.H) * Not in order (see table in PCBPLOT.H)
*/ */
/* Variables locales : */ /* Routine to Read a file D Codes.
* Accepts standard format or ALSPCB
/* Routines Locales */ * A ';' starts a comment.
/* Routine de Lecture d'un fichier de D Codes.
* Accepte format standard ou ALSPCB
* un ';' demarre un commentaire.
* *
* Format Standard: * Standard Format:
* tool, Horiz, Vert, drill, vitesse, acc. ,Type ; [DCODE (commentaire)] * Tool, Horiz, Vert, drill, speed, acc. Type; [dCode (comment)]
* ex: 1, 12, 12, 0, 0, 0, 3 ; D10 * Ex: 1, 12, 12, 0, 0, 0, 3; D10
* *
* Format ALSPCB: * Format: ALSPCB
* Ver , Hor , Type , Tool [,Drill] * Ver, Hor, Type, Tool, [Drill]
* ex: 0.012, 0.012, L , D10 * Eg 0012, 0012, L, D10
* *
* Classe les caract en buf_tmp sous forme de tableau de structures D_CODE. * Rank the characters in buf_tmp tabular structures D_CODE.
* Retourne: * Returns:
* < 0 si erreur: * <0 if error:
* -1 = Fichier non trouve * -1 = File not found
* -2 = Erreur lecture fichier * -2 = Error reading file
* Rang de D_code maxi lu ( nbr de dcodes ) * Rank D_code max lu (nbr of dCode)
* *
* Internal Representation:
* *
* Representation interne: * Lines are represented as standard TRACKS
* * The flash is represented as DRAWSEGMENTS
* Les lignes sont repr�sent�es par des TRACKS standards * - Round or oval: DRAWSEGMENTS
* Les Flash sont repr�sent�es par des DRAWSEGMENTS * - Rectangles DRAWSEGMENTS
* - ronds ou ovales: DRAWSEGMENTS * Reference to the D-CODE is set in the member Getnet()
* - rectangles: DRAWSEGMENTS
* la reference aux D-CODES est plac�e dans le membre GetNet()
*/ */
/********************************************************/ /* Read a gerber file (RS274D gold RS274X format).
bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC, * Normal size:
const wxString& GERBER_FullFileName,
const wxString& D_Code_FullFileName )
/********************************************************/
/* Read a gerber file (RS274D or RS274X format).
* Normal format:
* Imperial * Imperial
* Absolute * Absolute
* end of block = * * End of block = *
* CrLf after each command * CrLf after each command
* G codes repetes * G codes BROKE
*/ */
bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
const wxString& GERBER_FullFileName,
const wxString& D_Code_FullFileName )
{ {
int G_commande = 0, int G_commande = 0,
D_commande = 0; /* command number for G et D commands (like G04 or D02) */ D_commande = 0; /* command number for G or D commands
* (like G04 or D02) */
char line[GERBER_BUFZ]; char line[GERBER_BUFZ];
...@@ -155,11 +147,11 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC, ...@@ -155,11 +147,11 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
wxSetWorkingDirectory( path ); wxSetWorkingDirectory( path );
wxBusyCursor show_wait; wxBusyCursor show_wait;
SetLocaleTo_C_standard( ); SetLocaleTo_C_standard();
while( TRUE ) while( TRUE )
{ {
if( fgets( line, sizeof(line), gerber->m_Current_File ) == NULL ) // E.O.F if( fgets( line, sizeof(line), gerber->m_Current_File ) == NULL )
{ {
if( gerber->m_FilesPtr == 0 ) if( gerber->m_FilesPtr == 0 )
break; break;
...@@ -185,7 +177,7 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC, ...@@ -185,7 +177,7 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
text++; text++;
break; break;
case '*': // End commande case '*': // End command
gerber->m_CommandState = END_BLOCK; gerber->m_CommandState = END_BLOCK;
text++; text++;
break; break;
...@@ -202,7 +194,8 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC, ...@@ -202,7 +194,8 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
gerber->Execute_G_Command( text, G_commande ); gerber->Execute_G_Command( text, G_commande );
break; break;
case 'D': /* Line type Dxx : Tool selection (xx > 0) or command if xx = 0..9*/ case 'D': /* Line type Dxx : Tool selection (xx > 0) or
* command if xx = 0..9 */
D_commande = gerber->ReturnDCodeNumber( text ); D_commande = gerber->ReturnDCodeNumber( text );
gerber->Execute_DCODE_Command( this, DC, text, D_commande ); gerber->Execute_DCODE_Command( this, DC, text, D_commande );
break; break;
...@@ -256,10 +249,11 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC, ...@@ -256,10 +249,11 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
} }
fclose( gerber->m_Current_File ); fclose( gerber->m_Current_File );
SetLocaleTo_Default( ); SetLocaleTo_Default();
/* Init DCodes list and perhaps read a DCODES file, /* Init DCodes list and perhaps read a DCODES file,
* if the gerber file is only a RS274D file (without any aperture information) * if the gerber file is only a RS274D file (without any aperture
* information)
*/ */
if( !gerber->m_Has_DCode ) if( !gerber->m_Has_DCode )
{ {
...@@ -272,7 +266,8 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC, ...@@ -272,7 +266,8 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
fn = GERBER_FullFileName; fn = GERBER_FullFileName;
fn.SetExt( g_PenFilenameExt ); fn.SetExt( g_PenFilenameExt );
wildcard.Printf( _( "Gerber DCODE files (%s)|*.%s" ), wildcard.Printf( _( "Gerber DCODE files (%s)|*.%s" ),
GetChars( g_PenFilenameExt ), GetChars( g_PenFilenameExt )); GetChars( g_PenFilenameExt ),
GetChars( g_PenFilenameExt ) );
wildcard += AllFilesWildcard; wildcard += AllFilesWildcard;
wxFileDialog dlg( this, _( "Load GERBER DCODE File" ), wxFileDialog dlg( this, _( "Load GERBER DCODE File" ),
......
/**********************************************/ /***************/
/* GERBVIEW - Gestion des Options et Reglages */ /* reglage.cpp */
/**********************************************/ /***************/
/* Fichier reglage.cpp */
/* /*
* Options for file extensions * Options for file extensions
...@@ -16,13 +14,12 @@ ...@@ -16,13 +14,12 @@
#include "pcbplot.h" #include "pcbplot.h"
#include "protos.h" #include "protos.h"
/***********/
enum { enum
{
ID_SAVE_CFG = 1000 ID_SAVE_CFG = 1000
}; };
/* Routines Locales */
class WinEDA_ConfigFrame : public wxDialog class WinEDA_ConfigFrame : public wxDialog
{ {
...@@ -36,7 +33,6 @@ private: ...@@ -36,7 +33,6 @@ private:
WinEDA_EnterText* TextPhotoExt; WinEDA_EnterText* TextPhotoExt;
WinEDA_EnterText* TextPenExt; WinEDA_EnterText* TextPenExt;
// Constructor and destructor
public: public:
WinEDA_ConfigFrame( WinEDA_GerberFrame* parent, const wxPoint& pos ); WinEDA_ConfigFrame( WinEDA_GerberFrame* parent, const wxPoint& pos );
~WinEDA_ConfigFrame() { }; ~WinEDA_ConfigFrame() { };
...@@ -48,7 +44,8 @@ private: ...@@ -48,7 +44,8 @@ private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
/* Construction de la table des evenements pour WinEDA_ConfigFrame */
BEGIN_EVENT_TABLE( WinEDA_ConfigFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_ConfigFrame, wxDialog )
EVT_BUTTON( ID_SAVE_CFG, WinEDA_ConfigFrame::SaveCfg ) EVT_BUTTON( ID_SAVE_CFG, WinEDA_ConfigFrame::SaveCfg )
EVT_BUTTON( wxID_OK, WinEDA_ConfigFrame::OnOkClick ) EVT_BUTTON( wxID_OK, WinEDA_ConfigFrame::OnOkClick )
...@@ -56,14 +53,11 @@ BEGIN_EVENT_TABLE( WinEDA_ConfigFrame, wxDialog ) ...@@ -56,14 +53,11 @@ BEGIN_EVENT_TABLE( WinEDA_ConfigFrame, wxDialog )
END_EVENT_TABLE() END_EVENT_TABLE()
/*****************************************************************/
void WinEDA_GerberFrame::InstallConfigFrame( const wxPoint& pos )
/*****************************************************************/
/** Function InstallConfigFrame /** Function InstallConfigFrame
* install the dialog box to configure some gerbview options * install the dialog box to configure some gerbview options
* manly the default file extensions * mainly the default file extensions
*/ */
void WinEDA_GerberFrame::InstallConfigFrame( const wxPoint& pos )
{ {
WinEDA_ConfigFrame* CfgFrame = new WinEDA_ConfigFrame( this, pos ); WinEDA_ConfigFrame* CfgFrame = new WinEDA_ConfigFrame( this, pos );
...@@ -72,12 +66,10 @@ void WinEDA_GerberFrame::InstallConfigFrame( const wxPoint& pos ) ...@@ -72,12 +66,10 @@ void WinEDA_GerberFrame::InstallConfigFrame( const wxPoint& pos )
} }
/************************************************************/
WinEDA_ConfigFrame::WinEDA_ConfigFrame( WinEDA_GerberFrame* parent, WinEDA_ConfigFrame::WinEDA_ConfigFrame( WinEDA_GerberFrame* parent,
const wxPoint& framepos ) : const wxPoint& framepos ) :
wxDialog( parent, -1, wxEmptyString, framepos, wxSize( 300, 180 ), wxDialog( parent, -1, wxEmptyString, framepos, wxSize( 300, 180 ),
wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT ) wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT )
/************************************************************/
{ {
const int LEN_EXT = 100; const int LEN_EXT = 100;
wxString title; wxString title;
...@@ -132,9 +124,7 @@ WinEDA_ConfigFrame::WinEDA_ConfigFrame( WinEDA_GerberFrame* parent, ...@@ -132,9 +124,7 @@ WinEDA_ConfigFrame::WinEDA_ConfigFrame( WinEDA_GerberFrame* parent,
} }
/******************************************************************/
void WinEDA_ConfigFrame::OnOkClick( wxCommandEvent& WXUNUSED (event) ) void WinEDA_ConfigFrame::OnOkClick( wxCommandEvent& WXUNUSED (event) )
/******************************************************************/
{ {
g_DrillFilenameExt = TextDrillExt->GetValue(); g_DrillFilenameExt = TextDrillExt->GetValue();
g_PhotoFilenameExt = TextPhotoExt->GetValue(); g_PhotoFilenameExt = TextPhotoExt->GetValue();
...@@ -144,17 +134,13 @@ void WinEDA_ConfigFrame::OnOkClick( wxCommandEvent& WXUNUSED (event) ) ...@@ -144,17 +134,13 @@ void WinEDA_ConfigFrame::OnOkClick( wxCommandEvent& WXUNUSED (event) )
} }
/******************************************************************/
void WinEDA_ConfigFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) ) void WinEDA_ConfigFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) )
/******************************************************************/
{ {
EndModal( -1 ); EndModal( -1 );
} }
/******************************************************/
void WinEDA_ConfigFrame::SaveCfg( wxCommandEvent& event ) void WinEDA_ConfigFrame::SaveCfg( wxCommandEvent& event )
/******************************************************/
{ {
m_Parent->Update_config(); m_Parent->Update_config();
} }
This diff is collapsed.
/********************************************************/ /**************/
/* Routine de lecture d'un fichier GERBER format RS274X */ /* rs274x.cpp */
/********************************************************/ /**************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -41,9 +41,6 @@ enum RS274X_PARAMETERS { ...@@ -41,9 +41,6 @@ enum RS274X_PARAMETERS {
}; };
/* Local Functions */
/** /**
* Function ReadXCommand * Function ReadXCommand
* reads in two bytes of data and assembles them into an int with the first * reads in two bytes of data and assembles them into an int with the first
...@@ -109,11 +106,9 @@ static double ReadDouble( char*& text ) ...@@ -109,11 +106,9 @@ static double ReadDouble( char*& text )
} }
/****************************************************************************/
bool GERBER::ReadRS274XCommand( WinEDA_GerberFrame* frame, wxDC* DC, bool GERBER::ReadRS274XCommand( WinEDA_GerberFrame* frame, wxDC* DC,
char buff[GERBER_BUFZ], char*& text ) char buff[GERBER_BUFZ], char*& text )
{ {
/****************************************************************************/
bool ok = true; bool ok = true;
int code_command; int code_command;
...@@ -165,12 +160,10 @@ exit: ...@@ -165,12 +160,10 @@ exit:
} }
/*******************************************************************************/
bool GERBER::ExecuteRS274XCommand( int command, bool GERBER::ExecuteRS274XCommand( int command,
char buff[GERBER_BUFZ], char buff[GERBER_BUFZ],
char*& text ) char*& text )
{ {
/*******************************************************************************/
int code; int code;
int xy_seq_len, xy_seq_char; int xy_seq_len, xy_seq_char;
bool ok = TRUE; bool ok = TRUE;
...@@ -216,7 +209,8 @@ bool GERBER::ExecuteRS274XCommand( int command, ...@@ -216,7 +209,8 @@ bool GERBER::ExecuteRS274XCommand( int command,
text++; text++;
break; break;
case 'N': // Sequence code (followed by the number of digits for the X,Y command case 'N': // Sequence code (followed by the number of digits
// for the X,Y command
text++; text++;
xy_seq_char = *text++; xy_seq_char = *text++;
if( (xy_seq_char >= '0') && (xy_seq_char <= '9') ) if( (xy_seq_char >= '0') && (xy_seq_char <= '9') )
...@@ -224,14 +218,16 @@ bool GERBER::ExecuteRS274XCommand( int command, ...@@ -224,14 +218,16 @@ bool GERBER::ExecuteRS274XCommand( int command,
break; break;
case 'X': case 'X':
case 'Y': // Valeurs transmises :2 (really xy_seq_len : FIX ME) digits case 'Y': // Values transmitted :2 (really xy_seq_len : FIX
// ME) digits
{ {
code = *(text++); code = *(text++);
char ctmp = *(text++) - '0'; char ctmp = *(text++) - '0';
if( code == 'X' ) if( code == 'X' )
{ {
m_FmtScale.x = *text - '0'; // = nb chiffres apres la virgule // number of digits after the decimal point
m_FmtLen.x = ctmp + m_FmtScale.x; // = nb total de chiffres m_FmtScale.x = *text - '0';
m_FmtLen.x = ctmp + m_FmtScale.x;
} }
else else
{ {
...@@ -275,13 +271,13 @@ bool GERBER::ExecuteRS274XCommand( int command, ...@@ -275,13 +271,13 @@ bool GERBER::ExecuteRS274XCommand( int command,
{ {
switch( *text ) switch( *text )
{ {
case 'A': // A axis offset in current unit (inch ou mm) case 'A': // A axis offset in current unit (inch or mm)
text++; text++;
fcoord = ReadDouble( text ); fcoord = ReadDouble( text );
m_Offset.x = wxRound( fcoord * conv_scale ); m_Offset.x = wxRound( fcoord * conv_scale );
break; break;
case 'B': // B axis offset in current unit (inch ou mm) case 'B': // B axis offset in current unit (inch or mm)
text++; text++;
fcoord = ReadDouble( text ); fcoord = ReadDouble( text );
m_Offset.y = wxRound( fcoord * conv_scale ); m_Offset.y = wxRound( fcoord * conv_scale );
...@@ -348,7 +344,7 @@ bool GERBER::ExecuteRS274XCommand( int command, ...@@ -348,7 +344,7 @@ bool GERBER::ExecuteRS274XCommand( int command,
if( m_Current_File == 0 ) if( m_Current_File == 0 )
{ {
wxString msg; wxString msg;
msg.Printf( wxT( "fichier <%s> non trouve" ), line ); msg.Printf( wxT( "file <%s> not found." ), line );
DisplayError( NULL, msg, 10 ); DisplayError( NULL, msg, 10 );
ok = FALSE; ok = FALSE;
m_Current_File = m_FilesList[m_FilesPtr]; m_Current_File = m_FilesList[m_FilesPtr];
...@@ -514,10 +510,8 @@ bool GERBER::ExecuteRS274XCommand( int command, ...@@ -514,10 +510,8 @@ bool GERBER::ExecuteRS274XCommand( int command,
} }
/*****************************************************************/
bool GetEndOfBlock( char buff[GERBER_BUFZ], char*& text, FILE* gerber_file ) bool GetEndOfBlock( char buff[GERBER_BUFZ], char*& text, FILE* gerber_file )
{ {
/*****************************************************************/
for( ; ; ) for( ; ; )
{ {
while( (text < buff + GERBER_BUFZ) && *text ) while( (text < buff + GERBER_BUFZ) && *text )
...@@ -541,12 +535,10 @@ bool GetEndOfBlock( char buff[GERBER_BUFZ], char*& text, FILE* gerber_file ) ...@@ -541,12 +535,10 @@ bool GetEndOfBlock( char buff[GERBER_BUFZ], char*& text, FILE* gerber_file )
} }
/*******************************************************************/
bool GERBER::ReadApertureMacro( char buff[GERBER_BUFZ], bool GERBER::ReadApertureMacro( char buff[GERBER_BUFZ],
char*& text, char*& text,
FILE* gerber_file ) FILE* gerber_file )
{ {
/*******************************************************************/
APERTURE_MACRO am; APERTURE_MACRO am;
// read macro name // read macro name
...@@ -648,7 +640,8 @@ bool GERBER::ReadApertureMacro( char buff[GERBER_BUFZ], ...@@ -648,7 +640,8 @@ bool GERBER::ReadApertureMacro( char buff[GERBER_BUFZ],
param.SetValue( ReadDouble( text ) ); param.SetValue( ReadDouble( text ) );
} }
if( i < paramCount ) // maybe some day we can throw an exception and track a line number if( i < paramCount ) // maybe some day we can throw an exception and
// track a line number
printf( "i=%d, insufficient parameters\n", i ); printf( "i=%d, insufficient parameters\n", i );
// there are more parameters to read if this is an AMP_OUTLINE // there are more parameters to read if this is an AMP_OUTLINE
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "wx/statline.h" #include "wx/statline.h"
/* Variables locales */
#define LAYER_UNSELECTED NB_LAYERS #define LAYER_UNSELECTED NB_LAYERS
static int ButtonTable[32]; // Indexes buttons to Gerber layers static int ButtonTable[32]; // Indexes buttons to Gerber layers
...@@ -27,10 +26,6 @@ enum swap_layer_id { ...@@ -27,10 +26,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 +41,6 @@ private: ...@@ -46,7 +41,6 @@ private:
public: public:
// Constructor and destructor
WinEDA_SwapLayerFrame( WinEDA_GerberFrame* parent ); WinEDA_SwapLayerFrame( WinEDA_GerberFrame* parent );
~WinEDA_SwapLayerFrame() {}; ~WinEDA_SwapLayerFrame() {};
...@@ -58,7 +52,7 @@ private: ...@@ -58,7 +52,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 + 31, EVT_COMMAND_RANGE( ID_BUTTON_0, ID_BUTTON_0 + 31,
wxEVT_COMMAND_BUTTON_CLICKED, wxEVT_COMMAND_BUTTON_CLICKED,
...@@ -68,13 +62,12 @@ BEGIN_EVENT_TABLE( WinEDA_SwapLayerFrame, wxDialog ) ...@@ -68,13 +62,12 @@ BEGIN_EVENT_TABLE( WinEDA_SwapLayerFrame, wxDialog )
END_EVENT_TABLE() END_EVENT_TABLE()
/*************************************************************/
int* InstallDialogLayerPairChoice( WinEDA_GerberFrame * parent ) {
/*************************************************************/
/* Install a dialog frame to choose the equivalence /* Install a dialog frame to choose the equivalence
* between gerber layers and pcbnew layers * between gerber layers and pcbnew layers
* return the "lookup table" if ok, or NULL * return the "lookup table" if ok, or NULL
*/ */
int* InstallDialogLayerPairChoice( WinEDA_GerberFrame * parent )
{
WinEDA_SwapLayerFrame* frame = new WinEDA_SwapLayerFrame( parent ); WinEDA_SwapLayerFrame* frame = new WinEDA_SwapLayerFrame( parent );
int ii = frame->ShowModal(); int ii = frame->ShowModal();
...@@ -87,12 +80,10 @@ int* InstallDialogLayerPairChoice( WinEDA_GerberFrame * parent ) { ...@@ -87,12 +80,10 @@ int* InstallDialogLayerPairChoice( WinEDA_GerberFrame * parent ) {
} }
/*************************************************************************/
WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_GerberFrame* parent ) : WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_GerberFrame* parent ) :
wxDialog( parent, -1, _( "Layer selection:" ), wxPoint( -1, -1 ), wxDialog( parent, -1, _( "Layer selection:" ), wxPoint( -1, -1 ),
wxDefaultSize, wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER ) wxDefaultSize, wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER )
{ {
/*************************************************************************/
OuterBoxSizer = NULL; OuterBoxSizer = NULL;
MainBoxSizer = NULL; MainBoxSizer = NULL;
FlexColumnBoxSizer = NULL; FlexColumnBoxSizer = NULL;
...@@ -184,7 +175,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_GerberFrame* parent ) : ...@@ -184,7 +175,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_GerberFrame* parent ) :
// of those items are placed into the left hand column, middle // of those items are placed into the left hand column, middle
// column, and right hand column (respectively) of the Flexgrid // column, and right hand column (respectively) of the Flexgrid
// sizer, and the color of the second text string is set to // sizer, and the color of the second text string is set to
// fushia or blue (to respectively indicate whether the Gerber // fuchsia or blue (to respectively indicate whether the Gerber
// layer has been mapped to a pcbnew layer or is not being // layer has been mapped to a pcbnew layer or is not being
// exported at all). (Experimentation has shown that if a text // exported at all). (Experimentation has shown that if a text
// control is used to depict which pcbnew layer that each Gerber // control is used to depict which pcbnew layer that each Gerber
...@@ -249,7 +240,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_GerberFrame* parent ) : ...@@ -249,7 +240,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_GerberFrame* parent ) :
// Provide another text string to specify which pcbnew layer that this // Provide another text string to specify which pcbnew layer that this
// Gerber layer is initially mapped to, and set the initial text to // Gerber layer is initially mapped to, and set the initial text to
// specify the appropriate pcbnew layer, and set the foreground color // specify the appropriate pcbnew layer, and set the foreground color
// of the text to fushia (to indicate that the layer is being exported). // of the text to fuchsia (to indicate that the layer is being exported).
item_ID = ID_TEXT_0 + ii; item_ID = ID_TEXT_0 + ii;
// When the first of these text strings is being added, determine what // When the first of these text strings is being added, determine what
...@@ -367,7 +358,7 @@ void WinEDA_SwapLayerFrame::OnSelectLayer( wxCommandEvent& event ) ...@@ -367,7 +358,7 @@ void WinEDA_SwapLayerFrame::OnSelectLayer( wxCommandEvent& event )
{ {
layer_list[ii]->SetLabel( ReturnPcbLayerName( jj ) ); layer_list[ii]->SetLabel( ReturnPcbLayerName( jj ) );
// Change the text color to fushia (to highlight // Change the text color to fuchsia (to highlight
// that this layer *is* being exported) // that this layer *is* being exported)
layer_list[ii]->SetForegroundColour( wxColour( 255, 0, 128 ) ); layer_list[ii]->SetForegroundColour( wxColour( 255, 0, 128 ) );
} }
...@@ -375,18 +366,14 @@ void WinEDA_SwapLayerFrame::OnSelectLayer( wxCommandEvent& event ) ...@@ -375,18 +366,14 @@ void WinEDA_SwapLayerFrame::OnSelectLayer( wxCommandEvent& event )
} }
/*********************************************************/
void WinEDA_SwapLayerFrame::OnCancelClick( wxCommandEvent& event ) void WinEDA_SwapLayerFrame::OnCancelClick( wxCommandEvent& event )
/*********************************************************/
{ {
EndModal( -1 ); EndModal( -1 );
} }
/*********************************************************/
void WinEDA_SwapLayerFrame::OnOkClick( wxCommandEvent& event ) void WinEDA_SwapLayerFrame::OnOkClick( wxCommandEvent& event )
{ {
/*********************************************************/
int ii; int ii;
bool AsCmpLayer = false; bool AsCmpLayer = false;
......
...@@ -12,12 +12,8 @@ ...@@ -12,12 +12,8 @@
#include "bitmaps.h" #include "bitmaps.h"
#include "hotkeys.h" #include "hotkeys.h"
/***********************************************/
void WinEDA_GerberFrame::ReCreateMenuBar( void )
/***********************************************/
/* Cree ou reinitialise le menu du haut d'ecran void WinEDA_GerberFrame::ReCreateMenuBar( void )
*/
{ {
wxMenuBar *menuBar = GetMenuBar(); wxMenuBar *menuBar = GetMenuBar();
...@@ -34,7 +30,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void ) ...@@ -34,7 +30,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
FALSE ); FALSE );
filesMenu->Append( ID_APPEND_FILE, _( "Load Gerber File" ), filesMenu->Append( ID_APPEND_FILE, _( "Load Gerber File" ),
_( "Load new Gerber file on currrent layer" ), _( "Load new Gerber file on current layer" ),
FALSE ); FALSE );
filesMenu->Append( ID_MENU_INC_LAYER_AND_APPEND_FILE, filesMenu->Append( ID_MENU_INC_LAYER_AND_APPEND_FILE,
...@@ -79,15 +75,16 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void ) ...@@ -79,15 +75,16 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
// Configuration: // Configuration:
wxMenu* configmenu = new wxMenu; wxMenu* configmenu = new wxMenu;
ADD_MENUITEM_WITH_HELP( configmenu, ID_CONFIG_REQ, _( "&File Ext" ), ADD_MENUITEM_WITH_HELP( configmenu, ID_CONFIG_REQ, _( "&File Ext" ),
_( "Setting Files extension" ), config_xpm ); _( "Set files extensions" ), config_xpm );
ADD_MENUITEM_WITH_HELP( configmenu, ID_COLORS_SETUP, _( "&Colors" ), ADD_MENUITEM_WITH_HELP( configmenu, ID_COLORS_SETUP, _( "&Colors" ),
_( "Select Colors and Display for layers" ), _( "Select colors and display for layers" ),
palette_xpm ); palette_xpm );
ADD_MENUITEM_WITH_HELP( configmenu, ID_OPTIONS_SETUP, _( "&Options" ), ADD_MENUITEM_WITH_HELP( configmenu, ID_OPTIONS_SETUP, _( "&Options" ),
_( " Select general options" ), preference_xpm ); _( "Select general options" ), preference_xpm );
ADD_MENUITEM_WITH_HELP( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP, _( "Display" ), ADD_MENUITEM_WITH_HELP( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP,
_( " Select how items are displayed" ), _( "Display" ),
_( "Select how items are displayed" ),
display_options_xpm ); display_options_xpm );
wxGetApp().AddMenuLanguageList( configmenu ); wxGetApp().AddMenuLanguageList( configmenu );
...@@ -100,14 +97,11 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void ) ...@@ -100,14 +97,11 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
configmenu->AppendSeparator(); configmenu->AppendSeparator();
AddHotkeyConfigMenu( configmenu ); AddHotkeyConfigMenu( configmenu );
// Menu drill ( generation fichiers percage)
/* wxMenu *drill_menu = new wxMenu; /* wxMenu *drill_menu = new wxMenu;
* postprocess_menu->Append(ID_PCB_GEN_DRILL_FILE, "Create &Drill file", * postprocess_menu->Append(ID_PCB_GEN_DRILL_FILE, "Create &Drill file",
* "Gen Drill (EXCELLON] file and/or Drill sheet"); * "Gen Drill (EXCELLON] file and/or Drill sheet");
*/ */
// Menu d'outils divers
wxMenu* miscellaneous_menu = new wxMenu; wxMenu* miscellaneous_menu = new wxMenu;
ADD_MENUITEM_WITH_HELP( miscellaneous_menu, ID_GERBVIEW_SHOW_LIST_DCODES, ADD_MENUITEM_WITH_HELP( miscellaneous_menu, ID_GERBVIEW_SHOW_LIST_DCODES,
_( "&List DCodes" ), _( "&List DCodes" ),
...@@ -141,9 +135,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void ) ...@@ -141,9 +135,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
} }
/***********************************************/
void WinEDA_GerberFrame::ReCreateHToolbar( void ) void WinEDA_GerberFrame::ReCreateHToolbar( void )
/***********************************************/
{ {
int layer = 0; int layer = 0;
GERBER* gerber = NULL; GERBER* gerber = NULL;
...@@ -161,13 +153,15 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void ) ...@@ -161,13 +153,15 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
} }
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
#if !defined(KICAD_AUIMANAGER) #if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*)m_HToolBar ); SetToolBar( (wxToolBar*)m_HToolBar );
#endif #endif
// Set up toolbar // Set up toolbar
m_HToolBar->AddTool( ID_NEW_BOARD, wxEmptyString, m_HToolBar->AddTool( ID_NEW_BOARD, wxEmptyString,
wxBitmap( new_xpm ), wxBitmap( new_xpm ),
_( "New World" ) ); _( "New world" ) );
m_HToolBar->AddTool( ID_LOAD_FILE, wxEmptyString, m_HToolBar->AddTool( ID_LOAD_FILE, wxEmptyString,
wxBitmap( open_xpm ), wxBitmap( open_xpm ),
...@@ -208,7 +202,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void ) ...@@ -208,7 +202,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_GEN_PRINT, wxEmptyString, m_HToolBar->AddTool( ID_GEN_PRINT, wxEmptyString,
wxBitmap( print_button ), wxBitmap( print_button ),
_( "Print World" ) ); _( "Print world" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( _( "Zoom in" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_IN ); msg = AddHotkeyName( _( "Zoom in" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_IN );
...@@ -227,7 +221,8 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void ) ...@@ -227,7 +221,8 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
wxBitmap( zoom_redraw_xpm ), wxBitmap( zoom_redraw_xpm ),
msg ); msg );
msg = AddHotkeyName( _( "Zoom auto" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_AUTO ); msg = AddHotkeyName( _( "Zoom auto" ), s_Gerbview_Hokeys_Descr,
HK_ZOOM_AUTO );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
wxBitmap( zoom_auto_xpm ), wxBitmap( zoom_auto_xpm ),
msg ); msg );
...@@ -256,6 +251,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void ) ...@@ -256,6 +251,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
choices.Clear(); choices.Clear();
choices.Add( _( "No tool" ) ); choices.Add( _( "No tool" ) );
for( ii = 0; ii < MAX_TOOLS; ii++ ) for( ii = 0; ii < MAX_TOOLS; ii++ )
{ {
wxString msg; wxString msg;
...@@ -277,12 +273,10 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void ) ...@@ -277,12 +273,10 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
} }
/**********************************************/
void WinEDA_GerberFrame::ReCreateVToolbar( void )
/**********************************************/
/** /**
create or update the right vertical toolbar * Create or update the right vertical toolbar
*/ */
void WinEDA_GerberFrame::ReCreateVToolbar( void )
{ {
if( m_VToolBar ) if( m_VToolBar )
return; return;
...@@ -298,11 +292,11 @@ create or update the right vertical toolbar ...@@ -298,11 +292,11 @@ create or update the right vertical toolbar
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_COMPONENT_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_COMPONENT_BUTT, wxEmptyString,
wxBitmap( component_button ), wxBitmap( component_button ),
_( "Add Flashes" ) ); _( "Add flashes" ) );
m_VToolBar->AddTool( ID_BUS_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_BUS_BUTT, wxEmptyString,
wxBitmap( bus_button ), wxBitmap( bus_button ),
_( "Add Lines" ) ); _( "Add lines" ) );
m_VToolBar->AddTool( ID_JUNCTION_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_JUNCTION_BUTT, wxEmptyString,
wxBitmap( junction_xpm ), wxBitmap( junction_xpm ),
...@@ -311,7 +305,7 @@ create or update the right vertical toolbar ...@@ -311,7 +305,7 @@ create or update the right vertical toolbar
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_ADD_TEXT_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_ADD_TEXT_BUTT, wxEmptyString,
wxBitmap( tool_text_xpm ), wxBitmap( tool_text_xpm ),
_( "Add Text" ) ); _( "Add text" ) );
#endif #endif
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
...@@ -324,52 +318,51 @@ create or update the right vertical toolbar ...@@ -324,52 +318,51 @@ create or update the right vertical toolbar
} }
/************************************************/
void WinEDA_GerberFrame::ReCreateOptToolbar( void )
/************************************************/
/** /**
create or update the left vertical toolbar (option toolbar * Create or update the left vertical toolbar (option toolbar
*/ */
void WinEDA_GerberFrame::ReCreateOptToolbar( void )
{ {
if( m_OptionsToolBar ) if( m_OptionsToolBar )
return; return;
// creation du tool bar options // creation of tool bar options
m_OptionsToolBar = new WinEDA_Toolbar( TOOLBAR_OPTION, this, m_OptionsToolBar = new WinEDA_Toolbar( TOOLBAR_OPTION, this,
ID_OPT_TOOLBAR, FALSE ); ID_OPT_TOOLBAR, FALSE );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString,
wxBitmap( grid_xpm ), wxBitmap( grid_xpm ),
_( "Display Grid OFF" ), wxITEM_CHECK ); _( "Turn grid off" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
wxBitmap( polar_coord_xpm ), wxBitmap( polar_coord_xpm ),
_( "Display Polar Coord ON" ), wxITEM_CHECK ); _( "Turn polar coordinate on" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
wxBitmap( unit_inch_xpm ), wxBitmap( unit_inch_xpm ),
_( "Units in inches" ), wxITEM_CHECK ); _( "Set units to inches" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
wxBitmap( unit_mm_xpm ), wxBitmap( unit_mm_xpm ),
_( "Units in millimeters" ), wxITEM_CHECK ); _( "Set units to millimeters" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
wxBitmap( cursor_shape_xpm ), wxBitmap( cursor_shape_xpm ),
_( "Change Cursor Shape" ), wxITEM_CHECK ); _( "Change cursor shape" ), wxITEM_CHECK );
m_OptionsToolBar->AddSeparator(); m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
wxBitmap( pad_sketch_xpm ), wxBitmap( pad_sketch_xpm ),
_( "Show Spots in Sketch Mode" ), wxITEM_CHECK ); _( "Show spots in sketch mode" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, wxEmptyString,
wxBitmap( showtrack_xpm ), wxBitmap( showtrack_xpm ),
_( "Show Lines in Sketch Mode" ), wxITEM_CHECK ); _( "Show lines in sketch mode" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, wxEmptyString,
wxBitmap( opt_show_polygon_xpm ), wxBitmap( opt_show_polygon_xpm ),
_( "Show Polygons in Sketch Mode" ), wxITEM_CHECK ); _( "Show polygons in sketch mode" ),
wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_DCODES, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_DCODES, wxEmptyString,
wxBitmap( show_dcodenumber_xpm ), wxBitmap( show_dcodenumber_xpm ),
......
This diff is collapsed.
...@@ -58,7 +58,7 @@ public: ...@@ -58,7 +58,7 @@ public:
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
int BestZoom(); // Retourne le meilleur zoom int BestZoom();
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ); void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
...@@ -176,7 +176,6 @@ public: ...@@ -176,7 +176,6 @@ public:
void CopyDCodesSizeToItems(); void CopyDCodesSizeToItems();
void Liste_D_Codes( wxDC* DC ); void Liste_D_Codes( wxDC* DC );
/* Fonctions specifiques */
void Trace_Gerber( wxDC* DC, int draw_mode, int printmasklayer ); void Trace_Gerber( wxDC* DC, int draw_mode, int printmasklayer );
// Copper texts // Copper texts
......
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