some comment translations into English
This commit is contained in:
parent
d5d16186a6
commit
0bcc4d34b8
|
@ -1,6 +1,6 @@
|
||||||
/***************************************************/
|
/***************************************/
|
||||||
/* Files.cpp: Lecture / Sauvegarde des fichiers PCB */
|
/* files.cpp: read / write board files */
|
||||||
/***************************************************/
|
/***************************************/
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
|
void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
|
||||||
/****************************************************/
|
/****************************************************/
|
||||||
|
|
||||||
/* Gestion generale des commandes de lecture de fichiers
|
/* Handle the read/write file commands
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int id = event.GetId();
|
int id = event.GetId();
|
||||||
|
@ -23,7 +23,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
|
||||||
|
|
||||||
DrawPanel->PrepareGraphicContext( &dc );
|
DrawPanel->PrepareGraphicContext( &dc );
|
||||||
|
|
||||||
// Arret des commandes en cours
|
// If an edition is in progress, stop it
|
||||||
if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur )
|
if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur )
|
||||||
{
|
{
|
||||||
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
|
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
|
||||||
|
@ -125,11 +125,10 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
|
||||||
int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC * DC, bool Append )
|
int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC * DC, bool Append )
|
||||||
/******************************************************************************************/
|
/******************************************************************************************/
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Lecture d'un fichier PCB, le nom etant dans PcbNameBuffer.s
|
* Read a board file
|
||||||
* retourne:
|
* @param FullFileName = file name. If empty, a file name will be asked
|
||||||
* 0 si fichier non lu ( annulation de commande ... )
|
* @return 0 if fails or abort, 1 if OK
|
||||||
* 1 si OK
|
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int ii;
|
int ii;
|
||||||
|
@ -250,10 +249,10 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC* DC, boo
|
||||||
bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
|
bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
|
|
||||||
/* Sauvegarde du fichier PCB en format ASCII
|
/* Write the board file
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
wxString old_name;
|
wxString BackupFileName;
|
||||||
wxString FullFileName;
|
wxString FullFileName;
|
||||||
wxString upperTxt;
|
wxString upperTxt;
|
||||||
wxString lowerTxt;
|
wxString lowerTxt;
|
||||||
|
@ -283,38 +282,40 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
|
||||||
else
|
else
|
||||||
GetScreen()->m_FileName = FileName;
|
GetScreen()->m_FileName = FileName;
|
||||||
|
|
||||||
/* mise a jour date si modifications */
|
/* If changes are made, update the board date */
|
||||||
if( GetScreen()->IsModify() )
|
if( GetScreen()->IsModify() )
|
||||||
{
|
{
|
||||||
GetScreen()->m_Date = GenDate();
|
GetScreen()->m_Date = GenDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calcul du nom du fichier a creer */
|
/* Get the filename */
|
||||||
FullFileName = MakeFileName( wxEmptyString, GetScreen()->m_FileName, PcbExtBuffer );
|
FullFileName = MakeFileName( wxEmptyString, GetScreen()->m_FileName, PcbExtBuffer );
|
||||||
|
|
||||||
/* Calcul du nom du fichier de sauvegarde */
|
/* Get the backup file name */
|
||||||
old_name = FullFileName;
|
BackupFileName = FullFileName;
|
||||||
ChangeFileNameExt( old_name, wxT( ".000" ) );
|
ChangeFileNameExt( BackupFileName, wxT( ".000" ) );
|
||||||
|
|
||||||
/* Changement du nom de l'ancien fichier s'il existe */
|
/* If an old backup file exists, delete it.
|
||||||
|
if an old board file existes, rename it to the backup file name
|
||||||
|
*/
|
||||||
if( wxFileExists( FullFileName ) )
|
if( wxFileExists( FullFileName ) )
|
||||||
{
|
{
|
||||||
/* conversion en *.000 de l'ancien fichier */
|
/* rename the "old" file" from xxx.brd to xxx.000 */
|
||||||
wxRemoveFile( old_name ); /* S'il y a une ancienne sauvegarde */
|
wxRemoveFile( BackupFileName ); /* Remove the old file xxx.000 (if exists) */
|
||||||
if( !wxRenameFile( FullFileName, old_name ) )
|
if( !wxRenameFile( FullFileName, BackupFileName ) )
|
||||||
{
|
{
|
||||||
msg = _( "Warning: unable to create bakfile " ) + old_name;
|
msg = _( "Warning: unable to create bakfile " ) + BackupFileName;
|
||||||
DisplayError( this, msg, 15 );
|
DisplayError( this, msg, 15 );
|
||||||
saveok = FALSE;
|
saveok = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
old_name = wxEmptyString;
|
BackupFileName = wxEmptyString;
|
||||||
saveok = FALSE;
|
saveok = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sauvegarde de l'ancien fichier */
|
/* Create the file */
|
||||||
dest = wxFopen( FullFileName, wxT( "wt" ) );
|
dest = wxFopen( FullFileName, wxT( "wt" ) );
|
||||||
if( dest == 0 )
|
if( dest == 0 )
|
||||||
{
|
{
|
||||||
|
@ -332,12 +333,12 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
|
||||||
fclose( dest );
|
fclose( dest );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Affichage des fichiers crees: */
|
/* Display the file names: */
|
||||||
MsgPanel->EraseMsgBox();
|
MsgPanel->EraseMsgBox();
|
||||||
|
|
||||||
if( saveok )
|
if( saveok )
|
||||||
{
|
{
|
||||||
upperTxt = _( "Backup file: " ) + old_name;
|
upperTxt = _( "Backup file: " ) + BackupFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( dest )
|
if( dest )
|
||||||
|
@ -348,7 +349,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
|
||||||
|
|
||||||
Affiche_1_Parametre( this, 1, upperTxt, lowerTxt, CYAN );
|
Affiche_1_Parametre( this, 1, upperTxt, lowerTxt, CYAN );
|
||||||
|
|
||||||
g_SaveTime = time( NULL ); /* Reset delai pour sauvegarde automatique */
|
g_SaveTime = time( NULL ); /* Reset timer for the automatic saving */
|
||||||
|
|
||||||
GetScreen()->ClrModify();
|
GetScreen()->ClrModify();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -34,28 +34,24 @@
|
||||||
#include "id.h"
|
#include "id.h"
|
||||||
|
|
||||||
|
|
||||||
/* Fonctions locales: */
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************/
|
/**************************************************/
|
||||||
void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse )
|
void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse )
|
||||||
/**************************************************/
|
/**************************************************/
|
||||||
|
|
||||||
/* Calcule les offsets de trace.
|
/** Compute draw offset (scroll bars and draw parameters)
|
||||||
* Les offsets sont ajustés a un multiple du pas de grille
|
* in order to have the current graphic cursor position at the screen center
|
||||||
* si ToMouse == TRUE, le curseur souris (curseur "systeme") est replace
|
* @param ToMouse if TRUE, the mouse cursor is moved
|
||||||
* en position curseur graphique (curseur kicad)
|
* to the graphic cursor position (which is usually on grid)
|
||||||
*
|
*
|
||||||
* Note: Mac OS ** does not ** allow moving mouse cursor by program.
|
* Note: Mac OS ** does not ** allow moving mouse cursor by program.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
/* decalages a apporter au trace en coordonnees ecran */
|
|
||||||
PutOnGrid( &m_CurrentScreen->m_Curseur );
|
PutOnGrid( &m_CurrentScreen->m_Curseur );
|
||||||
AdjustScrollBars();
|
AdjustScrollBars();
|
||||||
|
|
||||||
ReDrawPanel();
|
ReDrawPanel();
|
||||||
|
|
||||||
/* Place le curseur souris sur le curseur SCHEMA*/
|
/* Move the mouse cursor to the on grid graphic cursor position */
|
||||||
if( ToMouse == TRUE )
|
if( ToMouse == TRUE )
|
||||||
DrawPanel->MouseToCursorSchema();
|
DrawPanel->MouseToCursorSchema();
|
||||||
}
|
}
|
||||||
|
@ -64,7 +60,9 @@ void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse )
|
||||||
/************************************************/
|
/************************************************/
|
||||||
void WinEDA_DrawFrame::PutOnGrid( wxPoint* coord )
|
void WinEDA_DrawFrame::PutOnGrid( wxPoint* coord )
|
||||||
/************************************************/
|
/************************************************/
|
||||||
/* retourne la valeur de la coordonnee coord sur le point de grille le plus proche */
|
/** Adjust the coordinate to the nearest grig value
|
||||||
|
* @param coord = coordinate to adjust
|
||||||
|
*/
|
||||||
{
|
{
|
||||||
double ftmp;
|
double ftmp;
|
||||||
|
|
||||||
|
@ -102,8 +100,7 @@ void WinEDA_DrawFrame::PutOnGrid( wxPoint* coord )
|
||||||
void WinEDA_DrawFrame::Zoom_Automatique( bool move_mouse_cursor )
|
void WinEDA_DrawFrame::Zoom_Automatique( bool move_mouse_cursor )
|
||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
|
|
||||||
/* Affiche le Schema au meilleur zoom au meilleur centrage pour le dessin
|
/** Redraw the screen with the zoom level which shows all the page or the board
|
||||||
* de facon a avoir toute la feuille affichee a l'ecran
|
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int bestzoom;
|
int bestzoom;
|
||||||
|
@ -118,8 +115,9 @@ void WinEDA_DrawFrame::Zoom_Automatique( bool move_mouse_cursor )
|
||||||
void WinEDA_DrawFrame::Window_Zoom( EDA_Rect& Rect )
|
void WinEDA_DrawFrame::Window_Zoom( EDA_Rect& Rect )
|
||||||
/*************************************************/
|
/*************************************************/
|
||||||
|
|
||||||
/* Compute the zoom factor and the new draw offset to draw the
|
/** Compute the zoom factor and the new draw offset to draw the
|
||||||
* selected area (Rect) in full window screen
|
* selected area (Rect) in full window screen
|
||||||
|
* @param Rect = selected area th show after zooming
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int ii, jj;
|
int ii, jj;
|
||||||
|
@ -146,12 +144,10 @@ void WinEDA_DrawFrame::Window_Zoom( EDA_Rect& Rect )
|
||||||
void WinEDA_DrawPanel::Process_Popup_Zoom( wxCommandEvent& event )
|
void WinEDA_DrawPanel::Process_Popup_Zoom( wxCommandEvent& event )
|
||||||
/*****************************************************************/
|
/*****************************************************************/
|
||||||
|
|
||||||
/* Gere les commandes de zoom appelées par le menu Popup
|
/* Handle only the Popup command zoom and grid level
|
||||||
* Toute autre commande est transmise a Parent->Process_Special_Functions(event)
|
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int id = event.GetId();
|
int id = event.GetId();
|
||||||
wxClientDC dc( this );
|
|
||||||
|
|
||||||
switch( id )
|
switch( id )
|
||||||
{
|
{
|
||||||
|
@ -454,9 +450,8 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu )
|
||||||
void WinEDA_DrawFrame::Process_Zoom( wxCommandEvent& event )
|
void WinEDA_DrawFrame::Process_Zoom( wxCommandEvent& event )
|
||||||
/**********************************************************/
|
/**********************************************************/
|
||||||
|
|
||||||
/* fonction de traitement des boutons de Zoom.
|
/* Handle the Zoom commands from the zoom tools in the main toolbar.
|
||||||
* Appelle simplement la fonction de traitement du Zoom de la
|
* Calls the active window Zoom function
|
||||||
* fenetre active.
|
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int id = event.GetId();
|
int id = event.GetId();
|
||||||
|
|
Loading…
Reference in New Issue