Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
0bcc4d34
Commit
0bcc4d34
authored
Oct 29, 2007
by
CHARRAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some comment translations into English
parent
d5d16186
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
47 deletions
+43
-47
files.cpp
pcbnew/files.cpp
+29
-28
zoom.cpp
share/zoom.cpp
+14
-19
No files found.
pcbnew/files.cpp
View file @
0bcc4d34
/***************************************
************
/
/***************************************/
/*
Files.cpp: Lecture / Sauvegarde des fichiers PCB
*/
/*
files.cpp: read / write board files
*/
/***************************************
************
/
/***************************************/
#include "fctsys.h"
#include "fctsys.h"
...
@@ -14,7 +14,7 @@
...
@@ -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 fichier
s
/*
Handle the read/write file command
s
*/
*/
{
{
int
id
=
event
.
GetId
();
int
id
=
event
.
GetId
();
...
@@ -23,7 +23,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
...
@@ -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
);
...
@@ -122,14 +122,13 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
...
@@ -122,14 +122,13 @@ 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
...
@@ -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_n
ame
;
wxString
BackupFileN
ame
;
wxString
FullFileName
;
wxString
FullFileName
;
wxString
upperTxt
;
wxString
upperTxt
;
wxString
lowerTxt
;
wxString
lowerTxt
;
...
@@ -283,38 +282,40 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
...
@@ -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 sauvegard
e */
/*
Get the backup file nam
e */
old_n
ame
=
FullFileName
;
BackupFileN
ame
=
FullFileName
;
ChangeFileNameExt
(
old_n
ame
,
wxT
(
".000"
)
);
ChangeFileNameExt
(
BackupFileN
ame
,
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_n
ame
)
)
if
(
!
wxRenameFile
(
FullFileName
,
BackupFileN
ame
)
)
{
{
msg
=
_
(
"Warning: unable to create bakfile "
)
+
old_n
ame
;
msg
=
_
(
"Warning: unable to create bakfile "
)
+
BackupFileN
ame
;
DisplayError
(
this
,
msg
,
15
);
DisplayError
(
this
,
msg
,
15
);
saveok
=
FALSE
;
saveok
=
FALSE
;
}
}
}
}
else
else
{
{
old_n
ame
=
wxEmptyString
;
BackupFileN
ame
=
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 )
...
@@ -332,12 +333,12 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
fclose
(
dest
);
fclose
(
dest
);
}
}
/*
Affichage des fichiers cre
es: */
/*
Display the file nam
es: */
MsgPanel
->
EraseMsgBox
();
MsgPanel
->
EraseMsgBox
();
if
(
saveok
)
if
(
saveok
)
{
{
upperTxt
=
_
(
"Backup file: "
)
+
old_n
ame
;
upperTxt
=
_
(
"Backup file: "
)
+
BackupFileN
ame
;
}
}
if
(
dest
)
if
(
dest
)
...
@@ -348,7 +349,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
...
@@ -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
;
...
...
share/zoom.cpp
View file @
0bcc4d34
...
@@ -34,28 +34,24 @@
...
@@ -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 ajusts 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 kica
d)
*
to the graphic cursor position (which is usually on gri
d)
*
*
* 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 )
...
@@ -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 )
...
@@ -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 )
...
@@ -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 )
...
@@ -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 appeles 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 )
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment