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
Hide 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"
...
...
@@ -14,7 +14,7 @@
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
();
...
...
@@ -23,7 +23,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
//
Arret des commandes en cours
//
If an edition is in progress, stop it
if
(
DrawPanel
->
ManageCurseur
&&
DrawPanel
->
ForceCloseManageCurseur
)
{
DrawPanel
->
ForceCloseManageCurseur
(
DrawPanel
,
&
dc
);
...
...
@@ -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
* retourne:
* 0 si fichier non lu ( annulation de commande ... )
* 1 si OK
/**
* Read a board file
* @param FullFileName = file name. If empty, a file name will be asked
* @return 0 if fails or abort, 1 if OK
*/
{
int
ii
;
...
...
@@ -250,10 +249,10 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC* DC, boo
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
upperTxt
;
wxString
lowerTxt
;
...
...
@@ -283,38 +282,40 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
else
GetScreen
()
->
m_FileName
=
FileName
;
/*
mise a jour date si modifications
*/
/*
If changes are made, update the board date
*/
if
(
GetScreen
()
->
IsModify
()
)
{
GetScreen
()
->
m_Date
=
GenDate
();
}
/*
Calcul du nom du fichier a creer
*/
/*
Get the filename
*/
FullFileName
=
MakeFileName
(
wxEmptyString
,
GetScreen
()
->
m_FileName
,
PcbExtBuffer
);
/*
Calcul du nom du fichier de sauvegard
e */
old_n
ame
=
FullFileName
;
ChangeFileNameExt
(
old_n
ame
,
wxT
(
".000"
)
);
/*
Get the backup file nam
e */
BackupFileN
ame
=
FullFileName
;
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
)
)
{
/*
conversion en *.000 de l'ancien fichier
*/
wxRemoveFile
(
old_name
);
/* S'il y a une ancienne sauvegarde
*/
if
(
!
wxRenameFile
(
FullFileName
,
old_n
ame
)
)
/*
rename the "old" file" from xxx.brd to xxx.000
*/
wxRemoveFile
(
BackupFileName
);
/* Remove the old file xxx.000 (if exists)
*/
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
);
saveok
=
FALSE
;
}
}
else
{
old_n
ame
=
wxEmptyString
;
BackupFileN
ame
=
wxEmptyString
;
saveok
=
FALSE
;
}
/*
Sauvegarde de l'ancien fichier
*/
/*
Create the file
*/
dest
=
wxFopen
(
FullFileName
,
wxT
(
"wt"
)
);
if
(
dest
==
0
)
{
...
...
@@ -332,12 +333,12 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
fclose
(
dest
);
}
/*
Affichage des fichiers cre
es: */
/*
Display the file nam
es: */
MsgPanel
->
EraseMsgBox
();
if
(
saveok
)
{
upperTxt
=
_
(
"Backup file: "
)
+
old_n
ame
;
upperTxt
=
_
(
"Backup file: "
)
+
BackupFileN
ame
;
}
if
(
dest
)
...
...
@@ -348,7 +349,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
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
();
return
TRUE
;
...
...
share/zoom.cpp
View file @
0bcc4d34
...
...
@@ -34,28 +34,24 @@
#include "id.h"
/* Fonctions locales: */
/**************************************************/
void
WinEDA_DrawFrame
::
Recadre_Trace
(
bool
ToMouse
)
/**************************************************/
/*
Calcule les offsets de trace.
*
Les offsets sont ajusts a un multiple du pas de grille
*
si ToMouse == TRUE, le curseur souris (curseur "systeme") est replace
*
en position curseur graphique (curseur kica
d)
/*
* Compute draw offset (scroll bars and draw parameters)
*
in order to have the current graphic cursor position at the screen center
*
@param ToMouse if TRUE, the mouse cursor is moved
*
to the graphic cursor position (which is usually on gri
d)
*
* Note: Mac OS ** does not ** allow moving mouse cursor by program.
*/
{
/* decalages a apporter au trace en coordonnees ecran */
PutOnGrid
(
&
m_CurrentScreen
->
m_Curseur
);
AdjustScrollBars
();
ReDrawPanel
();
/*
Place le curseur souris sur le curseur SCHEMA
*/
/*
Move the mouse cursor to the on grid graphic cursor position
*/
if
(
ToMouse
==
TRUE
)
DrawPanel
->
MouseToCursorSchema
();
}
...
...
@@ -64,7 +60,9 @@ void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse )
/************************************************/
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
;
...
...
@@ -102,8 +100,7 @@ void WinEDA_DrawFrame::PutOnGrid( wxPoint* coord )
void
WinEDA_DrawFrame
::
Zoom_Automatique
(
bool
move_mouse_cursor
)
/**************************************************************/
/* Affiche le Schema au meilleur zoom au meilleur centrage pour le dessin
* de facon a avoir toute la feuille affichee a l'ecran
/** Redraw the screen with the zoom level which shows all the page or the board
*/
{
int
bestzoom
;
...
...
@@ -118,8 +115,9 @@ void WinEDA_DrawFrame::Zoom_Automatique( bool move_mouse_cursor )
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
* @param Rect = selected area th show after zooming
*/
{
int
ii
,
jj
;
...
...
@@ -146,12 +144,10 @@ void WinEDA_DrawFrame::Window_Zoom( EDA_Rect& Rect )
void
WinEDA_DrawPanel
::
Process_Popup_Zoom
(
wxCommandEvent
&
event
)
/*****************************************************************/
/* Gere les commandes de zoom appeles par le menu Popup
* Toute autre commande est transmise a Parent->Process_Special_Functions(event)
/* Handle only the Popup command zoom and grid level
*/
{
int
id
=
event
.
GetId
();
wxClientDC
dc
(
this
);
switch
(
id
)
{
...
...
@@ -454,9 +450,8 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu )
void
WinEDA_DrawFrame
::
Process_Zoom
(
wxCommandEvent
&
event
)
/**********************************************************/
/* fonction de traitement des boutons de Zoom.
* Appelle simplement la fonction de traitement du Zoom de la
* fenetre active.
/* Handle the Zoom commands from the zoom tools in the main toolbar.
* Calls the active window Zoom function
*/
{
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