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
2e13ccf0
Commit
2e13ccf0
authored
Aug 24, 2007
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
see change_log.txt's 2007-Aug-23 UPDATE
parent
cc623057
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1412 additions
and
1037 deletions
+1412
-1037
change_log.txt
change_log.txt
+18
-6
base_struct.cpp
common/base_struct.cpp
+4
-0
base_struct.h
include/base_struct.h
+43
-7
class_collector.h
include/class_collector.h
+2
-20
pcbstruct.h
include/pcbstruct.h
+7
-0
wxstruct.h
include/wxstruct.h
+8
-8
class_board.cpp
pcbnew/class_board.cpp
+62
-8
class_module.cpp
pcbnew/class_module.cpp
+25
-6
class_module.h
pcbnew/class_module.h
+13
-2
class_text_mod.cpp
pcbnew/class_text_mod.cpp
+34
-0
class_text_mod.h
pcbnew/class_text_mod.h
+25
-0
classpcb.cpp
pcbnew/classpcb.cpp
+16
-0
classtrc.cpp
pcbnew/classtrc.cpp
+411
-358
collectors.cpp
pcbnew/collectors.cpp
+65
-19
collectors.h
pcbnew/collectors.h
+25
-16
controle.cpp
pcbnew/controle.cpp
+38
-8
files.cpp
pcbnew/files.cpp
+1
-1
locate.cpp
pcbnew/locate.cpp
+11
-14
pcbframe.cpp
pcbnew/pcbframe.cpp
+2
-2
protos.h
pcbnew/protos.h
+1
-1
set_color.cpp
pcbnew/set_color.cpp
+601
-561
No files found.
change_log.txt
View file @
2e13ccf0
...
@@ -7,9 +7,21 @@ email address.
...
@@ -7,9 +7,21 @@ email address.
2007-Aug-23 UPDATE Dick Hollenbeck <dick@softplc.com>
2007-Aug-23 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
@todo add constructor initializers for classes that were derived from
+ eeschema & pcbnew
EDA_BaseLineStruct but are now not. Its late, will do tomorrow.
* Fixed MODULE::Visit() and BOARD::Vist() so they traverse certain lists
@todo test yesterday's changes, it builds, may not run right yet.
only once and they are working nicely now.
* You can test the GENERALCOLLECTOR::Scan() code by compiling with DEBUG=1 on
the command line and enabling the stuff near line 124 in
pcbnew/controle.cpp, then watch Show( std::cout ) show the selected items in
xml format on your console. (launch pcbnew from command line.)
@todo:
The layer selection mechanism used by the collector is still inadequate, so
tomorrow I will add a new class COLLECTORS_GUIDE which can be used by a
COLLECTOR to control its operation. It adds the concept of layer
locking, even though PCBNEW does not support that in the UI yet.
@todo:
add constructor initializers for classes that were derived from
EDA_BaseLineStruct but are now not. Its late, will do tomorrow.
2007-Aug-22 UPDATE Dick Hollenbeck <dick@softplc.com>
2007-Aug-22 UPDATE Dick Hollenbeck <dick@softplc.com>
...
@@ -18,15 +30,15 @@ email address.
...
@@ -18,15 +30,15 @@ email address.
Things are still pretty transient, should be stable a day or two:
Things are still pretty transient, should be stable a day or two:
* Fixed a filename case sensitivity problem that would show up on Linux
* Fixed a filename case sensitivity problem that would show up on Linux
but probably not on Windows: bitmap/Reload.xpm needed uppercase R.
but probably not on Windows: bitmap/Reload.xpm needed uppercase R.
* Wedged a new class BOARD_ITEM underneath all PCB drawable classes
, t
his is
* Wedged a new class BOARD_ITEM underneath all PCB drawable classes
. T
his is
a big change and may introduce a bug or two, but it is worth it for the
a big change and may introduce a bug or two, but it is worth it for the
future, because we can
introduce
virtual functions there that do not impact
future, because we can
add
virtual functions there that do not impact
the entire project (since everything is derived from EDA_BaseStruct).
the entire project (since everything is derived from EDA_BaseStruct).
The corresponding class in EESCHEMA seems to be DrawPartStruct, so we had
The corresponding class in EESCHEMA seems to be DrawPartStruct, so we had
nothing in PCBNEW like that.
nothing in PCBNEW like that.
BOARD_ITEM::GetLayer() and SetLayer() introduced, more functions to come.
BOARD_ITEM::GetLayer() and SetLayer() introduced, more functions to come.
Much of this work is geared towards making collectors.cpp's ARROWCOLLECTOR::Inspect()
Much of this work is geared towards making collectors.cpp's ARROWCOLLECTOR::Inspect()
very very simple, and that can be model for future work.
very very simple, and that can be
a
model for future work.
* Changed min() and max() macros to MIN() and MAX() because min() and max()
* Changed min() and max() macros to MIN() and MAX() because min() and max()
are actually reserved according to the C++ standard! (and their usage prevented
are actually reserved according to the C++ standard! (and their usage prevented
the use of #include <vector>).
the use of #include <vector>).
...
...
common/base_struct.cpp
View file @
2e13ccf0
...
@@ -210,6 +210,10 @@ SEARCH_RESULT EDA_BaseStruct::Visit( INSPECTOR* inspector, const void* testData,
...
@@ -210,6 +210,10 @@ SEARCH_RESULT EDA_BaseStruct::Visit( INSPECTOR* inspector, const void* testData,
const
KICAD_T
scanTypes
[]
)
const
KICAD_T
scanTypes
[]
)
{
{
KICAD_T
stype
;
KICAD_T
stype
;
#if defined(DEBUG)
std
::
cout
<<
GetClass
().
mb_str
()
<<
' '
;
#endif
for
(
const
KICAD_T
*
p
=
scanTypes
;
(
stype
=*
p
)
!=
EOT
;
++
p
)
for
(
const
KICAD_T
*
p
=
scanTypes
;
(
stype
=*
p
)
!=
EOT
;
++
p
)
{
{
...
...
include/base_struct.h
View file @
2e13ccf0
...
@@ -133,7 +133,7 @@ public:
...
@@ -133,7 +133,7 @@ public:
EDA_BaseStruct
*
m_Son
;
/* Linked list: Link (son struct) */
EDA_BaseStruct
*
m_Son
;
/* Linked list: Link (son struct) */
EDA_BaseStruct
*
m_Image
;
/* Link to an image copy for undelete or abort command */
EDA_BaseStruct
*
m_Image
;
/* Link to an image copy for undelete or abort command */
int
m_Flags
;
// flags for editi
ons and other
int
m_Flags
;
// flags for editi
ng and other misc. uses
#define IS_CHANGED (1<<0)
#define IS_CHANGED (1<<0)
#define IS_LINKED (1<<1)
#define IS_LINKED (1<<1)
#define IN_EDIT (1<<2)
#define IN_EDIT (1<<2)
...
@@ -154,7 +154,6 @@ public:
...
@@ -154,7 +154,6 @@ public:
unsigned
long
m_TimeStamp
;
// Time stamp used for logical links
unsigned
long
m_TimeStamp
;
// Time stamp used for logical links
int
m_Selected
;
/* Used by block commands, and selective editing */
int
m_Selected
;
/* Used by block commands, and selective editing */
// int m_Layer; ///< used by many derived classes, so make common
private
:
private
:
int
m_Status
;
int
m_Status
;
...
@@ -394,23 +393,60 @@ public:
...
@@ -394,23 +393,60 @@ public:
{
{
}
}
BOARD_ITEM
*
Next
()
{
return
(
BOARD_ITEM
*
)
Pnext
;
}
BOARD_ITEM
*
Next
()
const
{
return
(
BOARD_ITEM
*
)
Pnext
;
}
BOARD_ITEM
*
GetParent
()
const
{
return
(
BOARD_ITEM
*
)
m_Parent
;
}
/**
/**
* Function GetLayer
* Function GetLayer
* returns the layer this item is on.
* returns the layer this item is on.
*/
*/
int
GetLayer
()
const
{
return
m_Layer
;
}
int
GetLayer
()
const
{
return
m_Layer
;
}
/**
/**
* Function SetLayer
* Function SetLayer
* sets the layer this item is on.
* sets the layer this item is on.
* @param aLayer The layer number.
* @param aLayer The layer number.
*/
*/
void
SetLayer
(
int
aLayer
)
{
m_Layer
=
aLayer
;
}
void
SetLayer
(
int
aLayer
)
{
m_Layer
=
aLayer
;
}
/**
* Function IsOnLayer
* tests to see if this object is on the given layer. Is virtual so
* objects like D_PAD, which reside on multiple layers can do their own
* form of testing.
* @param aLayer The layer to test for.
* @return bool - true if on given layer, else false.
*/
virtual
bool
IsOnLayer
(
int
aLayer
)
const
{
return
m_Layer
==
aLayer
;
}
/**
* Function IsOnOneOfTheseLayers
* returns true if this object is on one of the given layers. Is virtual so
* objects like D_PAD, which reside on multiple layers, can do their own
* form of testing.
* @param aLayerMask The bit-mapped set of layers to test for.
* @return bool - true if on one of the given layers, else false.
*/
virtual
bool
IsOnOneOfTheseLayers
(
int
aLayerMask
)
const
{
return
(
(
1
<<
m_Layer
)
&
aLayerMask
)
!=
0
;
}
/**
* Function IsLocked
* @returns bool - true if the object is locked, else false
*/
virtual
bool
IsLocked
()
const
{
return
false
;
// only MODULEs can be locked at this time.
}
};
};
...
...
include/class_collector.h
View file @
2e13ccf0
...
@@ -34,7 +34,6 @@
...
@@ -34,7 +34,6 @@
class
EDA_BaseStruct
;
class
EDA_BaseStruct
;
class
BOARD
;
/**
/**
...
@@ -48,16 +47,10 @@ class BOARD;
...
@@ -48,16 +47,10 @@ class BOARD;
*
*
* Later, after collection, the user can iterate through all the objects
* Later, after collection, the user can iterate through all the objects
* in the remembered collection using GetCount() and the [int] operator.
* in the remembered collection using GetCount() and the [int] operator.
*
* Philosophy: this class knows nothing of the context in which as BOARD is used
* and that means it knows nothing about which layers are visible or current,
* but can handle those concerns by the SetPreferredLayer() function.
*/
*/
class
COLLECTOR
:
public
INSPECTOR
class
COLLECTOR
:
public
INSPECTOR
{
{
protected
:
protected
:
// int m_Type;
/// Which object types to scan
/// Which object types to scan
const
KICAD_T
*
m_ScanTypes
;
const
KICAD_T
*
m_ScanTypes
;
...
@@ -84,20 +77,9 @@ public:
...
@@ -84,20 +77,9 @@ public:
virtual
~
COLLECTOR
()
virtual
~
COLLECTOR
()
{
{
// empty the list so that ~list() does not try and delete all
// the objects that it holds. list is not the owner of such objects
// and this prevents a double free()ing.
Empty
();
}
}
/**
* Function Type
* returns the type of the collector.
int Type() const { return m_Type; }
*/
void
SetPreferredLayer
(
int
aPreferredLayer
)
void
SetPreferredLayer
(
int
aPreferredLayer
)
{
{
m_PreferredLayer
=
aPreferredLayer
;
m_PreferredLayer
=
aPreferredLayer
;
...
@@ -108,7 +90,7 @@ public:
...
@@ -108,7 +90,7 @@ public:
* Function GetCount
* Function GetCount
* returns the number of objects in the list
* returns the number of objects in the list
*/
*/
int
GetCount
()
const
unsigned
GetCount
()
const
{
{
return
list
.
size
();
return
list
.
size
();
}
}
...
@@ -143,7 +125,7 @@ public:
...
@@ -143,7 +125,7 @@ public:
*/
*/
EDA_BaseStruct
*
operator
[](
int
ndx
)
const
EDA_BaseStruct
*
operator
[](
int
ndx
)
const
{
{
if
(
(
unsigned
)
ndx
<
(
unsigned
)
GetCount
()
)
if
(
(
unsigned
)
ndx
<
GetCount
()
)
return
list
[
ndx
];
return
list
[
ndx
];
return
NULL
;
return
NULL
;
}
}
...
...
include/pcbstruct.h
View file @
2e13ccf0
...
@@ -175,6 +175,13 @@ public:
...
@@ -175,6 +175,13 @@ public:
public
:
public
:
EDA_BoardDesignSettings
(
void
);
EDA_BoardDesignSettings
(
void
);
/**
* Function GetVisibleLayers
* returns a bit-map of all the layers that are visible.
* @return int - the visible layers in bit-mapped form.
*/
int
GetVisibleLayers
();
};
};
...
...
include/wxstruct.h
View file @
2e13ccf0
...
@@ -96,7 +96,7 @@ class WinEDA3D_DrawFrame;
...
@@ -96,7 +96,7 @@ class WinEDA3D_DrawFrame;
class
PARAM_CFG_BASE
;
class
PARAM_CFG_BASE
;
class
Ki_PageDescr
;
class
Ki_PageDescr
;
class
Ki_HotkeyInfo
;
class
Ki_HotkeyInfo
;
class
ARROW
COLLECTOR
;
class
GENERAL
COLLECTOR
;
enum
id_librarytype
{
enum
id_librarytype
{
...
@@ -372,6 +372,11 @@ private:
...
@@ -372,6 +372,11 @@ private:
virtual
void
GetComponentFromUndoList
(
void
);
virtual
void
GetComponentFromUndoList
(
void
);
virtual
void
GetComponentFromRedoList
(
void
);
virtual
void
GetComponentFromRedoList
(
void
);
#if defined(DEBUG)
protected
:
GENERALCOLLECTOR
*
m_Collector
;
#endif
public
:
public
:
// Read/write fonctions:
// Read/write fonctions:
...
@@ -385,8 +390,8 @@ public:
...
@@ -385,8 +390,8 @@ public:
// Gestion du PCB
// Gestion du PCB
bool
Clear_Pcb
(
wxDC
*
DC
,
bool
query
);
bool
Clear_Pcb
(
wxDC
*
DC
,
bool
query
);
EDA_BaseStruct
*
PcbGeneralLocateAndDisplay
();
BOARD_ITEM
*
PcbGeneralLocateAndDisplay
();
EDA_BaseStruct
*
Locate
(
int
typeloc
,
int
LayerSearch
);
BOARD_ITEM
*
Locate
(
int
typeloc
,
int
LayerSearch
);
// Gestion du curseur
// Gestion du curseur
void
place_marqueur
(
wxDC
*
DC
,
const
wxPoint
&
pos
,
char
*
pt_bitmap
,
void
place_marqueur
(
wxDC
*
DC
,
const
wxPoint
&
pos
,
char
*
pt_bitmap
,
...
@@ -517,11 +522,6 @@ private:
...
@@ -517,11 +522,6 @@ private:
bool
m_SelViaSizeBox_Changed
;
bool
m_SelViaSizeBox_Changed
;
wxMenu
*
m_FilesMenu
;
wxMenu
*
m_FilesMenu
;
#if defined(DEBUG)
ARROWCOLLECTOR
*
m_ArrowCollector
;
///< while arrow icon tool
#endif
public
:
public
:
WinEDA_PcbFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
const
wxString
&
title
,
WinEDA_PcbFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
const
wxPoint
&
pos
,
const
wxSize
&
size
);
...
...
pcbnew/class_board.cpp
View file @
2e13ccf0
...
@@ -311,13 +311,21 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData,
...
@@ -311,13 +311,21 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData,
KICAD_T
stype
;
KICAD_T
stype
;
SEARCH_RESULT
result
=
SEARCH_CONTINUE
;
SEARCH_RESULT
result
=
SEARCH_CONTINUE
;
const
KICAD_T
*
p
=
scanTypes
;
const
KICAD_T
*
p
=
scanTypes
;
bool
done
=
false
;
#if defined(DEBUG)
std
::
cout
<<
GetClass
().
mb_str
()
<<
' '
;
#endif
while
(
(
stype
=
*
p
++
)
!=
EOT
)
while
(
!
done
)
{
{
stype
=
*
p
;
switch
(
stype
)
switch
(
stype
)
{
{
case
TYPEPCB
:
case
TYPEPCB
:
result
=
inspector
->
Inspect
(
this
,
testData
);
// inspect me
result
=
inspector
->
Inspect
(
this
,
testData
);
// inspect me
// skip over any types handled in the above call.
++
p
;
break
;
break
;
/* Instances of the requested KICAD_T live in a list, either one
/* Instances of the requested KICAD_T live in a list, either one
...
@@ -332,7 +340,21 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData,
...
@@ -332,7 +340,21 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData,
case
TYPETEXTEMODULE
:
case
TYPETEXTEMODULE
:
case
TYPEEDGEMODULE
:
case
TYPEEDGEMODULE
:
// this calls MODULE::Visit() on each module.
// this calls MODULE::Visit() on each module.
result
=
IterateForward
(
m_Modules
,
inspector
,
testData
,
scanTypes
);
result
=
IterateForward
(
m_Modules
,
inspector
,
testData
,
p
);
// skip over any types handled in the above call.
for
(;;)
{
switch
(
stype
=
*++
p
)
{
case
TYPEMODULE
:
case
TYPEPAD
:
case
TYPETEXTEMODULE
:
case
TYPEEDGEMODULE
:
continue
;
default
:
;
}
break
;
}
break
;
break
;
case
TYPEDRAWSEGMENT
:
case
TYPEDRAWSEGMENT
:
...
@@ -340,27 +362,59 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData,
...
@@ -340,27 +362,59 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData,
case
TYPEMARQUEUR
:
case
TYPEMARQUEUR
:
case
TYPECOTATION
:
case
TYPECOTATION
:
case
TYPEMIRE
:
case
TYPEMIRE
:
result
=
IterateForward
(
m_Drawings
,
inspector
,
testData
,
scanTypes
);
result
=
IterateForward
(
m_Drawings
,
inspector
,
testData
,
p
);
// skip over any types handled in the above call.
for
(;;)
{
switch
(
stype
=
*++
p
)
{
case
TYPEDRAWSEGMENT
:
case
TYPETEXTE
:
case
TYPEMARQUEUR
:
case
TYPECOTATION
:
case
TYPEMIRE
:
continue
;
default
:
;
}
break
;
}
;
break
;
break
;
case
TYPEVIA
:
case
TYPEVIA
:
case
TYPETRACK
:
case
TYPETRACK
:
result
=
IterateForward
(
m_Track
,
inspector
,
testData
,
scanTypes
);
result
=
IterateForward
(
m_Track
,
inspector
,
testData
,
p
);
// skip over any types handled in the above call.
for
(;;)
{
switch
(
stype
=
*++
p
)
{
case
TYPEVIA
:
case
TYPETRACK
:
continue
;
default
:
;
}
break
;
}
break
;
break
;
case
PCB_EQUIPOT_STRUCT_TYPE
:
case
PCB_EQUIPOT_STRUCT_TYPE
:
result
=
IterateForward
(
m_Equipots
,
inspector
,
testData
,
scanTypes
);
result
=
IterateForward
(
m_Equipots
,
inspector
,
testData
,
p
);
++
p
;
break
;
break
;
case
TYPEZONE
:
case
TYPEZONE
:
result
=
IterateForward
(
m_Zone
,
inspector
,
testData
,
scanTypes
);
result
=
IterateForward
(
m_Zone
,
inspector
,
testData
,
p
);
++
p
;
break
;
break
;
case
TYPEEDGEZONE
:
case
TYPEEDGEZONE
:
result
=
IterateForward
(
m_CurrentLimitZone
,
inspector
,
testData
,
scanTypes
);
result
=
IterateForward
(
m_CurrentLimitZone
,
inspector
,
testData
,
p
);
++
p
;
break
;
break
;
default
:
default
:
// catch EOT or ANY OTHER type here and return.
done
=
true
;
break
;
break
;
}
}
...
...
pcbnew/class_module.cpp
View file @
2e13ccf0
...
@@ -1181,17 +1181,25 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR* inspector, const void* testData,
...
@@ -1181,17 +1181,25 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR* inspector, const void* testData,
KICAD_T
stype
;
KICAD_T
stype
;
SEARCH_RESULT
result
=
SEARCH_CONTINUE
;
SEARCH_RESULT
result
=
SEARCH_CONTINUE
;
const
KICAD_T
*
p
=
scanTypes
;
const
KICAD_T
*
p
=
scanTypes
;
bool
done
=
false
;
#if defined(DEBUG)
std
::
cout
<<
GetClass
().
mb_str
()
<<
' '
;
#endif
while
(
(
stype
=
*
p
++
)
!=
EOT
)
while
(
!
done
)
{
{
stype
=
*
p
;
switch
(
stype
)
switch
(
stype
)
{
{
case
TYPEMODULE
:
case
TYPEMODULE
:
result
=
inspector
->
Inspect
(
this
,
testData
);
// inspect me
result
=
inspector
->
Inspect
(
this
,
testData
);
// inspect me
++
p
;
break
;
break
;
case
TYPEPAD
:
case
TYPEPAD
:
result
=
IterateForward
(
m_Pads
,
inspector
,
testData
,
scanTypes
);
result
=
IterateForward
(
m_Pads
,
inspector
,
testData
,
p
);
++
p
;
break
;
break
;
case
TYPETEXTEMODULE
:
case
TYPETEXTEMODULE
:
...
@@ -1203,15 +1211,26 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR* inspector, const void* testData,
...
@@ -1203,15 +1211,26 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR* inspector, const void* testData,
if
(
result
==
SEARCH_QUIT
)
if
(
result
==
SEARCH_QUIT
)
break
;
break
;
// m_Drawings can hold TYPETEXTMODULE also?
// m_Drawings can hold TYPETEXTMODULE also, so fall thru
result
=
IterateForward
(
m_Drawings
,
inspector
,
testData
,
scanTypes
);
break
;
case
TYPEEDGEMODULE
:
case
TYPEEDGEMODULE
:
result
=
IterateForward
(
m_Drawings
,
inspector
,
testData
,
scanTypes
);
result
=
IterateForward
(
m_Drawings
,
inspector
,
testData
,
p
);
// skip over any types handled in the above call.
for
(;;)
{
switch
(
stype
=
*++
p
)
{
case
TYPETEXTEMODULE
:
case
TYPEEDGEMODULE
:
continue
;
default
:
;
}
break
;
}
break
;
break
;
default
:
default
:
done
=
true
;
break
;
break
;
}
}
...
...
pcbnew/class_module.h
View file @
2e13ccf0
...
@@ -92,9 +92,10 @@ public:
...
@@ -92,9 +92,10 @@ public:
/**
/**
* Function IsLocked
* Function IsLocked
* (virtual from BOARD_ITEM )
* @returns bool - true if the MODULE is locked, else false
* @returns bool - true if the MODULE is locked, else false
*/
*/
bool
IsLocked
()
bool
IsLocked
()
const
{
{
return
(
m_ModuleStatus
&
MODULE_is_LOCKED
)
!=
0
;
return
(
m_ModuleStatus
&
MODULE_is_LOCKED
)
!=
0
;
}
}
...
@@ -114,7 +115,7 @@ public:
...
@@ -114,7 +115,7 @@ public:
}
}
/* Readin
d
and writing data on files */
/* Readin
g
and writing data on files */
int
WriteDescr
(
FILE
*
File
);
int
WriteDescr
(
FILE
*
File
);
int
Write_3D_Descr
(
FILE
*
File
);
int
Write_3D_Descr
(
FILE
*
File
);
int
ReadDescr
(
FILE
*
File
,
int
*
LineNum
=
NULL
);
int
ReadDescr
(
FILE
*
File
,
int
*
LineNum
=
NULL
);
...
@@ -147,6 +148,16 @@ public:
...
@@ -147,6 +148,16 @@ public:
bool
HitTest
(
const
wxPoint
&
refPos
);
bool
HitTest
(
const
wxPoint
&
refPos
);
/**
* Function GetReference
* @return wxString - the reference designator text.
*/
const
wxString
&
GetReference
()
{
return
m_Reference
->
m_Text
;
}
/**
/**
* Function Visit
* Function Visit
* should be re-implemented for each derived class in order to handle
* should be re-implemented for each derived class in order to handle
...
...
pcbnew/class_text_mod.cpp
View file @
2e13ccf0
...
@@ -369,6 +369,40 @@ void TEXTE_MODULE::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -369,6 +369,40 @@ void TEXTE_MODULE::Display_Infos( WinEDA_DrawFrame* frame )
}
}
// see class_text_mod.h
bool
TEXTE_MODULE
::
IsOnLayer
(
int
aLayer
)
const
{
if
(
m_Layer
==
aLayer
)
return
true
;
/* test the parent, which is a MODULE */
if
(
aLayer
==
GetParent
()
->
GetLayer
()
)
return
true
;
if
(
aLayer
==
CUIVRE_N
)
{
if
(
m_Layer
==
ADHESIVE_N_CU
||
m_Layer
==
SILKSCREEN_N_CU
)
return
true
;
}
else
if
(
aLayer
==
CMP_N
)
{
if
(
m_Layer
==
ADHESIVE_N_CMP
||
m_Layer
==
SILKSCREEN_N_CMP
)
return
true
;
}
return
false
;
}
/* see class_text_mod.h
bool TEXTE_MODULE::IsOnOneOfTheseLayers( int aLayerMask ) const
{
}
*/
#if defined(DEBUG)
#if defined(DEBUG)
/**
/**
* Function Show
* Function Show
...
...
pcbnew/class_text_mod.h
View file @
2e13ccf0
...
@@ -73,6 +73,31 @@ public:
...
@@ -73,6 +73,31 @@ public:
* @return bool - true if a hit, else false
* @return bool - true if a hit, else false
*/
*/
bool
HitTest
(
const
wxPoint
&
posref
);
bool
HitTest
(
const
wxPoint
&
posref
);
/**
* Function IsOnLayer
* tests to see if this object is on the given layer. Is virtual so
* objects like D_PAD, which reside on multiple layers can do their own
* form of testing.
* virtual inheritance from BOARD_ITEM.
* @param aLayer The layer to test for.
* @return bool - true if on given layer, else false.
*/
bool
IsOnLayer
(
int
aLayer
)
const
;
/**
* Function IsOnOneOfTheseLayers
* returns true if this object is on one of the given layers. Is virtual so
* objects like D_PAD, which reside on multiple layers, can do their own
* form of testing.
* virtual inheritance from BOARD_ITEM.
* @param aLayerMask The bit-mapped set of layers to test for.
* @return bool - true if on one of the given layers, else false.
bool IsOnOneOfTheseLayers( int aLayerMask ) const;
*/
#if defined(DEBUG)
#if defined(DEBUG)
/**
/**
...
...
pcbnew/classpcb.cpp
View file @
2e13ccf0
...
@@ -429,3 +429,19 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings( void )
...
@@ -429,3 +429,19 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings( void )
m_PadCMPColor
=
RED
;
// Pad color for the COPPER side of the pad
m_PadCMPColor
=
RED
;
// Pad color for the COPPER side of the pad
m_RatsnestColor
=
WHITE
;
// Ratsnest color
m_RatsnestColor
=
WHITE
;
// Ratsnest color
}
}
// see pcbstruct.h
int
EDA_BoardDesignSettings
::
GetVisibleLayers
()
{
int
layerMask
=
0
;
for
(
int
i
=
0
,
mask
=
1
;
i
<
32
;
++
i
,
mask
<<=
1
)
{
if
(
!
(
m_LayerColor
[
i
]
&
ITEM_NOT_SHOW
)
)
layerMask
|=
mask
;
}
return
layerMask
;
}
pcbnew/classtrc.cpp
View file @
2e13ccf0
...
@@ -13,448 +13,501 @@
...
@@ -13,448 +13,501 @@
#endif
#endif
/**************************************/
/**************************************/
/* Classes pour Pistes, Vias et Zones */
/* Classes pour Pistes, Vias et Zones */
/**************************************/
/**************************************/
/* Constructeur des classes type pistes, vias et zones */
/* Constructeur des classes type pistes, vias et zones */
TRACK
::
TRACK
(
EDA_BaseStruct
*
StructFather
,
DrawStructureType
idtype
)
:
TRACK
::
TRACK
(
EDA_BaseStruct
*
StructFather
,
DrawStructureType
idtype
)
:
SEGDRAW_Struct
(
StructFather
,
idtype
)
SEGDRAW_Struct
(
StructFather
,
idtype
)
{
{
m_Shape
=
S_SEGMENT
;
m_Shape
=
S_SEGMENT
;
start
=
end
=
NULL
;
start
=
end
=
NULL
;
m_NetCode
=
0
;
m_NetCode
=
0
;
m_Sous_Netcode
=
0
;
m_Sous_Netcode
=
0
;
}
}
SEGZONE
::
SEGZONE
(
EDA_BaseStruct
*
StructFather
)
:
TRACK
(
StructFather
,
TYPEZONE
)
SEGZONE
::
SEGZONE
(
EDA_BaseStruct
*
StructFather
)
:
TRACK
(
StructFather
,
TYPEZONE
)
{
{
}
}
SEGVIA
::
SEGVIA
(
EDA_BaseStruct
*
StructFather
)
:
TRACK
(
StructFather
,
TYPEVIA
)
SEGVIA
::
SEGVIA
(
EDA_BaseStruct
*
StructFather
)
:
TRACK
(
StructFather
,
TYPEVIA
)
{
{
}
}
/******************************************/
/******************************************/
bool
SEGVIA
::
IsViaOnLayer
(
int
layer_number
)
bool
SEGVIA
::
IsViaOnLayer
(
int
layer_number
)
/******************************************/
/******************************************/
/* Retoune TRUE si Via sur layer layer_number
/* Retoune TRUE si Via sur layer layer_number
*/
*/
{
{
int
via_type
=
Shape
();
int
via_type
=
Shape
();
if
(
via_type
==
VIA_NORMALE
)
if
(
via_type
==
VIA_NORMALE
)
{
{
if
(
layer_number
<=
LAYER_CMP_N
)
return
TRUE
;
if
(
layer_number
<=
LAYER_CMP_N
)
else
return
FALSE
;
return
TRUE
;
}
else
return
FALSE
;
// VIA_BORGNE ou VIA_ENTERREE:
}
int
bottom_layer
,
top_layer
;
// VIA_BORGNE ou VIA_ENTERREE:
ReturnLayerPair
(
&
top_layer
,
&
bottom_layer
);
if
(
(
bottom_layer
<=
layer_number
)
&&
(
top_layer
>=
layer_number
)
)
int
bottom_layer
,
top_layer
;
return
TRUE
;
ReturnLayerPair
(
&
top_layer
,
&
bottom_layer
);
else
return
FALSE
;
if
(
(
bottom_layer
<=
layer_number
)
&&
(
top_layer
>=
layer_number
)
)
return
TRUE
;
else
return
FALSE
;
}
}
/*********************************************************/
/*********************************************************/
void
SEGVIA
::
SetLayerPair
(
int
top_layer
,
int
bottom_layer
)
void
SEGVIA
::
SetLayerPair
(
int
top_layer
,
int
bottom_layer
)
/*********************************************************/
/*********************************************************/
/* Met a jour .m_Layer pour une via:
/* Met a jour .m_Layer pour une via:
m_Layer code les 2 couches limitant la via
*
m_Layer code les 2 couches limitant la via
*/
*/
{
{
int
via_type
=
m_Shape
&
255
;
int
via_type
=
m_Shape
&
255
;
if
(
via_type
==
VIA_NORMALE
)
if
(
via_type
==
VIA_NORMALE
)
{
{
top_layer
=
LAYER_CMP_N
;
bottom_layer
=
LAYER_CUIVRE_N
;
top_layer
=
LAYER_CMP_N
;
bottom_layer
=
LAYER_CUIVRE_N
;
}
}
if
(
bottom_layer
>
top_layer
)
EXCHG
(
bottom_layer
,
top_layer
);
if
(
bottom_layer
>
top_layer
)
m_Layer
=
(
top_layer
&
15
)
+
(
(
bottom_layer
&
15
)
<<
4
);
EXCHG
(
bottom_layer
,
top_layer
);
m_Layer
=
(
top_layer
&
15
)
+
(
(
bottom_layer
&
15
)
<<
4
);
}
}
/***************************************************************/
/***************************************************************/
void
SEGVIA
::
ReturnLayerPair
(
int
*
top_layer
,
int
*
bottom_layer
)
void
SEGVIA
::
ReturnLayerPair
(
int
*
top_layer
,
int
*
bottom_layer
)
/***************************************************************/
/***************************************************************/
/* Retourne les 2 couches limitant la via
/* Retourne les 2 couches limitant la via
les pointeurs top_layer et bottom_layer peuvent etre NULLs
*
les pointeurs top_layer et bottom_layer peuvent etre NULLs
*/
*/
{
{
int
b_layer
=
(
m_Layer
>>
4
)
&
15
;
int
b_layer
=
(
m_Layer
>>
4
)
&
15
;
int
t_layer
=
m_Layer
&
15
;
int
t_layer
=
m_Layer
&
15
;
if
(
b_layer
>
t_layer
)
EXCHG
(
b_layer
,
t_layer
);
if
(
b_layer
>
t_layer
)
if
(
top_layer
)
*
top_layer
=
t_layer
;
EXCHG
(
b_layer
,
t_layer
);
if
(
bottom_layer
)
*
bottom_layer
=
b_layer
;
if
(
top_layer
)
*
top_layer
=
t_layer
;
if
(
bottom_layer
)
*
bottom_layer
=
b_layer
;
}
}
/************************/
/************************/
TRACK
*
TRACK
::
Next
(
void
)
TRACK
*
TRACK
::
Next
(
void
)
/************************/
/************************/
{
{
return
(
TRACK
*
)
Pnext
;
return
(
TRACK
*
)
Pnext
;
}
}
/* supprime du chainage la structure Struct
/* supprime du chainage la structure Struct
les structures arrieres et avant sont chainees directement
*
les structures arrieres et avant sont chainees directement
*/
*/
void
TRACK
::
UnLink
(
void
)
void
TRACK
::
UnLink
(
void
)
{
{
/* Modification du chainage arriere */
/* Modification du chainage arriere */
if
(
Pback
)
if
(
Pback
)
{
{
if
(
Pback
->
m_StructType
!=
TYPEPCB
)
if
(
Pback
->
m_StructType
!=
TYPEPCB
)
{
{
Pback
->
Pnext
=
Pnext
;
Pback
->
Pnext
=
Pnext
;
}
}
else
/* Le chainage arriere pointe sur la structure "Pere" */
else
/* Le chainage arriere pointe sur la structure "Pere" */
{
{
if
(
GetState
(
DELETED
)
)
// A REVOIR car Pback = NULL si place en undelete
if
(
GetState
(
DELETED
)
)
// A REVOIR car Pback = NULL si place en undelete
{
{
if
(
g_UnDeleteStack
)
if
(
g_UnDeleteStack
)
g_UnDeleteStack
[
g_UnDeleteStackPtr
-
1
]
=
Pnext
;
g_UnDeleteStack
[
g_UnDeleteStackPtr
-
1
]
=
Pnext
;
}
}
else
else
{
{
if
(
m_StructType
==
TYPEZONE
)
if
(
m_StructType
==
TYPEZONE
)
{
{
((
BOARD
*
)
Pback
)
->
m_Zone
=
(
TRACK
*
)
Pnext
;
(
(
BOARD
*
)
Pback
)
->
m_Zone
=
(
TRACK
*
)
Pnext
;
}
}
else
else
{
{
((
BOARD
*
)
Pback
)
->
m_Track
=
(
TRACK
*
)
Pnext
;
(
(
BOARD
*
)
Pback
)
->
m_Track
=
(
TRACK
*
)
Pnext
;
}
}
}
}
}
}
}
}
/* Modification du chainage avant */
/* Modification du chainage avant */
if
(
Pnext
)
Pnext
->
Pback
=
Pback
;
if
(
Pnext
)
Pnext
->
Pback
=
Pback
;
Pnext
=
Pback
=
NULL
;
Pnext
=
Pback
=
NULL
;
}
}
/************************************************************/
/************************************************************/
void
TRACK
::
Insert
(
BOARD
*
Pcb
,
EDA_BaseStruct
*
InsertPoint
)
void
TRACK
::
Insert
(
BOARD
*
Pcb
,
EDA_BaseStruct
*
InsertPoint
)
/************************************************************/
/************************************************************/
/* Ajoute un element ou une liste a une liste de base
/* Ajoute un element ou une liste a une liste de base
Si Insertpoint == NULL: insertion en debut de
*
Si Insertpoint == NULL: insertion en debut de
liste Pcb->Track ou Pcb->Zone
*
liste Pcb->Track ou Pcb->Zone
Insertion a la suite de InsertPoint
*
Insertion a la suite de InsertPoint
Si InsertPoint == NULL, insertion en tete de liste
*
Si InsertPoint == NULL, insertion en tete de liste
*/
*/
{
{
TRACK
*
track
,
*
NextS
;
TRACK
*
track
,
*
NextS
;
/* Insertion du debut de la chaine a greffer */
if
(
InsertPoint
==
NULL
)
/* Insertion du debut de la chaine a greffer */
{
if
(
InsertPoint
==
NULL
)
Pback
=
Pcb
;
{
if
(
m_StructType
==
TYPEZONE
)
Pback
=
Pcb
;
{
if
(
m_StructType
==
TYPEZONE
)
NextS
=
Pcb
->
m_Zone
;
Pcb
->
m_Zone
=
this
;
{
}
NextS
=
Pcb
->
m_Zone
;
Pcb
->
m_Zone
=
this
;
else
}
{
else
NextS
=
Pcb
->
m_Track
;
Pcb
->
m_Track
=
this
;
{
}
NextS
=
Pcb
->
m_Track
;
Pcb
->
m_Track
=
this
;
}
}
}
else
else
{
{
NextS
=
(
TRACK
*
)
InsertPoint
->
Pnext
;
NextS
=
(
TRACK
*
)
InsertPoint
->
Pnext
;
Pback
=
InsertPoint
;
Pback
=
InsertPoint
;
InsertPoint
->
Pnext
=
this
;
InsertPoint
->
Pnext
=
this
;
}
}
/* Chainage de la fin de la liste a greffer */
/* Chainage de la fin de la liste a greffer */
track
=
this
;
track
=
this
;
while
(
track
->
Pnext
)
track
=
(
TRACK
*
)
track
->
Pnext
;
while
(
track
->
Pnext
)
/* Track pointe la fin de la chaine a greffer */
track
=
(
TRACK
*
)
track
->
Pnext
;
track
->
Pnext
=
NextS
;
if
(
NextS
)
NextS
->
Pback
=
track
;
/* Track pointe la fin de la chaine a greffer */
track
->
Pnext
=
NextS
;
if
(
NextS
)
NextS
->
Pback
=
track
;
}
}
/***********************************************/
/***********************************************/
TRACK
*
TRACK
::
GetBestInsertPoint
(
BOARD
*
Pcb
)
TRACK
*
TRACK
::
GetBestInsertPoint
(
BOARD
*
Pcb
)
/***********************************************/
/***********************************************/
/* Recherche du meilleur point d'insertion pour le nouveau segment de piste
/* Recherche du meilleur point d'insertion pour le nouveau segment de piste
Retourne
*
Retourne
un pointeur sur le segment de piste APRES lequel l'insertion
*
un pointeur sur le segment de piste APRES lequel l'insertion
doit se faire ( dernier segment du net d'apartenance )
*
doit se faire ( dernier segment du net d'apartenance )
NULL si pas de piste ( liste vide );
*
NULL si pas de piste ( liste vide );
*/
*/
{
{
TRACK
*
track
,
*
NextTrack
;
TRACK
*
track
,
*
NextTrack
;
if
(
m_StructType
==
TYPEZONE
)
track
=
Pcb
->
m_Zone
;
if
(
m_StructType
==
TYPEZONE
)
else
track
=
Pcb
->
m_Track
;
track
=
Pcb
->
m_Zone
;
else
/* Traitement du debut de liste */
track
=
Pcb
->
m_Track
;
if
(
track
==
NULL
)
return
(
NULL
);
/* pas de piste ! */
if
(
m_NetCode
<
track
->
m_NetCode
)
/* insertion en tete de liste */
/* Traitement du debut de liste */
return
(
NULL
);
if
(
track
==
NULL
)
return
NULL
;
/* pas de piste ! */
while
(
(
NextTrack
=
(
TRACK
*
)
track
->
Pnext
)
!=
NULL
)
if
(
m_NetCode
<
track
->
m_NetCode
)
/* insertion en tete de liste */
{
return
NULL
;
if
(
NextTrack
->
m_NetCode
>
this
->
m_NetCode
)
break
;
track
=
NextTrack
;
while
(
(
NextTrack
=
(
TRACK
*
)
track
->
Pnext
)
!=
NULL
)
}
{
return
(
track
);
if
(
NextTrack
->
m_NetCode
>
this
->
m_NetCode
)
break
;
track
=
NextTrack
;
}
return
track
;
}
}
/* Recherche du debut du net
/* Recherche du debut du net
( les elements sont classes par net_code croissant )
*
( les elements sont classes par net_code croissant )
la recherche se fait a partir de this
*
la recherche se fait a partir de this
si net_code == -1 le netcode de this sera utilise
*
si net_code == -1 le netcode de this sera utilise
Retourne un pointeur sur le debut du net, ou NULL si net non trouve
*
Retourne un pointeur sur le debut du net, ou NULL si net non trouve
*/
*/
TRACK
*
TRACK
::
GetStartNetCode
(
int
NetCode
)
TRACK
*
TRACK
::
GetStartNetCode
(
int
NetCode
)
{
{
TRACK
*
Track
=
this
;
TRACK
*
Track
=
this
;
int
ii
=
0
;
int
ii
=
0
;
if
(
NetCode
==
-
1
)
NetCode
=
m_NetCode
;
if
(
NetCode
==
-
1
)
NetCode
=
m_NetCode
;
while
(
Track
!=
NULL
)
{
while
(
Track
!=
NULL
)
if
(
Track
->
m_NetCode
>
NetCode
)
break
;
{
if
(
Track
->
m_NetCode
==
NetCode
)
if
(
Track
->
m_NetCode
>
NetCode
)
{
break
;
ii
++
;
break
;
if
(
Track
->
m_NetCode
==
NetCode
)
}
{
Track
=
(
TRACK
*
)
Track
->
Pnext
;
ii
++
;
break
;
}
}
if
(
ii
)
return
(
Track
);
Track
=
(
TRACK
*
)
Track
->
Pnext
;
else
return
(
NULL
);
}
if
(
ii
)
return
Track
;
else
return
NULL
;
}
}
/* Recherche de la fin du net
/* Recherche de la fin du net
Retourne un pointeur sur la fin du net, ou NULL si net non trouve
*
Retourne un pointeur sur la fin du net, ou NULL si net non trouve
*/
*/
TRACK
*
TRACK
::
GetEndNetCode
(
int
NetCode
)
TRACK
*
TRACK
::
GetEndNetCode
(
int
NetCode
)
{
{
TRACK
*
NextS
,
*
Track
=
this
;
TRACK
*
NextS
,
*
Track
=
this
;
int
ii
=
0
;
int
ii
=
0
;
if
(
Track
==
NULL
)
return
(
NULL
);
if
(
Track
==
NULL
)
return
NULL
;
if
(
NetCode
==
-
1
)
NetCode
=
m_NetCode
;
if
(
NetCode
==
-
1
)
while
(
Track
!=
NULL
)
NetCode
=
m_NetCode
;
{
NextS
=
(
TRACK
*
)
Track
->
Pnext
;
while
(
Track
!=
NULL
)
if
(
Track
->
m_NetCode
==
NetCode
)
ii
++
;
{
if
(
NextS
==
NULL
)
break
;
NextS
=
(
TRACK
*
)
Track
->
Pnext
;
if
(
NextS
->
m_NetCode
>
NetCode
)
break
;
if
(
Track
->
m_NetCode
==
NetCode
)
Track
=
NextS
;
ii
++
;
}
if
(
NextS
==
NULL
)
if
(
ii
)
return
(
Track
);
break
;
else
return
(
NULL
);
if
(
NextS
->
m_NetCode
>
NetCode
)
break
;
Track
=
NextS
;
}
if
(
ii
)
return
Track
;
else
return
NULL
;
}
}
/**********************************/
/**********************************/
TRACK
*
TRACK
::
Copy
(
int
NbSegm
)
TRACK
*
TRACK
::
Copy
(
int
NbSegm
)
/**********************************/
/**********************************/
/* Copie d'un Element ou d'une chaine de n elements
/* Copie d'un Element ou d'une chaine de n elements
Retourne un pointeur sur le nouvel element ou le debut de la
*
Retourne un pointeur sur le nouvel element ou le debut de la
nouvelle chaine
*
nouvelle chaine
*/
*/
{
{
TRACK
*
NewTrack
,
*
FirstTrack
,
*
OldTrack
,
*
Source
=
this
;
TRACK
*
NewTrack
,
*
FirstTrack
,
*
OldTrack
,
*
Source
=
this
;
int
ii
;
int
ii
;
FirstTrack
=
NewTrack
=
new
TRACK
(
NULL
);
FirstTrack
=
NewTrack
=
new
TRACK
(
NULL
);
*
NewTrack
=
*
Source
;
*
NewTrack
=
*
Source
;
/* correction du chainage */
NewTrack
->
Pback
=
NewTrack
->
Pnext
=
NULL
;
/* correction du chainage */
NewTrack
->
Pback
=
NewTrack
->
Pnext
=
NULL
;
/* reset des pointeurs auxiliaires */
NewTrack
->
start
=
NewTrack
->
end
=
NULL
;
/* reset des pointeurs auxiliaires */
NewTrack
->
start
=
NewTrack
->
end
=
NULL
;
if
(
NbSegm
<=
1
)
return
(
FirstTrack
);
if
(
NbSegm
<=
1
)
for
(
ii
=
1
;
ii
<
NbSegm
;
ii
++
)
return
FirstTrack
;
{
Source
=
(
TRACK
*
)
Source
->
Pnext
;
for
(
ii
=
1
;
ii
<
NbSegm
;
ii
++
)
if
(
Source
==
NULL
)
break
;
{
OldTrack
=
NewTrack
;
Source
=
(
TRACK
*
)
Source
->
Pnext
;
NewTrack
=
new
TRACK
(
m_Parent
);
if
(
Source
==
NULL
)
if
(
NewTrack
==
NULL
)
break
;
break
;
NewTrack
->
m_StructType
=
Source
->
m_StructType
;
OldTrack
=
NewTrack
;
NewTrack
->
m_Shape
=
Source
->
m_Shape
;
NewTrack
=
new
TRACK
(
m_Parent
);
NewTrack
->
m_NetCode
=
Source
->
m_NetCode
;
NewTrack
->
m_Flags
=
Source
->
m_Flags
;
if
(
NewTrack
==
NULL
)
NewTrack
->
m_TimeStamp
=
Source
->
m_TimeStamp
;
break
;
NewTrack
->
SetStatus
(
Source
->
ReturnStatus
()
);
NewTrack
->
m_StructType
=
Source
->
m_StructType
;
NewTrack
->
m_Layer
=
Source
->
m_Layer
;
NewTrack
->
m_Shape
=
Source
->
m_Shape
;
NewTrack
->
m_Start
=
Source
->
m_Start
;
NewTrack
->
m_NetCode
=
Source
->
m_NetCode
;
NewTrack
->
m_End
=
Source
->
m_End
;
NewTrack
->
m_Flags
=
Source
->
m_Flags
;
NewTrack
->
m_Width
=
Source
->
m_Width
;
NewTrack
->
m_TimeStamp
=
Source
->
m_TimeStamp
;
NewTrack
->
SetStatus
(
Source
->
ReturnStatus
()
);
NewTrack
->
Insert
(
NULL
,
OldTrack
);
NewTrack
->
m_Layer
=
Source
->
m_Layer
;
}
NewTrack
->
m_Start
=
Source
->
m_Start
;
NewTrack
->
m_End
=
Source
->
m_End
;
return
(
FirstTrack
);
NewTrack
->
m_Width
=
Source
->
m_Width
;
NewTrack
->
Insert
(
NULL
,
OldTrack
);
}
return
FirstTrack
;
}
}
/********************************************/
/********************************************/
bool
TRACK
::
WriteTrackDescr
(
FILE
*
File
)
bool
TRACK
::
WriteTrackDescr
(
FILE
*
File
)
/********************************************/
/********************************************/
{
{
int
type
;
int
type
;
type
=
0
;
type
=
0
;
if
(
m_StructType
==
TYPEVIA
)
type
=
1
;
if
(
m_StructType
==
TYPEVIA
)
type
=
1
;
if
(
GetState
(
DELETED
)
)
return
FALSE
;
if
(
GetState
(
DELETED
)
)
return
FALSE
;
fprintf
(
File
,
"Po %d %d %d %d %d %d
\n
"
,
m_Shape
,
fprintf
(
File
,
"Po %d %d %d %d %d %d
\n
"
,
m_Shape
,
m_Start
.
x
,
m_Start
.
y
,
m_End
.
x
,
m_End
.
y
,
m_Width
);
m_Start
.
x
,
m_Start
.
y
,
m_End
.
x
,
m_End
.
y
,
m_Width
);
fprintf
(
File
,
"De %d %d %d %lX %X
\n
"
,
fprintf
(
File
,
"De %d %d %d %lX %X
\n
"
,
m_Layer
,
type
,
m_NetCode
,
m_Layer
,
type
,
m_NetCode
,
m_TimeStamp
,
ReturnStatus
()
);
m_TimeStamp
,
ReturnStatus
()
);
return
TRUE
;
return
TRUE
;
}
}
/**********************************************************************/
/**********************************************************************/
void
TRACK
::
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
draw_mode
)
void
TRACK
::
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
draw_mode
)
/*********************************************************************/
/*********************************************************************/
/* routine de trace de 1 segment de piste.
Parametres :
/* routine de trace de 1 segment de piste.
draw_mode = mode ( GR_XOR, GR_OR..)
* Parametres :
*/
* draw_mode = mode ( GR_XOR, GR_OR..)
*/
{
{
int
l_piste
;
int
l_piste
;
int
color
;
int
color
;
int
zoom
;
int
zoom
;
int
rayon
;
int
rayon
;
int
curr_layer
=
((
PCB_SCREEN
*
)
panel
->
GetScreen
())
->
m_Active_Layer
;
int
curr_layer
=
(
(
PCB_SCREEN
*
)
panel
->
GetScreen
()
)
->
m_Active_Layer
;
if
(
m_StructType
==
TYPEZONE
&&
(
!
DisplayOpt
.
DisplayZones
)
)
if
(
m_StructType
==
TYPEZONE
&&
(
!
DisplayOpt
.
DisplayZones
)
)
return
;
return
;
GRSetDrawMode
(
DC
,
draw_mode
);
GRSetDrawMode
(
DC
,
draw_mode
);
if
(
m_StructType
==
TYPEVIA
)
/* VIA rencontree */
if
(
m_StructType
==
TYPEVIA
)
/* VIA rencontree */
color
=
g_DesignSettings
.
m_ViaColor
[
m_Shape
];
color
=
g_DesignSettings
.
m_ViaColor
[
m_Shape
];
else
color
=
g_DesignSettings
.
m_LayerColor
[
m_Layer
];
else
color
=
g_DesignSettings
.
m_LayerColor
[
m_Layer
];
if
(
(
color
&
(
ITEM_NOT_SHOW
|
HIGHT_LIGHT_FLAG
))
==
ITEM_NOT_SHOW
)
return
;
if
(
(
color
&
(
ITEM_NOT_SHOW
|
HIGHT_LIGHT_FLAG
)
)
==
ITEM_NOT_SHOW
)
if
(
DisplayOpt
.
ContrastModeDisplay
)
return
;
{
if
(
m_StructType
==
TYPEVIA
)
if
(
DisplayOpt
.
ContrastModeDisplay
)
{
{
if
(
!
((
SEGVIA
*
)
this
)
->
IsViaOnLayer
(
curr_layer
)
)
if
(
m_StructType
==
TYPEVIA
)
{
{
color
&=
~
MASKCOLOR
;
if
(
!
(
(
SEGVIA
*
)
this
)
->
IsViaOnLayer
(
curr_layer
)
)
color
|=
DARKDARKGRAY
;
{
}
color
&=
~
MASKCOLOR
;
}
color
|=
DARKDARKGRAY
;
else
if
(
m_Layer
!=
curr_layer
)
}
{
}
color
&=
~
MASKCOLOR
;
else
if
(
m_Layer
!=
curr_layer
)
color
|=
DARKDARKGRAY
;
{
}
color
&=
~
MASKCOLOR
;
}
color
|=
DARKDARKGRAY
;
}
if
(
draw_mode
&
GR_SURBRILL
)
}
{
if
(
draw_mode
&
GR_AND
)
color
&=
~
HIGHT_LIGHT_FLAG
;
if
(
draw_mode
&
GR_SURBRILL
)
else
color
|=
HIGHT_LIGHT_FLAG
;
{
}
if
(
draw_mode
&
GR_AND
)
if
(
color
&
HIGHT_LIGHT_FLAG
)
color
&=
~
HIGHT_LIGHT_FLAG
;
color
=
ColorRefs
[
color
&
MASKCOLOR
].
m_LightColor
;
else
color
|=
HIGHT_LIGHT_FLAG
;
zoom
=
panel
->
GetZoom
();
}
if
(
color
&
HIGHT_LIGHT_FLAG
)
l_piste
=
m_Width
>>
1
;
color
=
ColorRefs
[
color
&
MASKCOLOR
].
m_LightColor
;
if
(
m_StructType
==
TYPEVIA
)
/* VIA rencontree */
zoom
=
panel
->
GetZoom
();
{
rayon
=
l_piste
;
if
(
rayon
<
zoom
)
rayon
=
zoom
;
l_piste
=
m_Width
>>
1
;
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
,
color
)
;
if
(
rayon
>
(
4
*
zoom
)
)
if
(
m_StructType
==
TYPEVIA
)
/* VIA rencontree */
{
{
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
=
l_piste
;
if
(
rayon
<
zoom
)
rayon
-
(
2
*
zoom
)
,
color
);
rayon
=
zoom
;
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
,
color
);
if
(
DisplayOpt
.
DisplayTrackIsol
)
if
(
rayon
>
(
4
*
zoom
)
)
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
{
rayon
+
g_DesignSettings
.
m_TrackClearence
,
color
);
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
}
rayon
-
(
2
*
zoom
),
color
);
return
;
}
if
(
DisplayOpt
.
DisplayTrackIsol
)
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
if
(
m_Shape
==
S_CIRCLE
)
rayon
+
g_DesignSettings
.
m_TrackClearence
,
color
);
{
}
rayon
=
(
int
)
hypot
((
double
)(
m_End
.
x
-
m_Start
.
x
),
return
;
(
double
)(
m_End
.
y
-
m_Start
.
y
)
);
}
if
(
(
l_piste
/
zoom
)
<
L_MIN_DESSIN
)
{
if
(
m_Shape
==
S_CIRCLE
)
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
,
color
)
;
{
}
rayon
=
(
int
)
hypot
(
(
double
)
(
m_End
.
x
-
m_Start
.
x
),
(
double
)
(
m_End
.
y
-
m_Start
.
y
)
);
else
if
(
(
l_piste
/
zoom
)
<
L_MIN_DESSIN
)
{
{
if
(
l_piste
<=
zoom
)
/* trace simplifie si l_piste/zoom <= 1 */
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
,
color
);
{
}
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
,
color
);
else
}
{
else
if
(
(
!
DisplayOpt
.
DisplayPcbTrackFill
)
||
GetState
(
FORCE_SKETCH
))
if
(
l_piste
<=
zoom
)
/* trace simplifie si l_piste/zoom <= 1 */
{
{
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
-
l_piste
,
color
);
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
,
color
);
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
+
l_piste
,
color
);
}
}
else
if
(
(
!
DisplayOpt
.
DisplayPcbTrackFill
)
||
GetState
(
FORCE_SKETCH
)
)
else
{
{
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
-
l_piste
,
color
);
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
,
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
+
l_piste
,
color
);
m_Width
,
color
);
}
}
else
}
{
return
;
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
,
}
m_Width
,
color
);
}
if
(
(
l_piste
/
zoom
)
<
L_MIN_DESSIN
)
}
{
return
;
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
}
m_End
.
x
,
m_End
.
y
,
color
);
return
;
if
(
(
l_piste
/
zoom
)
<
L_MIN_DESSIN
)
}
{
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
if
(
(
!
DisplayOpt
.
DisplayPcbTrackFill
)
||
GetState
(
FORCE_SKETCH
)
)
m_End
.
x
,
m_End
.
y
,
color
);
{
return
;
GRCSegm
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
}
m_End
.
x
,
m_End
.
y
,
m_Width
,
color
)
;
}
if
(
(
!
DisplayOpt
.
DisplayPcbTrackFill
)
||
GetState
(
FORCE_SKETCH
)
)
else
{
{
GRCSegm
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
GRFillCSegm
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
m_End
.
x
,
m_End
.
y
,
m_Width
,
color
);
m_End
.
x
,
m_End
.
y
,
m_Width
,
color
)
;
}
}
else
{
/* Trace de l'isolation (pour segments type CUIVRE et TRACK uniquement */
GRFillCSegm
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
if
(
(
DisplayOpt
.
DisplayTrackIsol
)
&&
(
m_Layer
<=
CMP_N
)
m_End
.
x
,
m_End
.
y
,
m_Width
,
color
);
&&
(
m_StructType
==
TYPETRACK
)
)
}
{
GRCSegm
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
/* Trace de l'isolation (pour segments type CUIVRE et TRACK uniquement */
m_End
.
x
,
m_End
.
y
,
if
(
(
DisplayOpt
.
DisplayTrackIsol
)
&&
(
m_Layer
<=
CMP_N
)
m_Width
+
(
g_DesignSettings
.
m_TrackClearence
*
2
),
color
)
;
&&
(
m_StructType
==
TYPETRACK
)
)
}
{
GRCSegm
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
m_End
.
x
,
m_End
.
y
,
m_Width
+
(
g_DesignSettings
.
m_TrackClearence
*
2
),
color
);
}
}
}
pcbnew/collectors.cpp
View file @
2e13ccf0
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
// see collectors.h
// see collectors.h
const
KICAD_T
ARROW
COLLECTOR
::
AllBoardItems
[]
=
{
const
KICAD_T
GENERAL
COLLECTOR
::
AllBoardItems
[]
=
{
TYPETEXTE
,
TYPETEXTE
,
TYPEDRAWSEGMENT
,
TYPEDRAWSEGMENT
,
TYPECOTATION
,
TYPECOTATION
,
...
@@ -59,45 +59,82 @@ const KICAD_T ARROWCOLLECTOR::AllBoardItems[] = {
...
@@ -59,45 +59,82 @@ const KICAD_T ARROWCOLLECTOR::AllBoardItems[] = {
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
* else SCAN_CONTINUE;
* else SCAN_CONTINUE;
*/
*/
SEARCH_RESULT
ARROW
COLLECTOR
::
Inspect
(
EDA_BaseStruct
*
testItem
,
const
void
*
notUsed
)
SEARCH_RESULT
GENERAL
COLLECTOR
::
Inspect
(
EDA_BaseStruct
*
testItem
,
const
void
*
notUsed
)
{
{
BOARD_ITEM
*
item
=
(
BOARD_ITEM
*
)
testItem
;
BOARD_ITEM
*
item
=
(
BOARD_ITEM
*
)
testItem
;
#if 1 // debugging
static
int
breakhere
=
0
;
switch
(
item
->
m_StructType
)
{
case
TYPEPAD
:
breakhere
++
;
break
;
case
TYPEVIA
:
breakhere
++
;
break
;
case
TYPETRACK
:
breakhere
++
;
break
;
case
TYPETEXTE
:
breakhere
++
;
break
;
case
TYPEDRAWSEGMENT
:
breakhere
++
;
break
;
case
TYPECOTATION
:
breakhere
++
;
break
;
case
TYPETEXTEMODULE
:
TEXTE_MODULE
*
tm
;
tm
=
(
TEXTE_MODULE
*
)
item
;
if
(
tm
->
m_Text
==
wxT
(
"U5"
)
)
{
breakhere
++
;
}
break
;
case
TYPEMODULE
:
breakhere
++
;
break
;
default
:
breakhere
++
;
break
;
}
#endif
switch
(
item
->
m_StructType
)
switch
(
item
->
m_StructType
)
{
{
case
TYPEPAD
:
case
TYPEPAD
:
case
TYPEVIA
:
case
TYPEVIA
:
/*
if( item->IsOnOneOfTheseLayers( m_LayerMask ) )
{
if( item->HitTest( refPos ) )
Append2nd( testItem );
}
*/
break
;
case
TYPETRACK
:
case
TYPETRACK
:
case
TYPETEXTE
:
case
TYPETEXTE
:
case
TYPEDRAWSEGMENT
:
case
TYPEDRAWSEGMENT
:
case
TYPECOTATION
:
case
TYPECOTATION
:
case
TYPETEXTEMODULE
:
case
TYPETEXTEMODULE
:
case
TYPEMODULE
:
case
TYPEMODULE
:
if
(
item
->
GetLayer
()
==
m_PreferredLayer
)
// The primary search criteria:
if
(
item
->
IsOnLayer
(
m_PreferredLayer
)
)
{
{
if
(
item
->
HitTest
(
m_RefPos
)
)
if
(
item
->
HitTest
(
m_RefPos
)
)
Append
(
item
);
{
if
(
!
item
->
IsLocked
()
)
Append
(
item
);
else
Append2nd
(
item
);
// 2nd if locked.
}
}
}
/*
// The secondary search criteria
else
if
(
item
->
IsOnOneOfTheseLayers
(
m_LayerMask
)
)
else
if
(
item
->
IsOnOneOfTheseLayers
(
m_LayerMask
)
)
{
{
if
(
item
->
HitTest
(
m_RefPos
)
)
if
(
item
->
HitTest
(
m_RefPos
)
)
Append2nd
(
item
);
Append2nd
(
item
);
}
}
*/
break
;
break
;
default
:
default
:
;
// nothing
printf
(
"OOPS, not expecting class type %d
\n
"
,
item
->
m_StructType
);
}
}
return
SEARCH_CONTINUE
;
return
SEARCH_CONTINUE
;
...
@@ -105,16 +142,23 @@ SEARCH_RESULT ARROWCOLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* not
...
@@ -105,16 +142,23 @@ SEARCH_RESULT ARROWCOLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* not
// see collectors.h
// see collectors.h
void
ARROW
COLLECTOR
::
Scan
(
BOARD
*
board
,
const
wxPoint
&
refPos
,
void
GENERAL
COLLECTOR
::
Scan
(
BOARD
*
board
,
const
wxPoint
&
refPos
,
int
aPreferredLayer
,
int
aLayerMask
)
int
aPreferredLayer
,
int
aLayerMask
)
{
{
Empty
();
// empty the collection, primary criteria list
Empty
();
// empty the collection, primary criteria list
Empty2nd
();
// empty the collection, secondary criteria list
Empty2nd
();
// empty the collection, secondary criteria list
SetPreferredLayer
(
aPreferredLayer
);
SetLayerMask
(
aLayerMask
);
/* remember where the snapshot was taken from and pass refPos to
/* remember where the snapshot was taken from and pass refPos to
the Inspect() function.
the Inspect() function.
*/
*/
SetRefPos
(
refPos
);
SetRefPos
(
refPos
);
#if defined(DEBUG)
std
::
cout
<<
'\n'
;
#endif
// visit the board with the INSPECTOR (me).
// visit the board with the INSPECTOR (me).
board
->
Visit
(
this
,
// INSPECTOR* inspector
board
->
Visit
(
this
,
// INSPECTOR* inspector
...
@@ -123,7 +167,9 @@ void ARROWCOLLECTOR::Scan( BOARD* board, const wxPoint& refPos,
...
@@ -123,7 +167,9 @@ void ARROWCOLLECTOR::Scan( BOARD* board, const wxPoint& refPos,
SetTimeNow
();
// when snapshot was taken
SetTimeNow
();
// when snapshot was taken
// @todo: append 2nd list onto end of the first "list"
// append 2nd list onto end of the first "list"
for
(
unsigned
i
=
0
;
i
<
list2nd
.
size
();
++
i
)
Append
(
list2nd
[
i
]
);
Empty2nd
();
Empty2nd
();
}
}
...
...
pcbnew/collectors.h
View file @
2e13ccf0
...
@@ -33,26 +33,18 @@
...
@@ -33,26 +33,18 @@
#include "class_collector.h"
#include "class_collector.h"
class
RAT1COLLECTOR
:
public
COLLECTOR
{
;
};
/**
/**
* Class
ARROW
COLLECTOR
* Class
GENERAL
COLLECTOR
* is intended for use when the right click button is pressed, or when the
* is intended for use when the right click button is pressed, or when the
* plain "arrow" tool is in effect. This class can be used by window classes
* plain "arrow" tool is in effect. This class can be used by window classes
* such as WinEDA_PcbFrame.
* such as WinEDA_PcbFrame.
*
*
* Philosophy: this class knows nothing of the context in which a
s
BOARD is used
* Philosophy: this class knows nothing of the context in which a BOARD is used
* and that means it knows nothing about which layers are visible or current,
* and that means it knows nothing about which layers are visible or current,
* but can handle those concerns by the SetPreferredLayer() function and the
* but can handle those concerns by the SetPreferredLayer() function and the
* SetLayerMask() fuction.
* SetLayerMask() fuction.
*/
*/
class
ARROW
COLLECTOR
:
public
COLLECTOR
class
GENERAL
COLLECTOR
:
public
COLLECTOR
{
{
/**
/**
* A place to hold collected objects which don't match precisely the search
* A place to hold collected objects which don't match precisely the search
...
@@ -60,7 +52,7 @@ class ARROWCOLLECTOR : public COLLECTOR
...
@@ -60,7 +52,7 @@ class ARROWCOLLECTOR : public COLLECTOR
* "2nd" choice, which will be appended to the end of COLLECTOR's prime
* "2nd" choice, which will be appended to the end of COLLECTOR's prime
* "list" at the end of the search.
* "list" at the end of the search.
*/
*/
std
::
vector
<
EDA_BaseStruct
*>
list2nd
;
std
::
vector
<
BOARD_ITEM
*>
list2nd
;
/**
/**
...
@@ -77,9 +69,9 @@ public:
...
@@ -77,9 +69,9 @@ public:
/**
/**
* Constructor
ARROW
COLLECTOR
* Constructor
GENERAL
COLLECTOR
*/
*/
ARROW
COLLECTOR
()
GENERAL
COLLECTOR
()
{
{
m_LayerMask
=
0
;
m_LayerMask
=
0
;
SetScanTypes
(
AllBoardItems
);
SetScanTypes
(
AllBoardItems
);
...
@@ -90,7 +82,7 @@ public:
...
@@ -90,7 +82,7 @@ public:
list2nd
.
clear
();
list2nd
.
clear
();
}
}
void
Append2nd
(
EDA_BaseStruct
*
item
)
void
Append2nd
(
BOARD_ITEM
*
item
)
{
{
list2nd
.
push_back
(
item
);
list2nd
.
push_back
(
item
);
}
}
...
@@ -99,7 +91,7 @@ public:
...
@@ -99,7 +91,7 @@ public:
/**
/**
* Function SetLayerMask
* Function SetLayerMask
* takes a bit-mapped layer mask and records it. During the scan/search,
* takes a bit-mapped layer mask and records it. During the scan/search,
* this is used as a secondary criterion. That is, if there is no direct
* this is used as a secondary
search
criterion. That is, if there is no direct
* layer match with COLLECTOR::m_PreferredLayer (the primary criterion),
* layer match with COLLECTOR::m_PreferredLayer (the primary criterion),
* then an object on any layer given in this bit-map is recorded as a
* then an object on any layer given in this bit-map is recorded as a
* second choice object if it also HitTest()s true.
* second choice object if it also HitTest()s true.
...
@@ -115,6 +107,21 @@ public:
...
@@ -115,6 +107,21 @@ public:
}
}
/**
* Function operator[int]
* overloads COLLECTOR::operator[](int) to return a BOARD_ITEM* instead of
* an EDA_BaseStruct* type.
* @param ndx The index into the list.
* @return BOARD_ITEM* - or something derived from it, or NULL.
*/
BOARD_ITEM
*
operator
[](
int
ndx
)
const
{
if
(
(
unsigned
)
ndx
<
(
unsigned
)
GetCount
()
)
return
(
BOARD_ITEM
*
)
list
[
ndx
];
return
NULL
;
}
/**
/**
* Function Inspect
* Function Inspect
* is the examining function within the INSPECTOR which is passed to the
* is the examining function within the INSPECTOR which is passed to the
...
@@ -133,6 +140,8 @@ public:
...
@@ -133,6 +140,8 @@ public:
* scans a BOARD using this class's Inspector method, which does the collection.
* scans a BOARD using this class's Inspector method, which does the collection.
* @param board A BOARD to scan.
* @param board A BOARD to scan.
* @param refPos A wxPoint to use in hit-testing.
* @param refPos A wxPoint to use in hit-testing.
* @param aPreferredLayer The layer meeting the primary search criterion.
* @param aLayerMask The layers, in bit-mapped form, meeting the secondary search criterion.
*/
*/
void
Scan
(
BOARD
*
board
,
const
wxPoint
&
refPos
,
int
aPreferredLayer
,
int
aLayerMask
);
void
Scan
(
BOARD
*
board
,
const
wxPoint
&
refPos
,
int
aPreferredLayer
,
int
aLayerMask
);
};
};
...
...
pcbnew/controle.cpp
View file @
2e13ccf0
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include "id.h"
#include "id.h"
#include "protos.h"
#include "protos.h"
#include "collectors.h"
/* Routines Locales : */
/* Routines Locales : */
...
@@ -44,8 +45,6 @@ void RemoteCommand( const char* cmdline )
...
@@ -44,8 +45,6 @@ void RemoteCommand( const char* cmdline )
if
(
(
idcmd
==
NULL
)
||
(
text
==
NULL
)
)
if
(
(
idcmd
==
NULL
)
||
(
text
==
NULL
)
)
return
;
return
;
// @todo: this code does not reposition the window when the chosen part is scrolled off screen.
if
(
strcmp
(
idcmd
,
"$PART:"
)
==
0
)
if
(
strcmp
(
idcmd
,
"$PART:"
)
==
0
)
{
{
msg
=
CONV_FROM_UTF8
(
text
);
msg
=
CONV_FROM_UTF8
(
text
);
...
@@ -93,11 +92,11 @@ void RemoteCommand( const char* cmdline )
...
@@ -93,11 +92,11 @@ void RemoteCommand( const char* cmdline )
if
(
netcode
>
0
)
/* hightlighted the net selected net*/
if
(
netcode
>
0
)
/* hightlighted the net selected net*/
{
{
if
(
g_HightLigt_Status
)
/* erase the old hightlighted net */
if
(
g_HightLigt_Status
)
/* erase the old hightlighted net */
frame
->
Hight_Light
(
&
dc
);
frame
->
Hight_Light
(
&
dc
);
g_HightLigth_NetCode
=
netcode
;
g_HightLigth_NetCode
=
netcode
;
frame
->
Hight_Light
(
&
dc
);
/* hightlighted the new one */
frame
->
Hight_Light
(
&
dc
);
/* hightlighted the new one */
frame
->
DrawPanel
->
CursorOff
(
&
dc
);
frame
->
DrawPanel
->
CursorOff
(
&
dc
);
frame
->
GetScreen
()
->
m_Curseur
=
pad
->
m_Pos
;
frame
->
GetScreen
()
->
m_Curseur
=
pad
->
m_Pos
;
...
@@ -113,13 +112,13 @@ void RemoteCommand( const char* cmdline )
...
@@ -113,13 +112,13 @@ void RemoteCommand( const char* cmdline )
frame
->
Affiche_Message
(
msg
);
frame
->
Affiche_Message
(
msg
);
}
}
if
(
module
)
// center the module on screen.
if
(
module
)
//
if found,
center the module on screen.
frame
->
Recadre_Trace
(
false
);
frame
->
Recadre_Trace
(
false
);
}
}
/***********************************************************************/
/***********************************************************************/
EDA_BaseStruct
*
WinEDA_BasePcbFrame
::
PcbGeneralLocateAndDisplay
(
void
)
BOARD_ITEM
*
WinEDA_BasePcbFrame
::
PcbGeneralLocateAndDisplay
(
)
/***********************************************************************/
/***********************************************************************/
/* Search an item under the mouse cursor.
/* Search an item under the mouse cursor.
...
@@ -127,12 +126,43 @@ EDA_BaseStruct* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( void )
...
@@ -127,12 +126,43 @@ EDA_BaseStruct* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( void )
* if nothing found, an item will be searched without layer restriction
* if nothing found, an item will be searched without layer restriction
*/
*/
{
{
EDA_BaseStruct
*
item
;
BOARD_ITEM
*
item
;
#if defined(DEBUG)
// test scaffolding for Scan():
m_Collector
->
Scan
(
m_Pcb
,
GetScreen
()
->
RefPos
(
true
),
// these two are inadequate, because the layer support
// in Kicad is not elegant or easily understood.
// The final solution will be a new class COLLECTORS_GUIDE!
GetScreen
()
->
m_Active_Layer
,
g_DesignSettings
.
GetVisibleLayers
()
);
// use only the first one collected for now.
item
=
(
*
m_Collector
)[
0
];
// grab first one, may be NULL
std
::
cout
<<
"collected "
<<
m_Collector
->
GetCount
()
<<
'\n'
;
// debugging only
if
(
item
)
{
item
->
Display_Infos
(
this
);
// debugging: print out the collected items, showing their order too.
for
(
unsigned
i
=
0
;
i
<
m_Collector
->
GetCount
();
++
i
)
(
*
m_Collector
)[
i
]
->
Show
(
0
,
std
::
cout
);
}
return
item
;
#else
item
=
Locate
(
CURSEUR_OFF_GRILLE
,
GetScreen
()
->
m_Active_Layer
);
item
=
Locate
(
CURSEUR_OFF_GRILLE
,
GetScreen
()
->
m_Active_Layer
);
if
(
item
==
NULL
)
if
(
item
==
NULL
)
item
=
Locate
(
CURSEUR_OFF_GRILLE
,
-
1
);
item
=
Locate
(
CURSEUR_OFF_GRILLE
,
-
1
);
return
item
;
return
item
;
#endif
}
}
...
...
pcbnew/files.cpp
View file @
2e13ccf0
...
@@ -235,7 +235,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC* DC, boo
...
@@ -235,7 +235,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC* DC, boo
g_SaveTime
=
time
(
NULL
);
g_SaveTime
=
time
(
NULL
);
#if
0
&& defined(DEBUG)
#if
1
&& defined(DEBUG)
// note this seems to freeze up pcbnew when run under the kicad project
// note this seems to freeze up pcbnew when run under the kicad project
// manager. runs fine from command prompt.
// manager. runs fine from command prompt.
// output the board object tree to stdout:
// output the board object tree to stdout:
...
...
pcbnew/locate.cpp
View file @
2e13ccf0
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
/* fonctions locales */
/* fonctions locales */
EDA_BaseStruct
*
Locate_MirePcb
(
EDA_BaseStruct
*
PtStruct
,
int
LayerSearch
,
int
typeloc
);
MIREPCB
*
Locate_MirePcb
(
BOARD_ITEM
*
PtStruct
,
int
LayerSearch
,
int
typeloc
);
D_PAD
*
Locate_Any_Pad
(
BOARD
*
Pcb
,
const
wxPoint
&
ref_pos
,
bool
OnlyCurrentLayer
);
D_PAD
*
Locate_Any_Pad
(
BOARD
*
Pcb
,
const
wxPoint
&
ref_pos
,
bool
OnlyCurrentLayer
);
...
@@ -84,7 +84,7 @@ D_PAD* ReturnPad( MODULE* module, const wxString& name )
...
@@ -84,7 +84,7 @@ D_PAD* ReturnPad( MODULE* module, const wxString& name )
/*******************************************************************************/
/*******************************************************************************/
EDA_BaseStruct
*
WinEDA_BasePcbFrame
::
Locate
(
int
typeloc
,
int
LayerSearch
)
BOARD_ITEM
*
WinEDA_BasePcbFrame
::
Locate
(
int
typeloc
,
int
LayerSearch
)
/*******************************************************************************/
/*******************************************************************************/
/* General locate function
/* General locate function
...
@@ -93,7 +93,7 @@ EDA_BaseStruct* WinEDA_BasePcbFrame::Locate( int typeloc, int LayerSearch )
...
@@ -93,7 +93,7 @@ EDA_BaseStruct* WinEDA_BasePcbFrame::Locate( int typeloc, int LayerSearch )
*/
*/
{
{
int
masque_layer
;
int
masque_layer
;
EDA_BaseStruct
*
item
;
BOARD_ITEM
*
item
;
item
=
Locate_Texte_Pcb
(
m_Pcb
->
m_Drawings
,
LayerSearch
,
typeloc
);
item
=
Locate_Texte_Pcb
(
m_Pcb
->
m_Drawings
,
LayerSearch
,
typeloc
);
if
(
item
)
if
(
item
)
...
@@ -324,7 +324,7 @@ EDGE_MODULE* Locate_Edge_Module( MODULE* module, int typeloc )
...
@@ -324,7 +324,7 @@ EDGE_MODULE* Locate_Edge_Module( MODULE* module, int typeloc )
/*************************************************************************/
/*************************************************************************/
EDA_BaseStruct
*
Locate_Cotation
(
BOARD
*
Pcb
,
int
LayerSearch
,
int
typeloc
)
COTATION
*
Locate_Cotation
(
BOARD
*
Pcb
,
int
LayerSearch
,
int
typeloc
)
/*************************************************************************/
/*************************************************************************/
/* Serach for a cotation item , on LayerSearch,
/* Serach for a cotation item , on LayerSearch,
...
@@ -334,8 +334,8 @@ EDA_BaseStruct* Locate_Cotation( BOARD* Pcb, int LayerSearch, int typeloc )
...
@@ -334,8 +334,8 @@ EDA_BaseStruct* Locate_Cotation( BOARD* Pcb, int LayerSearch, int typeloc )
{
{
wxPoint
ref_pos
=
RefPos
(
typeloc
);
wxPoint
ref_pos
=
RefPos
(
typeloc
);
EDA_BaseStruct
*
PtStruct
=
Pcb
->
m_Drawings
;
BOARD_ITEM
*
PtStruct
=
Pcb
->
m_Drawings
;
for
(
;
PtStruct
!=
NULL
;
PtStruct
=
PtStruct
->
Pnext
)
for
(
;
PtStruct
!=
NULL
;
PtStruct
=
PtStruct
->
Next
()
)
{
{
if
(
PtStruct
->
m_StructType
!=
TYPECOTATION
)
if
(
PtStruct
->
m_StructType
!=
TYPECOTATION
)
continue
;
continue
;
...
@@ -1027,8 +1027,7 @@ TRACK* Fast_Locate_Via( TRACK* start_adr, TRACK* end_adr,
...
@@ -1027,8 +1027,7 @@ TRACK* Fast_Locate_Via( TRACK* start_adr, TRACK* end_adr,
/***********************************************************************/
/***********************************************************************/
EDA_BaseStruct
*
Locate_MirePcb
(
EDA_BaseStruct
*
PtStruct
,
int
LayerSearch
,
MIREPCB
*
Locate_MirePcb
(
BOARD_ITEM
*
PtStruct
,
int
LayerSearch
,
int
typeloc
)
int
typeloc
)
/***********************************************************************/
/***********************************************************************/
/* Search for a photo target
/* Search for a photo target
...
@@ -1041,20 +1040,18 @@ EDA_BaseStruct* Locate_MirePcb( EDA_BaseStruct* PtStruct, int LayerSearch,
...
@@ -1041,20 +1040,18 @@ EDA_BaseStruct* Locate_MirePcb( EDA_BaseStruct* PtStruct, int LayerSearch,
ref_pos
=
RefPos
(
typeloc
);
ref_pos
=
RefPos
(
typeloc
);
for
(
;
PtStruct
!=
NULL
;
PtStruct
=
PtStruct
->
Pnext
)
for
(
;
PtStruct
!=
NULL
;
PtStruct
=
PtStruct
->
Next
()
)
{
{
MIREPCB
*
item
;
if
(
PtStruct
->
m_StructType
!=
TYPEMIRE
)
if
(
PtStruct
->
m_StructType
!=
TYPEMIRE
)
continue
;
continue
;
item
=
(
MIREPCB
*
)
PtStruct
;
if
(
LayerSearch
!=
-
1
&&
PtStruct
->
GetLayer
()
!=
LayerSearch
)
if
(
LayerSearch
!=
-
1
&&
item
->
GetLayer
()
!=
LayerSearch
)
continue
;
continue
;
if
(
item
->
HitTest
(
ref_pos
)
)
if
(
PtStruct
->
HitTest
(
ref_pos
)
)
break
;
break
;
}
}
return
PtStruct
;
return
(
MIREPCB
*
)
PtStruct
;
}
}
pcbnew/pcbframe.cpp
View file @
2e13ccf0
...
@@ -193,7 +193,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent,
...
@@ -193,7 +193,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent,
m_SelViaSizeBox_Changed
=
FALSE
;
m_SelViaSizeBox_Changed
=
FALSE
;
#if defined(DEBUG)
#if defined(DEBUG)
m_
ArrowCollector
=
new
ARROW
COLLECTOR
();
m_
Collector
=
new
GENERAL
COLLECTOR
();
#endif
#endif
m_DisplayPcbTrackFill
=
DisplayOpt
.
DisplayPcbTrackFill
;
m_DisplayPcbTrackFill
=
DisplayOpt
.
DisplayPcbTrackFill
;
...
@@ -243,7 +243,7 @@ WinEDA_PcbFrame::~WinEDA_PcbFrame( void )
...
@@ -243,7 +243,7 @@ WinEDA_PcbFrame::~WinEDA_PcbFrame( void )
m_CurrentScreen
=
ScreenPcb
;
m_CurrentScreen
=
ScreenPcb
;
#if defined(DEBUG)
#if defined(DEBUG)
delete
m_
Arrow
Collector
;
delete
m_Collector
;
#endif
#endif
}
}
...
...
pcbnew/protos.h
View file @
2e13ccf0
...
@@ -203,7 +203,7 @@ TRACK * Locate_Zone(TRACK * start_adresse, const wxPoint & ref_pos,int layer);
...
@@ -203,7 +203,7 @@ TRACK * Locate_Zone(TRACK * start_adresse, const wxPoint & ref_pos,int layer);
La recherche commence a l'adresse start_adresse
La recherche commence a l'adresse start_adresse
*/
*/
EDA_BaseStruct
*
Locate_Cotation
(
BOARD
*
Pcb
,
int
LayerSearch
,
int
typeloc
);
COTATION
*
Locate_Cotation
(
BOARD
*
Pcb
,
int
LayerSearch
,
int
typeloc
);
/* Localise un element de cotation, en priorite sur la couche active,
/* Localise un element de cotation, en priorite sur la couche active,
et a defaut sur les autres couches
et a defaut sur les autres couches
retourne un pointeur sur l'element (TRACK ou TEXTE_PCB) localise
retourne un pointeur sur l'element (TRACK ou TEXTE_PCB) localise
...
...
pcbnew/set_color.cpp
View file @
2e13ccf0
...
@@ -14,779 +14,819 @@ int CurrentColor;
...
@@ -14,779 +14,819 @@ int CurrentColor;
/* Fonctions locales: */
/* Fonctions locales: */
/* Macro utile : */
/* Macro utile : */
#define ADR(
numlayer)
&g_DesignSettings.m_LayerColor[(numlayer)]
#define ADR(
numlayer )
&g_DesignSettings.m_LayerColor[(numlayer)]
#define BUTT_SIZE_X 25
#define BUTT_SIZE_X 25
#define BUTT_SIZE_Y 15
#define BUTT_SIZE_Y 15
enum
col_sel_id
{
enum
col_sel_id
{
ID_COLOR_RESET_SHOW_LAYER_ON
=
1800
,
ID_COLOR_RESET_SHOW_LAYER_ON
=
1800
,
ID_COLOR_RESET_SHOW_LAYER_OFF
,
ID_COLOR_RESET_SHOW_LAYER_OFF
,
ID_COLOR_EXIT
,
ID_COLOR_EXIT
,
ID_COLOR_CHECKBOX_ONOFF
,
ID_COLOR_CHECKBOX_ONOFF
,
ID_COLOR_SETUP
ID_COLOR_SETUP
};
};
/**********************************/
/**********************************/
/* Liste des menus de Menu_Layers */
/* Liste des menus de Menu_Layers */
/**********************************/
/**********************************/
struct
ColorButton
struct
ColorButton
{
{
const
wxString
m_Title
;
const
wxString
m_Title
;
int
m_LayerNumber
;
int
m_LayerNumber
;
int
*
m_Color
;
// Pointeur sur la variable couleur
int
*
m_Color
;
// Pointeur sur la variable couleur
bool
m_NoDisplayIsColor
;
// TRUE si bit ITEM_NOT_SHOW de la variable Color
bool
m_NoDisplayIsColor
;
// TRUE si bit ITEM_NOT_SHOW de la variable Color
bool
*
m_NoDisplay
;
// Pointeur sur la variable Display on/off si ce n'est pas la var
bool
*
m_NoDisplay
;
// Pointeur sur la variable Display on/off si ce n'est pas la var
// Color
// Color
int
m_Id
;
int
m_Id
;
wxBitmapButton
*
m_Button
;
wxBitmapButton
*
m_Button
;
int
m_State
;
int
m_State
;
wxCheckBox
*
m_CheckBox
;
// Option Display ON/OFF
wxCheckBox
*
m_CheckBox
;
// Option Display ON/OFF
};
};
static
ColorButton
Msg_Layers_Cu
=
static
ColorButton
Msg_Layers_Cu
=
{
{
_
(
"Copper Layers"
),
-
1
/* Title */
_
(
"Copper Layers"
),
-
1
/* Title */
};
};
static
ColorButton
Msg_Layers_Tech
=
static
ColorButton
Msg_Layers_Tech
=
{
{
_
(
"Tech Layers"
),
-
1
/* Title */
_
(
"Tech Layers"
),
-
1
/* Title */
};
};
static
ColorButton
Layer_1_Butt
=
static
ColorButton
Layer_1_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
CUIVRE_N
,
/* Title */
CUIVRE_N
,
/* Title */
ADR
(
CUIVRE_N
),
/* adr du parametre optionnel */
ADR
(
CUIVRE_N
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_2_Butt
=
static
ColorButton
Layer_2_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
1
,
/* Title */
1
,
/* Title */
ADR
(
1
),
/* adr du parametre optionnel */
ADR
(
1
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_3_Butt
=
static
ColorButton
Layer_3_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
2
,
/* Title */
2
,
/* Title */
ADR
(
2
),
/* adr du parametre optionnel */
ADR
(
2
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_4_Butt
=
static
ColorButton
Layer_4_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
3
,
/* Title */
3
,
/* Title */
ADR
(
3
),
/* adr du parametre optionnel */
ADR
(
3
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_5_Butt
=
static
ColorButton
Layer_5_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
4
,
/* Title */
4
,
/* Title */
ADR
(
4
),
/* adr du parametre optionnel */
ADR
(
4
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_6_Butt
=
static
ColorButton
Layer_6_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
5
,
/* Title */
5
,
/* Title */
ADR
(
5
),
/* adr du parametre optionnel */
ADR
(
5
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_7_Butt
=
static
ColorButton
Layer_7_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
6
,
/* Title */
6
,
/* Title */
ADR
(
6
),
/* adr du parametre optionnel */
ADR
(
6
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_8_Butt
=
static
ColorButton
Layer_8_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
7
,
/* Title */
7
,
/* Title */
ADR
(
7
),
/* adr du parametre optionnel */
ADR
(
7
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_9_Butt
=
static
ColorButton
Layer_9_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
8
,
/* Title */
8
,
/* Title */
ADR
(
8
),
/* adr du parametre optionnel */
ADR
(
8
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_10_Butt
=
static
ColorButton
Layer_10_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
9
,
/* Title */
9
,
/* Title */
ADR
(
9
),
/* adr du parametre optionnel */
ADR
(
9
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_11_Butt
=
static
ColorButton
Layer_11_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
10
,
/* Title */
10
,
/* Title */
ADR
(
10
),
/* adr du parametre optionnel */
ADR
(
10
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_12_Butt
=
static
ColorButton
Layer_12_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
11
,
/* Title */
11
,
/* Title */
ADR
(
11
),
/* adr du parametre optionnel */
ADR
(
11
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_13_Butt
=
static
ColorButton
Layer_13_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
12
,
/* Title */
12
,
/* Title */
ADR
(
12
),
/* adr du parametre optionnel */
ADR
(
12
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_14_Butt
=
static
ColorButton
Layer_14_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
13
,
/* Title */
13
,
/* Title */
ADR
(
13
),
/* adr du parametre optionnel */
ADR
(
13
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_15_Butt
=
static
ColorButton
Layer_15_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
14
,
/* Title */
14
,
/* Title */
ADR
(
14
),
/* adr du parametre optionnel */
ADR
(
14
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_16_Butt
=
static
ColorButton
Layer_16_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
CMP_N
,
/* Title */
CMP_N
,
/* Title */
ADR
(
CMP_N
),
/* adr du parametre optionnel */
ADR
(
CMP_N
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_17_Butt
=
static
ColorButton
Layer_17_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
ADHESIVE_N_CU
,
/* Title */
ADHESIVE_N_CU
,
/* Title */
ADR
(
ADHESIVE_N_CU
),
/* adr du parametre optionnel */
ADR
(
ADHESIVE_N_CU
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_18_Butt
=
static
ColorButton
Layer_18_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
ADHESIVE_N_CMP
,
/* Title */
ADHESIVE_N_CMP
,
/* Title */
ADR
(
ADHESIVE_N_CMP
),
/* adr du parametre optionnel */
ADR
(
ADHESIVE_N_CMP
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_19_Butt
=
static
ColorButton
Layer_19_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
SOLDERPASTE_N_CU
,
/* Title */
SOLDERPASTE_N_CU
,
/* Title */
ADR
(
SOLDERPASTE_N_CU
),
/* adr du parametre optionnel */
ADR
(
SOLDERPASTE_N_CU
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_20_Butt
=
static
ColorButton
Layer_20_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
SOLDERPASTE_N_CMP
,
/* Title */
SOLDERPASTE_N_CMP
,
/* Title */
ADR
(
SOLDERPASTE_N_CMP
),
/* adr du parametre optionnel */
ADR
(
SOLDERPASTE_N_CMP
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_21_Butt
=
static
ColorButton
Layer_21_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
SILKSCREEN_N_CU
,
/* Title */
SILKSCREEN_N_CU
,
/* Title */
ADR
(
SILKSCREEN_N_CU
),
/* adr du parametre optionnel */
ADR
(
SILKSCREEN_N_CU
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_22_Butt
=
static
ColorButton
Layer_22_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
SILKSCREEN_N_CMP
,
/* Title */
SILKSCREEN_N_CMP
,
/* Title */
ADR
(
SILKSCREEN_N_CMP
),
/* adr du parametre optionnel */
ADR
(
SILKSCREEN_N_CMP
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_23_Butt
=
static
ColorButton
Layer_23_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
SOLDERMASK_N_CU
,
/* Title */
SOLDERMASK_N_CU
,
/* Title */
ADR
(
SOLDERMASK_N_CU
),
/* adr du parametre optionnel */
ADR
(
SOLDERMASK_N_CU
),
/* adr du parametre optionnel */
TRUE
/* adr du parametre display on/off */
TRUE
/* adr du parametre display on/off */
};
};
static
ColorButton
Layer_24_Butt
=
static
ColorButton
Layer_24_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
SOLDERMASK_N_CMP
,
/* Title */
SOLDERMASK_N_CMP
,
/* Title */
ADR
(
SOLDERMASK_N_CMP
),
/* adr du parametre optionnel */
ADR
(
SOLDERMASK_N_CMP
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_25_Butt
=
static
ColorButton
Layer_25_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
DRAW_N
,
/* Title */
DRAW_N
,
/* Title */
ADR
(
DRAW_N
),
/* adr du parametre optionnel */
ADR
(
DRAW_N
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_26_Butt
=
static
ColorButton
Layer_26_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
COMMENT_N
,
/* Title */
COMMENT_N
,
/* Title */
ADR
(
COMMENT_N
),
/* adr du parametre optionnel */
ADR
(
COMMENT_N
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_27_Butt
=
static
ColorButton
Layer_27_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
ECO1_N
,
/* Title */
ECO1_N
,
/* Title */
ADR
(
ECO1_N
),
/* adr du parametre optionnel */
ADR
(
ECO1_N
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_28_Butt
=
static
ColorButton
Layer_28_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
ECO2_N
,
/* Title */
ECO2_N
,
/* Title */
ADR
(
ECO2_N
),
/* adr du parametre optionnel */
ADR
(
ECO2_N
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Layer_29_Butt
=
static
ColorButton
Layer_29_Butt
=
{
{
wxEmptyString
,
wxEmptyString
,
EDGE_N
,
/* Title */
EDGE_N
,
/* Title */
ADR
(
EDGE_N
),
/* adr du parametre optionnel */
ADR
(
EDGE_N
),
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Msg_Others_Items
=
static
ColorButton
Msg_Others_Items
=
{
{
wxT
(
"Others"
),
-
1
/* Title */
wxT
(
"Others"
),
-
1
/* Title */
};
};
static
ColorButton
Via_Normale_Butt
=
static
ColorButton
Via_Normale_Butt
=
{
{
wxT
(
"*"
),
wxT
(
"*"
),
VIA_NORMALE
,
/* Title */
VIA_NORMALE
,
/* Title */
&
g_DesignSettings
.
m_ViaColor
[
VIA_NORMALE
],
/* adr du parametre optionnel */
&
g_DesignSettings
.
m_ViaColor
[
VIA_NORMALE
],
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Via_Aveugle_Butt
=
static
ColorButton
Via_Aveugle_Butt
=
{
{
wxT
(
"*"
),
wxT
(
"*"
),
VIA_ENTERREE
,
/* Title */
VIA_ENTERREE
,
/* Title */
&
g_DesignSettings
.
m_ViaColor
[
VIA_ENTERREE
],
/* adr du parametre optionnel */
&
g_DesignSettings
.
m_ViaColor
[
VIA_ENTERREE
],
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Via_Borgne_Butt
=
static
ColorButton
Via_Borgne_Butt
=
{
{
wxT
(
"*"
),
wxT
(
"*"
),
VIA_BORGNE
,
/* Title */
VIA_BORGNE
,
/* Title */
&
g_DesignSettings
.
m_ViaColor
[
VIA_BORGNE
],
/* adr du parametre optionnel */
&
g_DesignSettings
.
m_ViaColor
[
VIA_BORGNE
],
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Ratsnest_Butt
=
static
ColorButton
Ratsnest_Butt
=
{
{
_
(
"Ratsnest"
),
/* Title */
_
(
"Ratsnest"
),
/* Title */
-
1
,
-
1
,
&
g_DesignSettings
.
m_RatsnestColor
,
/* adr du parametre optionnel */
&
g_DesignSettings
.
m_RatsnestColor
,
/* adr du parametre optionnel */
FALSE
,
&
g_Show_Ratsnest
/* adr du parametre avec flag ITEM_NOT_SHOW */
FALSE
,
&
g_Show_Ratsnest
/* adr du parametre avec flag ITEM_NOT_SHOW */
};
};
static
ColorButton
Pad_Cu_Butt
=
static
ColorButton
Pad_Cu_Butt
=
{
{
_
(
"Pad Cu"
),
/* Title */
_
(
"Pad Cu"
),
/* Title */
-
1
,
-
1
,
&
g_PadCUColor
,
/* adr du parametre optionnel */
&
g_PadCUColor
,
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Pad_Cmp_Butt
=
static
ColorButton
Pad_Cmp_Butt
=
{
{
_
(
"Pad Cmp"
),
/* Title */
_
(
"Pad Cmp"
),
/* Title */
-
1
,
-
1
,
&
g_PadCMPColor
,
/* adr du parametre optionnel */
&
g_PadCMPColor
,
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Text_Mod_Cu_Butt
=
static
ColorButton
Text_Mod_Cu_Butt
=
{
{
_
(
"Text Module Cu"
),
/* Title */
_
(
"Text Module Cu"
),
/* Title */
-
1
,
-
1
,
&
g_ModuleTextCUColor
,
/* adr du parametre optionnel */
&
g_ModuleTextCUColor
,
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Text_Mod_Cmp_Butt
=
static
ColorButton
Text_Mod_Cmp_Butt
=
{
{
_
(
"Text Module Cmp"
),
/* Title */
_
(
"Text Module Cmp"
),
/* Title */
-
1
,
-
1
,
&
g_ModuleTextCMPColor
,
/* adr du parametre optionnel */
&
g_ModuleTextCMPColor
,
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Text_Mod_NoVisible_Butt
=
static
ColorButton
Text_Mod_NoVisible_Butt
=
{
{
_
(
"Text Module invisible"
),
/* Title */
_
(
"Text Module invisible"
),
/* Title */
-
1
,
-
1
,
&
g_ModuleTextNOVColor
,
/* adr du parametre optionnel */
&
g_ModuleTextNOVColor
,
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Anchors_Butt
=
static
ColorButton
Anchors_Butt
=
{
{
_
(
"Anchors"
),
/* Title */
_
(
"Anchors"
),
/* Title */
-
1
,
-
1
,
&
g_AnchorColor
,
/* adr du parametre optionnel */
&
g_AnchorColor
,
/* adr du parametre optionnel */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
TRUE
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Grid_Butt
=
static
ColorButton
Grid_Butt
=
{
{
_
(
"Grid"
),
/* Title */
_
(
"Grid"
),
/* Title */
-
1
,
-
1
,
&
g_PcbGridColor
,
/* adr du parametre optionnel */
&
g_PcbGridColor
,
/* adr du parametre optionnel */
FALSE
,
FALSE
,
&
g_ShowGrid
/* parametre display on/off = bit ITEM_NOT_SHOW */
&
g_ShowGrid
/* parametre display on/off = bit ITEM_NOT_SHOW */
};
};
static
ColorButton
Show_Zones_Butt
=
static
ColorButton
Show_Zones_Butt
=
{
{
_
(
"Show Zones"
),
/* Title */
_
(
"Show Zones"
),
/* Title */
-
1
,
-
1
,
NULL
,
/* adr du parametre optionnel */
NULL
,
/* adr du parametre optionnel */
FALSE
,
FALSE
,
&
DisplayOpt
.
DisplayZones
/* adr du parametre avec flag ITEM_NOT_SHOW */
&
DisplayOpt
.
DisplayZones
/* adr du parametre avec flag ITEM_NOT_SHOW */
};
};
static
ColorButton
Show_Pads_Noconnect_Butt
=
static
ColorButton
Show_Pads_Noconnect_Butt
=
{
{
_
(
"Show Noconnect"
),
/* Title */
_
(
"Show Noconnect"
),
/* Title */
-
1
,
-
1
,
NULL
,
/* adr du parametre optionnel */
NULL
,
/* adr du parametre optionnel */
FALSE
,
FALSE
,
&
DisplayOpt
.
DisplayPadNoConn
/* adr du parametre avec flag ITEM_NOT_SHOW */
&
DisplayOpt
.
DisplayPadNoConn
/* adr du parametre avec flag ITEM_NOT_SHOW */
};
};
static
ColorButton
Show_Modules_Cmp_Butt
=
static
ColorButton
Show_Modules_Cmp_Butt
=
{
{
_
(
"Show Modules Cmp"
),
/* Title */
_
(
"Show Modules Cmp"
),
/* Title */
-
1
,
-
1
,
NULL
,
/* adr du parametre optionnel */
NULL
,
/* adr du parametre optionnel */
FALSE
,
FALSE
,
&
DisplayOpt
.
Show_Modules_Cmp
/* adr du parametre avec flag ITEM_NOT_SHOW */
&
DisplayOpt
.
Show_Modules_Cmp
/* adr du parametre avec flag ITEM_NOT_SHOW */
};
};
static
ColorButton
Show_Modules_Cu_Butt
=
static
ColorButton
Show_Modules_Cu_Butt
=
{
{
_
(
"Show Modules Cu"
),
/* Title */
_
(
"Show Modules Cu"
),
/* Title */
-
1
,
-
1
,
NULL
,
/* adr du parametre optionnel */
NULL
,
/* adr du parametre optionnel */
FALSE
,
FALSE
,
&
DisplayOpt
.
Show_Modules_Cu
/* adr du parametre avec flag ITEM_NOT_SHOW */
&
DisplayOpt
.
Show_Modules_Cu
/* adr du parametre avec flag ITEM_NOT_SHOW */
};
};
static
ColorButton
*
laytool_list
[]
=
{
static
ColorButton
*
laytool_list
[]
=
{
&
Msg_Layers_Cu
,
&
Msg_Layers_Cu
,
&
Layer_1_Butt
,
&
Layer_1_Butt
,
&
Layer_2_Butt
,
&
Layer_2_Butt
,
&
Layer_3_Butt
,
&
Layer_3_Butt
,
&
Layer_4_Butt
,
&
Layer_4_Butt
,
&
Layer_5_Butt
,
&
Layer_5_Butt
,
&
Layer_6_Butt
,
&
Layer_6_Butt
,
&
Layer_7_Butt
,
&
Layer_7_Butt
,
&
Layer_8_Butt
,
&
Layer_8_Butt
,
&
Layer_9_Butt
,
&
Layer_9_Butt
,
&
Layer_10_Butt
,
&
Layer_10_Butt
,
&
Layer_11_Butt
,
&
Layer_11_Butt
,
&
Layer_12_Butt
,
&
Layer_12_Butt
,
&
Layer_13_Butt
,
&
Layer_13_Butt
,
&
Layer_14_Butt
,
&
Layer_14_Butt
,
&
Layer_15_Butt
,
&
Layer_15_Butt
,
&
Layer_16_Butt
,
&
Layer_16_Butt
,
&
Msg_Layers_Tech
,
&
Layer_17_Butt
,
&
Layer_18_Butt
,
&
Layer_19_Butt
,
&
Layer_20_Butt
,
&
Layer_21_Butt
,
&
Layer_22_Butt
,
&
Layer_23_Butt
,
&
Layer_24_Butt
,
&
Layer_25_Butt
,
&
Layer_26_Butt
,
&
Layer_27_Butt
,
&
Layer_28_Butt
,
&
Layer_29_Butt
,
&
Msg_Layers_Tech
,
&
Layer_17_Butt
,
&
Layer_18_Butt
,
&
Layer_19_Butt
,
&
Layer_20_Butt
,
&
Layer_21_Butt
,
&
Layer_22_Butt
,
&
Layer_23_Butt
,
&
Layer_24_Butt
,
&
Layer_25_Butt
,
&
Layer_26_Butt
,
&
Layer_27_Butt
,
&
Layer_28_Butt
,
&
Layer_29_Butt
,
// &Layer_30_Butt,
// &Layer_30_Butt,
// &Layer_31_Butt,
// &Layer_31_Butt,
&
Msg_Others_Items
,
&
Msg_Others_Items
,
&
Via_Normale_Butt
,
&
Via_Normale_Butt
,
&
Via_Aveugle_Butt
,
&
Via_Aveugle_Butt
,
&
Via_Borgne_Butt
,
&
Via_Borgne_Butt
,
&
Ratsnest_Butt
,
&
Ratsnest_Butt
,
&
Pad_Cu_Butt
,
&
Pad_Cu_Butt
,
&
Pad_Cmp_Butt
,
&
Pad_Cmp_Butt
,
&
Text_Mod_Cu_Butt
,
&
Text_Mod_Cu_Butt
,
&
Text_Mod_Cmp_Butt
,
&
Text_Mod_Cmp_Butt
,
&
Text_Mod_NoVisible_Butt
,
&
Text_Mod_NoVisible_Butt
,
&
Anchors_Butt
,
&
Anchors_Butt
,
&
Grid_Butt
,
&
Grid_Butt
,
&
Show_Zones_Butt
,
&
Show_Zones_Butt
,
&
Show_Pads_Noconnect_Butt
,
&
Show_Pads_Noconnect_Butt
,
&
Show_Modules_Cmp_Butt
,
&
Show_Modules_Cmp_Butt
,
&
Show_Modules_Cu_Butt
,
&
Show_Modules_Cu_Butt
,
NULL
NULL
};
};
/*************************************************************/
/*************************************************************/
/* classe derivee pour la frame de Configuration des couleurs*/
/* classe derivee pour la frame de Configuration des couleurs*/
/*************************************************************/
/*************************************************************/
class
WinEDA_SetColorsFrame
:
public
wxDialog
class
WinEDA_SetColorsFrame
:
public
wxDialog
{
{
private
:
private
:
WinEDA_DrawFrame
*
m_Parent
;
WinEDA_DrawFrame
*
m_Parent
;
public
:
public
:
// Constructor and destructor
// Constructor and destructor
WinEDA_SetColorsFrame
(
WinEDA_DrawFrame
*
parent
,
const
wxPoint
&
framepos
);
WinEDA_SetColorsFrame
(
WinEDA_DrawFrame
*
parent
,
const
wxPoint
&
framepos
);
~
WinEDA_SetColorsFrame
(
void
)
{
};
~
WinEDA_SetColorsFrame
(
void
)
{
};
private
:
private
:
void
OnQuit
(
wxCommandEvent
&
event
);
void
OnQuit
(
wxCommandEvent
&
event
);
void
SetColor
(
wxCommandEvent
&
event
);
void
SetColor
(
wxCommandEvent
&
event
);
void
SetDisplayOnOff
(
wxCommandEvent
&
event
);
void
SetDisplayOnOff
(
wxCommandEvent
&
event
);
void
ResetDisplayLayersCu
(
wxCommandEvent
&
event
);
void
ResetDisplayLayersCu
(
wxCommandEvent
&
event
);
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
};
};
/* Table des evenements pour WinEDA_SetColorsFrame */
/* Table des evenements pour WinEDA_SetColorsFrame */
BEGIN_EVENT_TABLE
(
WinEDA_SetColorsFrame
,
wxDialog
)
BEGIN_EVENT_TABLE
(
WinEDA_SetColorsFrame
,
wxDialog
)
EVT_BUTTON
(
ID_COLOR_RESET_SHOW_LAYER_OFF
,
WinEDA_SetColorsFrame
::
ResetDisplayLayersCu
)
EVT_BUTTON
(
ID_COLOR_RESET_SHOW_LAYER_OFF
,
WinEDA_SetColorsFrame
::
ResetDisplayLayersCu
)
EVT_BUTTON
(
ID_COLOR_RESET_SHOW_LAYER_ON
,
WinEDA_SetColorsFrame
::
ResetDisplayLayersCu
)
EVT_BUTTON
(
ID_COLOR_RESET_SHOW_LAYER_ON
,
WinEDA_SetColorsFrame
::
ResetDisplayLayersCu
)
EVT_BUTTON
(
ID_COLOR_EXIT
,
WinEDA_SetColorsFrame
::
OnQuit
)
EVT_BUTTON
(
ID_COLOR_EXIT
,
WinEDA_SetColorsFrame
::
OnQuit
)
EVT_CHECKBOX
(
ID_COLOR_CHECKBOX_ONOFF
,
WinEDA_SetColorsFrame
::
SetDisplayOnOff
)
EVT_CHECKBOX
(
ID_COLOR_CHECKBOX_ONOFF
,
WinEDA_SetColorsFrame
::
SetDisplayOnOff
)
EVT_BUTTON
(
ID_COLOR_SETUP
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
1
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
1
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
2
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
2
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
3
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
3
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
4
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
4
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
5
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
5
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
6
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
6
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
7
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
7
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
8
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
8
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
9
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
9
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
10
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
10
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
11
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
11
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
12
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
12
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
13
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
13
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
14
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
14
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
15
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
15
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
16
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
16
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
17
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
17
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
18
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
18
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
19
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
19
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
20
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
20
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
21
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
21
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
22
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
22
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
23
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
23
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
24
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
24
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
25
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
25
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
26
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
26
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
27
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
27
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
28
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
28
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
29
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
29
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
30
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
30
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
31
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
31
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
32
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
32
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
33
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
33
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
34
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
34
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
35
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
35
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
36
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
36
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
37
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
37
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
38
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
38
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
39
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
39
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
40
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
40
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
41
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
41
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
42
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
42
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
43
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
43
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
44
,
WinEDA_SetColorsFrame
::
SetColor
)
EVT_BUTTON
(
ID_COLOR_SETUP
+
44
,
WinEDA_SetColorsFrame
::
SetColor
)
END_EVENT_TABLE
()
END_EVENT_TABLE
()
/*****************************************************/
/*****************************************************/
void
DisplayColorSetupFrame
(
WinEDA_DrawFrame
*
parent
,
void
DisplayColorSetupFrame
(
WinEDA_DrawFrame
*
parent
,
const
wxPoint
&
framepos
)
const
wxPoint
&
framepos
)
/*****************************************************/
/*****************************************************/
{
{
WinEDA_SetColorsFrame
*
frame
=
WinEDA_SetColorsFrame
*
frame
=
new
WinEDA_SetColorsFrame
(
parent
,
framepos
);
new
WinEDA_SetColorsFrame
(
parent
,
framepos
);
frame
->
ShowModal
();
frame
->
Destroy
();
frame
->
ShowModal
();
frame
->
Destroy
();
}
}
/**********************************************************************/
/**********************************************************************/
WinEDA_SetColorsFrame
::
WinEDA_SetColorsFrame
(
WinEDA_DrawFrame
*
parent
,
WinEDA_SetColorsFrame
::
WinEDA_SetColorsFrame
(
WinEDA_DrawFrame
*
parent
,
const
wxPoint
&
framepos
)
:
const
wxPoint
&
framepos
)
:
wxDialog
(
parent
,
-
1
,
_
(
"Colors:"
),
framepos
,
wxDialog
(
parent
,
-
1
,
_
(
"Colors:"
),
framepos
,
wxSize
(
-
1
,
-
1
),
wxSize
(
-
1
,
-
1
),
DIALOG_STYLE
)
DIALOG_STYLE
)
/**********************************************************************/
/**********************************************************************/
{
{
#define START_Y 25
#define START_Y 25
wxBitmapButton
*
ButtonB
;
wxBitmapButton
*
ButtonB
;
int
ii
,
yy
,
xx
,
butt_ID
,
buttcolor
;
int
ii
,
yy
,
xx
,
butt_ID
,
buttcolor
;
wxPoint
pos
;
wxPoint
pos
;
wxSize
winsize
;
wxSize
winsize
;
int
w
=
BUTT_SIZE_X
,
h
=
BUTT_SIZE_Y
;
int
w
=
BUTT_SIZE_X
;
wxString
msg
;
int
h
=
BUTT_SIZE_Y
;
wxString
msg
;
m_Parent
=
parent
;
SetFont
(
*
g_DialogFont
);
m_Parent
=
parent
;
SetFont
(
*
g_DialogFont
);
pos
.
x
=
5
;
pos
.
y
=
START_Y
;
for
(
ii
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
pos
.
x
=
5
;
{
pos
.
y
=
START_Y
;
if
(
!
laytool_list
[
ii
]
->
m_Color
&&
!
laytool_list
[
ii
]
->
m_NoDisplay
)
{
for
(
ii
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
if
(
pos
.
y
!=
START_Y
)
{
{
if
(
!
laytool_list
[
ii
]
->
m_Color
&&
!
laytool_list
[
ii
]
->
m_NoDisplay
)
pos
.
x
+=
w
+
120
;
pos
.
y
=
START_Y
;
{
}
if
(
pos
.
y
!=
START_Y
)
if
(
laytool_list
[
ii
]
->
m_LayerNumber
>=
0
)
{
{
pos
.
x
+=
w
+
120
;
if
(
laytool_list
[
ii
]
->
m_Title
==
wxT
(
"*"
)
)
pos
.
y
=
START_Y
;
{
}
msg
=
g_ViaType_Name
[
laytool_list
[
ii
]
->
m_LayerNumber
];
}
if
(
laytool_list
[
ii
]
->
m_LayerNumber
>=
0
)
else
msg
=
ReturnPcbLayerName
(
laytool_list
[
ii
]
->
m_LayerNumber
);
{
}
if
(
laytool_list
[
ii
]
->
m_Title
==
wxT
(
"*"
)
)
else
{
msg
=
wxGetTranslation
(
laytool_list
[
ii
]
->
m_Title
.
GetData
());
msg
=
g_ViaType_Name
[
laytool_list
[
ii
]
->
m_LayerNumber
];
}
new
wxStaticText
(
this
,
-
1
,
msg
,
else
wxPoint
(
pos
.
x
+
10
,
pos
.
y
-
18
),
wxSize
(
-
1
,
-
1
),
0
);
msg
=
ReturnPcbLayerName
(
laytool_list
[
ii
]
->
m_LayerNumber
);
continue
;
}
}
else
msg
=
wxGetTranslation
(
laytool_list
[
ii
]
->
m_Title
.
GetData
()
);
if
(
laytool_list
[
ii
]
->
m_Id
==
0
)
laytool_list
[
ii
]
->
m_Id
=
ID_COLOR_SETUP
+
ii
;
new
wxStaticText
(
this
,
-
1
,
msg
,
butt_ID
=
laytool_list
[
ii
]
->
m_Id
;
wxPoint
(
pos
.
x
+
10
,
pos
.
y
-
18
),
wxSize
(
-
1
,
-
1
),
0
);
laytool_list
[
ii
]
->
m_CheckBox
=
new
wxCheckBox
(
this
,
continue
;
ID_COLOR_CHECKBOX_ONOFF
,
wxEmptyString
,
}
pos
);
if
(
laytool_list
[
ii
]
->
m_Id
==
0
)
if
(
laytool_list
[
ii
]
->
m_NoDisplayIsColor
)
laytool_list
[
ii
]
->
m_Id
=
ID_COLOR_SETUP
+
ii
;
{
if
(
*
laytool_list
[
ii
]
->
m_Color
&
ITEM_NOT_SHOW
)
butt_ID
=
laytool_list
[
ii
]
->
m_Id
;
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
FALSE
);
else
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
TRUE
);
laytool_list
[
ii
]
->
m_CheckBox
=
new
wxCheckBox
(
this
,
}
ID_COLOR_CHECKBOX_ONOFF
,
wxEmptyString
,
pos
);
else
if
(
laytool_list
[
ii
]
->
m_NoDisplay
)
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
*
laytool_list
[
ii
]
->
m_NoDisplay
);
if
(
laytool_list
[
ii
]
->
m_NoDisplayIsColor
)
{
xx
=
3
+
laytool_list
[
ii
]
->
m_CheckBox
->
GetSize
().
x
;
if
(
*
laytool_list
[
ii
]
->
m_Color
&
ITEM_NOT_SHOW
)
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
FALSE
);
if
(
laytool_list
[
ii
]
->
m_Color
)
else
{
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
TRUE
);
wxMemoryDC
iconDC
;
}
wxBitmap
ButtBitmap
(
w
,
h
);
else
if
(
laytool_list
[
ii
]
->
m_NoDisplay
)
iconDC
.
SelectObject
(
ButtBitmap
);
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
*
laytool_list
[
ii
]
->
m_NoDisplay
);
buttcolor
=
*
laytool_list
[
ii
]
->
m_Color
&
MASKCOLOR
;
wxBrush
Brush
;
xx
=
3
+
laytool_list
[
ii
]
->
m_CheckBox
->
GetSize
().
x
;
iconDC
.
SelectObject
(
ButtBitmap
);
iconDC
.
SetPen
(
*
wxBLACK_PEN
);
if
(
laytool_list
[
ii
]
->
m_Color
)
Brush
.
SetColour
(
{
ColorRefs
[
buttcolor
].
m_Red
,
wxMemoryDC
iconDC
;
ColorRefs
[
buttcolor
].
m_Green
,
ColorRefs
[
buttcolor
].
m_Blue
wxBitmap
ButtBitmap
(
w
,
h
);
);
Brush
.
SetStyle
(
wxSOLID
);
iconDC
.
SelectObject
(
ButtBitmap
);
iconDC
.
SetBrush
(
Brush
);
buttcolor
=
*
laytool_list
[
ii
]
->
m_Color
&
MASKCOLOR
;
iconDC
.
DrawRectangle
(
0
,
0
,
w
,
h
);
wxBrush
Brush
;
ButtonB
=
new
wxBitmapButton
(
this
,
butt_ID
,
ButtBitmap
,
iconDC
.
SelectObject
(
ButtBitmap
);
wxPoint
(
pos
.
x
+
xx
,
pos
.
y
),
iconDC
.
SetPen
(
*
wxBLACK_PEN
);
wxSize
(
w
,
h
)
);
laytool_list
[
ii
]
->
m_Button
=
ButtonB
;
Brush
.
SetColour
(
xx
+=
3
+
w
;
ColorRefs
[
buttcolor
].
m_Red
,
}
ColorRefs
[
buttcolor
].
m_Green
,
ColorRefs
[
buttcolor
].
m_Blue
if
(
laytool_list
[
ii
]
->
m_LayerNumber
>=
0
)
);
{
if
(
laytool_list
[
ii
]
->
m_Title
==
wxT
(
"*"
)
)
Brush
.
SetStyle
(
wxSOLID
);
{
msg
=
g_ViaType_Name
[
laytool_list
[
ii
]
->
m_LayerNumber
];
iconDC
.
SetBrush
(
Brush
);
}
iconDC
.
DrawRectangle
(
0
,
0
,
w
,
h
);
else
msg
=
ReturnPcbLayerName
(
laytool_list
[
ii
]
->
m_LayerNumber
);
}
ButtonB
=
new
wxBitmapButton
(
this
,
butt_ID
,
else
ButtBitmap
,
msg
=
wxGetTranslation
(
laytool_list
[
ii
]
->
m_Title
.
GetData
());
wxPoint
(
pos
.
x
+
xx
,
pos
.
y
),
wxSize
(
w
,
h
)
);
new
wxStaticText
(
this
,
-
1
,
msg
,
wxPoint
(
pos
.
x
+
xx
,
pos
.
y
+
1
),
laytool_list
[
ii
]
->
m_Button
=
ButtonB
;
wxSize
(
-
1
,
-
1
),
0
);
xx
+=
3
+
w
;
}
yy
=
h
+
5
;
pos
.
y
+=
yy
;
if
(
laytool_list
[
ii
]
->
m_LayerNumber
>=
0
)
}
{
if
(
laytool_list
[
ii
]
->
m_Title
==
wxT
(
"*"
)
)
pos
.
x
=
150
;
pos
.
y
=
300
;
{
wxButton
*
Button
=
new
wxButton
(
this
,
ID_COLOR_RESET_SHOW_LAYER_ON
,
msg
=
g_ViaType_Name
[
laytool_list
[
ii
]
->
m_LayerNumber
];
_
(
"Show All"
),
pos
);
}
Button
->
SetForegroundColour
(
wxColor
(
0
,
100
,
0
));
else
msg
=
ReturnPcbLayerName
(
laytool_list
[
ii
]
->
m_LayerNumber
);
pos
.
y
+=
Button
->
GetSize
().
y
+
2
;
}
Button
=
new
wxButton
(
this
,
ID_COLOR_RESET_SHOW_LAYER_OFF
,
else
_
(
"Show None"
),
pos
);
msg
=
wxGetTranslation
(
laytool_list
[
ii
]
->
m_Title
.
GetData
()
);
Button
->
SetForegroundColour
(
wxColor
(
100
,
0
,
0
));
new
wxStaticText
(
this
,
-
1
,
msg
,
pos
.
x
+=
Button
->
GetSize
().
x
+
50
;
wxPoint
(
pos
.
x
+
xx
,
pos
.
y
+
1
),
Button
=
new
wxButton
(
this
,
ID_COLOR_EXIT
,
wxSize
(
-
1
,
-
1
),
0
);
_
(
"Exit"
),
pos
);
Button
->
SetForegroundColour
(
*
wxBLUE
);
yy
=
h
+
5
;
winsize
.
x
=
500
;
winsize
.
y
=
pos
.
y
+
Button
->
GetSize
().
y
+
5
;
pos
.
y
+=
yy
;
SetClientSize
(
winsize
);
}
pos
.
x
=
150
;
pos
.
y
=
300
;
wxButton
*
Button
=
new
wxButton
(
this
,
ID_COLOR_RESET_SHOW_LAYER_ON
,
_
(
"Show All"
),
pos
);
Button
->
SetForegroundColour
(
wxColor
(
0
,
100
,
0
)
);
pos
.
y
+=
Button
->
GetSize
().
y
+
2
;
Button
=
new
wxButton
(
this
,
ID_COLOR_RESET_SHOW_LAYER_OFF
,
_
(
"Show None"
),
pos
);
Button
->
SetForegroundColour
(
wxColor
(
100
,
0
,
0
)
);
pos
.
x
+=
Button
->
GetSize
().
x
+
50
;
Button
=
new
wxButton
(
this
,
ID_COLOR_EXIT
,
_
(
"Exit"
),
pos
);
Button
->
SetForegroundColour
(
*
wxBLUE
);
winsize
.
x
=
500
;
winsize
.
y
=
pos
.
y
+
Button
->
GetSize
().
y
+
5
;
SetClientSize
(
winsize
);
}
}
/**********************************************************************/
/**********************************************************************/
void
WinEDA_SetColorsFrame
::
OnQuit
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
void
WinEDA_SetColorsFrame
::
OnQuit
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
/**********************************************************************/
/**********************************************************************/
{
{
Close
(
true
);
// true is to force the frame to close
Close
(
true
);
// true is to force the frame to close
}
}
/**********************************************************/
/**********************************************************/
void
WinEDA_SetColorsFrame
::
SetColor
(
wxCommandEvent
&
event
)
void
WinEDA_SetColorsFrame
::
SetColor
(
wxCommandEvent
&
event
)
/**********************************************************/
/**********************************************************/
{
{
int
ii
;
int
ii
;
int
id
=
event
.
GetId
();
int
id
=
event
.
GetId
();
int
color
;
int
color
;
int
w
=
BUTT_SIZE_X
,
h
=
BUTT_SIZE_Y
;
int
w
=
BUTT_SIZE_X
,
h
=
BUTT_SIZE_Y
;
color
=
DisplayColorFrame
(
this
);
color
=
DisplayColorFrame
(
this
);
if
(
color
<
0
)
if
(
color
<
0
)
return
;
return
;
for
(
ii
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
for
(
ii
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
{
{
if
(
laytool_list
[
ii
]
->
m_Id
!=
id
)
continue
;
if
(
laytool_list
[
ii
]
->
m_Id
!=
id
)
if
(
laytool_list
[
ii
]
->
m_Color
==
NULL
)
continue
;
continue
;
if
(
*
laytool_list
[
ii
]
->
m_Color
==
color
)
break
;
if
(
laytool_list
[
ii
]
->
m_Color
==
NULL
)
continue
;
*
laytool_list
[
ii
]
->
m_Color
=
color
;
wxMemoryDC
iconDC
;
if
(
*
laytool_list
[
ii
]
->
m_Color
==
color
)
break
;
wxBitmapButton
*
Button
=
laytool_list
[
ii
]
->
m_Button
;
*
laytool_list
[
ii
]
->
m_Color
=
color
;
wxBitmap
ButtBitmap
=
Button
->
GetBitmapLabel
();
wxMemoryDC
iconDC
;
iconDC
.
SelectObject
(
ButtBitmap
);
int
buttcolor
=
*
laytool_list
[
ii
]
->
m_Color
;
wxBitmapButton
*
Button
=
laytool_list
[
ii
]
->
m_Button
;
wxBrush
Brush
;
iconDC
.
SetPen
(
*
wxBLACK_PEN
);
wxBitmap
ButtBitmap
=
Button
->
GetBitmapLabel
();
Brush
.
SetColour
(
iconDC
.
SelectObject
(
ButtBitmap
);
ColorRefs
[
buttcolor
].
m_Red
,
int
buttcolor
=
*
laytool_list
[
ii
]
->
m_Color
;
ColorRefs
[
buttcolor
].
m_Green
,
ColorRefs
[
buttcolor
].
m_Blue
wxBrush
Brush
;
);
Brush
.
SetStyle
(
wxSOLID
);
iconDC
.
SetPen
(
*
wxBLACK_PEN
);
Brush
.
SetColour
(
iconDC
.
SetBrush
(
Brush
);
ColorRefs
[
buttcolor
].
m_Red
,
iconDC
.
DrawRectangle
(
0
,
0
,
w
,
h
);
ColorRefs
[
buttcolor
].
m_Green
,
Button
->
SetBitmapLabel
(
ButtBitmap
);
ColorRefs
[
buttcolor
].
m_Blue
Button
->
Refresh
();
);
SetDisplayOnOff
(
event
);
m_Parent
->
m_CurrentScreen
->
SetRefreshReq
();
Brush
.
SetStyle
(
wxSOLID
);
}
Refresh
(
FALSE
);
iconDC
.
SetBrush
(
Brush
);
iconDC
.
DrawRectangle
(
0
,
0
,
w
,
h
);
Button
->
SetBitmapLabel
(
ButtBitmap
);
Button
->
Refresh
();
SetDisplayOnOff
(
event
);
m_Parent
->
m_CurrentScreen
->
SetRefreshReq
();
}
Refresh
(
FALSE
);
}
}
/******************************************************************/
/******************************************************************/
void
WinEDA_SetColorsFrame
::
SetDisplayOnOff
(
wxCommandEvent
&
event
)
void
WinEDA_SetColorsFrame
::
SetDisplayOnOff
(
wxCommandEvent
&
event
)
/******************************************************************/
/******************************************************************/
{
{
for
(
int
ii
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
for
(
int
ii
=
0
;
laytool_list
[
ii
]
!=
NULL
;
ii
++
)
{
{
if
(
laytool_list
[
ii
]
->
m_CheckBox
==
NULL
)
continue
;
if
(
laytool_list
[
ii
]
->
m_CheckBox
==
NULL
)
if
(
!
laytool_list
[
ii
]
->
m_NoDisplayIsColor
&&
continue
;
(
laytool_list
[
ii
]
->
m_NoDisplay
==
NULL
)
)
continue
;
if
(
!
laytool_list
[
ii
]
->
m_NoDisplayIsColor
if
(
laytool_list
[
ii
]
->
m_NoDisplayIsColor
)
&&
(
laytool_list
[
ii
]
->
m_NoDisplay
==
NULL
)
)
{
continue
;
if
(
laytool_list
[
ii
]
->
m_CheckBox
->
GetValue
()
)
*
laytool_list
[
ii
]
->
m_Color
&=
~
ITEM_NOT_SHOW
;
if
(
laytool_list
[
ii
]
->
m_NoDisplayIsColor
)
else
*
laytool_list
[
ii
]
->
m_Color
|=
ITEM_NOT_SHOW
;
{
}
if
(
laytool_list
[
ii
]
->
m_CheckBox
->
GetValue
()
)
*
laytool_list
[
ii
]
->
m_Color
&=
~
ITEM_NOT_SHOW
;
else
else
{
*
laytool_list
[
ii
]
->
m_Color
|=
ITEM_NOT_SHOW
;
*
laytool_list
[
ii
]
->
m_NoDisplay
=
laytool_list
[
ii
]
->
m_CheckBox
->
GetValue
();
}
}
else
{
m_Parent
->
m_CurrentScreen
->
SetRefreshReq
();
*
laytool_list
[
ii
]
->
m_NoDisplay
=
laytool_list
[
ii
]
->
m_CheckBox
->
GetValue
();
}
}
m_Parent
->
m_CurrentScreen
->
SetRefreshReq
();
}
}
}
/**********************************************************************/
/**********************************************************************/
void
WinEDA_SetColorsFrame
::
ResetDisplayLayersCu
(
wxCommandEvent
&
event
)
void
WinEDA_SetColorsFrame
::
ResetDisplayLayersCu
(
wxCommandEvent
&
event
)
/**********************************************************************/
/**********************************************************************/
{
{
bool
NewState
=
(
event
.
GetId
()
==
ID_COLOR_RESET_SHOW_LAYER_ON
)
?
TRUE
:
FALSE
;
bool
NewState
=
(
event
.
GetId
()
==
ID_COLOR_RESET_SHOW_LAYER_ON
)
?
TRUE
:
FALSE
;
for
(
int
ii
=
1
;
ii
<
17
;
ii
++
)
for
(
int
ii
=
1
;
ii
<
17
;
ii
++
)
{
{
if
(
laytool_list
[
ii
]
->
m_CheckBox
==
NULL
)
continue
;
if
(
laytool_list
[
ii
]
->
m_CheckBox
==
NULL
)
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
NewState
);
continue
;
}
laytool_list
[
ii
]
->
m_CheckBox
->
SetValue
(
NewState
);
}
SetDisplayOnOff
(
event
);
SetDisplayOnOff
(
event
);
}
}
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