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
34909473
Commit
34909473
authored
Sep 19, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eeschema: code cleaning
parent
bf688ea1
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
295 additions
and
271 deletions
+295
-271
class_library.h
eeschema/class_library.h
+12
-6
class_pin.cpp
eeschema/class_pin.cpp
+11
-2
eelibs_draw_components.cpp
eeschema/eelibs_draw_components.cpp
+4
-8
general.h
eeschema/general.h
+143
-136
libarch.cpp
eeschema/libarch.cpp
+7
-6
libedit.cpp
eeschema/libedit.cpp
+4
-4
libframe.cpp
eeschema/libframe.cpp
+1
-1
protos.h
eeschema/protos.h
+0
-19
savelib.cpp
eeschema/savelib.cpp
+82
-82
schframe.cpp
eeschema/schframe.cpp
+31
-7
No files found.
eeschema/class_library.h
View file @
34909473
...
...
@@ -87,14 +87,12 @@ public:
}
/**
* Function SaveLibrary
* writes the data structures for this object out to 2 FILE in "*.lib" and ".dcm" format.
* the main file (.lib) is the library content (set of components)
* the second file (.dcm)is the auxiliary file that contents the keywords and description for components)
* @param FullFileName the new full filename (*.lib).
* Function SaveDoc
* writes the doc info out to a FILE in "*.dcm" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
Library
(
const
wxString
&
FullFileNam
e
);
bool
Save
Doc
(
FILE
*
aFil
e
);
};
...
...
@@ -131,6 +129,14 @@ public:
~
EDA_LibComponentStruct
();
void
SortDrawItems
();
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.lib" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
);
};
...
...
eeschema/class_pin.cpp
View file @
34909473
...
...
@@ -18,8 +18,17 @@ void LibDrawPin::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffs
int
aDrawMode
,
void
*
aData
,
int
aTransformMatrix
[
2
][
2
]
)
/**********************************************************************************************/
{
if
(
(
m_Attributs
&
PINNOTDRAW
)
&&
!
g_ShowAllPins
)
return
;
// Invisibles pins are only drawn on request.
// But in libedit they are drawn in g_InvisibleItemColor because we must see them
if
(
(
m_Attributs
&
PINNOTDRAW
)
)
{
if
(
g_EDA_Appl
->
m_LibeditFrame
&&
g_EDA_Appl
->
m_LibeditFrame
->
IsActive
()
)
aColor
=
g_InvisibleItemColor
;
else
if
(
!
g_ShowAllPins
)
return
;
}
EDA_LibComponentStruct
*
Entry
=
(
(
DrawPinPrms
*
)
aData
)
->
m_Entry
;
bool
DrawPinText
=
(
(
DrawPinPrms
*
)
aData
)
->
m_DrawPinText
;
...
...
eeschema/eelibs_draw_components.cpp
View file @
34909473
...
...
@@ -13,11 +13,7 @@
#include "trigo.h"
#include "protos.h"
#define UNVISIBLE_COLOR DARKGRAY
//#define DRAW_ARC_WITH_ANGLE // Used to draw arcs
//#define DRAW_ARC_WITH_ANGLE // Used to select function to draw arcs
/* Local functions */
...
...
@@ -129,7 +125,7 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
if
(
Color
>=
0
)
color
=
Color
;
else
color
=
UNVISIBLE_COLOR
;
color
=
g_InvisibleItemColor
;
}
else
color
=
Color
;
...
...
@@ -146,7 +142,7 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
if
(
Color
>=
0
)
color
=
Color
;
else
color
=
UNVISIBLE_COLOR
;
color
=
g_InvisibleItemColor
;
}
else
color
=
Color
;
...
...
@@ -164,7 +160,7 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
if
(
Color
>=
0
)
color
=
Color
;
else
color
=
UNVISIBLE_COLOR
;
color
=
g_InvisibleItemColor
;
}
else
color
=
Color
;
Field
->
Draw
(
panel
,
DC
,
aOffset
,
color
,
DrawMode
,
NULL
,
TransMat
);
...
...
eeschema/general.h
View file @
34909473
This diff is collapsed.
Click to expand it.
eeschema/libarch.cpp
View file @
34909473
...
...
@@ -60,7 +60,7 @@ const wxChar * Text;
{
Text
=
List
[
ii
].
m_Comp
->
m_ChipName
.
GetData
();
Entry
=
FindLibPart
(
Text
,
wxEmptyString
,
FIND_ROOT
);
ListEntry
[
ii
]
=
Entry
;
// = NULL
si Composant non trouv� en librairie
ListEntry
[
ii
]
=
Entry
;
// = NULL
component not found
}
MyFree
(
List
);
...
...
@@ -90,21 +90,22 @@ const wxChar * Text;
if
(
DocFile
)
fprintf
(
DocFile
,
"%s %s
\n
"
,
DOCFILE_IDENT
,
DateAndTime
(
Line
));
/*
Generation des elements
*/
/*
Save components in file
*/
for
(
ii
=
0
;
ii
<
NbItems
;
ii
++
)
{
if
(
ListEntry
[
ii
]
==
NULL
)
//
Composant non trouv� en librairie
if
(
ListEntry
[
ii
]
==
NULL
)
//
Not found in lib
{
continue
;
}
if
(
(
ii
==
0
)
||
(
ListEntry
[
ii
-
1
]
!=
ListEntry
[
ii
]
)
)
{
WriteOneLibEntry
(
ArchiveFile
,
ListEntry
[
ii
]);
if
(
DocFile
)
WriteOneDocLibEntry
(
DocFile
,
ListEntry
[
ii
]);
if
(
ListEntry
[
ii
]
->
Type
==
ROOT
)
// Must be always true, but just in case
ListEntry
[
ii
]
->
Save
(
ArchiveFile
);
if
(
DocFile
)
ListEntry
[
ii
]
->
SaveDoc
(
DocFile
);
}
}
/* Generation fin de fichier */
fprintf
(
ArchiveFile
,
"#
\n
#EndLibrary
\n
"
);
fclose
(
ArchiveFile
);
...
...
eeschema/libedit.cpp
View file @
34909473
...
...
@@ -85,7 +85,7 @@ wxString msg;
wxString
CmpName
;
EDA_LibComponentStruct
*
LibEntry
=
NULL
;
if
(
ScreenLib
->
IsModify
()
)
if
(
g_
ScreenLib
->
IsModify
()
)
{
if
(
!
IsOK
(
this
,
_
(
"Current Part not saved.
\n
Continue?"
)
)
)
return
FALSE
;
}
...
...
@@ -96,7 +96,7 @@ EDA_LibComponentStruct *LibEntry = NULL;
i
=
GetNameOfPartToLoad
(
this
,
CurrentLib
,
CmpName
);
if
(
i
==
0
)
return
FALSE
;
ScreenLib
->
ClrModify
();
g_
ScreenLib
->
ClrModify
();
CurrentDrawItem
=
NULL
;
// Effacement ancien composant affich�
if
(
CurrentLibEntry
)
...
...
@@ -166,7 +166,7 @@ const wxChar * CmpName, *RootName = NULL;
BuildAliasData
(
Library
,
CurrentLibEntry
);
ScreenLib
->
ClrModify
();
g_
ScreenLib
->
ClrModify
();
g_AsDeMorgan
=
0
;
if
(
LookForConvertPart
(
CurrentLibEntry
)
>
1
)
g_AsDeMorgan
=
1
;
...
...
@@ -564,7 +564,7 @@ bool NewCmp = TRUE;
}
CurrentLib
->
m_Modified
=
1
;
ScreenLib
->
ClrModify
();
g_
ScreenLib
->
ClrModify
();
PQCompFunc
((
PQCompFuncType
)
LibraryEntryCompare
);
...
...
eeschema/libframe.cpp
View file @
34909473
...
...
@@ -71,7 +71,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
// Give an icon
SetIcon
(
wxIcon
(
libedit_xpm
)
);
SetBaseScreen
(
ScreenLib
);
SetBaseScreen
(
g_
ScreenLib
);
GetSettings
();
SetSize
(
m_FramePos
.
x
,
m_FramePos
.
y
,
m_FrameSize
.
x
,
m_FrameSize
.
y
);
if
(
DrawPanel
)
...
...
eeschema/protos.h
View file @
34909473
...
...
@@ -59,10 +59,6 @@ void DrawLibraryDrawStruct(WinEDA_DrawPanel * aPanel, wxDC * aDC,
bool
MapAngles
(
int
*
Angle1
,
int
*
Angle2
,
int
TransMat
[
2
][
2
]);
/**************/
/* EELIBS_DRAW_COMPONENTS.CPP */
/**************/
EDA_LibComponentStruct
*
Read_Component_Definition
(
WinEDA_DrawFrame
*
frame
,
char
*
Line
,
FILE
*
f
,
int
*
LineNum
);
/* Routine to Read a DEF/ENDDEF part entry from given open file. */
...
...
@@ -229,22 +225,12 @@ LibEDA_BaseStruct * CopyDrawEntryStruct( wxWindow * frame, LibEDA_BaseStruct * D
Retourne:
Pointeur sur la structure creee (ou NULL si impossible) */
int
WriteOneLibEntry
(
FILE
*
ExportFile
,
EDA_LibComponentStruct
*
LibEntry
);
/* Routine d'ecriture du composant pointe par LibEntry
dans le fichier ExportFile( qui doit etre deja ouvert)
return: FALSE si Ok, TRUE si err write */
EDA_LibComponentStruct
*
CopyLibEntryStruct
(
wxWindow
*
frame
,
EDA_LibComponentStruct
*
OldEntry
);
/* Routine de copie d'une partlib
Parametres d'entree: pointeur sur la structure de depart
Parametres de sortie: pointeur sur la structure creee */
int
WriteOneDocLibEntry
(
FILE
*
ExportFile
,
EDA_LibComponentStruct
*
LibEntry
);
/* Routine d'ecriture de la doc du composant pointe par LibEntry
dans le fichier ExportFile( qui doit etre deja ouvert)
return: 0 si Ok
1 si err write */
/***************/
/* SYMBEDIT.CPP */
...
...
@@ -254,11 +240,6 @@ void SuppressDuplicateDrawItem(EDA_LibComponentStruct * LibEntry);
frequente lorsque l'on charge des symboles predessines plusieurs fois
pour definir un composant */
/***************/
/* SYMBTEXT.CPP */
/***************/
/**************/
/* NETLIST.CPP */
/**************/
...
...
eeschema/savelib.cpp
View file @
34909473
...
...
@@ -2,7 +2,7 @@
/* EESchema - eesavlib.cpp */
/****************************/
/*
Write Routine
s to save schematic libraries and library components (::Save() members)
/*
Function
s to save schematic libraries and library components (::Save() members)
*/
#include "fctsys.h"
...
...
@@ -350,137 +350,132 @@ EDA_LibComponentStruct* CopyLibEntryStruct( wxWindow* frame, EDA_LibComponentStr
return
NewStruct
;
}
/*************************************************************************/
int
WriteOneLibEntry
(
FILE
*
ExportFile
,
EDA_LibComponentStruct
*
LibEntry
)
/*************************************************************************/
/* Routine d'ecriture du composant pointe par LibEntry
* dans le fichier ExportFile( qui doit etre deja ouvert)
* return: 0 si Ok
* -1 si err write
* 1 si composant non ecrit ( type ALIAS )
/************************************************/
bool
EDA_LibComponentStruct
::
Save
(
FILE
*
aFile
)
/***********************************************/
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
#define UNUSED 0
{
LibEDA_BaseStruct
*
DrawEntry
;
LibDrawField
*
Field
;
if
(
LibEntry
->
Type
!=
ROOT
)
return
1
;
if
(
Type
!=
ROOT
)
// should not happen, but just in case
return
false
;
/*
Creation du commentaire donnant le nom du composant
*/
fprintf
(
ExportFile
,
"#
\n
# %s
\n
#
\n
"
,
CONV_TO_UTF8
(
LibEntry
->
m_Name
.
m_Text
)
);
/*
First line: it s a comment (component name for readers)
*/
fprintf
(
aFile
,
"#
\n
# %s
\n
#
\n
"
,
CONV_TO_UTF8
(
m_Name
.
m_Text
)
);
/*
Generation des lignes utiles
*/
fprintf
(
Export
File
,
"DEF"
);
if
(
(
LibEntry
->
m_Name
.
m_Attributs
&
TEXT_NO_VISIBLE
)
==
0
)
fprintf
(
ExportFile
,
" %s"
,
CONV_TO_UTF8
(
LibEntry
->
m_Name
.
m_Text
)
);
/*
Save data
*/
fprintf
(
a
File
,
"DEF"
);
if
(
(
m_Name
.
m_Attributs
&
TEXT_NO_VISIBLE
)
==
0
)
fprintf
(
aFile
,
" %s"
,
CONV_TO_UTF8
(
m_Name
.
m_Text
)
);
else
fprintf
(
ExportFile
,
" ~%s"
,
CONV_TO_UTF8
(
LibEntry
->
m_Name
.
m_Text
)
);
fprintf
(
aFile
,
" ~%s"
,
CONV_TO_UTF8
(
m_Name
.
m_Text
)
);
if
(
!
LibEntry
->
m_Prefix
.
m_Text
.
IsEmpty
()
)
fprintf
(
ExportFile
,
" %s"
,
CONV_TO_UTF8
(
LibEntry
->
m_Prefix
.
m_Text
)
);
if
(
!
m_Prefix
.
m_Text
.
IsEmpty
()
)
fprintf
(
aFile
,
" %s"
,
CONV_TO_UTF8
(
m_Prefix
.
m_Text
)
);
else
fprintf
(
Export
File
,
" ~"
);
fprintf
(
Export
File
,
" %d %d %c %c %d %c %c
\n
"
,
UNUSED
,
LibEntry
->
m_TextInside
,
LibEntry
->
m_DrawPinNum
?
'Y'
:
'N'
,
LibEntry
->
m_DrawPinName
?
'Y'
:
'N'
,
LibEntry
->
m_UnitCount
,
LibEntry
->
m_UnitSelectionLocked
?
'L'
:
'F'
,
LibEntry
->
m_Options
==
ENTRY_POWER
?
'P'
:
'N'
);
fprintf
(
a
File
,
" ~"
);
fprintf
(
a
File
,
" %d %d %c %c %d %c %c
\n
"
,
UNUSED
,
m_TextInside
,
m_DrawPinNum
?
'Y'
:
'N'
,
m_DrawPinName
?
'Y'
:
'N'
,
m_UnitCount
,
m_UnitSelectionLocked
?
'L'
:
'F'
,
m_Options
==
ENTRY_POWER
?
'P'
:
'N'
);
WriteLibEntryDateAndTime
(
ExportFile
,
LibEntry
);
WriteLibEntryDateAndTime
(
aFile
,
this
);
/*
Position / orientation / visibilite des champ
s */
LibEntry
->
m_Prefix
.
Save
(
Export
File
);
LibEntry
->
m_Name
.
Save
(
Export
File
);
/*
Save field
s */
m_Prefix
.
Save
(
a
File
);
m_Name
.
Save
(
a
File
);
for
(
Field
=
LibEntry
->
Fields
;
Field
!=
NULL
;
for
(
Field
=
Fields
;
Field
!=
NULL
;
Field
=
(
LibDrawField
*
)
Field
->
Pnext
)
{
if
(
Field
->
m_Text
.
IsEmpty
()
&&
Field
->
m_Name
.
IsEmpty
()
)
continue
;
Field
->
Save
(
Export
File
);
Field
->
Save
(
a
File
);
}
/* Sa
uvegarde de la ligne
"ALIAS" */
if
(
LibEntry
->
m_AliasList
.
GetCount
()
!=
0
)
/* Sa
ve the alias list: a line starting by
"ALIAS" */
if
(
m_AliasList
.
GetCount
()
!=
0
)
{
fprintf
(
Export
File
,
"ALIAS"
);
fprintf
(
a
File
,
"ALIAS"
);
unsigned
ii
;
for
(
ii
=
0
;
ii
<
LibEntry
->
m_AliasList
.
GetCount
();
ii
++
)
fprintf
(
ExportFile
,
" %s"
,
CONV_TO_UTF8
(
LibEntry
->
m_AliasList
[
ii
]
)
);
for
(
ii
=
0
;
ii
<
m_AliasList
.
GetCount
();
ii
++
)
fprintf
(
aFile
,
" %s"
,
CONV_TO_UTF8
(
m_AliasList
[
ii
]
)
);
fprintf
(
Export
File
,
"
\n
"
);
fprintf
(
a
File
,
"
\n
"
);
}
/* Write the footprint filter list */
if
(
LibEntry
->
m_FootprintList
.
GetCount
()
!=
0
)
if
(
m_FootprintList
.
GetCount
()
!=
0
)
{
fprintf
(
Export
File
,
"$FPLIST
\n
"
);
fprintf
(
a
File
,
"$FPLIST
\n
"
);
unsigned
ii
;
for
(
ii
=
0
;
ii
<
LibEntry
->
m_FootprintList
.
GetCount
();
ii
++
)
fprintf
(
ExportFile
,
" %s
\n
"
,
CONV_TO_UTF8
(
LibEntry
->
m_FootprintList
[
ii
]
)
);
for
(
ii
=
0
;
ii
<
m_FootprintList
.
GetCount
();
ii
++
)
fprintf
(
aFile
,
" %s
\n
"
,
CONV_TO_UTF8
(
m_FootprintList
[
ii
]
)
);
fprintf
(
Export
File
,
"$ENDFPLIST
\n
"
);
fprintf
(
a
File
,
"$ENDFPLIST
\n
"
);
}
/* Sauvegarde des elements de trace */
DrawEntry
=
LibEntry
->
m_Drawings
;
if
(
LibEntry
->
m_Drawings
)
/* Save graphics items (including pins) */
if
(
m_Drawings
)
{
/* we sort the draw items, in order to have an edition more easy,
* when a file editing "by hand" is made */
LibEntry
->
SortDrawItems
();
SortDrawItems
();
fprintf
(
Export
File
,
"DRAW
\n
"
);
DrawEntry
=
LibEntry
->
m_Drawings
;
fprintf
(
a
File
,
"DRAW
\n
"
);
DrawEntry
=
m_Drawings
;
while
(
DrawEntry
)
{
DrawEntry
->
Save
(
Export
File
);
DrawEntry
->
Save
(
a
File
);
DrawEntry
=
DrawEntry
->
Next
();
}
fprintf
(
Export
File
,
"ENDDRAW
\n
"
);
fprintf
(
a
File
,
"ENDDRAW
\n
"
);
}
fprintf
(
Export
File
,
"ENDDEF
\n
"
);
fprintf
(
a
File
,
"ENDDEF
\n
"
);
return
0
;
return
true
;
}
/***************************************
**********************************
/
int
WriteOneDocLibEntry
(
FILE
*
ExportFile
,
EDA_LibComponentStruct
*
LibEntry
)
/***************************************
**********************************
/
/* Routine d'ecriture de la doc du composant pointe par LibEntry
*
dans le fichier ExportFile( qui doit etre deja ouvert)
*
return: 0 si Ok
*
1 si err write
*
Cependant, si i tous les Pointeurs sur textes sont nulls ( pas de Doc )
*
rien ne sera ecrit
.
/***************************************/
bool
LibCmpEntry
::
SaveDoc
(
FILE
*
aFile
)
/***************************************/
/**
* Function SaveDoc
*
writes the doc info out to a FILE in "*.dcm" format.
*
Only non empty fields are written.
*
If all fielsd are empty, does not write anything
*
@param aFile The FILE to write to.
*
@return bool - true if success writing else false
.
*/
{
if
(
(
LibEntry
->
m_Doc
.
IsEmpty
()
)
&&
(
LibEntry
->
m_KeyWord
.
IsEmpty
()
)
&&
(
LibEntry
->
m_DocFile
.
IsEmpty
()
)
)
return
0
;
if
(
m_Doc
.
IsEmpty
()
&&
m_KeyWord
.
IsEmpty
()
&&
m_DocFile
.
IsEmpty
()
)
return
true
;
/* Generation des lignes utiles */
fprintf
(
ExportFile
,
"#
\n
$CMP %s
\n
"
,
CONV_TO_UTF8
(
LibEntry
->
m_Name
.
m_Text
)
);
fprintf
(
aFile
,
"#
\n
$CMP %s
\n
"
,
CONV_TO_UTF8
(
m_Name
.
m_Text
)
);
if
(
!
LibEntry
->
m_Doc
.
IsEmpty
()
)
fprintf
(
ExportFile
,
"D %s
\n
"
,
CONV_TO_UTF8
(
LibEntry
->
m_Doc
)
);
if
(
!
m_Doc
.
IsEmpty
()
)
fprintf
(
aFile
,
"D %s
\n
"
,
CONV_TO_UTF8
(
m_Doc
)
);
if
(
!
LibEntry
->
m_KeyWord
.
IsEmpty
()
)
fprintf
(
ExportFile
,
"K %s
\n
"
,
CONV_TO_UTF8
(
LibEntry
->
m_KeyWord
)
);
if
(
!
m_KeyWord
.
IsEmpty
()
)
fprintf
(
aFile
,
"K %s
\n
"
,
CONV_TO_UTF8
(
m_KeyWord
)
);
if
(
!
LibEntry
->
m_DocFile
.
IsEmpty
()
)
fprintf
(
ExportFile
,
"F %s
\n
"
,
CONV_TO_UTF8
(
LibEntry
->
m_DocFile
)
);
if
(
!
m_DocFile
.
IsEmpty
()
)
fprintf
(
aFile
,
"F %s
\n
"
,
CONV_TO_UTF8
(
m_DocFile
)
);
fprintf
(
Export
File
,
"$ENDCMP
\n
"
);
return
0
;
fprintf
(
a
File
,
"$ENDCMP
\n
"
);
return
true
;
}
...
...
@@ -560,11 +555,16 @@ bool LibraryStruct::SaveLibrary( const wxString& FullFileName )
bool
success
=
true
;
while
(
LibEntry
)
{
if
(
WriteOneLibEntry
(
libfile
,
LibEntry
)
!=
0
)
success
=
false
;
if
(
LibEntry
->
Type
==
ROOT
)
{
if
(
!
LibEntry
->
Save
(
libfile
)
)
success
=
false
;
}
if
(
docfile
)
if
(
WriteOneDocLibEntry
(
docfile
,
LibEntry
)
!=
0
)
{
if
(
!
LibEntry
->
SaveDoc
(
docfile
)
)
success
=
false
;
}
LibEntry
=
(
EDA_LibComponentStruct
*
)
PQNext
(
m_Entries
,
LibEntry
,
NULL
);
...
...
eeschema/schframe.cpp
View file @
34909473
...
...
@@ -275,10 +275,10 @@ void WinEDA_SchematicFrame::CreateScreens()
m_CurrentSheet
->
Clear
();
m_CurrentSheet
->
Push
(
g_RootSheet
);
if
(
ScreenLib
==
NULL
)
ScreenLib
=
new
SCH_SCREEN
(
LIBEDITOR_FRAME
);
ScreenLib
->
SetZoom
(
4
);
ScreenLib
->
m_UndoRedoCountMax
=
10
;
if
(
g_
ScreenLib
==
NULL
)
g_
ScreenLib
=
new
SCH_SCREEN
(
LIBEDITOR_FRAME
);
g_
ScreenLib
->
SetZoom
(
4
);
g_
ScreenLib
->
m_UndoRedoCountMax
=
10
;
}
...
...
@@ -356,9 +356,7 @@ void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event )
/*****************************************************************************
*
* Enable or disable some tools according to current conditions
*
*****************************************************************************/
void
WinEDA_SchematicFrame
::
SetToolbars
()
{
...
...
@@ -451,21 +449,27 @@ int WinEDA_SchematicFrame::BestZoom()
return
bestzoom
;
}
/**************************************************************/
void
WinEDA_SchematicFrame
::
OnAnnotate
(
wxCommandEvent
&
event
)
/**************************************************************/
{
WinEDA_AnnotateFrame
*
dlg
=
new
WinEDA_AnnotateFrame
(
this
);
dlg
->
ShowModal
();
dlg
->
Destroy
();
}
/*********************************************************/
void
WinEDA_SchematicFrame
::
OnErc
(
wxCommandEvent
&
event
)
/*********************************************************/
{
WinEDA_ErcFrame
*
dlg
=
new
WinEDA_ErcFrame
(
this
);
dlg
->
ShowModal
();
dlg
->
Destroy
();
}
/*******************************************************************/
void
WinEDA_SchematicFrame
::
OnCreateNetlist
(
wxCommandEvent
&
event
)
/*******************************************************************/
{
int
i
;
...
...
@@ -481,14 +485,18 @@ void WinEDA_SchematicFrame::OnCreateNetlist( wxCommandEvent& event )
// If a plugin is removed or added, rebuild and reopen the new dialog
}
/**********************************************************************/
void
WinEDA_SchematicFrame
::
OnCreateBillOfMaterials
(
wxCommandEvent
&
)
/**********************************************************************/
{
WinEDA_Build_BOM_Frame
*
dlg
=
new
WinEDA_Build_BOM_Frame
(
this
);
dlg
->
ShowModal
();
dlg
->
Destroy
();
}
/*******************************************************************/
void
WinEDA_SchematicFrame
::
OnFindItems
(
wxCommandEvent
&
event
)
/*******************************************************************/
{
this
->
DrawPanel
->
m_IgnoreMouseEvents
=
TRUE
;
WinEDA_FindFrame
*
dlg
=
new
WinEDA_FindFrame
(
this
);
...
...
@@ -497,7 +505,9 @@ void WinEDA_SchematicFrame::OnFindItems( wxCommandEvent& event )
this
->
DrawPanel
->
m_IgnoreMouseEvents
=
FALSE
;
}
/***************************************************************/
void
WinEDA_SchematicFrame
::
OnLoadFile
(
wxCommandEvent
&
event
)
/***************************************************************/
{
int
i
=
event
.
GetId
()
-
ID_LOAD_FILE_1
;
...
...
@@ -505,23 +515,31 @@ void WinEDA_SchematicFrame::OnLoadFile( wxCommandEvent& event )
SetToolbars
();
}
/*******************************************************************/
void
WinEDA_SchematicFrame
::
OnLoadStuffFile
(
wxCommandEvent
&
event
)
/*******************************************************************/
{
ReadInputStuffFile
(
);
DrawPanel
->
Refresh
();
}
/****************************************************************/
void
WinEDA_SchematicFrame
::
OnNewProject
(
wxCommandEvent
&
event
)
/****************************************************************/
{
LoadOneEEProject
(
wxEmptyString
,
true
);
}
/*****************************************************************/
void
WinEDA_SchematicFrame
::
OnLoadProject
(
wxCommandEvent
&
event
)
/*****************************************************************/
{
LoadOneEEProject
(
wxEmptyString
,
false
);
}
/****************************************************************/
void
WinEDA_SchematicFrame
::
OnOpenPcbnew
(
wxCommandEvent
&
event
)
/****************************************************************/
{
wxString
Line
=
g_RootSheet
->
m_AssociatedScreen
->
m_FileName
;
...
...
@@ -535,7 +553,9 @@ void WinEDA_SchematicFrame::OnOpenPcbnew( wxCommandEvent& event )
ExecuteFile
(
this
,
PCBNEW_EXE
);
}
/***************************************************************/
void
WinEDA_SchematicFrame
::
OnOpenCvpcb
(
wxCommandEvent
&
event
)
/***************************************************************/
{
wxString
Line
=
g_RootSheet
->
m_AssociatedScreen
->
m_FileName
;
...
...
@@ -549,7 +569,9 @@ void WinEDA_SchematicFrame::OnOpenCvpcb( wxCommandEvent& event )
ExecuteFile
(
this
,
CVPCB_EXE
);
}
/*************************************************************************/
void
WinEDA_SchematicFrame
::
OnOpenLibraryViewer
(
wxCommandEvent
&
event
)
/*************************************************************************/
{
if
(
m_Parent
->
m_ViewlibFrame
)
{
...
...
@@ -564,7 +586,9 @@ void WinEDA_SchematicFrame::OnOpenLibraryViewer( wxCommandEvent& event )
}
}
/*************************************************************************/
void
WinEDA_SchematicFrame
::
OnOpenLibraryEditor
(
wxCommandEvent
&
event
)
/*************************************************************************/
{
if
(
m_Parent
->
m_LibeditFrame
)
{
...
...
@@ -578,7 +602,7 @@ void WinEDA_SchematicFrame::OnOpenLibraryEditor( wxCommandEvent& event )
wxT
(
"Library Editor"
),
wxPoint
(
-
1
,
-
1
),
wxSize
(
600
,
400
)
);
ActiveScreen
=
ScreenLib
;
ActiveScreen
=
g_
ScreenLib
;
m_Parent
->
m_LibeditFrame
->
AdjustScrollBars
();
}
}
...
...
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