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
7fe80baf
Commit
7fe80baf
authored
Aug 04, 2007
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
beautification
parent
803ecc3b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1681 additions
and
1612 deletions
+1681
-1612
base_struct.h
include/base_struct.h
+205
-182
pcbstruct.h
include/pcbstruct.h
+258
-255
wxstruct.h
include/wxstruct.h
+1218
-1175
No files found.
include/base_struct.h
View file @
7fe80baf
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
enum
DrawStructureType
{
enum
DrawStructureType
{
TYPE_NOT_INIT
=
0
,
TYPE_NOT_INIT
=
0
,
TYPEPCB
,
TYPEPCB
,
// Items in pcb
// Items in pcb
PCB_EQUIPOT_STRUCT_TYPE
,
PCB_EQUIPOT_STRUCT_TYPE
,
TYPEMODULE
,
TYPEMODULE
,
...
@@ -27,6 +28,7 @@ enum DrawStructureType {
...
@@ -27,6 +28,7 @@ enum DrawStructureType {
TYPESCREEN
,
TYPESCREEN
,
TYPEBLOCK
,
TYPEBLOCK
,
TYPEEDGEZONE
,
TYPEEDGEZONE
,
// Draw Items in schematic
// Draw Items in schematic
DRAW_POLYLINE_STRUCT_TYPE
,
DRAW_POLYLINE_STRUCT_TYPE
,
DRAW_JUNCTION_STRUCT_TYPE
,
DRAW_JUNCTION_STRUCT_TYPE
,
...
@@ -42,9 +44,11 @@ enum DrawStructureType {
...
@@ -42,9 +44,11 @@ enum DrawStructureType {
DRAW_MARKER_STRUCT_TYPE
,
DRAW_MARKER_STRUCT_TYPE
,
DRAW_NOCONNECT_STRUCT_TYPE
,
DRAW_NOCONNECT_STRUCT_TYPE
,
DRAW_PART_TEXT_STRUCT_TYPE
,
DRAW_PART_TEXT_STRUCT_TYPE
,
// General
// General
SCREEN_STRUCT_TYPE
,
SCREEN_STRUCT_TYPE
,
BLOCK_LOCATE_STRUCT_TYPE
,
BLOCK_LOCATE_STRUCT_TYPE
,
// Draw Items in library component
// Draw Items in library component
LIBCOMPONENT_STRUCT_TYPE
,
LIBCOMPONENT_STRUCT_TYPE
,
COMPONENT_ARC_DRAW_TYPE
,
COMPONENT_ARC_DRAW_TYPE
,
...
@@ -55,6 +59,7 @@ enum DrawStructureType {
...
@@ -55,6 +59,7 @@ enum DrawStructureType {
COMPONENT_LINE_DRAW_TYPE
,
COMPONENT_LINE_DRAW_TYPE
,
COMPONENT_PIN_DRAW_TYPE
,
COMPONENT_PIN_DRAW_TYPE
,
COMPONENT_FIELD_DRAW_TYPE
,
COMPONENT_FIELD_DRAW_TYPE
,
// End value
// End value
MAX_STRUCT_TYPE_ID
MAX_STRUCT_TYPE_ID
};
};
...
@@ -68,11 +73,11 @@ class EDA_BaseStruct /* Basic class, not directly used */
...
@@ -68,11 +73,11 @@ class EDA_BaseStruct /* Basic class, not directly used */
{
{
public
:
public
:
int
m_StructType
;
/* Struct ident for run time identification */
int
m_StructType
;
/* Struct ident for run time identification */
EDA_BaseStruct
*
Pnext
;
/* Linked list: Link (next struct) */
EDA_BaseStruct
*
Pnext
;
/* Linked list: Link (next struct) */
EDA_BaseStruct
*
Pback
;
/* Linked list: Link (previous struct) */
EDA_BaseStruct
*
Pback
;
/* Linked list: Link (previous struct) */
EDA_BaseStruct
*
m_Parent
;
/* Linked list: Link (parent struct) */
EDA_BaseStruct
*
m_Parent
;
/* Linked list: Link (parent struct) */
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 editions and other
int
m_Flags
;
// flags for editions and other
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 */
...
@@ -81,32 +86,43 @@ private:
...
@@ -81,32 +86,43 @@ private:
int
m_Status
;
int
m_Status
;
private
:
private
:
void
InitVars
(
void
);
void
InitVars
(
void
);
public
:
public
:
EDA_BaseStruct
(
EDA_BaseStruct
*
parent
,
int
idType
);
EDA_BaseStruct
(
EDA_BaseStruct
*
parent
,
int
idType
);
EDA_BaseStruct
(
int
struct_type
);
EDA_BaseStruct
(
int
struct_type
);
virtual
~
EDA_BaseStruct
()
{};
virtual
~
EDA_BaseStruct
()
{
};
EDA_BaseStruct
*
Next
(
void
)
{
return
Pnext
;
}
EDA_BaseStruct
*
Next
(
void
)
{
return
Pnext
;
}
/* Gestion de l'etat (status) de la structure (active, deleted..) */
/* Gestion de l'etat (status) de la structure (active, deleted..) */
int
GetState
(
int
type
);
int
GetState
(
int
type
);
void
SetState
(
int
type
,
int
state
);
void
SetState
(
int
type
,
int
state
);
int
ReturnStatus
(
void
)
const
int
ReturnStatus
(
void
)
const
{
{
return
(
m_Status
)
;
return
m_Status
;
}
}
void
SetStatus
(
int
new_status
)
void
SetStatus
(
int
new_status
)
{
{
m_Status
=
new_status
;
m_Status
=
new_status
;
}
}
wxString
ReturnClassName
(
void
);
/* addition d'une nouvelle struct a la liste chaine */
wxString
ReturnClassName
(
void
);
void
AddToChain
(
EDA_BaseStruct
*
laststruct
);
/* addition d'une nouvelle struct a la liste chain� */
void
AddToChain
(
EDA_BaseStruct
*
laststruct
);
/* fonction de placement */
/* fonction de placement */
virtual
void
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
);
virtual
void
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
);
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
draw_mode
,
int
Color
=
-
1
);
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
draw_mode
,
int
Color
=
-
1
);
};
};
// Text justify:
// Text justify:
...
@@ -117,12 +133,14 @@ typedef enum {
...
@@ -117,12 +133,14 @@ typedef enum {
GR_TEXT_HJUSTIFY_RIGHT
=
1
GR_TEXT_HJUSTIFY_RIGHT
=
1
}
GRTextHorizJustifyType
;
}
GRTextHorizJustifyType
;
typedef
enum
{
typedef
enum
{
GR_TEXT_VJUSTIFY_TOP
=
-
1
,
GR_TEXT_VJUSTIFY_TOP
=
-
1
,
GR_TEXT_VJUSTIFY_CENTER
=
0
,
GR_TEXT_VJUSTIFY_CENTER
=
0
,
GR_TEXT_VJUSTIFY_BOTTOM
=
1
GR_TEXT_VJUSTIFY_BOTTOM
=
1
}
GRTextVertJustifyType
;
}
GRTextVertJustifyType
;
/* controle des remplissages a l'ecran (Segments textes...)*/
/* controle des remplissages a l'ecran (Segments textes...)*/
#define FILAIRE 0
#define FILAIRE 0
#define FILLED 1
#define FILLED 1
...
@@ -132,7 +150,7 @@ typedef enum {
...
@@ -132,7 +150,7 @@ typedef enum {
#define DEFAULT_SIZE_TEXT 60
/* Hauteur (en 1/000" par defaut des textes */
#define DEFAULT_SIZE_TEXT 60
/* Hauteur (en 1/000" par defaut des textes */
/* classe de gestion des textes (labels, textes composants ..)
/* classe de gestion des textes (labels, textes composants ..)
(Non utilisee seule) */
*
(Non utilisee seule) */
class
EDA_TextStruct
class
EDA_TextStruct
{
{
public
:
public
:
...
@@ -147,30 +165,30 @@ public:
...
@@ -147,30 +165,30 @@ public:
int
m_CharType
;
/* normal, bold, italic ... */
int
m_CharType
;
/* normal, bold, italic ... */
int
m_HJustify
,
m_VJustify
;
/* Justifications Horiz et Vert du texte */
int
m_HJustify
,
m_VJustify
;
/* Justifications Horiz et Vert du texte */
int
m_ZoomLevelDrawable
;
/* Niveau de zoom acceptable pour affichage normal */
int
m_ZoomLevelDrawable
;
/* Niveau de zoom acceptable pour affichage normal */
int
*
m_TextDrawings
;
/* pointeur sur la liste des segments de dessin */
int
*
m_TextDrawings
;
/* pointeur sur la liste des segments de dessin */
int
m_TextDrawingsSize
;
/* nombre de segments a dessiner */
int
m_TextDrawingsSize
;
/* nombre de segments a dessiner */
public
:
public
:
EDA_TextStruct
(
const
wxString
&
text
=
wxEmptyString
);
EDA_TextStruct
(
const
wxString
&
text
=
wxEmptyString
);
virtual
~
EDA_TextStruct
(
void
);
virtual
~
EDA_TextStruct
(
void
);
void
CreateDrawData
(
void
);
void
CreateDrawData
(
void
);
int
GetLength
(
void
)
{
return
m_Text
.
Length
();
};
int
Pitch
(
void
);
/* retourne le pas entre 2 caracteres */
int
GetLength
(
void
)
{
return
m_Text
.
Length
();
};
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
Pitch
(
void
);
/* retourne le pas entre 2 caracteres */
const
wxPoint
&
offset
,
int
color
,
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
draw_mode
,
int
display_mode
=
FILAIRE
,
int
anchor_color
=
-
1
);
const
wxPoint
&
offset
,
int
color
,
int
draw_mode
,
int
display_mode
=
FILAIRE
,
int
anchor_color
=
-
1
);
/* locate functions */
/* locate functions */
int
Locate
(
const
wxPoint
&
posref
);
int
Locate
(
const
wxPoint
&
posref
);
int
Len_Size
(
void
);
// Return the text lenght in internal units
int
Len_Size
(
void
);
// Return the text lenght in internal units
};
};
/* Basic class for build items like lines, which have 1 start point and 1 end point.
/* Basic class for build items like lines, which have 1 start point and 1 end point.
Arc and circles can use this class.
*
Arc and circles can use this class.
*/
*/
class
EDA_BaseLineStruct
:
public
EDA_BaseStruct
class
EDA_BaseLineStruct
:
public
EDA_BaseStruct
{
{
public
:
public
:
int
m_Layer
;
// Layer number
int
m_Layer
;
// Layer number
...
@@ -179,39 +197,40 @@ public:
...
@@ -179,39 +197,40 @@ public:
wxPoint
m_End
;
// Line end point
wxPoint
m_End
;
// Line end point
public
:
public
:
EDA_BaseLineStruct
(
EDA_BaseStruct
*
StructFather
,
DrawStructureType
idtype
);
EDA_BaseLineStruct
(
EDA_BaseStruct
*
StructFather
,
DrawStructureType
idtype
);
};
};
/**************************/
/**************************/
/* class DrawPickedStruct */
/* class DrawPickedStruct */
/**************************/
/**************************/
/* Class to hold structures picked by pick events (like block selection)
/* Class to hold structures picked by pick events (like block selection)
This class has only one useful member: .m_PickedStruct, used as a link.
*
This class has only one useful member: .m_PickedStruct, used as a link.
It does not describe really an item.
*
It does not describe really an item.
It is used to create a linked list of selected items (in block selection).
*
It is used to create a linked list of selected items (in block selection).
Each DrawPickedStruct item has is member: .m_PickedStruct pointing the
*
Each DrawPickedStruct item has is member: .m_PickedStruct pointing the
real selected item
*
real selected item
*/
*/
class
DrawPickedStruct
:
public
EDA_BaseStruct
class
DrawPickedStruct
:
public
EDA_BaseStruct
{
{
public
:
public
:
EDA_BaseStruct
*
m_PickedStruct
;
EDA_BaseStruct
*
m_PickedStruct
;
public
:
public
:
DrawPickedStruct
(
EDA_BaseStruct
*
pickedstruct
=
NULL
);
DrawPickedStruct
(
EDA_BaseStruct
*
pickedstruct
=
NULL
);
~
DrawPickedStruct
(
void
);
~
DrawPickedStruct
(
void
);
void
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
)
{};
void
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
)
{
};
void
DeleteWrapperList
(
void
);
void
DeleteWrapperList
(
void
);
DrawPickedStruct
*
Next
(
void
)
{
return
(
DrawPickedStruct
*
)
Pnext
;
}
DrawPickedStruct
*
Next
(
void
)
{
return
(
DrawPickedStruct
*
)
Pnext
;
}
};
};
/* class to handle component boundary box.
/* class to handle component boundary box.
This class is similar to wxRect, but some wxRect functions are very curious,
*
This class is similar to wxRect, but some wxRect functions are very curious,
so I prefer this suitable class
*
so I prefer this suitable class
*/
*/
class
EDA_Rect
class
EDA_Rect
{
{
public
:
public
:
...
@@ -219,40 +238,44 @@ public:
...
@@ -219,40 +238,44 @@ public:
wxSize
m_Size
;
// Rectangle Size
wxSize
m_Size
;
// Rectangle Size
public
:
public
:
EDA_Rect
(
void
)
{
};
EDA_Rect
(
void
)
{
};
wxPoint
Centre
(
void
)
wxPoint
Centre
(
void
)
{
{
return
wxPoint
(
m_Pos
.
x
+
(
m_Size
.
x
>>
1
),
m_Pos
.
y
+
(
m_Size
.
y
>>
1
)
);
return
wxPoint
(
m_Pos
.
x
+
(
m_Size
.
x
>>
1
),
m_Pos
.
y
+
(
m_Size
.
y
>>
1
)
);
}
}
void
Normalize
(
void
);
// Ensure the height ant width are >= 0
bool
Inside
(
const
wxPoint
&
point
);
// Return TRUE if point is in Rect
void
Normalize
(
void
);
// Ensure the height ant width are >= 0
bool
Inside
(
int
x
,
int
y
)
{
return
Inside
(
wxPoint
(
x
,
y
));
}
bool
Inside
(
const
wxPoint
&
point
);
// Return TRUE if point is in Rect
wxSize
GetSize
(
void
)
{
return
m_Size
;
}
int
GetX
(
void
)
{
return
m_Pos
.
x
;}
bool
Inside
(
int
x
,
int
y
)
{
return
Inside
(
wxPoint
(
x
,
y
)
);
}
int
GetY
(
void
)
{
return
m_Pos
.
y
;}
wxSize
GetSize
(
void
)
{
return
m_Size
;
}
wxPoint
GetOrigin
(
void
)
{
return
m_Pos
;}
int
GetX
(
void
)
{
return
m_Pos
.
x
;
}
wxPoint
GetPosition
(
void
)
{
return
m_Pos
;}
int
GetY
(
void
)
{
return
m_Pos
.
y
;
}
wxPoint
GetEnd
(
void
)
{
return
wxPoint
(
GetRight
(),
GetBottom
());}
wxPoint
GetOrigin
(
void
)
{
return
m_Pos
;
}
int
GetWidth
(
void
)
{
return
m_Size
.
x
;
}
wxPoint
GetPosition
(
void
)
{
return
m_Pos
;
}
int
GetHeight
(
void
)
{
return
m_Size
.
y
;
}
wxPoint
GetEnd
(
void
)
{
return
wxPoint
(
GetRight
(),
GetBottom
()
);
}
int
GetRight
(
void
)
{
return
m_Pos
.
x
+
m_Size
.
x
;
}
int
GetWidth
(
void
)
{
return
m_Size
.
x
;
}
int
GetBottom
(
void
)
{
return
m_Pos
.
y
+
m_Size
.
y
;
}
int
GetHeight
(
void
)
{
return
m_Size
.
y
;
}
void
SetOrigin
(
const
wxPoint
&
pos
)
{
m_Pos
=
pos
;
}
int
GetRight
(
void
)
{
return
m_Pos
.
x
+
m_Size
.
x
;
}
void
SetOrigin
(
int
x
,
int
y
)
{
m_Pos
.
x
=
x
;
m_Pos
.
y
=
y
;
}
int
GetBottom
(
void
)
{
return
m_Pos
.
y
+
m_Size
.
y
;
}
void
SetSize
(
const
wxSize
&
size
)
{
m_Size
=
size
;
}
void
SetOrigin
(
const
wxPoint
&
pos
)
{
m_Pos
=
pos
;
}
void
SetSize
(
int
w
,
int
h
)
{
m_Size
.
x
=
w
;
m_Size
.
y
=
h
;
}
void
SetOrigin
(
int
x
,
int
y
)
{
m_Pos
.
x
=
x
;
m_Pos
.
y
=
y
;
}
void
Offset
(
int
dx
,
int
dy
)
{
m_Pos
.
x
+=
dx
;
m_Pos
.
y
+=
dy
;
}
void
SetSize
(
const
wxSize
&
size
)
{
m_Size
=
size
;
}
void
Offset
(
const
wxPoint
&
offset
)
{
m_Pos
.
x
+=
offset
.
x
;
m_Pos
.
y
+=
offset
.
y
;
}
void
SetSize
(
int
w
,
int
h
)
{
m_Size
.
x
=
w
;
m_Size
.
y
=
h
;
}
void
SetX
(
int
val
)
{
m_Pos
.
x
=
val
;
}
void
Offset
(
int
dx
,
int
dy
)
{
m_Pos
.
x
+=
dx
;
m_Pos
.
y
+=
dy
;
}
void
SetY
(
int
val
)
{
m_Pos
.
y
=
val
;
}
void
Offset
(
const
wxPoint
&
offset
)
{
m_Pos
.
x
+=
offset
.
x
;
m_Pos
.
y
+=
offset
.
y
;
}
void
SetWidth
(
int
val
)
{
m_Size
.
x
=
val
;
}
void
SetX
(
int
val
)
{
m_Pos
.
x
=
val
;
}
void
SetHeight
(
int
val
)
{
m_Size
.
y
=
val
;
}
void
SetY
(
int
val
)
{
m_Pos
.
y
=
val
;
}
void
SetEnd
(
const
wxPoint
&
pos
)
void
SetWidth
(
int
val
)
{
m_Size
.
x
=
val
;
}
void
SetHeight
(
int
val
)
{
m_Size
.
y
=
val
;
}
void
SetEnd
(
const
wxPoint
&
pos
)
{
{
m_Size
.
x
=
pos
.
x
-
m_Pos
.
x
;
m_Size
.
y
=
pos
.
y
-
m_Pos
.
y
;
m_Size
.
x
=
pos
.
x
-
m_Pos
.
x
;
m_Size
.
y
=
pos
.
y
-
m_Pos
.
y
;
}
}
EDA_Rect
&
Inflate
(
wxCoord
dx
,
wxCoord
dy
);
EDA_Rect
&
Inflate
(
wxCoord
dx
,
wxCoord
dy
);
};
};
#endif
/* BASE_STRUCT_H */
#endif
/* BASE_STRUCT_H */
include/pcbstruct.h
View file @
7fe80baf
/**************************************************************/
/**************************************************************/
/* pcbstruct.h : definition des structures de donnees type PCB */
/* pcbstruct.h : definition des structures de donnees type PCB */
/**************************************************************/
/**************************************************************/
#ifndef PCBSTRUCT_H
#ifndef PCBSTRUCT_H
#define PCBSTRUCT_H
#define PCBSTRUCT_H
...
@@ -11,9 +11,9 @@
...
@@ -11,9 +11,9 @@
#define ENTETE_LIBRAIRIE "PCBNEW-LibModule-V1"
#define ENTETE_LIBRAIRIE "PCBNEW-LibModule-V1"
#define ENTETE_LIBDOC "PCBNEW-LibDoc----V1"
#define ENTETE_LIBDOC "PCBNEW-LibDoc----V1"
#define L_ENTETE_LIB 18
#define L_ENTETE_LIB 18
#define EXT_CMP
wxT(".emp"
)
#define EXT_CMP
wxT( ".emp"
)
#define EXT_CMP_MASK
wxT("*.emp"
)
#define EXT_CMP_MASK
wxT( "*.emp"
)
#define EXT_DOC
wxT(".mdc"
)
#define EXT_DOC
wxT( ".mdc"
)
/* Bits indicateurs du membre .Status, pour pistes, modules... */
/* Bits indicateurs du membre .Status, pour pistes, modules... */
...
@@ -22,9 +22,9 @@
...
@@ -22,9 +22,9 @@
#define BEGIN_ONPAD 0x800
/* flag indiquant un debut de segment sur pad */
#define BEGIN_ONPAD 0x800
/* flag indiquant un debut de segment sur pad */
#define END_ONPAD 0x400
/* flag indiquant une fin de segment sur pad */
#define END_ONPAD 0x400
/* flag indiquant une fin de segment sur pad */
#define BUSY 0x0200
/* flag indiquant que la structure a deja
#define BUSY 0x0200
/* flag indiquant que la structure a deja
ete examinee, dans certaines routines */
*
ete examinee, dans certaines routines */
#define DELETED 0x0100
/* Bit flag de Status pour structures effacee
#define DELETED 0x0100
/* Bit flag de Status pour structures effacee
et mises en chaine "DELETED" */
*
et mises en chaine "DELETED" */
#define NO_TRACE 0x80
/* l'element ne doit pas etre affiche */
#define NO_TRACE 0x80
/* l'element ne doit pas etre affiche */
#define SURBRILL 0x20
/* element en surbrillance */
#define SURBRILL 0x20
/* element en surbrillance */
#define DRAG 0x10
/* segment en mode drag */
#define DRAG 0x10
/* segment en mode drag */
...
@@ -34,9 +34,9 @@
...
@@ -34,9 +34,9 @@
#define CHAIN 0x01
/* segment marque */
#define CHAIN 0x01
/* segment marque */
/*************************************/
/*************************************/
/* constantes de gestion des couches */
/* constantes de gestion des couches */
/*************************************/
/*************************************/
#define CUIVRE_LAYER 0x00000001
/* Bit layer cuivre */
#define CUIVRE_LAYER 0x00000001
/* Bit layer cuivre */
#define LAYER_2 0x00000002
/* Bit layer 2 */
#define LAYER_2 0x00000002
/* Bit layer 2 */
#define LAYER_3 0x00000004
/* Bit layer 3 */
#define LAYER_3 0x00000004
/* Bit layer 3 */
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
#define LAYER_N_15 14
/* Numero layer 15 */
#define LAYER_N_15 14
/* Numero layer 15 */
#define LAYER_CMP_N 15
#define LAYER_CMP_N 15
#define CMP_N 15
#define CMP_N 15
#define NB_COPPER_LAYERS
(CMP_N+
1)
#define NB_COPPER_LAYERS
(CMP_N +
1)
#define FIRST_NO_COPPER_LAYER 16
#define FIRST_NO_COPPER_LAYER 16
#define ADHESIVE_N_CU 16
#define ADHESIVE_N_CU 16
#define ADHESIVE_N_CMP 17
#define ADHESIVE_N_CMP 17
...
@@ -111,7 +111,7 @@
...
@@ -111,7 +111,7 @@
#define ECO2_N 27
#define ECO2_N 27
#define EDGE_N 28
#define EDGE_N 28
#define LAST_NO_COPPER_LAYER 28
#define LAST_NO_COPPER_LAYER 28
#define NB_LAYERS
(EDGE_N+
1)
#define NB_LAYERS
(EDGE_N +
1)
#define LAYER_COUNT 32
#define LAYER_COUNT 32
/* Forme des segments (pistes, contours ..) ( parametre .shape ) */
/* Forme des segments (pistes, contours ..) ( parametre .shape ) */
...
@@ -147,7 +147,7 @@ public:
...
@@ -147,7 +147,7 @@ public:
int
m_ViaDrill
;
// via drill (for the entire board)
int
m_ViaDrill
;
// via drill (for the entire board)
int
m_CurrentViaSize
;
// Current via size
int
m_CurrentViaSize
;
// Current via size
int
m_ViaSizeHistory
[
HIST0RY_NUMBER
];
// Last HIST0RY_NUMBER used via sizes
int
m_ViaSizeHistory
[
HIST0RY_NUMBER
];
// Last HIST0RY_NUMBER used via sizes
int
m_CurrentViaType
;
/* via type (BLIND, TROUGHT ...), bits 1 and 2 (not 0 and 1)*/
int
m_CurrentViaType
;
// via type (BLIND, TROUGHT ...), bits 1 and 2 (not 0 and 1)
int
m_CurrentTrackWidth
;
// current track width
int
m_CurrentTrackWidth
;
// current track width
int
m_TrackWidhtHistory
[
HIST0RY_NUMBER
];
// Last HIST0RY_NUMBER used track widths
int
m_TrackWidhtHistory
[
HIST0RY_NUMBER
];
// Last HIST0RY_NUMBER used track widths
int
m_DrawSegmentWidth
;
// current graphic line width (not EDGE layer)
int
m_DrawSegmentWidth
;
// current graphic line width (not EDGE layer)
...
@@ -157,9 +157,10 @@ public:
...
@@ -157,9 +157,10 @@ public:
int
m_TrackClearence
;
// track to track and track to pads clearance
int
m_TrackClearence
;
// track to track and track to pads clearance
int
m_ZoneClearence
;
// zone to track and zone to pads clearance
int
m_ZoneClearence
;
// zone to track and zone to pads clearance
int
m_MaskMargin
;
// Solder mask margin
int
m_MaskMargin
;
// Solder mask margin
/* Color options for screen display of the Printed Board: */
// Color options for screen display of the Printed Board:
int
m_PcbGridColor
;
// Grid color
int
m_PcbGridColor
;
// Grid color
int
m_LayerColor
[
32
]
;
// Layer colors (tracks and graphic items)
int
m_LayerColor
[
32
];
// Layer colors (tracks and graphic items)
int
m_ViaColor
[
4
];
// Via color (depending on is type)
int
m_ViaColor
[
4
];
// Via color (depending on is type)
int
m_ModuleTextCMPColor
;
// Text module color for modules on the COMPONENT layer
int
m_ModuleTextCMPColor
;
// Text module color for modules on the COMPONENT layer
int
m_ModuleTextCUColor
;
// Text module color for modules on the COPPER layer
int
m_ModuleTextCUColor
;
// Text module color for modules on the COPPER layer
...
@@ -168,10 +169,11 @@ public:
...
@@ -168,10 +169,11 @@ public:
int
m_PadCUColor
;
// Pad color for the COMPONENT side of the pad
int
m_PadCUColor
;
// Pad color for the COMPONENT side of the pad
int
m_PadCMPColor
;
// Pad color for the COPPER side of the pad
int
m_PadCMPColor
;
// Pad color for the COPPER side of the pad
// Pad color for the pads of both sides is m_PadCUColor OR m_PadCMPColor (in terms of colors)
// Pad color for the pads of both sides is m_PadCUColor OR m_PadCMPColor (in terms of colors)
int
m_RatsnestColor
;
// Ratsnest color
int
m_RatsnestColor
;
// Ratsnest color
public
:
public
:
EDA_BoardDesignSettings
(
void
);
EDA_BoardDesignSettings
(
void
);
};
};
// Values for m_DisplayViaMode member:
// Values for m_DisplayViaMode member:
...
@@ -180,16 +182,17 @@ enum DisplayViaMode {
...
@@ -180,16 +182,17 @@ enum DisplayViaMode {
VIA_SPECIAL_HOLE_SHOW
,
VIA_SPECIAL_HOLE_SHOW
,
ALL_VIA_HOLE_SHOW
,
ALL_VIA_HOLE_SHOW
,
OPT_VIA_HOLE_END
OPT_VIA_HOLE_END
};
};
class
BOARD
:
public
EDA_BaseStruct
class
BOARD
:
public
EDA_BaseStruct
{
{
public
:
public
:
WinEDA_BasePcbFrame
*
m_PcbFrame
;
// Window de visualisation
WinEDA_BasePcbFrame
*
m_PcbFrame
;
// Window de visualisation
EDA_Rect
m_BoundaryBox
;
// Limites d'encadrement du PCB
EDA_Rect
m_BoundaryBox
;
// Limites d'encadrement du PCB
int
m_Unused
;
//
int
m_Unused
;
int
m_Status_Pcb
;
// Mot d'etat: Bit 1 = Chevelu calcule
int
m_Status_Pcb
;
// Mot d'etat: Bit 1 = Chevelu calcule
EDA_BoardDesignSettings
*
m_BoardSettings
;
// Link to current design settings
EDA_BoardDesignSettings
*
m_BoardSettings
;
// Link to current design settings
int
m_NbNets
;
// Nombre de nets (equipotentielles)
int
m_NbNets
;
// Nombre de nets (equipotentielles)
int
m_NbNodes
;
// nombre de pads connectes
int
m_NbNodes
;
// nombre de pads connectes
int
m_NbLinks
;
// nombre de chevelus
int
m_NbLinks
;
// nombre de chevelus
...
@@ -199,34 +202,34 @@ class BOARD: public EDA_BaseStruct
...
@@ -199,34 +202,34 @@ class BOARD: public EDA_BaseStruct
int
m_NbSegmTrack
;
// nombre d'elements de type segments de piste
int
m_NbSegmTrack
;
// nombre d'elements de type segments de piste
int
m_NbSegmZone
;
// nombre d'elements de type segments de zone
int
m_NbSegmZone
;
// nombre d'elements de type segments de zone
EDA_BaseStruct
*
m_Drawings
;
// pointeur sur liste drawings
EDA_BaseStruct
*
m_Drawings
;
// pointeur sur liste drawings
MODULE
*
m_Modules
;
// pointeur sur liste zone modules
MODULE
*
m_Modules
;
// pointeur sur liste zone modules
EQUIPOT
*
m_Equipots
;
// pointeur liste zone equipot
EQUIPOT
*
m_Equipots
;
// pointeur liste zone equipot
TRACK
*
m_Track
;
// pointeur relatif zone piste
TRACK
*
m_Track
;
// pointeur relatif zone piste
TRACK
*
m_Zone
;
// pointeur tableau zone zones de cuivre
TRACK
*
m_Zone
;
// pointeur tableau zone zones de cuivre
D_PAD
**
m_Pads
;
// pointeur liste d'acces aux pads
D_PAD
**
m_Pads
;
// pointeur liste d'acces aux pads
int
m_NbPads
;
// nombre total de pads
int
m_NbPads
;
// nombre total de pads
CHEVELU
*
m_Ratsnest
;
// pointeur liste des chevelus
CHEVELU
*
m_Ratsnest
;
// pointeur liste des chevelus
CHEVELU
*
m_LocalRatsnest
;
// pointeur liste des chevelus d'un module
CHEVELU
*
m_LocalRatsnest
;
// pointeur liste des chevelus d'un module
EDGE_ZONE
*
m_CurrentLimitZone
;
/* pointeur sur la liste des segments
EDGE_ZONE
*
m_CurrentLimitZone
;
/* pointeur sur la liste des segments
de delimitation de la zone en cours de trace */
*
de delimitation de la zone en cours de trace */
BOARD
(
EDA_BaseStruct
*
StructFather
,
WinEDA_BasePcbFrame
*
frame
);
BOARD
(
EDA_BaseStruct
*
StructFather
,
WinEDA_BasePcbFrame
*
frame
);
~
BOARD
(
void
);
~
BOARD
(
void
);
/* supprime du chainage la structure Struct */
/* supprime du chainage la structure Struct */
void
UnLink
(
void
);
void
UnLink
(
void
);
/* Routines de calcul des nombres de segments pistes et zones */
/* Routines de calcul des nombres de segments pistes et zones */
int
GetNumSegmTrack
(
void
);
int
GetNumSegmTrack
(
void
);
int
GetNumSegmZone
(
void
);
int
GetNumSegmZone
(
void
);
int
GetNumNoconnect
(
void
);
// retourne le nombre de connexions manquantes
int
GetNumNoconnect
(
void
);
// retourne le nombre de connexions manquantes
int
GetNumRatsnests
(
void
);
// retourne le nombre de chevelus
int
GetNumRatsnests
(
void
);
// retourne le nombre de chevelus
int
GetNumNodes
(
void
);
// retourne le nombre de pads a netcode > 0
int
GetNumNodes
(
void
);
// retourne le nombre de pads a netcode > 0
// Calcul du rectangle d'encadrement:
// Calcul du rectangle d'encadrement:
bool
ComputeBoundaryBox
(
void
);
bool
ComputeBoundaryBox
(
void
);
};
};
...
@@ -239,18 +242,18 @@ public:
...
@@ -239,18 +242,18 @@ public:
int
m_Route_Layer_BOTTOM
;
/* pour placement vias et routage 2 couches */
int
m_Route_Layer_BOTTOM
;
/* pour placement vias et routage 2 couches */
public
:
public
:
PCB_SCREEN
(
int
idscreen
);
PCB_SCREEN
(
int
idscreen
);
~
PCB_SCREEN
(
void
);
~
PCB_SCREEN
(
void
);
PCB_SCREEN
*
Next
(
void
)
{
return
(
PCB_SCREEN
*
)
Pnext
;
}
PCB_SCREEN
*
Next
(
void
)
{
return
(
PCB_SCREEN
*
)
Pnext
;
}
void
Init
(
void
);
void
Init
(
void
);
void
SetNextZoom
(
void
);
void
SetNextZoom
(
void
);
void
SetPreviousZoom
(
void
);
void
SetPreviousZoom
(
void
);
void
SetLastZoom
(
void
);
void
SetLastZoom
(
void
);
};
};
/***************************/
/***************************/
/* Description des Modules */
/* Description des Modules */
/***************************/
/***************************/
#include "class_pad.h"
/* Description des Pastilles :*/
#include "class_pad.h"
/* Description des Pastilles :*/
#include "class_edge_mod.h"
#include "class_edge_mod.h"
...
@@ -259,11 +262,11 @@ public:
...
@@ -259,11 +262,11 @@ public:
#include "class_equipot.h"
#include "class_equipot.h"
/***********************************/
/***********************************/
/* Description des elements du PCB */
/* Description des elements du PCB */
/***********************************/
/***********************************/
class
DRAWSEGMENT
:
public
EDA_BaseLineStruct
class
DRAWSEGMENT
:
public
EDA_BaseLineStruct
{
{
public
:
public
:
int
m_Shape
;
// forme: Segment , Cercle..
int
m_Shape
;
// forme: Segment , Cercle..
...
@@ -271,17 +274,17 @@ public:
...
@@ -271,17 +274,17 @@ public:
int
m_Angle
;
// pour les arcs: "longueur" de l'arc en 1/10 deg
int
m_Angle
;
// pour les arcs: "longueur" de l'arc en 1/10 deg
public
:
public
:
DRAWSEGMENT
(
EDA_BaseStruct
*
StructFather
,
DrawStructureType
idtype
=
TYPEDRAWSEGMENT
);
DRAWSEGMENT
(
EDA_BaseStruct
*
StructFather
,
DrawStructureType
idtype
=
TYPEDRAWSEGMENT
);
~
DRAWSEGMENT
(
void
);
~
DRAWSEGMENT
(
void
);
// Read/write data
// Read/write data
bool
WriteDrawSegmentDescr
(
FILE
*
File
);
bool
WriteDrawSegmentDescr
(
FILE
*
File
);
bool
ReadDrawSegmentDescr
(
FILE
*
File
,
int
*
LineNum
);
bool
ReadDrawSegmentDescr
(
FILE
*
File
,
int
*
LineNum
);
/* supprime du chainage la structure Struct */
/* supprime du chainage la structure Struct */
void
UnLink
(
void
);
void
UnLink
(
void
);
void
Copy
(
DRAWSEGMENT
*
source
);
void
Copy
(
DRAWSEGMENT
*
source
);
};
};
...
@@ -290,37 +293,38 @@ public:
...
@@ -290,37 +293,38 @@ public:
#include "class_mire.h"
#include "class_mire.h"
#include "class_track.h"
#include "class_track.h"
/*******************/
/*******************/
/* class EDGE_ZONE */
/* class EDGE_ZONE */
/*******************/
/*******************/
class
EDGE_ZONE
:
public
DRAWSEGMENT
class
EDGE_ZONE
:
public
DRAWSEGMENT
{
{
public
:
public
:
EDGE_ZONE
(
EDA_BaseStruct
*
StructFather
);
EDGE_ZONE
(
EDA_BaseStruct
*
StructFather
);
EDGE_ZONE
(
const
EDGE_ZONE
&
edgezone
);
EDGE_ZONE
(
const
EDGE_ZONE
&
edgezone
);
~
EDGE_ZONE
(
void
);
~
EDGE_ZONE
(
void
);
};
};
/************************************/
/************************************/
/* Gestion des marqueurs sur le PCB */
/* Gestion des marqueurs sur le PCB */
/************************************/
/************************************/
class
MARQUEUR
:
public
EDA_BaseStruct
class
MARQUEUR
:
public
EDA_BaseStruct
{
/* Description d'un marqueur */
{
/* Description d'un marqueur */
public
:
public
:
wxPoint
m_Pos
;
wxPoint
m_Pos
;
char
*
m_Bitmap
;
/* Shape (bitmap) */
char
*
m_Bitmap
;
/* Shape (bitmap) */
int
m_Type
;
int
m_Type
;
int
m_Color
;
/* couleur */
int
m_Color
;
/* couleur */
wxString
m_Diag
;
/* Associated text (comment) */
wxString
m_Diag
;
/* Associated text (comment) */
public
:
public
:
MARQUEUR
(
EDA_BaseStruct
*
StructFather
);
MARQUEUR
(
EDA_BaseStruct
*
StructFather
);
~
MARQUEUR
(
void
);
~
MARQUEUR
(
void
);
void
UnLink
(
void
);
void
UnLink
(
void
);
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
DrawMode
);
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
DrawMode
);
};
};
...
@@ -337,8 +341,8 @@ public:
...
@@ -337,8 +341,8 @@ public:
bool
DisplayPcbTrackFill
;
/* FALSE = sketch , TRUE = filled */
bool
DisplayPcbTrackFill
;
/* FALSE = sketch , TRUE = filled */
bool
DisplayTrackIsol
;
bool
DisplayTrackIsol
;
int
m_DisplayViaMode
;
/* 0 do not show via hole,
int
m_DisplayViaMode
;
/* 0 do not show via hole,
1 show via hole for non default value
*
1 show via hole for non default value
2 show all via hole */
*
2 show all via hole */
bool
DisplayPolarCood
;
bool
DisplayPolarCood
;
bool
DisplayZones
;
bool
DisplayZones
;
...
@@ -349,9 +353,8 @@ public:
...
@@ -349,9 +353,8 @@ public:
bool
ContrastModeDisplay
;
bool
ContrastModeDisplay
;
public
:
public
:
DISPLAY_OPTIONS
(
void
);
DISPLAY_OPTIONS
(
void
);
};
};
#endif
/* PCBSTRUCT_H */
#endif
/* PCBSTRUCT_H */
include/wxstruct.h
View file @
7fe80baf
/***********************************************************/
/***********************************************************/
/* wxstruct.h:
*/
/* wxstruct.h:
*/
/* descriptions des principales classes derivees utilisees */
/* descriptions des principales classes derivees utilisees */
/***********************************************************/
/***********************************************************/
#ifndef WXSTRUCT_H
#ifndef WXSTRUCT_H
#define WXSTRUCT_H
#define WXSTRUCT_H
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
// Option d'affichage des fenetres de dialogue
// Option d'affichage des fenetres de dialogue
//#define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxFRAME_FLOAT_ON_PARENT|wxSTAY_ON_TOP
//#define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxFRAME_FLOAT_ON_PARENT|wxSTAY_ON_TOP
#define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE
|
wxFRAME_FLOAT_ON_PARENT
#define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE
|
wxFRAME_FLOAT_ON_PARENT
#define EDA_DRAW_PANEL wxScrolledWindow
#define EDA_DRAW_PANEL wxScrolledWindow
...
@@ -97,8 +97,7 @@ class PARAM_CFG_BASE;
...
@@ -97,8 +97,7 @@ class PARAM_CFG_BASE;
class
Ki_PageDescr
;
class
Ki_PageDescr
;
enum
id_librarytype
enum
id_librarytype
{
{
LIBRARY_TYPE_EESCHEMA
,
LIBRARY_TYPE_EESCHEMA
,
LIBRARY_TYPE_PCBNEW
,
LIBRARY_TYPE_PCBNEW
,
LIBRARY_TYPE_DOC
LIBRARY_TYPE_DOC
...
@@ -126,82 +125,84 @@ enum id_toolbar {
...
@@ -126,82 +125,84 @@ enum id_toolbar {
TOOLBAR_AUX
TOOLBAR_AUX
};
};
/**********************/
/* Classes pour WXWIN */
/**********************/
/**********************/
/* Classes pour WXWIN */
/**********************/
#define MSG_PANEL_DEFAULT_HEIGHT ( 28 ) // hauteur de la zone d'affichage des infos en bas d'ecran
#define MSG_PANEL_DEFAULT_HEIGHT ( 28 ) // hauteur de la zone d'affichage des infos en bas d'ecran
/**********************************************/
/**********************************************/
/* Class representing the entire Application */
/* Class representing the entire Application */
/**********************************************/
/**********************************************/
#include "appl_wxstruct.h"
#include "appl_wxstruct.h"
/********************************************/
/********************************************/
/* classe pour la Fenetre generale de trace */
/* classe pour la Fenetre generale de trace */
/********************************************/
/********************************************/
class
WinEDA_BasicFrame
:
public
wxFrame
class
WinEDA_BasicFrame
:
public
wxFrame
{
{
public
:
public
:
int
m_Ident
;
// Id Type (pcb, schematic, library..)
int
m_Ident
;
// Id Type (pcb, schematic, library..)
WinEDA_App
*
m_Parent
;
WinEDA_App
*
m_Parent
;
wxPoint
m_FramePos
;
wxPoint
m_FramePos
;
wxSize
m_FrameSize
;
wxSize
m_FrameSize
;
int
m_MsgFrameHeight
;
int
m_MsgFrameHeight
;
WinEDA_MenuBar
*
m_MenuBar
;
// menu du haut d'ecran
WinEDA_MenuBar
*
m_MenuBar
;
// menu du haut d'ecran
WinEDA_Toolbar
*
m_HToolBar
;
// Standard horizontal Toolbar
WinEDA_Toolbar
*
m_HToolBar
;
// Standard horizontal Toolbar
bool
m_FrameIsActive
;
bool
m_FrameIsActive
;
wxString
m_FrameName
;
// name used for writting and reading setup
wxString
m_FrameName
;
// name used for writting and reading setup
// It is "SchematicFrame", "PcbFrame" ....
// It is "SchematicFrame", "PcbFrame" ....
public
:
public
:
// Constructor and destructor
// Constructor and destructor
WinEDA_BasicFrame
(
wxWindow
*
father
,
int
idtype
,
WinEDA_App
*
parent
,
WinEDA_BasicFrame
(
wxWindow
*
father
,
int
idtype
,
WinEDA_App
*
parent
,
const
wxString
&
title
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
const
wxPoint
&
pos
,
const
wxSize
&
size
);
#ifdef KICAD_PYTHON
#ifdef KICAD_PYTHON
WinEDA_BasicFrame
(
const
WinEDA_BasicFrame
&
)
{}
// Should throw!!
WinEDA_BasicFrame
(
const
WinEDA_BasicFrame
&
)
{
}
// Should throw!!
WinEDA_BasicFrame
()
{}
// Should throw!!
WinEDA_BasicFrame
()
{
}
// Should throw!!
#endif
#endif
~
WinEDA_BasicFrame
(
void
);
~
WinEDA_BasicFrame
(
void
);
void
GetKicadHelp
(
wxCommandEvent
&
event
);
void
GetKicadHelp
(
wxCommandEvent
&
event
);
void
GetKicadAbout
(
wxCommandEvent
&
event
);
void
GetKicadAbout
(
wxCommandEvent
&
event
);
void
PrintMsg
(
const
wxString
&
text
);
void
PrintMsg
(
const
wxString
&
text
);
void
GetSettings
(
void
);
void
GetSettings
(
void
);
void
SaveSettings
(
void
);
void
SaveSettings
(
void
);
void
SetLanguage
(
wxCommandEvent
&
event
);
void
SetLanguage
(
wxCommandEvent
&
event
);
void
ProcessFontPreferences
(
int
id
);
void
ProcessFontPreferences
(
int
id
);
wxString
GetLastProject
(
int
rang
);
wxString
GetLastProject
(
int
rang
);
void
SetLastProject
(
const
wxString
&
FullFileName
);
void
SetLastProject
(
const
wxString
&
FullFileName
);
void
DisplayActivity
(
int
PerCent
,
const
wxString
&
Text
);
void
DisplayActivity
(
int
PerCent
,
const
wxString
&
Text
);
virtual
void
ReCreateMenuBar
(
void
);
virtual
void
ReCreateMenuBar
(
void
);
};
};
/********************************************/
/********************************************/
/* classe pour la Fenetre generale de trace */
/* classe pour la Fenetre generale de trace */
/********************************************/
/********************************************/
class
WinEDA_DrawFrame
:
public
WinEDA_BasicFrame
class
WinEDA_DrawFrame
:
public
WinEDA_BasicFrame
{
{
public
:
public
:
WinEDA_DrawPanel
*
DrawPanel
;
// surface de dessin
WinEDA_DrawPanel
*
DrawPanel
;
// surface de dessin
WinEDA_MsgPanel
*
MsgPanel
;
// Zone d'affichage de caracteristiques
WinEDA_MsgPanel
*
MsgPanel
;
// Zone d'affichage de caracteristiques
WinEDA_Toolbar
*
m_VToolBar
;
// Vertical (right side) Toolbar
WinEDA_Toolbar
*
m_VToolBar
;
// Vertical (right side) Toolbar
WinEDA_Toolbar
*
m_AuxVToolBar
;
// Auxiliary Vertical (right side) Toolbar
WinEDA_Toolbar
*
m_AuxVToolBar
;
// Auxiliary Vertical (right side) Toolbar
WinEDA_Toolbar
*
m_OptionsToolBar
;
// Options Toolbar (left side)
WinEDA_Toolbar
*
m_OptionsToolBar
;
// Options Toolbar (left side)
WinEDA_Toolbar
*
m_AuxiliaryToolBar
;
// Toolbar auxiliaire (utilis� dans pcbnew)
WinEDA_Toolbar
*
m_AuxiliaryToolBar
;
// Toolbar auxiliaire (utilis� dans pcbnew)
WinEDAChoiceBox
*
m_SelGridBox
;
// Dialog box to choose the grid size
WinEDAChoiceBox
*
m_SelGridBox
;
// Dialog box to choose the grid size
WinEDAChoiceBox
*
m_SelZoomBox
;
// Dialog box to choose the Zoom value
WinEDAChoiceBox
*
m_SelZoomBox
;
// Dialog box to choose the Zoom value
int
m_ZoomMaxValue
;
// Max zoom value: Draw min scale is 1/m_ZoomMaxValue
int
m_ZoomMaxValue
;
// Max zoom value: Draw min scale is 1/m_ZoomMaxValue
BASE_SCREEN
*
m_CurrentScreen
;
// SCREEN en cours
BASE_SCREEN
*
m_CurrentScreen
;
// SCREEN en cours
int
m_CurrentCursorShape
;
// shape for cursor (0 = default cursor)
int
m_CurrentCursorShape
;
// shape for cursor (0 = default cursor)
int
m_ID_current_state
;
// Id du bouton actif du tool bar vertical
int
m_ID_current_state
;
// Id du bouton actif du tool bar vertical
...
@@ -209,6 +210,7 @@ public:
...
@@ -209,6 +210,7 @@ public:
int
m_InternalUnits
;
// nombre d'unites internes pour 1 pouce
int
m_InternalUnits
;
// nombre d'unites internes pour 1 pouce
// = 1000 pour schema, = 10000 pour PCB
// = 1000 pour schema, = 10000 pour PCB
int
m_UnitType
;
// Internal Unit type (0 = inch)
int
m_UnitType
;
// Internal Unit type (0 = inch)
bool
m_Draw_Axis
;
// TRUE pour avoir les axes dessines
bool
m_Draw_Axis
;
// TRUE pour avoir les axes dessines
bool
m_Draw_Grid
;
// TRUE pour avoir la grille dessinee
bool
m_Draw_Grid
;
// TRUE pour avoir la grille dessinee
...
@@ -217,97 +219,101 @@ public:
...
@@ -217,97 +219,101 @@ public:
bool
m_Print_Sheet_Ref
;
// TRUE pour avoir le cartouche imprim�
bool
m_Print_Sheet_Ref
;
// TRUE pour avoir le cartouche imprim�
bool
m_Draw_Auxiliary_Axis
;
// TRUE pour avoir les axes auxiliaires dessines
bool
m_Draw_Auxiliary_Axis
;
// TRUE pour avoir les axes auxiliaires dessines
wxPoint
m_Auxiliary_Axis_Position
;
/* origine de l'axe auxiliaire (app:
wxPoint
m_Auxiliary_Axis_Position
;
/* origine de l'axe auxiliaire (app:
dans la generation les fichiers de positionnement
*
dans la generation les fichiers de positionnement
des composants) */
*
des composants) */
public
:
public
:
// Constructor and destructor
// Constructor and destructor
WinEDA_DrawFrame
(
wxWindow
*
father
,
int
idtype
,
WinEDA_App
*
parent
,
WinEDA_DrawFrame
(
wxWindow
*
father
,
int
idtype
,
WinEDA_App
*
parent
,
const
wxString
&
title
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
const
wxPoint
&
pos
,
const
wxSize
&
size
);
~
WinEDA_DrawFrame
(
void
);
~
WinEDA_DrawFrame
(
void
);
BASE_SCREEN
*
GetScreen
(
void
)
{
return
m_CurrentScreen
;
}
BASE_SCREEN
*
GetScreen
(
void
)
{
return
m_CurrentScreen
;
}
void
OnMenuOpen
(
wxMenuEvent
&
event
);
void
OnMouseEvent
(
wxMouseEvent
&
event
);
void
OnMenuOpen
(
wxMenuEvent
&
event
);
virtual
void
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
);
void
OnMouseEvent
(
wxMouseEvent
&
event
);
void
AddFontSelectionMenu
(
wxMenu
*
main_menu
);
virtual
void
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
);
void
ProcessFontPreferences
(
wxCommandEvent
&
event
);
void
AddFontSelectionMenu
(
wxMenu
*
main_menu
);
void
ProcessFontPreferences
(
wxCommandEvent
&
event
);
void
Affiche_Message
(
const
wxString
&
message
);
void
EraseMsgBox
(
void
);
void
Affiche_Message
(
const
wxString
&
message
);
void
Process_PageSettings
(
wxCommandEvent
&
event
);
void
EraseMsgBox
(
void
);
void
SetDrawBgColor
(
int
color_num
);
void
Process_PageSettings
(
wxCommandEvent
&
event
);
virtual
void
SetToolbars
(
void
);
void
SetDrawBgColor
(
int
color_num
);
void
SetLanguage
(
wxCommandEvent
&
event
);
virtual
void
SetToolbars
(
void
);
virtual
void
ReCreateHToolbar
(
void
)
=
0
;
void
SetLanguage
(
wxCommandEvent
&
event
);
virtual
void
ReCreateVToolbar
(
void
)
=
0
;
virtual
void
ReCreateHToolbar
(
void
)
=
0
;
virtual
void
ReCreateMenuBar
(
void
);
virtual
void
ReCreateVToolbar
(
void
)
=
0
;
virtual
void
ReCreateAuxiliaryToolbar
(
void
);
virtual
void
ReCreateMenuBar
(
void
);
void
SetToolID
(
int
id
,
int
new_cursor_id
,
const
wxString
&
title
);
virtual
void
ReCreateAuxiliaryToolbar
(
void
);
void
SetToolID
(
int
id
,
int
new_cursor_id
,
const
wxString
&
title
);
virtual
void
OnSelectGrid
(
wxCommandEvent
&
event
);
virtual
void
OnSelectZoom
(
wxCommandEvent
&
event
);
virtual
void
OnSelectGrid
(
wxCommandEvent
&
event
);
virtual
void
OnSelectZoom
(
wxCommandEvent
&
event
);
virtual
void
GeneralControle
(
wxDC
*
DC
,
wxPoint
Mouse
);
virtual
void
OnSize
(
wxSizeEvent
&
event
);
virtual
void
GeneralControle
(
wxDC
*
DC
,
wxPoint
Mouse
);
void
OnEraseBackground
(
wxEraseEvent
&
SizeEvent
);
virtual
void
OnSize
(
wxSizeEvent
&
event
);
void
OnEraseBackground
(
wxEraseEvent
&
SizeEvent
);
// void OnChar(wxKeyEvent& event);
// void OnChar(wxKeyEvent& event);
void
SetToolbarBgColor
(
int
color_num
);
void
SetToolbarBgColor
(
int
color_num
);
void
OnZoom
(
int
zoom_type
);
void
OnZoom
(
int
zoom_type
);
void
OnPanning
(
int
direction
);
void
OnPanning
(
int
direction
);
void
OnGrid
(
int
grid_type
);
void
OnGrid
(
int
grid_type
);
void
Recadre_Trace
(
bool
ToMouse
);
void
Recadre_Trace
(
bool
ToMouse
);
void
PutOnGrid
(
wxPoint
*
coord
);
/* corrige la valeur de la coordonnee coord
void
PutOnGrid
(
wxPoint
*
coord
);
/* corrige la valeur de la coordonnee coord
pour etre sur le point de grille le plus proche */
* pour etre sur le point de grille le plus proche */
void
Zoom_Automatique
(
bool
move_mouse_cursor
);
void
Zoom_Automatique
(
bool
move_mouse_cursor
);
/* Affiche le schema au meilleur zoom au meilleur centrage pour le dessin
/* Affiche le schema au meilleur zoom au meilleur centrage pour le dessin
de facon a avoir tout le circuit affiche a l'ecran */
* de facon a avoir tout le circuit affiche a l'ecran */
void
Window_Zoom
(
EDA_Rect
&
Rect
);
void
Window_Zoom
(
EDA_Rect
&
Rect
);
/* Recalcule le zoom et les offsets pour que l'affichage se fasse dans la
/* Recalcule le zoom et les offsets pour que l'affichage se fasse dans la
fenetre de coord x0, y0 a x1, y1 */
*
fenetre de coord x0, y0 a x1, y1 */
virtual
int
BestZoom
(
void
)
=
0
;
// Retourne le meilleur zoom
virtual
int
BestZoom
(
void
)
=
0
;
// Retourne le meilleur zoom
void
ToPrinter
(
wxCommandEvent
&
event
);
void
ToPrinter
(
wxCommandEvent
&
event
);
void
SVG_Print
(
wxCommandEvent
&
event
);
void
SVG_Print
(
wxCommandEvent
&
event
);
void
OnActivate
(
wxActivateEvent
&
event
);
void
OnActivate
(
wxActivateEvent
&
event
);
void
ReDrawPanel
(
void
);
void
ReDrawPanel
(
void
);
void
TraceWorkSheet
(
wxDC
*
DC
,
BASE_SCREEN
*
screen
,
int
line_width
);
void
TraceWorkSheet
(
wxDC
*
DC
,
BASE_SCREEN
*
screen
,
int
line_width
);
void
DisplayToolMsg
(
const
wxString
msg
);
void
DisplayToolMsg
(
const
wxString
msg
);
void
Process_Zoom
(
wxCommandEvent
&
event
);
void
Process_Zoom
(
wxCommandEvent
&
event
);
void
Process_Grid
(
wxCommandEvent
&
event
);
void
Process_Grid
(
wxCommandEvent
&
event
);
virtual
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
)
=
0
;
virtual
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
)
=
0
;
virtual
void
Process_Special_Functions
(
wxCommandEvent
&
event
)
=
0
;
virtual
void
Process_Special_Functions
(
wxCommandEvent
&
event
)
=
0
;
virtual
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
virtual
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
virtual
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
=
0
;
virtual
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
=
0
;
virtual
void
ToolOnRightClick
(
wxCommandEvent
&
event
);
virtual
void
ToolOnRightClick
(
wxCommandEvent
&
event
);
void
AdjustScrollBars
(
void
);
void
AdjustScrollBars
(
void
);
void
Affiche_Status_Box
(
void
);
/* Affichage des coord curseur, zoom .. */
void
Affiche_Status_Box
(
void
);
/* Affichage des coord curseur, zoom .. */
void
DisplayUnitsMsg
(
void
);
void
DisplayUnitsMsg
(
void
);
/* Gestion generale des operations sur block */
/* Gestion generale des operations sur block */
virtual
int
ReturnBlockCommand
(
int
key
);
virtual
int
ReturnBlockCommand
(
int
key
);
virtual
void
InitBlockPasteInfos
();
virtual
void
InitBlockPasteInfos
();
virtual
bool
HandleBlockBegin
(
wxDC
*
DC
,
int
cmd_type
,
const
wxPoint
&
startpos
);
virtual
bool
HandleBlockBegin
(
wxDC
*
DC
,
int
cmd_type
,
const
wxPoint
&
startpos
);
virtual
void
HandleBlockPlace
(
wxDC
*
DC
);
virtual
void
HandleBlockPlace
(
wxDC
*
DC
);
virtual
int
HandleBlockEnd
(
wxDC
*
DC
);
virtual
int
HandleBlockEnd
(
wxDC
*
DC
);
void
CopyToClipboard
(
wxCommandEvent
&
event
);
void
CopyToClipboard
(
wxCommandEvent
&
event
);
/* interprocess communication */
/* interprocess communication */
void
OnSockRequest
(
wxSocketEvent
&
evt
);
void
OnSockRequest
(
wxSocketEvent
&
evt
);
void
OnSockRequestServer
(
wxSocketEvent
&
evt
);
void
OnSockRequestServer
(
wxSocketEvent
&
evt
);
};
};
#define COMMON_EVENTS_DRAWFRAME \
#define COMMON_EVENTS_DRAWFRAME \
EVT_MOUSEWHEEL(WinEDA_DrawFrame::OnMouseEvent)\
EVT_MOUSEWHEEL( WinEDA_DrawFrame::OnMouseEvent ) \
EVT_MENU_OPEN(WinEDA_DrawFrame::OnMenuOpen)\
EVT_MENU_OPEN( WinEDA_DrawFrame::OnMenuOpen ) \
EVT_ACTIVATE(WinEDA_DrawFrame::OnActivate)
EVT_ACTIVATE( WinEDA_DrawFrame::OnActivate )
/**************************************************************/
/**************************************************************/
...
@@ -315,10 +321,10 @@ public:
...
@@ -315,10 +321,10 @@ public:
/* aux classes d'affichage de PCB, et de l'editeur de Modules */
/* aux classes d'affichage de PCB, et de l'editeur de Modules */
/**************************************************************/
/**************************************************************/
class
WinEDA_BasePcbFrame
:
public
WinEDA_DrawFrame
class
WinEDA_BasePcbFrame
:
public
WinEDA_DrawFrame
{
{
public
:
public
:
BOARD
*
m_Pcb
;
BOARD
*
m_Pcb
;
bool
m_DisplayPadFill
;
// How show pads
bool
m_DisplayPadFill
;
// How show pads
bool
m_DisplayPadNum
;
// show pads number
bool
m_DisplayPadNum
;
// show pads number
...
@@ -326,482 +332,484 @@ public:
...
@@ -326,482 +332,484 @@ public:
int
m_DisplayModEdge
;
// How show module drawings
int
m_DisplayModEdge
;
// How show module drawings
int
m_DisplayModText
;
// How show module texts
int
m_DisplayModText
;
// How show module texts
bool
m_DisplayPcbTrackFill
;
/* FALSE = sketch , TRUE = rempli */
bool
m_DisplayPcbTrackFill
;
/* FALSE = sketch , TRUE = rempli */
WinEDA3D_DrawFrame
*
m_Draw3DFrame
;
WinEDA3D_DrawFrame
*
m_Draw3DFrame
;
public
:
public
:
WinEDA_BasePcbFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
int
idtype
,
WinEDA_BasePcbFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
int
idtype
,
const
wxString
&
title
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
const
wxPoint
&
pos
,
const
wxSize
&
size
);
~
WinEDA_BasePcbFrame
(
void
);
~
WinEDA_BasePcbFrame
(
void
);
// General
// General
virtual
void
OnCloseWindow
(
wxCloseEvent
&
Event
)
=
0
;
virtual
void
OnCloseWindow
(
wxCloseEvent
&
Event
)
=
0
;
virtual
void
Process_Special_Functions
(
wxCommandEvent
&
event
)
=
0
;
virtual
void
Process_Special_Functions
(
wxCommandEvent
&
event
)
=
0
;
virtual
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
)
=
0
;
virtual
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
)
=
0
;
virtual
void
ReCreateHToolbar
(
void
)
=
0
;
virtual
void
ReCreateHToolbar
(
void
)
=
0
;
virtual
void
ReCreateVToolbar
(
void
)
=
0
;
virtual
void
ReCreateVToolbar
(
void
)
=
0
;
virtual
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
=
0
;
virtual
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
=
0
;
virtual
void
ReCreateMenuBar
(
void
);
virtual
void
ReCreateMenuBar
(
void
);
PCB_SCREEN
*
GetScreen
(
void
)
{
return
(
PCB_SCREEN
*
)
m_CurrentScreen
;
}
PCB_SCREEN
*
GetScreen
(
void
)
{
return
(
PCB_SCREEN
*
)
m_CurrentScreen
;
}
int
BestZoom
(
void
);
// Retourne le meilleur zoom
int
BestZoom
(
void
);
// Retourne le meilleur zoom
void
Show3D_Frame
(
wxCommandEvent
&
event
);
void
Show3D_Frame
(
wxCommandEvent
&
event
);
virtual
void
GeneralControle
(
wxDC
*
DC
,
wxPoint
Mouse
);
virtual
void
GeneralControle
(
wxDC
*
DC
,
wxPoint
Mouse
);
// Undo and redo functions
// Undo and redo functions
public
:
public
:
virtual
void
SaveCopyInUndoList
(
EDA_BaseStruct
*
ItemToCopy
,
virtual
void
SaveCopyInUndoList
(
EDA_BaseStruct
*
ItemToCopy
,
int
flag_type_command
=
0
);
int
flag_type_command
=
0
);
private
:
private
:
virtual
void
GetComponentFromUndoList
(
void
);
virtual
void
GetComponentFromUndoList
(
void
);
virtual
void
GetComponentFromRedoList
(
void
);
virtual
void
GetComponentFromRedoList
(
void
);
public
:
public
:
// Read/write fonctions:
// Read/write fonctions:
EDA_BaseStruct
*
ReadDrawSegmentDescr
(
FILE
*
File
,
int
*
LineNum
);
EDA_BaseStruct
*
ReadDrawSegmentDescr
(
FILE
*
File
,
int
*
LineNum
);
int
ReadListeSegmentDescr
(
wxDC
*
DC
,
FILE
*
File
,
int
ReadListeSegmentDescr
(
wxDC
*
DC
,
FILE
*
File
,
TRACK
*
PtSegm
,
int
StructType
,
TRACK
*
PtSegm
,
int
StructType
,
int
*
LineNum
,
int
NumSegm
);
int
*
LineNum
,
int
NumSegm
);
int
ReadSetup
(
FILE
*
File
,
int
*
LineNum
);
int
ReadGeneralDescrPcb
(
wxDC
*
DC
,
FILE
*
File
,
int
*
LineNum
);
int
ReadSetup
(
FILE
*
File
,
int
*
LineNum
);
int
ReadGeneralDescrPcb
(
wxDC
*
DC
,
FILE
*
File
,
int
*
LineNum
);
// Gestion du PCB
// Gestion du PCB
bool
Clear_Pcb
(
wxDC
*
DC
,
bool
query
);
bool
Clear_Pcb
(
wxDC
*
DC
,
bool
query
);
EDA_BaseStruct
*
PcbGeneralLocateAndDisplay
(
void
);
EDA_BaseStruct
*
PcbGeneralLocateAndDisplay
(
);
EDA_BaseStruct
*
Locate
(
int
typeloc
,
int
LayerSearch
);
EDA_BaseStruct
*
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
,
int
DrawMode
,
int
color
,
int
type
);
int
DrawMode
,
int
color
,
int
type
);
/* Place un repere sur l'ecran au point de coordonnees PCB pos */
/* Place un repere sur l'ecran au point de coordonnees PCB pos */
// Gestion des modules
// Gestion des modules
void
InstallModuleOptionsFrame
(
MODULE
*
Module
,
void
InstallModuleOptionsFrame
(
MODULE
*
Module
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
wxDC
*
DC
,
const
wxPoint
&
pos
);
MODULE
*
Copie_Module
(
MODULE
*
module
);
MODULE
*
Copie_Module
(
MODULE
*
module
);
MODULE
*
Exchange_Module
(
wxWindow
*
winaff
,
MODULE
*
old_module
,
MODULE
*
new_module
);
MODULE
*
Exchange_Module
(
wxWindow
*
winaff
,
MODULE
*
old_module
,
MODULE
*
new_module
);
int
Save_1_Module
(
const
wxString
&
LibName
,
MODULE
*
Module
,
int
Save_1_Module
(
const
wxString
&
LibName
,
MODULE
*
Module
,
bool
Overwrite
,
bool
DisplayDialog
);
bool
Overwrite
,
bool
DisplayDialog
);
void
Archive_Modules
(
const
wxString
&
LibName
,
bool
NewModulesOnly
);
void
Archive_Modules
(
const
wxString
&
LibName
,
bool
NewModulesOnly
);
MODULE
*
Select_1_Module_From_BOARD
(
BOARD
*
Pcb
);
MODULE
*
Select_1_Module_From_BOARD
(
BOARD
*
Pcb
);
MODULE
*
GetModuleByName
(
void
);
MODULE
*
GetModuleByName
(
void
);
// Modules
// Modules
MODULE
*
Create_1_Module
(
wxDC
*
DC
,
const
wxString
&
module_name
);
MODULE
*
Create_1_Module
(
wxDC
*
DC
,
const
wxString
&
module_name
);
void
Edit_Module
(
MODULE
*
module
,
wxDC
*
DC
);
void
Edit_Module
(
MODULE
*
module
,
wxDC
*
DC
);
void
Rotate_Module
(
wxDC
*
DC
,
MODULE
*
module
,
int
angle
,
bool
incremental
);
void
Rotate_Module
(
wxDC
*
DC
,
MODULE
*
module
,
int
angle
,
bool
incremental
);
void
Change_Side_Module
(
MODULE
*
Module
,
wxDC
*
DC
);
void
Change_Side_Module
(
MODULE
*
Module
,
wxDC
*
DC
);
void
Place_Module
(
MODULE
*
module
,
wxDC
*
DC
);
void
Place_Module
(
MODULE
*
module
,
wxDC
*
DC
);
void
InstallExchangeModuleFrame
(
MODULE
*
ExchangeModuleModule
,
void
InstallExchangeModuleFrame
(
MODULE
*
ExchangeModuleModule
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
wxDC
*
DC
,
const
wxPoint
&
pos
);
// Textes sur modules
// Textes sur modules
void
RotateTextModule
(
TEXTE_MODULE
*
Text
,
wxDC
*
DC
);
void
RotateTextModule
(
TEXTE_MODULE
*
Text
,
wxDC
*
DC
);
void
DeleteTextModule
(
TEXTE_MODULE
*
Text
,
wxDC
*
DC
);
void
DeleteTextModule
(
TEXTE_MODULE
*
Text
,
wxDC
*
DC
);
void
PlaceTexteModule
(
TEXTE_MODULE
*
Text
,
wxDC
*
DC
);
void
PlaceTexteModule
(
TEXTE_MODULE
*
Text
,
wxDC
*
DC
);
void
StartMoveTexteModule
(
TEXTE_MODULE
*
Text
,
wxDC
*
DC
);
void
StartMoveTexteModule
(
TEXTE_MODULE
*
Text
,
wxDC
*
DC
);
TEXTE_MODULE
*
CreateTextModule
(
MODULE
*
Module
,
wxDC
*
DC
);
TEXTE_MODULE
*
CreateTextModule
(
MODULE
*
Module
,
wxDC
*
DC
);
void
InstallPadOptionsFrame
(
D_PAD
*
pad
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
void
InstallPadOptionsFrame
(
D_PAD
*
pad
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
void
InstallTextModOptionsFrame
(
TEXTE_MODULE
*
TextMod
,
void
InstallTextModOptionsFrame
(
TEXTE_MODULE
*
TextMod
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
wxDC
*
DC
,
const
wxPoint
&
pos
);
// Pads sur modules
// Pads sur modules
void
AddPad
(
MODULE
*
Module
,
wxDC
*
DC
);
void
AddPad
(
MODULE
*
Module
,
wxDC
*
DC
);
void
DeletePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
DeletePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
StartMovePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
StartMovePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
RotatePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
RotatePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
PlacePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
PlacePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
Export_Pad_Settings
(
D_PAD
*
pt_pad
);
void
Export_Pad_Settings
(
D_PAD
*
pt_pad
);
void
Import_Pad_Settings
(
D_PAD
*
pt_pad
,
wxDC
*
DC
);
void
Import_Pad_Settings
(
D_PAD
*
pt_pad
,
wxDC
*
DC
);
void
Global_Import_Pad_Settings
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
Global_Import_Pad_Settings
(
D_PAD
*
Pad
,
wxDC
*
DC
);
// Chargement de modules
// Chargement de modules
MODULE
*
Get_Librairie_Module
(
wxWindow
*
winaff
,
const
wxString
&
library
,
MODULE
*
Get_Librairie_Module
(
wxWindow
*
winaff
,
const
wxString
&
library
,
const
wxString
&
ModuleName
,
bool
show_msg_err
);
const
wxString
&
ModuleName
,
bool
show_msg_err
);
wxString
Select_1_Module_From_List
(
wxString
Select_1_Module_From_List
(
WinEDA_DrawFrame
*
active_window
,
const
wxString
&
Library
,
WinEDA_DrawFrame
*
active_window
,
const
wxString
&
Library
,
const
wxString
&
Mask
,
const
wxString
&
KeyWord
);
const
wxString
&
Mask
,
const
wxString
&
KeyWord
);
MODULE
*
Load_Module_From_Library
(
const
wxString
&
library
,
wxDC
*
DC
);
MODULE
*
Load_Module_From_Library
(
const
wxString
&
library
,
wxDC
*
DC
);
// Gestion des chevelus (ratsnest)
// Gestion des chevelus (ratsnest)
void
Compile_Ratsnest
(
wxDC
*
DC
,
bool
affiche
);
/* Recalcul complet du chevelu */
void
Compile_Ratsnest
(
wxDC
*
DC
,
bool
affiche
);
/* Recalcul complet du chevelu */
void
ReCompile_Ratsnest_After_Changes
(
wxDC
*
DC
);
void
ReCompile_Ratsnest_After_Changes
(
wxDC
*
DC
);
int
Test_1_Net_Ratsnest
(
wxDC
*
DC
,
int
net_code
);
int
Test_1_Net_Ratsnest
(
wxDC
*
DC
,
int
net_code
);
char
*
build_ratsnest_module
(
wxDC
*
DC
,
MODULE
*
Module
);
char
*
build_ratsnest_module
(
wxDC
*
DC
,
MODULE
*
Module
);
void
trace_ratsnest_module
(
wxDC
*
DC
);
void
trace_ratsnest_module
(
wxDC
*
DC
);
void
Build_Board_Ratsnest
(
wxDC
*
DC
);
void
Build_Board_Ratsnest
(
wxDC
*
DC
);
void
DrawGeneralRatsnest
(
wxDC
*
DC
,
int
net_code
=
0
);
void
DrawGeneralRatsnest
(
wxDC
*
DC
,
int
net_code
=
0
);
void
trace_ratsnest_pad
(
wxDC
*
DC
);
void
trace_ratsnest_pad
(
wxDC
*
DC
);
void
recalcule_pad_net_code
(
void
);
/* Routine de
void
recalcule_pad_net_code
(
void
);
/* Routine de
calcul et de mise a jour des net_codes des PADS */
*
calcul et de mise a jour des net_codes des PADS */
void
build_liste_pads
(
void
);
void
build_liste_pads
(
void
);
int
*
build_ratsnest_pad
(
EDA_BaseStruct
*
ref
,
const
wxPoint
&
refpos
,
bool
init
);
int
*
build_ratsnest_pad
(
EDA_BaseStruct
*
ref
,
const
wxPoint
&
refpos
,
bool
init
);
void
Tst_Ratsnest
(
wxDC
*
DC
,
int
ref_netcode
);
void
Tst_Ratsnest
(
wxDC
*
DC
,
int
ref_netcode
);
void
Recalcule_all_net_connexion
(
wxDC
*
DC
);
void
Recalcule_all_net_connexion
(
wxDC
*
DC
);
void
test_connexions
(
wxDC
*
DC
)
;
void
test_connexions
(
wxDC
*
DC
)
;
void
test_1_net_connexion
(
wxDC
*
DC
,
int
net_code
);
void
test_1_net_connexion
(
wxDC
*
DC
,
int
net_code
);
void
reattribution_reference_piste
(
int
affiche
);
void
reattribution_reference_piste
(
int
affiche
);
// Plotting
// Plotting
void
ToPlotter
(
wxCommandEvent
&
event
);
void
ToPlotter
(
wxCommandEvent
&
event
);
void
Plot_Serigraphie
(
int
format_plot
,
FILE
*
File
,
int
masque_layer
);
void
Plot_Serigraphie
(
int
format_plot
,
FILE
*
File
,
int
masque_layer
);
void
Genere_GERBER
(
const
wxString
&
FullFileName
,
int
Layer
,
void
Genere_GERBER
(
const
wxString
&
FullFileName
,
int
Layer
,
bool
PlotOriginIsAuxAxis
);
bool
PlotOriginIsAuxAxis
);
void
Genere_HPGL
(
const
wxString
&
FullFileName
,
int
Layer
);
void
Genere_HPGL
(
const
wxString
&
FullFileName
,
int
Layer
);
void
Genere_PS
(
const
wxString
&
FullFileName
,
int
Layer
);
void
Genere_PS
(
const
wxString
&
FullFileName
,
int
Layer
);
void
Plot_Layer_HPGL
(
FILE
*
File
,
int
masque_layer
,
void
Plot_Layer_HPGL
(
FILE
*
File
,
int
masque_layer
,
int
garde
,
int
tracevia
,
int
modetrace
);
int
garde
,
int
tracevia
,
int
modetrace
);
void
Plot_Layer_GERBER
(
FILE
*
File
,
int
masque_layer
,
void
Plot_Layer_GERBER
(
FILE
*
File
,
int
masque_layer
,
int
garde
,
int
tracevia
);
int
garde
,
int
tracevia
);
int
Gen_D_CODE_File
(
FILE
*
file
);
int
Gen_D_CODE_File
(
FILE
*
file
);
void
Plot_Layer_PS
(
FILE
*
File
,
int
masque_layer
,
void
Plot_Layer_PS
(
FILE
*
File
,
int
masque_layer
,
int
garde
,
int
tracevia
,
int
modetrace
);
int
garde
,
int
tracevia
,
int
modetrace
);
/* Block operations: */
/* Block operations: */
void
Block_Delete
(
wxDC
*
DC
);
void
Block_Delete
(
wxDC
*
DC
);
void
Block_Rotate
(
wxDC
*
DC
);
void
Block_Rotate
(
wxDC
*
DC
);
void
Block_Invert
(
wxDC
*
DC
);
void
Block_Invert
(
wxDC
*
DC
);
void
Block_Move
(
wxDC
*
DC
);
void
Block_Move
(
wxDC
*
DC
);
void
Block_Duplicate
(
wxDC
*
DC
);
void
Block_Duplicate
(
wxDC
*
DC
);
// Gestion des zones:
// Gestion des zones:
void
DelLimitesZone
(
wxDC
*
DC
,
bool
Redraw
);
void
DelLimitesZone
(
wxDC
*
DC
,
bool
Redraw
);
// Gestion des layers:
// Gestion des layers:
int
SelectLayer
(
int
default_layer
,
int
min_layer
,
int
max_layer
);
int
SelectLayer
(
int
default_layer
,
int
min_layer
,
int
max_layer
);
void
SelectLayerPair
(
void
);
void
SelectLayerPair
(
void
);
virtual
void
SwitchLayer
(
wxDC
*
DC
,
int
layer
);
virtual
void
SwitchLayer
(
wxDC
*
DC
,
int
layer
);
// divers
// divers
void
AddHistory
(
int
value
,
DrawStructureType
type
);
// Add value in data list history
void
AddHistory
(
int
value
,
DrawStructureType
type
);
// Add value in data list history
void
InstallGridFrame
(
const
wxPoint
&
pos
);
void
InstallGridFrame
(
const
wxPoint
&
pos
);
};
};
/*****************************************************/
/*****************************************************/
/* class WinEDA_PcbFrame: public WinEDA_BasePcbFrame */
/* class WinEDA_PcbFrame: public WinEDA_BasePcbFrame */
/*****************************************************/
/*****************************************************/
class
WinEDA_PcbFrame
:
public
WinEDA_BasePcbFrame
class
WinEDA_PcbFrame
:
public
WinEDA_BasePcbFrame
{
{
public
:
public
:
WinEDAChoiceBox
*
m_SelLayerBox
;
WinEDAChoiceBox
*
m_SelLayerBox
;
WinEDAChoiceBox
*
m_SelTrackWidthBox
;
WinEDAChoiceBox
*
m_SelTrackWidthBox
;
WinEDAChoiceBox
*
m_SelViaSizeBox
;
WinEDAChoiceBox
*
m_SelViaSizeBox
;
private
:
private
:
bool
m_SelTrackWidthBox_Changed
;
bool
m_SelTrackWidthBox_Changed
;
bool
m_SelViaSizeBox_Changed
;
bool
m_SelViaSizeBox_Changed
;
wxMenu
*
m_FilesMenu
;
wxMenu
*
m_FilesMenu
;
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
);
~
WinEDA_PcbFrame
(
void
);
~
WinEDA_PcbFrame
(
void
);
// Configurations:
// Configurations:
void
InstallConfigFrame
(
const
wxPoint
&
pos
);
void
InstallConfigFrame
(
const
wxPoint
&
pos
);
void
Process_Config
(
wxCommandEvent
&
event
);
void
Process_Config
(
wxCommandEvent
&
event
);
void
Update_config
(
wxWindow
*
displayframe
);
void
Update_config
(
wxWindow
*
displayframe
);
void
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
);
void
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
);
bool
OnHotkeyDeleteItem
(
wxDC
*
DC
,
EDA_BaseStruct
*
DrawStruct
);
bool
OnHotkeyDeleteItem
(
wxDC
*
DC
,
EDA_BaseStruct
*
DrawStruct
);
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
ProcessMuWaveFunctions
(
wxCommandEvent
&
event
);
void
ProcessMuWaveFunctions
(
wxCommandEvent
&
event
);
void
MuWaveCommand
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
MuWaveCommand
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
);
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
);
void
ReCreateHToolbar
(
void
);
void
ReCreateHToolbar
(
void
);
void
ReCreateAuxiliaryToolbar
(
void
);
void
ReCreateAuxiliaryToolbar
(
void
);
void
ReCreateVToolbar
(
void
);
void
ReCreateVToolbar
(
void
);
void
ReCreateAuxVToolbar
(
void
);
void
ReCreateAuxVToolbar
(
void
);
void
ReCreateOptToolbar
(
void
);
void
ReCreateOptToolbar
(
void
);
void
ReCreateMenuBar
(
void
);
void
ReCreateMenuBar
(
void
);
WinEDAChoiceBox
*
ReCreateLayerBox
(
WinEDA_Toolbar
*
parent
);
WinEDAChoiceBox
*
ReCreateLayerBox
(
WinEDA_Toolbar
*
parent
);
void
PrepareLayerIndicator
(
void
);
void
PrepareLayerIndicator
(
void
);
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
void
ToolOnRightClick
(
wxCommandEvent
&
event
);
void
ToolOnRightClick
(
wxCommandEvent
&
event
);
/* Gestion generale des operations sur block */
/* Gestion generale des operations sur block */
int
ReturnBlockCommand
(
int
key
);
int
ReturnBlockCommand
(
int
key
);
void
HandleBlockPlace
(
wxDC
*
DC
);
void
HandleBlockPlace
(
wxDC
*
DC
);
int
HandleBlockEnd
(
wxDC
*
DC
);
int
HandleBlockEnd
(
wxDC
*
DC
);
void
SetToolbars
(
void
);
void
SetToolbars
(
void
);
void
Process_Settings
(
wxCommandEvent
&
event
);
void
Process_Settings
(
wxCommandEvent
&
event
);
void
InstallPcbOptionsFrame
(
const
wxPoint
&
pos
,
wxDC
*
DC
,
int
id
);
void
InstallPcbOptionsFrame
(
const
wxPoint
&
pos
,
wxDC
*
DC
,
int
id
);
void
InstallPcbGlobalDeleteFrame
(
const
wxPoint
&
pos
);
void
InstallPcbGlobalDeleteFrame
(
const
wxPoint
&
pos
);
void
GenModulesPosition
(
wxCommandEvent
&
event
);
void
GenModulesPosition
(
wxCommandEvent
&
event
);
void
GenModuleReport
(
wxCommandEvent
&
event
);
void
GenModuleReport
(
wxCommandEvent
&
event
);
void
InstallDrillFrame
(
wxCommandEvent
&
event
);
void
InstallDrillFrame
(
wxCommandEvent
&
event
);
void
ToPostProcess
(
wxCommandEvent
&
event
);
void
ToPostProcess
(
wxCommandEvent
&
event
);
void
Files_io
(
wxCommandEvent
&
event
);
void
Files_io
(
wxCommandEvent
&
event
);
int
LoadOnePcbFile
(
const
wxString
&
FileName
,
wxDC
*
DC
,
bool
Append
);
int
LoadOnePcbFile
(
const
wxString
&
FileName
,
wxDC
*
DC
,
bool
Append
);
int
ReadPcbFile
(
wxDC
*
DC
,
FILE
*
File
,
bool
Append
);
int
ReadPcbFile
(
wxDC
*
DC
,
FILE
*
File
,
bool
Append
);
bool
SavePcbFile
(
const
wxString
&
FileName
);
bool
SavePcbFile
(
const
wxString
&
FileName
);
int
SavePcbFormatAscii
(
FILE
*
File
);
int
SavePcbFormatAscii
(
FILE
*
File
);
bool
WriteGeneralDescrPcb
(
FILE
*
File
);
bool
WriteGeneralDescrPcb
(
FILE
*
File
);
bool
RecreateCmpFileFromBoard
(
void
);
bool
RecreateCmpFileFromBoard
(
void
);
void
ExportToGenCAD
(
wxCommandEvent
&
event
);
void
ExportToGenCAD
(
wxCommandEvent
&
event
);
/* Fonctions specifiques */
/* Fonctions specifiques */
MODULE
*
ListAndSelectModuleName
(
void
);
MODULE
*
ListAndSelectModuleName
(
void
);
void
Liste_Equipot
(
wxCommandEvent
&
event
);
void
Liste_Equipot
(
wxCommandEvent
&
event
);
void
Swap_Layers
(
wxCommandEvent
&
event
);
void
Swap_Layers
(
wxCommandEvent
&
event
);
int
Test_DRC
(
wxDC
*
DC
,
bool
TestPad2Pad
,
bool
TestZone
);
int
Test_DRC
(
wxDC
*
DC
,
bool
TestPad2Pad
,
bool
TestZone
);
void
Install_Test_DRC_Frame
(
wxDC
*
DC
);
void
Install_Test_DRC_Frame
(
wxDC
*
DC
);
void
Trace_Pcb
(
wxDC
*
DC
,
int
mode
);
void
Trace_Pcb
(
wxDC
*
DC
,
int
mode
);
void
Trace_PcbEdges
(
wxDC
*
DC
,
int
mode_color
);
void
Trace_PcbEdges
(
wxDC
*
DC
,
int
mode_color
);
// Gestion des textes sur pcb
// Gestion des textes sur pcb
void
Rotate_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
Rotate_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
TEXTE_PCB
*
Create_Texte_Pcb
(
wxDC
*
DC
);
TEXTE_PCB
*
Create_Texte_Pcb
(
wxDC
*
DC
);
void
Delete_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
Delete_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
StartMoveTextePcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
StartMoveTextePcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
Place_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
Place_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
InstallTextPCBOptionsFrame
(
TEXTE_PCB
*
TextPCB
,
void
InstallTextPCBOptionsFrame
(
TEXTE_PCB
*
TextPCB
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
wxDC
*
DC
,
const
wxPoint
&
pos
);
// Gestion des Segments type DRAWITEM
// Gestion des Segments type DRAWITEM
void
Start_Move_DrawItem
(
DRAWSEGMENT
*
drawitem
,
wxDC
*
DC
);
void
Start_Move_DrawItem
(
DRAWSEGMENT
*
drawitem
,
wxDC
*
DC
);
void
Place_DrawItem
(
DRAWSEGMENT
*
drawitem
,
wxDC
*
DC
);
void
Place_DrawItem
(
DRAWSEGMENT
*
drawitem
,
wxDC
*
DC
);
// Gestion des modules (voir egalement WinEDA_BasePcbFrame)
// Gestion des modules (voir egalement WinEDA_BasePcbFrame)
void
StartMove_Module
(
MODULE
*
module
,
wxDC
*
DC
);
void
StartMove_Module
(
MODULE
*
module
,
wxDC
*
DC
);
bool
Delete_Module
(
MODULE
*
module
,
wxDC
*
DC
);
bool
Delete_Module
(
MODULE
*
module
,
wxDC
*
DC
);
// Chargement de modules: voir WinEDA_BasePcbFrame
// Chargement de modules: voir WinEDA_BasePcbFrame
// Gestion du PCB
// Gestion du PCB
void
Erase_Zones
(
wxDC
*
DC
,
bool
query
);
void
Erase_Zones
(
wxDC
*
DC
,
bool
query
);
void
Erase_Segments_Pcb
(
wxDC
*
DC
,
bool
is_edges
,
bool
query
);
void
Erase_Segments_Pcb
(
wxDC
*
DC
,
bool
is_edges
,
bool
query
);
void
Erase_Pistes
(
wxDC
*
DC
,
int
masque_type
,
bool
query
);
void
Erase_Pistes
(
wxDC
*
DC
,
int
masque_type
,
bool
query
);
void
Erase_Modules
(
wxDC
*
DC
,
bool
query
);
void
Erase_Modules
(
wxDC
*
DC
,
bool
query
);
void
Erase_Textes_Pcb
(
wxDC
*
DC
,
bool
query
);
void
Erase_Textes_Pcb
(
wxDC
*
DC
,
bool
query
);
void
Erase_Marqueurs
(
void
);
void
Erase_Marqueurs
(
void
);
void
UnDeleteItem
(
wxDC
*
DC
);
void
UnDeleteItem
(
wxDC
*
DC
);
void
RemoveStruct
(
EDA_BaseStruct
*
Item
,
wxDC
*
DC
);
void
RemoveStruct
(
EDA_BaseStruct
*
Item
,
wxDC
*
DC
);
void
Via_Edit_Control
(
wxDC
*
DC
,
int
command_type
,
SEGVIA
*
via
);
void
Via_Edit_Control
(
wxDC
*
DC
,
int
command_type
,
SEGVIA
*
via
);
// Mise en surbrillance des nets:
// Mise en surbrillance des nets:
int
Select_High_Light
(
wxDC
*
DC
);
int
Select_High_Light
(
wxDC
*
DC
);
void
Hight_Light
(
wxDC
*
DC
);
void
Hight_Light
(
wxDC
*
DC
);
void
DrawHightLight
(
wxDC
*
DC
,
int
NetCode
);
void
DrawHightLight
(
wxDC
*
DC
,
int
NetCode
);
// Track and via edition:
// Track and via edition:
void
DisplayTrackSettings
(
void
);
void
DisplayTrackSettings
(
void
);
void
Other_Layer_Route
(
TRACK
*
track
,
wxDC
*
DC
);
void
Other_Layer_Route
(
TRACK
*
track
,
wxDC
*
DC
);
void
Affiche_PadsNoConnect
(
wxDC
*
DC
);
void
Affiche_PadsNoConnect
(
wxDC
*
DC
);
void
Affiche_Status_Net
(
wxDC
*
DC
);
void
Affiche_Status_Net
(
wxDC
*
DC
);
TRACK
*
Delete_Segment
(
wxDC
*
DC
,
TRACK
*
Track
);
TRACK
*
Delete_Segment
(
wxDC
*
DC
,
TRACK
*
Track
);
void
Delete_Track
(
wxDC
*
DC
,
TRACK
*
Track
);
void
Delete_Track
(
wxDC
*
DC
,
TRACK
*
Track
);
void
Delete_net
(
wxDC
*
DC
,
TRACK
*
Track
);
void
Delete_net
(
wxDC
*
DC
,
TRACK
*
Track
);
void
Delete_Zone
(
wxDC
*
DC
,
SEGZONE
*
Track
);
void
Delete_Zone
(
wxDC
*
DC
,
SEGZONE
*
Track
);
void
Supprime_Une_Piste
(
wxDC
*
DC
,
TRACK
*
pt_segm
);
void
Supprime_Une_Piste
(
wxDC
*
DC
,
TRACK
*
pt_segm
);
bool
Resize_Pistes_Vias
(
wxDC
*
DC
,
bool
Track
,
bool
Via
);
bool
Resize_Pistes_Vias
(
wxDC
*
DC
,
bool
Track
,
bool
Via
);
void
Edit_Zone_Width
(
wxDC
*
DC
,
SEGZONE
*
pt_ref
);
void
Edit_Zone_Width
(
wxDC
*
DC
,
SEGZONE
*
pt_ref
);
void
Edit_Net_Width
(
wxDC
*
DC
,
int
Netcode
);
void
Edit_Net_Width
(
wxDC
*
DC
,
int
Netcode
);
void
Edit_Track_Width
(
wxDC
*
DC
,
TRACK
*
Track
);
void
Edit_Track_Width
(
wxDC
*
DC
,
TRACK
*
Track
);
int
Edit_TrackSegm_Width
(
wxDC
*
DC
,
TRACK
*
segm
);
int
Edit_TrackSegm_Width
(
wxDC
*
DC
,
TRACK
*
segm
);
TRACK
*
Begin_Route
(
TRACK
*
track
,
wxDC
*
DC
);
TRACK
*
Begin_Route
(
TRACK
*
track
,
wxDC
*
DC
);
void
End_Route
(
TRACK
*
track
,
wxDC
*
DC
);
void
End_Route
(
TRACK
*
track
,
wxDC
*
DC
);
void
ExChange_Track_Layer
(
TRACK
*
pt_segm
,
wxDC
*
DC
);
void
ExChange_Track_Layer
(
TRACK
*
pt_segm
,
wxDC
*
DC
);
void
Attribut_Segment
(
TRACK
*
track
,
wxDC
*
DC
,
bool
Flag_On
);
void
Attribut_Segment
(
TRACK
*
track
,
wxDC
*
DC
,
bool
Flag_On
);
void
Attribut_Track
(
TRACK
*
track
,
wxDC
*
DC
,
bool
Flag_On
);
void
Attribut_Track
(
TRACK
*
track
,
wxDC
*
DC
,
bool
Flag_On
);
void
Attribut_net
(
wxDC
*
DC
,
int
net_code
,
bool
Flag_On
);
void
Attribut_net
(
wxDC
*
DC
,
int
net_code
,
bool
Flag_On
);
void
Start_MoveOneNodeOrSegment
(
TRACK
*
track
,
wxDC
*
DC
,
int
command
);
void
Start_MoveOneNodeOrSegment
(
TRACK
*
track
,
wxDC
*
DC
,
int
command
);
bool
PlaceDraggedTrackSegment
(
TRACK
*
Track
,
wxDC
*
DC
);
bool
PlaceDraggedTrackSegment
(
TRACK
*
Track
,
wxDC
*
DC
);
void
Start_DragTrackSegmentAndKeepSlope
(
TRACK
*
track
,
wxDC
*
DC
);
void
Start_DragTrackSegmentAndKeepSlope
(
TRACK
*
track
,
wxDC
*
DC
);
void
SwitchLayer
(
wxDC
*
DC
,
int
layer
);
void
SwitchLayer
(
wxDC
*
DC
,
int
layer
);
// Edition des zones
// Edition des zones
EDGE_ZONE
*
Del_SegmEdgeZone
(
wxDC
*
DC
,
EDGE_ZONE
*
edge_zone
);
EDGE_ZONE
*
Del_SegmEdgeZone
(
wxDC
*
DC
,
EDGE_ZONE
*
edge_zone
);
void
CaptureNetName
(
wxDC
*
DC
);
void
CaptureNetName
(
wxDC
*
DC
);
EDGE_ZONE
*
Begin_Zone
(
void
);
EDGE_ZONE
*
Begin_Zone
(
void
);
void
End_Zone
(
wxDC
*
DC
);
void
End_Zone
(
wxDC
*
DC
);
void
Fill_Zone
(
wxDC
*
DC
);
void
Fill_Zone
(
wxDC
*
DC
);
// Edition des mires de centrage
// Edition des mires de centrage
MIREPCB
*
Create_Mire
(
wxDC
*
DC
);
MIREPCB
*
Create_Mire
(
wxDC
*
DC
);
void
Delete_Mire
(
MIREPCB
*
MirePcb
,
wxDC
*
DC
);
void
Delete_Mire
(
MIREPCB
*
MirePcb
,
wxDC
*
DC
);
void
StartMove_Mire
(
MIREPCB
*
MirePcb
,
wxDC
*
DC
);
void
StartMove_Mire
(
MIREPCB
*
MirePcb
,
wxDC
*
DC
);
void
Place_Mire
(
MIREPCB
*
MirePcb
,
wxDC
*
DC
);
void
Place_Mire
(
MIREPCB
*
MirePcb
,
wxDC
*
DC
);
void
InstallMireOptionsFrame
(
MIREPCB
*
MirePcb
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
void
InstallMireOptionsFrame
(
MIREPCB
*
MirePcb
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
// Gestion des segments de dessin type DRAWSEGMENT:
// Gestion des segments de dessin type DRAWSEGMENT:
DRAWSEGMENT
*
Begin_DrawSegment
(
DRAWSEGMENT
*
Segment
,
int
shape
,
wxDC
*
DC
);
DRAWSEGMENT
*
Begin_DrawSegment
(
DRAWSEGMENT
*
Segment
,
int
shape
,
wxDC
*
DC
);
void
End_Edge
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
void
End_Edge
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
void
Drawing_SetNewWidth
(
DRAWSEGMENT
*
DrawSegm
,
wxDC
*
DC
);
void
Drawing_SetNewWidth
(
DRAWSEGMENT
*
DrawSegm
,
wxDC
*
DC
);
void
Delete_Segment_Edge
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
void
Delete_Segment_Edge
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
void
Delete_Drawings_All_Layer
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
void
Delete_Drawings_All_Layer
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
// Gestion des cotations:
// Gestion des cotations:
void
Install_Edit_Cotation
(
COTATION
*
Cotation
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
void
Install_Edit_Cotation
(
COTATION
*
Cotation
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
COTATION
*
Begin_Cotation
(
COTATION
*
Cotation
,
wxDC
*
DC
);
COTATION
*
Begin_Cotation
(
COTATION
*
Cotation
,
wxDC
*
DC
);
void
Delete_Cotation
(
COTATION
*
Cotation
,
wxDC
*
DC
);
void
Delete_Cotation
(
COTATION
*
Cotation
,
wxDC
*
DC
);
// Gestion des netlistes:
// Gestion des netlistes:
void
InstallNetlistFrame
(
wxDC
*
DC
,
const
wxPoint
&
pos
);
void
InstallNetlistFrame
(
wxDC
*
DC
,
const
wxPoint
&
pos
);
// Autoplacement:
// Autoplacement:
void
AutoPlace
(
wxCommandEvent
&
event
);
void
AutoPlace
(
wxCommandEvent
&
event
);
void
ReOrientModules
(
const
wxString
&
ModuleMask
,
int
Orient
,
void
ReOrientModules
(
const
wxString
&
ModuleMask
,
int
Orient
,
bool
include_fixe
,
wxDC
*
DC
);
bool
include_fixe
,
wxDC
*
DC
);
void
FixeModule
(
MODULE
*
Module
,
bool
Fixe
);
void
FixeModule
(
MODULE
*
Module
,
bool
Fixe
);
void
AutoMoveModulesOnPcb
(
wxDC
*
DC
,
bool
PlaceModulesHorsPcb
);
void
AutoMoveModulesOnPcb
(
wxDC
*
DC
,
bool
PlaceModulesHorsPcb
);
bool
SetBoardBoundaryBoxFromEdgesOnly
(
void
);
bool
SetBoardBoundaryBoxFromEdgesOnly
(
void
);
void
AutoPlaceModule
(
MODULE
*
Module
,
int
place_mode
,
wxDC
*
DC
);
void
AutoPlaceModule
(
MODULE
*
Module
,
int
place_mode
,
wxDC
*
DC
);
int
RecherchePlacementModule
(
MODULE
*
Module
,
wxDC
*
DC
);
int
RecherchePlacementModule
(
MODULE
*
Module
,
wxDC
*
DC
);
void
GenModuleOnBoard
(
MODULE
*
Module
);
void
GenModuleOnBoard
(
MODULE
*
Module
);
float
Compute_Ratsnest_PlaceModule
(
wxDC
*
DC
);
float
Compute_Ratsnest_PlaceModule
(
wxDC
*
DC
);
int
GenPlaceBoard
(
void
);
int
GenPlaceBoard
(
void
);
void
DrawInfoPlace
(
wxDC
*
DC
);
void
DrawInfoPlace
(
wxDC
*
DC
);
// Autoroutage:
// Autoroutage:
int
Solve
(
wxDC
*
DC
,
int
two_sides
);
int
Solve
(
wxDC
*
DC
,
int
two_sides
);
void
Reset_Noroutable
(
wxDC
*
DC
);
void
Reset_Noroutable
(
wxDC
*
DC
);
void
Autoroute
(
wxDC
*
DC
,
int
mode
);
void
Autoroute
(
wxDC
*
DC
,
int
mode
);
void
ReadAutoroutedTracks
(
wxDC
*
DC
);
void
ReadAutoroutedTracks
(
wxDC
*
DC
);
void
GlobalRoute
(
wxDC
*
DC
);
void
GlobalRoute
(
wxDC
*
DC
);
// fonctions generales
// fonctions generales
void
Show_1_Ratsnest
(
EDA_BaseStruct
*
item
,
wxDC
*
DC
);
void
Show_1_Ratsnest
(
EDA_BaseStruct
*
item
,
wxDC
*
DC
);
void
Ratsnest_On_Off
(
wxDC
*
DC
);
void
Ratsnest_On_Off
(
wxDC
*
DC
);
void
Clean_Pcb
(
wxDC
*
DC
);
void
Clean_Pcb
(
wxDC
*
DC
);
EDA_BaseStruct
*
SaveItemEfface
(
EDA_BaseStruct
*
PtItem
,
int
nbitems
);
EDA_BaseStruct
*
SaveItemEfface
(
EDA_BaseStruct
*
PtItem
,
int
nbitems
);
// divers
// divers
void
InstallFindFrame
(
const
wxPoint
&
pos
,
wxDC
*
DC
);
void
InstallFindFrame
(
const
wxPoint
&
pos
,
wxDC
*
DC
);
/* Special micro_ondes */
/* Special micro_ondes */
void
Edit_Gap
(
wxDC
*
DC
,
MODULE
*
Module
);
void
Edit_Gap
(
wxDC
*
DC
,
MODULE
*
Module
);
MODULE
*
Create_MuWaveBasicShape
(
wxDC
*
DC
,
const
wxString
&
name
,
int
pad_count
);
MODULE
*
Create_MuWaveBasicShape
(
wxDC
*
DC
,
const
wxString
&
name
,
int
pad_count
);
MODULE
*
Create_MuWaveComponent
(
wxDC
*
DC
,
int
shape_type
);
MODULE
*
Create_MuWaveComponent
(
wxDC
*
DC
,
int
shape_type
);
MODULE
*
Create_MuWavePolygonShape
(
wxDC
*
DC
);
MODULE
*
Create_MuWavePolygonShape
(
wxDC
*
DC
);
void
Begin_Self
(
wxDC
*
DC
);
void
Begin_Self
(
wxDC
*
DC
);
MODULE
*
Genere_Self
(
wxDC
*
DC
);
MODULE
*
Genere_Self
(
wxDC
*
DC
);
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
};
};
/****************************************************/
/* class WinEDA_GerberFrame: public WinEDA_PcbFrame */
/****************************************************/
class
WinEDA_GerberFrame
:
public
WinEDA_BasePcbFrame
/****************************************************/
/* class WinEDA_GerberFrame: public WinEDA_PcbFrame */
/****************************************************/
class
WinEDA_GerberFrame
:
public
WinEDA_BasePcbFrame
{
{
public
:
public
:
WinEDAChoiceBox
*
m_SelLayerBox
;
WinEDAChoiceBox
*
m_SelLayerBox
;
WinEDAChoiceBox
*
m_SelLayerTool
;
WinEDAChoiceBox
*
m_SelLayerTool
;
private
:
private
:
wxMenu
*
m_FilesMenu
;
wxMenu
*
m_FilesMenu
;
public
:
public
:
WinEDA_GerberFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
const
wxString
&
title
,
WinEDA_GerberFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
const
wxPoint
&
pos
,
const
wxSize
&
size
);
~
WinEDA_GerberFrame
(
void
);
~
WinEDA_GerberFrame
(
void
);
void
Update_config
(
void
);
void
Update_config
(
void
);
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
);
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
);
void
ReCreateHToolbar
(
void
);
void
ReCreateHToolbar
(
void
);
void
ReCreateVToolbar
(
void
);
void
ReCreateVToolbar
(
void
);
void
ReCreateOptToolbar
(
void
);
void
ReCreateOptToolbar
(
void
);
void
ReCreateMenuBar
(
void
);
void
ReCreateMenuBar
(
void
);
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
int
BestZoom
(
void
);
// Retourne le meilleur zoom
int
BestZoom
(
void
);
// Retourne le meilleur zoom
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
EDA_BaseStruct
*
GerberGeneralLocateAndDisplay
(
void
);
EDA_BaseStruct
*
GerberGeneralLocateAndDisplay
(
void
);
EDA_BaseStruct
*
Locate
(
int
typeloc
);
EDA_BaseStruct
*
Locate
(
int
typeloc
);
void
SetToolbars
(
void
);
void
SetToolbars
(
void
);
void
Process_Settings
(
wxCommandEvent
&
event
);
void
Process_Settings
(
wxCommandEvent
&
event
);
void
Process_Config
(
wxCommandEvent
&
event
);
void
Process_Config
(
wxCommandEvent
&
event
);
void
InstallConfigFrame
(
const
wxPoint
&
pos
);
void
InstallConfigFrame
(
const
wxPoint
&
pos
);
void
InstallPcbOptionsFrame
(
const
wxPoint
&
pos
,
int
id
);
void
InstallPcbOptionsFrame
(
const
wxPoint
&
pos
,
int
id
);
void
InstallPcbGlobalDeleteFrame
(
const
wxPoint
&
pos
);
void
InstallPcbGlobalDeleteFrame
(
const
wxPoint
&
pos
);
/* Gestion generale des operations sur block */
/* Gestion generale des operations sur block */
int
ReturnBlockCommand
(
int
key
);
int
ReturnBlockCommand
(
int
key
);
virtual
void
HandleBlockPlace
(
wxDC
*
DC
);
virtual
void
HandleBlockPlace
(
wxDC
*
DC
);
virtual
int
HandleBlockEnd
(
wxDC
*
DC
);
virtual
int
HandleBlockEnd
(
wxDC
*
DC
);
void
InstallDrillFrame
(
wxCommandEvent
&
event
);
void
InstallDrillFrame
(
wxCommandEvent
&
event
);
void
ToPostProcess
(
wxCommandEvent
&
event
);
void
ToPostProcess
(
wxCommandEvent
&
event
);
void
Genere_HPGL
(
const
wxString
&
FullFileName
,
int
Layers
);
void
Genere_HPGL
(
const
wxString
&
FullFileName
,
int
Layers
);
void
Genere_GERBER
(
const
wxString
&
FullFileName
,
int
Layers
);
void
Genere_GERBER
(
const
wxString
&
FullFileName
,
int
Layers
);
void
Genere_PS
(
const
wxString
&
FullFileName
,
int
Layers
);
void
Genere_PS
(
const
wxString
&
FullFileName
,
int
Layers
);
void
Plot_Layer_HPGL
(
FILE
*
File
,
int
masque_layer
,
void
Plot_Layer_HPGL
(
FILE
*
File
,
int
masque_layer
,
int
garde
,
int
tracevia
,
int
modetrace
);
int
garde
,
int
tracevia
,
int
modetrace
);
void
Plot_Layer_GERBER
(
FILE
*
File
,
int
masque_layer
,
void
Plot_Layer_GERBER
(
FILE
*
File
,
int
masque_layer
,
int
garde
,
int
tracevia
);
int
garde
,
int
tracevia
);
int
Gen_D_CODE_File
(
const
wxString
&
Name_File
);
int
Gen_D_CODE_File
(
const
wxString
&
Name_File
);
void
Plot_Layer_PS
(
FILE
*
File
,
int
masque_layer
,
void
Plot_Layer_PS
(
FILE
*
File
,
int
masque_layer
,
int
garde
,
int
tracevia
,
int
modetrace
);
int
garde
,
int
tracevia
,
int
modetrace
);
void
Files_io
(
wxCommandEvent
&
event
);
void
Files_io
(
wxCommandEvent
&
event
);
int
LoadOneGerberFile
(
const
wxString
&
FileName
,
wxDC
*
DC
,
int
mode
);
int
LoadOneGerberFile
(
const
wxString
&
FileName
,
wxDC
*
DC
,
int
mode
);
int
ReadGerberFile
(
wxDC
*
DC
,
FILE
*
File
,
bool
Append
);
int
ReadGerberFile
(
wxDC
*
DC
,
FILE
*
File
,
bool
Append
);
bool
Read_GERBER_File
(
wxDC
*
DC
,
bool
Read_GERBER_File
(
wxDC
*
DC
,
const
wxString
&
GERBER_FullFileName
,
const
wxString
&
GERBER_FullFileName
,
const
wxString
&
D_Code_FullFileName
);
const
wxString
&
D_Code_FullFileName
);
bool
SaveGerberFile
(
const
wxString
&
FileName
,
wxDC
*
DC
);
bool
SaveGerberFile
(
const
wxString
&
FileName
,
wxDC
*
DC
);
int
Read_D_Code_File
(
const
wxString
&
D_Code_FullFileName
);
int
Read_D_Code_File
(
const
wxString
&
D_Code_FullFileName
);
void
CopyDCodesSizeToItems
(
void
);
void
CopyDCodesSizeToItems
(
void
);
void
Liste_D_Codes
(
wxDC
*
DC
);
void
Liste_D_Codes
(
wxDC
*
DC
);
/* Fonctions specifiques */
/* Fonctions specifiques */
void
Trace_Gerber
(
wxDC
*
DC
,
int
mode
);
void
Trace_Gerber
(
wxDC
*
DC
,
int
mode
);
// Gestion des textes sur pcb
// Gestion des textes sur pcb
void
Rotate_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
Rotate_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
TEXTE_PCB
*
Create_Texte_Pcb
(
wxDC
*
DC
);
TEXTE_PCB
*
Create_Texte_Pcb
(
wxDC
*
DC
);
void
Delete_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
Delete_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
StartMoveTextePcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
StartMoveTextePcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
Place_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
Place_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
// Gestion du PCB
// Gestion du PCB
bool
Clear_Pcb
(
wxDC
*
DC
,
bool
query
);
bool
Clear_Pcb
(
wxDC
*
DC
,
bool
query
);
void
Erase_Current_Layer
(
wxDC
*
DC
,
bool
query
);
void
Erase_Current_Layer
(
wxDC
*
DC
,
bool
query
);
void
Erase_Zones
(
wxDC
*
DC
,
bool
query
);
void
Erase_Zones
(
wxDC
*
DC
,
bool
query
);
void
Erase_Segments_Pcb
(
wxDC
*
DC
,
bool
is_edges
,
bool
query
);
void
Erase_Segments_Pcb
(
wxDC
*
DC
,
bool
is_edges
,
bool
query
);
void
Erase_Pistes
(
wxDC
*
DC
,
int
masque_type
,
bool
query
);
void
Erase_Pistes
(
wxDC
*
DC
,
int
masque_type
,
bool
query
);
void
Erase_Textes_Pcb
(
wxDC
*
DC
,
bool
query
);
void
Erase_Textes_Pcb
(
wxDC
*
DC
,
bool
query
);
void
UnDeleteItem
(
wxDC
*
DC
);
void
UnDeleteItem
(
wxDC
*
DC
);
void
Delete_DCode_Items
(
wxDC
*
DC
,
int
dcode_value
,
int
layer_number
);
void
Delete_DCode_Items
(
wxDC
*
DC
,
int
dcode_value
,
int
layer_number
);
TRACK
*
Begin_Route
(
TRACK
*
track
,
wxDC
*
DC
);
TRACK
*
Begin_Route
(
TRACK
*
track
,
wxDC
*
DC
);
void
End_Route
(
TRACK
*
track
,
wxDC
*
DC
);
void
End_Route
(
TRACK
*
track
,
wxDC
*
DC
);
TRACK
*
Delete_Segment
(
wxDC
*
DC
,
TRACK
*
Track
);
TRACK
*
Delete_Segment
(
wxDC
*
DC
,
TRACK
*
Track
);
int
Edit_TrackSegm_Width
(
wxDC
*
DC
,
TRACK
*
segm
);
int
Edit_TrackSegm_Width
(
wxDC
*
DC
,
TRACK
*
segm
);
// Conversion function
// Conversion function
void
ExportDataInPcbnewFormat
(
wxCommandEvent
&
event
);
void
ExportDataInPcbnewFormat
(
wxCommandEvent
&
event
);
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
};
};
...
@@ -812,87 +820,88 @@ public:
...
@@ -812,87 +820,88 @@ public:
/* Class de la fenetre d'�dition des modules pour PCB */
/* Class de la fenetre d'�dition des modules pour PCB */
/*********************************************************/
/*********************************************************/
class
WinEDA_ModuleEditFrame
:
public
WinEDA_BasePcbFrame
class
WinEDA_ModuleEditFrame
:
public
WinEDA_BasePcbFrame
{
{
public
:
public
:
MODULE
*
CurrentModule
;
MODULE
*
CurrentModule
;
wxString
m_CurrentLib
;
wxString
m_CurrentLib
;
public
:
public
:
WinEDA_ModuleEditFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
WinEDA_ModuleEditFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
const
wxString
&
title
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
const
wxPoint
&
pos
,
const
wxSize
&
size
);
~
WinEDA_ModuleEditFrame
(
void
);
~
WinEDA_ModuleEditFrame
(
void
);
void
InstallOptionsFrame
(
const
wxPoint
&
pos
);
void
InstallOptionsFrame
(
const
wxPoint
&
pos
);
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
);
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
);
void
ReCreateHToolbar
(
void
);
void
ReCreateHToolbar
(
void
);
void
ReCreateVToolbar
(
void
);
void
ReCreateVToolbar
(
void
);
void
ReCreateOptToolbar
(
void
);
void
ReCreateOptToolbar
(
void
);
void
ReCreateAuxiliaryToolbar
(
void
);
void
ReCreateAuxiliaryToolbar
(
void
);
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
void
SetToolbars
(
void
);
void
SetToolbars
(
void
);
void
ReCreateMenuBar
(
void
);
void
ReCreateMenuBar
(
void
);
void
ToolOnRightClick
(
wxCommandEvent
&
event
);
void
ToolOnRightClick
(
wxCommandEvent
&
event
);
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
void
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
);
void
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
);
/* Gestion generale des operations sur block */
/* Gestion generale des operations sur block */
int
ReturnBlockCommand
(
int
key
);
int
ReturnBlockCommand
(
int
key
);
virtual
void
HandleBlockPlace
(
wxDC
*
DC
);
virtual
void
HandleBlockPlace
(
wxDC
*
DC
);
virtual
int
HandleBlockEnd
(
wxDC
*
DC
);
virtual
int
HandleBlockEnd
(
wxDC
*
DC
);
EDA_BaseStruct
*
ModeditLocateAndDisplay
(
void
);
EDA_BaseStruct
*
ModeditLocateAndDisplay
(
void
);
public
:
public
:
void
SaveCopyInUndoList
(
EDA_BaseStruct
*
ItemToCopy
,
int
flag_type_command
=
0
);
void
SaveCopyInUndoList
(
EDA_BaseStruct
*
ItemToCopy
,
int
flag_type_command
=
0
);
private
:
private
:
void
GetComponentFromUndoList
(
void
);
void
GetComponentFromUndoList
(
void
);
void
GetComponentFromRedoList
(
void
);
void
GetComponentFromRedoList
(
void
);
public
:
public
:
// Gestion des modules
// Gestion des modules
void
Place_Ancre
(
MODULE
*
module
,
wxDC
*
DC
);
void
Place_Ancre
(
MODULE
*
module
,
wxDC
*
DC
);
void
RemoveStruct
(
EDA_BaseStruct
*
Item
,
wxDC
*
DC
);
void
RemoveStruct
(
EDA_BaseStruct
*
Item
,
wxDC
*
DC
);
void
Transform
(
MODULE
*
module
,
wxDC
*
DC
,
int
transform
);
void
Transform
(
MODULE
*
module
,
wxDC
*
DC
,
int
transform
);
// Chargement de modules
// Chargement de modules
MODULE
*
Import_Module
(
wxDC
*
DC
);
MODULE
*
Import_Module
(
wxDC
*
DC
);
void
Export_Module
(
MODULE
*
ptmod
,
bool
createlib
);
void
Export_Module
(
MODULE
*
ptmod
,
bool
createlib
);
void
Load_Module_Module_From_BOARD
(
MODULE
*
Module
);
void
Load_Module_Module_From_BOARD
(
MODULE
*
Module
);
// Gestion des contours
// Gestion des contours
void
Edit_Edge_Width
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
);
void
Edit_Edge_Width
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
);
void
Edit_Edge_Layer
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
);
void
Edit_Edge_Layer
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
);
void
Delete_Edge_Module
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
);
void
Delete_Edge_Module
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
);
EDGE_MODULE
*
Begin_Edge_Module
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
,
int
type_edge
);
EDGE_MODULE
*
Begin_Edge_Module
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
,
int
type_edge
);
void
End_Edge_Module
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
);
void
End_Edge_Module
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
);
void
Enter_Edge_Width
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
);
void
Enter_Edge_Width
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
);
void
Start_Move_EdgeMod
(
EDGE_MODULE
*
drawitem
,
wxDC
*
DC
);
void
Start_Move_EdgeMod
(
EDGE_MODULE
*
drawitem
,
wxDC
*
DC
);
void
Place_EdgeMod
(
EDGE_MODULE
*
drawitem
,
wxDC
*
DC
);
void
Place_EdgeMod
(
EDGE_MODULE
*
drawitem
,
wxDC
*
DC
);
// Gestion des librairies:
// Gestion des librairies:
void
Delete_Module_In_Library
(
const
wxString
&
libname
);
void
Delete_Module_In_Library
(
const
wxString
&
libname
);
int
Create_Librairie
(
const
wxString
&
LibName
);
int
Create_Librairie
(
const
wxString
&
LibName
);
void
Select_Active_Library
(
void
);
void
Select_Active_Library
(
void
);
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
};
};
/*******************************/
/*******************************/
/* class WinEDA_SchematicFrame */
/* class WinEDA_SchematicFrame */
/*******************************/
/*******************************/
/* enum utilis� dans RotationMiroir() */
/* enum utilis� dans RotationMiroir() */
enum
fl_rot_cmp
enum
fl_rot_cmp
{
{
CMP_NORMAL
,
// orientation normale (O, pas de miroir)
CMP_NORMAL
,
// orientation normale (O, pas de miroir)
CMP_ROTATE_CLOCKWISE
,
// nouvelle rotation de -90
CMP_ROTATE_CLOCKWISE
,
// nouvelle rotation de -90
CMP_ROTATE_COUNTERCLOCKWISE
,
// nouvelle rotation de +90
CMP_ROTATE_COUNTERCLOCKWISE
,
// nouvelle rotation de +90
...
@@ -902,350 +911,366 @@ enum fl_rot_cmp
...
@@ -902,350 +911,366 @@ enum fl_rot_cmp
CMP_ORIENT_270
,
// orientation -90, pas de miroir
CMP_ORIENT_270
,
// orientation -90, pas de miroir
CMP_MIROIR_X
=
0x100
,
// miroir selon axe X
CMP_MIROIR_X
=
0x100
,
// miroir selon axe X
CMP_MIROIR_Y
=
0x200
// miroir selon axe Y
CMP_MIROIR_Y
=
0x200
// miroir selon axe Y
};
};
class
WinEDA_SchematicFrame
:
public
WinEDA_DrawFrame
class
WinEDA_SchematicFrame
:
public
WinEDA_DrawFrame
{
{
public
:
public
:
WinEDAChoiceBox
*
m_SelPartBox
;
WinEDAChoiceBox
*
m_SelPartBox
;
private
:
private
:
wxMenu
*
m_FilesMenu
;
wxMenu
*
m_FilesMenu
;
public
:
public
:
WinEDA_SchematicFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
WinEDA_SchematicFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
const
wxString
&
title
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
const
wxPoint
&
pos
,
const
wxSize
&
size
);
~
WinEDA_SchematicFrame
(
void
);
~
WinEDA_SchematicFrame
(
void
);
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
Process_Config
(
wxCommandEvent
&
event
);
void
Process_Config
(
wxCommandEvent
&
event
);
void
Save_Config
(
wxWindow
*
displayframe
);
void
Save_Config
(
wxWindow
*
displayframe
);
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
);
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
);
void
ReCreateHToolbar
(
void
);
void
ReCreateHToolbar
(
void
);
void
ReCreateVToolbar
(
void
);
void
ReCreateVToolbar
(
void
);
void
ReCreateOptToolbar
(
void
);
void
ReCreateOptToolbar
(
void
);
void
ReCreateMenuBar
(
void
);
void
ReCreateMenuBar
(
void
);
void
SetToolbars
(
void
);
void
SetToolbars
(
void
);
SCH_SCREEN
*
GetScreen
(
void
)
{
return
(
SCH_SCREEN
*
)
m_CurrentScreen
;}
void
InstallConfigFrame
(
const
wxPoint
&
pos
);
SCH_SCREEN
*
GetScreen
(
void
)
{
return
(
SCH_SCREEN
*
)
m_CurrentScreen
;
}
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
InstallConfigFrame
(
const
wxPoint
&
pos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
void
ToolOnRightClick
(
wxCommandEvent
&
event
);
int
BestZoom
(
void
);
// Retourne le meilleur zoom
EDA_BaseStruct
*
SchematicGeneralLocateAndDisplay
(
bool
IncludePin
=
TRUE
);
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
EDA_BaseStruct
*
SchematicGeneralLocateAndDisplay
(
const
wxPoint
&
refpoint
,
bool
IncludePin
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
void
ToolOnRightClick
(
wxCommandEvent
&
event
);
int
BestZoom
(
void
);
// Retourne le meilleur zoom
EDA_BaseStruct
*
SchematicGeneralLocateAndDisplay
(
bool
IncludePin
=
TRUE
);
EDA_BaseStruct
*
SchematicGeneralLocateAndDisplay
(
const
wxPoint
&
refpoint
,
bool
IncludePin
);
/* netlist generation */
/* netlist generation */
void
*
BuildNetListBase
(
void
);
void
*
BuildNetListBase
(
void
);
// FUnctions used for hierarchy handling
// FUnctions used for hierarchy handling
void
InstallPreviousScreen
(
void
);
void
InstallPreviousScreen
(
void
);
void
InstallNextScreen
(
DrawSheetStruct
*
Sheet
);
void
InstallNextScreen
(
DrawSheetStruct
*
Sheet
);
void
ToPlot_PS
(
wxCommandEvent
&
event
);
void
ToPlot_PS
(
wxCommandEvent
&
event
);
void
ToPlot_HPGL
(
wxCommandEvent
&
event
);
void
ToPlot_HPGL
(
wxCommandEvent
&
event
);
void
ToPostProcess
(
wxCommandEvent
&
event
);
void
ToPostProcess
(
wxCommandEvent
&
event
);
void
Save_File
(
wxCommandEvent
&
event
);
void
Save_File
(
wxCommandEvent
&
event
);
int
LoadOneEEProject
(
const
wxString
&
FileName
,
bool
IsNew
);
int
LoadOneEEProject
(
const
wxString
&
FileName
,
bool
IsNew
);
bool
LoadOneEEFile
(
SCH_SCREEN
*
screen
,
const
wxString
&
FullFileName
);
bool
LoadOneEEFile
(
SCH_SCREEN
*
screen
,
const
wxString
&
FullFileName
);
bool
SaveEEFile
(
SCH_SCREEN
*
screen
,
int
FileSave
);
bool
SaveEEFile
(
SCH_SCREEN
*
screen
,
int
FileSave
);
bool
LoadOneSheet
(
SCH_SCREEN
*
screen
,
const
wxString
&
FullFileName
);
bool
LoadOneSheet
(
SCH_SCREEN
*
screen
,
const
wxString
&
FullFileName
);
// General search:
// General search:
EDA_BaseStruct
*
FindSchematicItem
(
const
wxString
&
pattern
,
int
SearchType
);
EDA_BaseStruct
*
FindSchematicItem
(
const
wxString
&
pattern
,
int
SearchType
);
EDA_BaseStruct
*
FindMarker
(
int
SearchType
);
EDA_BaseStruct
*
FindMarker
(
int
SearchType
);
private
:
private
:
void
Process_Move_Item
(
EDA_BaseStruct
*
DrawStruct
,
wxDC
*
DC
);
void
Process_Move_Item
(
EDA_BaseStruct
*
DrawStruct
,
wxDC
*
DC
);
// Bus Entry
// Bus Entry
DrawBusEntryStruct
*
CreateBusEntry
(
wxDC
*
DC
,
int
entry_type
);
DrawBusEntryStruct
*
CreateBusEntry
(
wxDC
*
DC
,
int
entry_type
);
void
SetBusEntryShape
(
wxDC
*
DC
,
DrawBusEntryStruct
*
BusEntry
,
int
entry_type
);
void
SetBusEntryShape
(
wxDC
*
DC
,
int
GetBusEntryShape
(
DrawBusEntryStruct
*
BusEntry
);
DrawBusEntryStruct
*
BusEntry
,
void
StartMoveBusEntry
(
DrawBusEntryStruct
*
DrawLibItem
,
wxDC
*
DC
);
int
entry_type
);
int
GetBusEntryShape
(
DrawBusEntryStruct
*
BusEntry
);
void
StartMoveBusEntry
(
DrawBusEntryStruct
*
DrawLibItem
,
wxDC
*
DC
);
// NoConnect
// NoConnect
EDA_BaseStruct
*
CreateNewNoConnectStruct
(
wxDC
*
DC
);
EDA_BaseStruct
*
CreateNewNoConnectStruct
(
wxDC
*
DC
);
// Junction
// Junction
DrawJunctionStruct
*
CreateNewJunctionStruct
(
wxDC
*
DC
,
DrawJunctionStruct
*
CreateNewJunctionStruct
(
wxDC
*
DC
,
const
wxPoint
&
pos
,
bool
PutInUndoList
=
FALSE
);
const
wxPoint
&
pos
,
bool
PutInUndoList
=
FALSE
);
// Text ,label, glabel
// Text ,label, glabel
EDA_BaseStruct
*
CreateNewText
(
wxDC
*
DC
,
int
type
);
EDA_BaseStruct
*
CreateNewText
(
wxDC
*
DC
,
int
type
);
void
EditSchematicText
(
DrawTextStruct
*
TextStruct
,
wxDC
*
DC
);
void
EditSchematicText
(
DrawTextStruct
*
TextStruct
,
wxDC
*
DC
);
void
ChangeTextOrient
(
DrawTextStruct
*
TextStruct
,
wxDC
*
DC
);
void
ChangeTextOrient
(
DrawTextStruct
*
TextStruct
,
wxDC
*
DC
);
void
StartMoveTexte
(
DrawTextStruct
*
TextStruct
,
wxDC
*
DC
);
void
StartMoveTexte
(
DrawTextStruct
*
TextStruct
,
wxDC
*
DC
);
void
ConvertTextType
(
DrawTextStruct
*
Text
,
wxDC
*
DC
,
int
newtype
);
void
ConvertTextType
(
DrawTextStruct
*
Text
,
wxDC
*
DC
,
int
newtype
);
// Wire, Bus
// Wire, Bus
void
BeginSegment
(
wxDC
*
DC
,
int
type
);
void
BeginSegment
(
wxDC
*
DC
,
int
type
);
void
EndSegment
(
wxDC
*
DC
);
void
EndSegment
(
wxDC
*
DC
);
void
DeleteCurrentSegment
(
wxDC
*
DC
);
void
DeleteCurrentSegment
(
wxDC
*
DC
);
void
DeleteConnection
(
wxDC
*
DC
,
bool
DeleteFullConnection
);
void
DeleteConnection
(
wxDC
*
DC
,
bool
DeleteFullConnection
);
// graphic lines
// graphic lines
void
Delete_Segment_Edge
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
void
Delete_Segment_Edge
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
void
Drawing_SetNewWidth
(
DRAWSEGMENT
*
DrawSegm
,
wxDC
*
DC
);
void
Drawing_SetNewWidth
(
DRAWSEGMENT
*
DrawSegm
,
wxDC
*
DC
);
void
Delete_Drawings_All_Layer
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
void
Delete_Drawings_All_Layer
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
DRAWSEGMENT
*
Begin_Edge
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
DRAWSEGMENT
*
Begin_Edge
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
// Hierarchical Sheet & PinSheet
// Hierarchical Sheet & PinSheet
void
InstallHierarchyFrame
(
wxDC
*
DC
,
wxPoint
&
pos
);
void
InstallHierarchyFrame
(
wxDC
*
DC
,
wxPoint
&
pos
);
DrawSheetStruct
*
CreateSheet
(
wxDC
*
DC
);
DrawSheetStruct
*
CreateSheet
(
wxDC
*
DC
);
void
ReSizeSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
);
void
ReSizeSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
);
public
:
public
:
bool
EditSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
);
bool
EditSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
);
private
:
private
:
void
StartMoveSheet
(
DrawSheetStruct
*
sheet
,
wxDC
*
DC
);
void
StartMoveSheet
(
DrawSheetStruct
*
sheet
,
wxDC
*
DC
);
DrawSheetLabelStruct
*
Create_PinSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
);
DrawSheetLabelStruct
*
Create_PinSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
);
void
Edit_PinSheet
(
DrawSheetLabelStruct
*
SheetLabel
,
wxDC
*
DC
);
void
Edit_PinSheet
(
DrawSheetLabelStruct
*
SheetLabel
,
wxDC
*
DC
);
void
StartMove_PinSheet
(
DrawSheetLabelStruct
*
SheetLabel
,
wxDC
*
DC
);
void
StartMove_PinSheet
(
DrawSheetLabelStruct
*
SheetLabel
,
wxDC
*
DC
);
void
Place_PinSheet
(
DrawSheetLabelStruct
*
SheetLabel
,
wxDC
*
DC
);
void
Place_PinSheet
(
DrawSheetLabelStruct
*
SheetLabel
,
wxDC
*
DC
);
DrawSheetLabelStruct
*
Import_PinSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
);
DrawSheetLabelStruct
*
Import_PinSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
);
public
:
public
:
void
DeleteSheetLabel
(
wxDC
*
DC
,
DrawSheetLabelStruct
*
SheetLabelToDel
);
void
DeleteSheetLabel
(
wxDC
*
DC
,
DrawSheetLabelStruct
*
SheetLabelToDel
);
private
:
private
:
// Component
// Component
EDA_SchComponentStruct
*
Load_Component
(
wxDC
*
DC
,
EDA_SchComponentStruct
*
Load_Component
(
wxDC
*
DC
,
const
wxString
&
libname
,
wxArrayString
&
List
,
bool
UseLibBrowser
);
const
wxString
&
libname
,
void
StartMovePart
(
EDA_SchComponentStruct
*
DrawLibItem
,
wxDC
*
DC
);
wxArrayString
&
List
,
bool
UseLibBrowser
);
void
StartMovePart
(
EDA_SchComponentStruct
*
DrawLibItem
,
wxDC
*
DC
);
public
:
public
:
void
CmpRotationMiroir
(
void
CmpRotationMiroir
(
EDA_SchComponentStruct
*
DrawComponent
,
wxDC
*
DC
,
int
type_rotate
);
EDA_SchComponentStruct
*
DrawComponent
,
wxDC
*
DC
,
int
type_rotate
);
private
:
private
:
void
SelPartUnit
(
EDA_SchComponentStruct
*
DrawComponent
,
int
unit
,
wxDC
*
DC
);
void
SelPartUnit
(
EDA_SchComponentStruct
*
DrawComponent
,
int
unit
,
wxDC
*
DC
);
void
ConvertPart
(
EDA_SchComponentStruct
*
DrawComponent
,
wxDC
*
DC
);
void
ConvertPart
(
EDA_SchComponentStruct
*
DrawComponent
,
wxDC
*
DC
);
void
SetInitCmp
(
EDA_SchComponentStruct
*
DrawComponent
,
wxDC
*
DC
);
void
SetInitCmp
(
EDA_SchComponentStruct
*
DrawComponent
,
wxDC
*
DC
);
void
EditComponentReference
(
EDA_SchComponentStruct
*
DrawLibItem
,
wxDC
*
DC
);
void
EditComponentReference
(
EDA_SchComponentStruct
*
DrawLibItem
,
wxDC
*
DC
);
void
EditComponentValue
(
EDA_SchComponentStruct
*
DrawLibItem
,
wxDC
*
DC
);
void
EditComponentValue
(
EDA_SchComponentStruct
*
DrawLibItem
,
wxDC
*
DC
);
void
StartMoveCmpField
(
PartTextStruct
*
Field
,
wxDC
*
DC
);
void
StartMoveCmpField
(
PartTextStruct
*
Field
,
wxDC
*
DC
);
void
EditCmpFieldText
(
PartTextStruct
*
Field
,
wxDC
*
DC
);
void
EditCmpFieldText
(
PartTextStruct
*
Field
,
wxDC
*
DC
);
void
RotateCmpField
(
PartTextStruct
*
Field
,
wxDC
*
DC
);
void
RotateCmpField
(
PartTextStruct
*
Field
,
wxDC
*
DC
);
/* Operations sur bloc */
/* Operations sur bloc */
void
PasteStruct
(
wxDC
*
DC
);
void
PasteStruct
(
wxDC
*
DC
);
/* Undo - redo */
/* Undo - redo */
public
:
public
:
void
SaveCopyInUndoList
(
EDA_BaseStruct
*
ItemToCopy
,
int
flag_type_command
=
0
);
void
SaveCopyInUndoList
(
EDA_BaseStruct
*
ItemToCopy
,
int
flag_type_command
=
0
);
private
:
private
:
void
PutDataInPreviousState
(
DrawPickedStruct
*
List
);
void
PutDataInPreviousState
(
DrawPickedStruct
*
List
);
void
GetSchematicFromRedoList
(
void
);
void
GetSchematicFromRedoList
(
void
);
void
GetSchematicFromUndoList
(
void
);
void
GetSchematicFromUndoList
(
void
);
public
:
public
:
void
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
);
void
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
);
/* Gestion generale des operations sur block */
/* Gestion generale des operations sur block */
int
ReturnBlockCommand
(
int
key
);
int
ReturnBlockCommand
(
int
key
);
void
InitBlockPasteInfos
();
void
InitBlockPasteInfos
();
void
HandleBlockPlace
(
wxDC
*
DC
);
void
HandleBlockPlace
(
wxDC
*
DC
);
int
HandleBlockEnd
(
wxDC
*
DC
);
int
HandleBlockEnd
(
wxDC
*
DC
);
void
HandleBlockEndByPopUp
(
int
Command
,
wxDC
*
DC
);
void
HandleBlockEndByPopUp
(
int
Command
,
wxDC
*
DC
);
// Repetition automatique de placements
// Repetition automatique de placements
void
RepeatDrawItem
(
wxDC
*
DC
);
void
RepeatDrawItem
(
wxDC
*
DC
);
// Test des points de connexion en l'air (dangling ends)
// Test des points de connexion en l'air (dangling ends)
void
TestDanglingEnds
(
EDA_BaseStruct
*
DrawList
,
wxDC
*
DC
);
void
TestDanglingEnds
(
EDA_BaseStruct
*
DrawList
,
wxDC
*
DC
);
LibDrawPin
*
LocatePinEnd
(
EDA_BaseStruct
*
DrawList
,
const
wxPoint
&
pos
);
LibDrawPin
*
LocatePinEnd
(
EDA_BaseStruct
*
DrawList
,
const
wxPoint
&
pos
);
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
};
};
/*****************************/
/* class WinEDA_LibeditFrame */
/*****************************/
/*****************************/
class
WinEDA_LibeditFrame
:
public
WinEDA_DrawFrame
/* class WinEDA_LibeditFrame */
/*****************************/
class
WinEDA_LibeditFrame
:
public
WinEDA_DrawFrame
{
{
public
:
public
:
WinEDAChoiceBox
*
m_SelpartBox
;
WinEDAChoiceBox
*
m_SelpartBox
;
WinEDAChoiceBox
*
m_SelAliasBox
;
WinEDAChoiceBox
*
m_SelAliasBox
;
public
:
public
:
WinEDA_LibeditFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
WinEDA_LibeditFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
const
wxString
&
title
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
const
wxPoint
&
pos
,
const
wxSize
&
size
);
~
WinEDA_LibeditFrame
(
void
);
~
WinEDA_LibeditFrame
(
void
);
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
DisplayLibInfos
(
void
);
void
DisplayLibInfos
(
void
);
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
);
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
);
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
void
ReCreateHToolbar
(
void
);
void
ReCreateHToolbar
(
void
);
void
ReCreateVToolbar
(
void
);
void
ReCreateVToolbar
(
void
);
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
int
BestZoom
(
void
);
// Retourne le meilleur zoom
int
BestZoom
(
void
);
// Retourne le meilleur zoom
void
SetToolbars
(
void
);
void
SetToolbars
(
void
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
SCH_SCREEN
*
GetScreen
(
void
)
{
return
(
SCH_SCREEN
*
)
m_CurrentScreen
;}
SCH_SCREEN
*
GetScreen
(
void
)
{
return
(
SCH_SCREEN
*
)
m_CurrentScreen
;
}
private
:
private
:
// General:
// General:
void
CreateNewLibraryPart
(
void
);
void
CreateNewLibraryPart
(
void
);
void
DeleteOnePart
(
void
);
void
DeleteOnePart
(
void
);
void
SaveOnePartInMemory
(
void
);
void
SaveOnePartInMemory
(
void
);
void
SelectActiveLibrary
(
void
);
void
SelectActiveLibrary
(
void
);
bool
LoadOneLibraryPart
(
void
);
bool
LoadOneLibraryPart
(
void
);
void
SaveActiveLibrary
(
void
);
void
SaveActiveLibrary
(
void
);
void
ImportOnePart
(
void
);
void
ImportOnePart
(
void
);
void
ExportOnePart
(
bool
create_lib
);
void
ExportOnePart
(
bool
create_lib
);
int
LoadOneLibraryPartAux
(
EDA_LibComponentStruct
*
LibEntry
,
int
LoadOneLibraryPartAux
(
EDA_LibComponentStruct
*
LibEntry
,
LibraryStruct
*
Library
,
int
noMsg
=
0
);
LibraryStruct
*
Library
,
int
noMsg
=
0
);
void
DisplayCmpDoc
(
const
wxString
&
Name
);
void
DisplayCmpDoc
(
const
wxString
&
Name
);
void
InstallLibeditFrame
(
const
wxPoint
&
pos
);
void
InstallLibeditFrame
(
const
wxPoint
&
pos
);
// General editing
// General editing
public
:
public
:
void
SaveCopyInUndoList
(
EDA_BaseStruct
*
ItemToCopy
,
int
flag_type_command
=
0
);
void
SaveCopyInUndoList
(
EDA_BaseStruct
*
ItemToCopy
,
int
flag_type_command
=
0
);
private
:
private
:
void
GetComponentFromUndoList
(
void
);
void
GetComponentFromUndoList
(
void
);
void
GetComponentFromRedoList
(
void
);
void
GetComponentFromRedoList
(
void
);
// Edition des Pins:
// Edition des Pins:
void
CreatePin
(
wxDC
*
DC
);
void
CreatePin
(
wxDC
*
DC
);
void
DeletePin
(
wxDC
*
DC
,
void
DeletePin
(
wxDC
*
DC
,
EDA_LibComponentStruct
*
LibEntry
,
EDA_LibComponentStruct
*
LibEntry
,
LibDrawPin
*
Pin
);
LibDrawPin
*
Pin
);
void
StartMovePin
(
wxDC
*
DC
);
void
StartMovePin
(
wxDC
*
DC
);
// Test des pins ( duplicates...)
// Test des pins ( duplicates...)
bool
TestPins
(
EDA_LibComponentStruct
*
LibEntry
);
bool
TestPins
(
EDA_LibComponentStruct
*
LibEntry
);
// Edition de l'ancre
// Edition de l'ancre
void
PlaceAncre
(
void
);
void
PlaceAncre
(
void
);
// Edition des graphismes:
// Edition des graphismes:
LibEDA_BaseStruct
*
CreateGraphicItem
(
wxDC
*
DC
);
LibEDA_BaseStruct
*
CreateGraphicItem
(
wxDC
*
DC
);
void
GraphicItemBeginDraw
(
wxDC
*
DC
);
void
GraphicItemBeginDraw
(
wxDC
*
DC
);
void
StartMoveDrawSymbol
(
wxDC
*
DC
);
void
StartMoveDrawSymbol
(
wxDC
*
DC
);
void
EndDrawGraphicItem
(
wxDC
*
DC
);
void
EndDrawGraphicItem
(
wxDC
*
DC
);
void
LoadOneSymbol
(
wxDC
*
DC
);
void
LoadOneSymbol
(
wxDC
*
DC
);
void
SaveOneSymbol
(
void
);
void
SaveOneSymbol
(
void
);
void
EditGraphicSymbol
(
wxDC
*
DC
,
LibEDA_BaseStruct
*
DrawItem
);
void
EditGraphicSymbol
(
wxDC
*
DC
,
LibEDA_BaseStruct
*
DrawItem
);
void
EditSymbolText
(
wxDC
*
DC
,
LibEDA_BaseStruct
*
DrawItem
);
void
EditSymbolText
(
wxDC
*
DC
,
LibEDA_BaseStruct
*
DrawItem
);
void
RotateSymbolText
(
wxDC
*
DC
);
void
RotateSymbolText
(
wxDC
*
DC
);
void
DeleteDrawPoly
(
wxDC
*
DC
);
void
DeleteDrawPoly
(
wxDC
*
DC
);
LibDrawField
*
LocateField
(
EDA_LibComponentStruct
*
LibEntry
);
LibDrawField
*
LocateField
(
EDA_LibComponentStruct
*
LibEntry
);
void
RotateField
(
wxDC
*
DC
,
LibDrawField
*
Field
);
void
RotateField
(
wxDC
*
DC
,
LibDrawField
*
Field
);
void
PlaceField
(
wxDC
*
DC
,
LibDrawField
*
Field
);
void
PlaceField
(
wxDC
*
DC
,
LibDrawField
*
Field
);
void
EditField
(
wxDC
*
DC
,
LibDrawField
*
Field
);
void
EditField
(
wxDC
*
DC
,
LibDrawField
*
Field
);
void
StartMoveField
(
wxDC
*
DC
,
LibDrawField
*
field
);
void
StartMoveField
(
wxDC
*
DC
,
LibDrawField
*
field
);
public
:
public
:
/* Block commands: */
/* Block commands: */
int
ReturnBlockCommand
(
int
key
);
int
ReturnBlockCommand
(
int
key
);
void
HandleBlockPlace
(
wxDC
*
DC
);
void
HandleBlockPlace
(
wxDC
*
DC
);
int
HandleBlockEnd
(
wxDC
*
DC
);
int
HandleBlockEnd
(
wxDC
*
DC
);
void
DeletePartInLib
(
LibraryStruct
*
Library
,
EDA_LibComponentStruct
*
Entry
);
void
DeletePartInLib
(
LibraryStruct
*
Library
,
EDA_LibComponentStruct
*
Entry
);
void
PlacePin
(
wxDC
*
DC
);
void
PlacePin
(
wxDC
*
DC
);
void
InitEditOnePin
(
void
);
void
InitEditOnePin
(
void
);
void
GlobalSetPins
(
wxDC
*
DC
,
LibDrawPin
*
MasterPin
,
int
id
);
void
GlobalSetPins
(
wxDC
*
DC
,
LibDrawPin
*
MasterPin
,
int
id
);
// Repetition automatique de placement de pins
// Repetition automatique de placement de pins
void
RepeatPinItem
(
wxDC
*
DC
,
LibDrawPin
*
Pin
);
void
RepeatPinItem
(
wxDC
*
DC
,
LibDrawPin
*
Pin
);
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
};
};
class
LibraryStruct
;
class
LibraryStruct
;
class
WinEDA_ViewlibFrame
:
public
WinEDA_DrawFrame
class
WinEDA_ViewlibFrame
:
public
WinEDA_DrawFrame
{
{
public
:
public
:
WinEDAChoiceBox
*
SelpartBox
;
WinEDAChoiceBox
*
SelpartBox
;
wxListBox
*
m_LibList
;
wxListBox
*
m_LibList
;
wxSize
m_LibListSize
;
wxSize
m_LibListSize
;
wxListBox
*
m_CmpList
;
wxListBox
*
m_CmpList
;
wxSize
m_CmpListSize
;
wxSize
m_CmpListSize
;
wxSemaphore
*
m_Semaphore
;
// != NULL if the frame must emulate a modal dialog
wxSemaphore
*
m_Semaphore
;
// != NULL if the frame must emulate a modal dialog
public
:
public
:
WinEDA_ViewlibFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
WinEDA_ViewlibFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
LibraryStruct
*
Library
=
NULL
,
LibraryStruct
*
Library
=
NULL
,
wxSemaphore
*
semaphore
=
NULL
);
wxSemaphore
*
semaphore
=
NULL
);
~
WinEDA_ViewlibFrame
(
void
);
~
WinEDA_ViewlibFrame
(
void
);
void
OnSize
(
wxSizeEvent
&
event
);
void
OnSize
(
wxSizeEvent
&
event
);
void
ReCreateListLib
(
void
);
void
ReCreateListLib
(
void
);
void
ReCreateListCmp
(
void
);
void
ReCreateListCmp
(
void
);
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
DisplayLibInfos
(
void
);
void
DisplayLibInfos
(
void
);
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
);
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
);
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
void
ReCreateHToolbar
(
void
);
void
ReCreateHToolbar
(
void
);
void
ReCreateVToolbar
(
void
);
void
ReCreateVToolbar
(
void
);
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
int
BestZoom
(
void
);
// Retourne le meilleur zoom
int
BestZoom
(
void
);
// Retourne le meilleur zoom
void
ClickOnLibList
(
wxCommandEvent
&
event
);
void
ClickOnLibList
(
wxCommandEvent
&
event
);
void
ClickOnCmpList
(
wxCommandEvent
&
event
);
void
ClickOnCmpList
(
wxCommandEvent
&
event
);
SCH_SCREEN
*
GetScreen
(
void
)
{
return
(
SCH_SCREEN
*
)
m_CurrentScreen
;}
SCH_SCREEN
*
GetScreen
(
void
)
{
return
(
SCH_SCREEN
*
)
m_CurrentScreen
;
}
private
:
private
:
void
SelectCurrentLibrary
(
void
);
void
SelectCurrentLibrary
(
void
);
void
SelectAndViewLibraryPart
(
int
option
);
void
SelectAndViewLibraryPart
(
int
option
);
void
ExportToSchematicLibraryPart
(
wxCommandEvent
&
event
);
void
ExportToSchematicLibraryPart
(
wxCommandEvent
&
event
);
void
ViewOneLibraryContent
(
LibraryStruct
*
Lib
,
int
Flag
);
void
ViewOneLibraryContent
(
LibraryStruct
*
Lib
,
int
Flag
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
};
};
/****************************************************/
/****************************************************/
/* classe representant un ecran graphique de dessin */
/* classe representant un ecran graphique de dessin */
/****************************************************/
/****************************************************/
#include "drawpanel_wxstruct.h"
#include "drawpanel_wxstruct.h"
/*********************************************************/
/* classe representant un ecran d'affichage des messages */
/*********************************************************/
class
WinEDA_MsgPanel
:
public
wxPanel
/*********************************************************/
/* classe representant un ecran d'affichage des messages */
/*********************************************************/
class
WinEDA_MsgPanel
:
public
wxPanel
{
{
public
:
public
:
WinEDA_DrawFrame
*
m_Parent
;
WinEDA_DrawFrame
*
m_Parent
;
int
m_BgColor
;
// couleur de fond
int
m_BgColor
;
// couleur de fond
public
:
public
:
// Constructor and destructor
// Constructor and destructor
WinEDA_MsgPanel
(
WinEDA_DrawFrame
*
parent
,
int
id
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
WinEDA_MsgPanel
(
WinEDA_DrawFrame
*
parent
,
int
id
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
~
WinEDA_MsgPanel
(
void
);
~
WinEDA_MsgPanel
(
void
);
void
OnPaint
(
wxPaintEvent
&
event
);
void
OnPaint
(
wxPaintEvent
&
event
);
void
EraseMsgBox
(
void
);
void
EraseMsgBox
(
void
);
void
EraseMsgBox
(
wxDC
*
DC
);
void
EraseMsgBox
(
wxDC
*
DC
);
void
Affiche_1_Parametre
(
int
pos_X
,
const
wxString
&
texte_H
,
void
Affiche_1_Parametre
(
int
pos_X
,
const
wxString
&
texte_H
,
const
wxString
&
texte_L
,
int
color
);
const
wxString
&
texte_L
,
int
color
);
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
...
@@ -1262,27 +1287,32 @@ public:
...
@@ -1262,27 +1287,32 @@ public:
private
:
private
:
wxString
m_NewText
;
wxString
m_NewText
;
wxTextCtrl
*
m_FrameText
;
wxTextCtrl
*
m_FrameText
;
wxStaticText
*
m_Title
;
wxStaticText
*
m_Title
;
public
:
public
:
// Constructor and destructor
// Constructor and destructor
WinEDA_EnterText
(
wxWindow
*
parent
,
const
wxString
&
Title
,
WinEDA_EnterText
(
wxWindow
*
parent
,
const
wxString
&
Title
,
const
wxString
&
TextToEdit
,
wxBoxSizer
*
BoxSizer
,
const
wxString
&
TextToEdit
,
wxBoxSizer
*
BoxSizer
,
const
wxSize
&
Size
);
const
wxSize
&
Size
);
~
WinEDA_EnterText
(
void
)
~
WinEDA_EnterText
(
void
)
{
{
}
}
wxString
GetValue
(
void
);
void
GetValue
(
char
*
buffer
,
int
lenmax
);
wxString
GetValue
(
void
);
void
SetValue
(
const
wxString
&
new_text
);
void
GetValue
(
char
*
buffer
,
int
lenmax
);
void
Enable
(
bool
enbl
);
void
SetValue
(
const
wxString
&
new_text
);
void
SetFocus
(
void
)
{
m_FrameText
->
SetFocus
();
}
void
Enable
(
bool
enbl
);
void
SetInsertionPoint
(
int
n
)
{
m_FrameText
->
SetInsertionPoint
(
n
);
}
void
SetSelection
(
int
n
,
int
m
)
{
void
SetFocus
(
void
)
{
m_FrameText
->
SetFocus
();
}
m_FrameText
->
SetSelection
(
n
,
m
);
}
void
SetInsertionPoint
(
int
n
)
{
m_FrameText
->
SetInsertionPoint
(
n
);
}
void
SetSelection
(
int
n
,
int
m
)
{
m_FrameText
->
SetSelection
(
n
,
m
);
}
};
};
/*********************************************************************/
/*********************************************************************/
...
@@ -1293,27 +1323,29 @@ class WinEDA_GraphicTextCtrl
...
@@ -1293,27 +1323,29 @@ class WinEDA_GraphicTextCtrl
public
:
public
:
int
m_Units
,
m_Internal_Unit
;
int
m_Units
,
m_Internal_Unit
;
wxTextCtrl
*
m_FrameText
;
wxTextCtrl
*
m_FrameText
;
wxTextCtrl
*
m_FrameSize
;
wxTextCtrl
*
m_FrameSize
;
private
:
private
:
wxStaticText
*
m_Title
;
wxStaticText
*
m_Title
;
public
:
public
:
// Constructor and destructor
// Constructor and destructor
WinEDA_GraphicTextCtrl
(
wxWindow
*
parent
,
const
wxString
&
Title
,
WinEDA_GraphicTextCtrl
(
wxWindow
*
parent
,
const
wxString
&
Title
,
const
wxString
&
TextToEdit
,
int
textsize
,
const
wxString
&
TextToEdit
,
int
textsize
,
int
units
,
wxBoxSizer
*
BoxSizer
,
int
framelen
=
200
,
int
units
,
wxBoxSizer
*
BoxSizer
,
int
framelen
=
200
,
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
~
WinEDA_GraphicTextCtrl
(
void
);
~
WinEDA_GraphicTextCtrl
(
void
);
wxString
GetText
(
void
);
wxString
GetText
(
void
);
int
GetTextSize
(
void
);
int
GetTextSize
(
void
);
void
Enable
(
bool
state
);
void
Enable
(
bool
state
);
void
SetTitle
(
const
wxString
&
title
);
void
SetTitle
(
const
wxString
&
title
);
void
SetFocus
(
void
)
{
m_FrameText
->
SetFocus
();
}
void
SetValue
(
const
wxString
&
value
);
void
SetFocus
(
void
)
{
m_FrameText
->
SetFocus
();
}
void
SetValue
(
int
value
);
void
SetValue
(
const
wxString
&
value
);
void
SetValue
(
int
value
);
};
};
...
@@ -1326,73 +1358,78 @@ public:
...
@@ -1326,73 +1358,78 @@ public:
int
m_Units
,
m_Internal_Unit
;
int
m_Units
,
m_Internal_Unit
;
wxPoint
m_Pos_To_Edit
;
wxPoint
m_Pos_To_Edit
;
wxTextCtrl
*
m_FramePosX
;
wxTextCtrl
*
m_FramePosX
;
wxTextCtrl
*
m_FramePosY
;
wxTextCtrl
*
m_FramePosY
;
private
:
private
:
wxStaticText
*
m_TextX
,
*
m_TextY
;
wxStaticText
*
m_TextX
,
*
m_TextY
;
public
:
public
:
// Constructor and destructor
// Constructor and destructor
WinEDA_PositionCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
WinEDA_PositionCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
const
wxPoint
&
pos_to_edit
,
const
wxPoint
&
pos_to_edit
,
int
units
,
wxBoxSizer
*
BoxSizer
,
int
units
,
wxBoxSizer
*
BoxSizer
,
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
~
WinEDA_PositionCtrl
(
void
);
~
WinEDA_PositionCtrl
(
void
);
void
Enable
(
bool
x_win_on
,
bool
y_win_on
);
void
Enable
(
bool
x_win_on
,
bool
y_win_on
);
void
SetValue
(
int
x_value
,
int
y_value
);
void
SetValue
(
int
x_value
,
int
y_value
);
wxPoint
GetValue
(
void
);
wxPoint
GetValue
(
void
);
};
};
/*****************************************************************/
/*****************************************************************/
/* Classe pour afficher et editer une coordonn�e en INCHES ou MM */
/* Classe pour afficher et editer une coordonn�e en INCHES ou MM */
/*****************************************************************/
/*****************************************************************/
class
WinEDA_SizeCtrl
:
public
WinEDA_PositionCtrl
class
WinEDA_SizeCtrl
:
public
WinEDA_PositionCtrl
{
{
public
:
public
:
// Constructor and destructor
// Constructor and destructor
WinEDA_SizeCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
WinEDA_SizeCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
const
wxSize
&
size_to_edit
,
const
wxSize
&
size_to_edit
,
int
units
,
wxBoxSizer
*
BoxSizer
,
int
units
,
wxBoxSizer
*
BoxSizer
,
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
~
WinEDA_SizeCtrl
(
void
)
{
}
~
WinEDA_SizeCtrl
(
void
)
{
}
wxSize
GetValue
(
void
);
wxSize
GetValue
(
void
);
};
};
/*****************************************************************/
/*****************************************************************/
/* Classe pour afficher et editer une valeur en INCHES ou MM */
/* Classe pour afficher et editer une valeur en INCHES ou MM */
/*****************************************************************/
/*****************************************************************/
/* internal_unit est le nombre d'unites internes par inch
/* internal_unit est le nombre d'unites internes par inch
- 1000 sur EESchema
*
- 1000 sur EESchema
- 10000 sur PcbNew
*
- 10000 sur PcbNew
*/
*/
class
WinEDA_ValueCtrl
class
WinEDA_ValueCtrl
{
{
public
:
public
:
int
m_Units
;
int
m_Units
;
int
m_Value
;
int
m_Value
;
wxTextCtrl
*
m_ValueCtrl
;
wxTextCtrl
*
m_ValueCtrl
;
private
:
private
:
int
m_Internal_Unit
;
int
m_Internal_Unit
;
wxStaticText
*
m_Text
;
wxStaticText
*
m_Text
;
public
:
public
:
// Constructor and destructor
// Constructor and destructor
WinEDA_ValueCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
int
value
,
WinEDA_ValueCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
int
value
,
int
units
,
wxBoxSizer
*
BoxSizer
,
int
units
,
wxBoxSizer
*
BoxSizer
,
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
~
WinEDA_ValueCtrl
(
void
);
~
WinEDA_ValueCtrl
(
void
);
int
GetValue
(
void
);
int
GetValue
(
void
);
void
SetValue
(
int
new_value
);
void
SetValue
(
int
new_value
);
void
Enable
(
bool
enbl
);
void
Enable
(
bool
enbl
);
void
SetToolTip
(
const
wxString
&
text
)
void
SetToolTip
(
const
wxString
&
text
)
{
{
m_ValueCtrl
->
SetToolTip
(
text
);
m_ValueCtrl
->
SetToolTip
(
text
);
}
}
};
};
...
@@ -1403,84 +1440,87 @@ class WinEDA_DFloatValueCtrl
...
@@ -1403,84 +1440,87 @@ class WinEDA_DFloatValueCtrl
{
{
public
:
public
:
double
m_Value
;
double
m_Value
;
wxTextCtrl
*
m_ValueCtrl
;
wxTextCtrl
*
m_ValueCtrl
;
private
:
private
:
wxStaticText
*
m_Text
;
wxStaticText
*
m_Text
;
public
:
public
:
// Constructor and destructor
// Constructor and destructor
WinEDA_DFloatValueCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
WinEDA_DFloatValueCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
double
value
,
wxBoxSizer
*
BoxSizer
);
double
value
,
wxBoxSizer
*
BoxSizer
);
~
WinEDA_DFloatValueCtrl
(
void
);
~
WinEDA_DFloatValueCtrl
(
void
);
double
GetValue
(
void
);
double
GetValue
(
void
);
void
SetValue
(
double
new_value
);
void
SetValue
(
double
new_value
);
void
Enable
(
bool
enbl
);
void
Enable
(
bool
enbl
);
void
SetToolTip
(
const
wxString
&
text
)
void
SetToolTip
(
const
wxString
&
text
)
{
{
m_ValueCtrl
->
SetToolTip
(
text
);
m_ValueCtrl
->
SetToolTip
(
text
);
}
}
};
};
/*************************/
/*************************/
/* class WinEDA_Toolbar */
/* class WinEDA_Toolbar */
/*************************/
/*************************/
class
WinEDA_Toolbar
:
public
wxToolBar
class
WinEDA_Toolbar
:
public
wxToolBar
{
{
public
:
public
:
wxWindow
*
m_Parent
;
wxWindow
*
m_Parent
;
id_toolbar
m_Ident
;
id_toolbar
m_Ident
;
WinEDA_Toolbar
*
Pnext
;
WinEDA_Toolbar
*
Pnext
;
bool
m_Horizontal
;
bool
m_Horizontal
;
int
m_Size
;
int
m_Size
;
public
:
public
:
WinEDA_Toolbar
(
id_toolbar
type
,
wxWindow
*
parent
,
WinEDA_Toolbar
(
id_toolbar
type
,
wxWindow
*
parent
,
wxWindowID
id
,
bool
horizontal
);
wxWindowID
id
,
bool
horizontal
);
WinEDA_Toolbar
*
Next
(
void
)
{
return
Pnext
;
}
WinEDA_Toolbar
*
Next
(
void
)
{
return
Pnext
;
}
};
};
/***********************/
/***********************/
/* class WinEDAListBox */
/* class WinEDAListBox */
/***********************/
/***********************/
class
WinEDAListBox
:
public
wxDialog
class
WinEDAListBox
:
public
wxDialog
{
{
public
:
public
:
WinEDA_DrawFrame
*
m_Parent
;
WinEDA_DrawFrame
*
m_Parent
;
wxListBox
*
m_List
;
wxListBox
*
m_List
;
wxTextCtrl
*
m_WinMsg
;
wxTextCtrl
*
m_WinMsg
;
const
wxChar
**
m_ItemList
;
const
wxChar
**
m_ItemList
;
private
:
private
:
void
(
*
m_MoveFct
)(
wxString
&
Text
);
void
(
*
m_MoveFct
)(
wxString
&
Text
);
public
:
public
:
WinEDAListBox
(
WinEDA_DrawFrame
*
parent
,
const
wxString
&
title
,
WinEDAListBox
(
WinEDA_DrawFrame
*
parent
,
const
wxString
&
title
,
const
wxChar
**
ItemList
,
const
wxChar
**
ItemList
,
const
wxString
&
RefText
,
const
wxString
&
RefText
,
void
(
*
movefct
)(
wxString
&
Text
)
=
NULL
,
void
(
*
movefct
)(
wxString
&
Text
)
=
NULL
,
const
wxColour
&
colour
=
wxNullColour
,
const
wxColour
&
colour
=
wxNullColour
,
wxPoint
dialog_position
=
wxDefaultPosition
);
wxPoint
dialog_position
=
wxDefaultPosition
);
~
WinEDAListBox
(
void
);
~
WinEDAListBox
(
void
);
void
SortList
(
void
);
void
SortList
(
void
);
void
Append
(
const
wxString
&
item
);
void
Append
(
const
wxString
&
item
);
void
InsertItems
(
const
wxArrayString
&
itemlist
,
int
position
=
0
);
void
InsertItems
(
const
wxArrayString
&
itemlist
,
int
position
=
0
);
void
MoveMouseToOrigin
(
void
);
void
MoveMouseToOrigin
(
void
);
wxString
GetTextSelection
(
void
);
wxString
GetTextSelection
(
void
);
private
:
private
:
void
OnClose
(
wxCloseEvent
&
event
);
void
OnClose
(
wxCloseEvent
&
event
);
void
Cancel
(
wxCommandEvent
&
event
);
void
Cancel
(
wxCommandEvent
&
event
);
void
Ok
(
wxCommandEvent
&
event
);
void
Ok
(
wxCommandEvent
&
event
);
void
ClickOnList
(
wxCommandEvent
&
event
);
void
ClickOnList
(
wxCommandEvent
&
event
);
void
D_ClickOnList
(
wxCommandEvent
&
event
);
void
D_ClickOnList
(
wxCommandEvent
&
event
);
void
OnKeyEvent
(
wxKeyEvent
&
event
);
void
OnKeyEvent
(
wxKeyEvent
&
event
);
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
};
};
...
@@ -1488,38 +1528,41 @@ private:
...
@@ -1488,38 +1528,41 @@ private:
/*************************/
/*************************/
/* class WinEDAChoiceBox */
/* class WinEDAChoiceBox */
/*************************/
/*************************/
/* class to display a choice list.
/* class to display a choice list.
This is a wrapper to wxComboBox (or wxChoice)
*
This is a wrapper to wxComboBox (or wxChoice)
but because they have some problems, WinEDAChoiceBox uses workarounds:
*
but because they have some problems, WinEDAChoiceBox uses workarounds:
- in wxGTK 2.6.2 wxGetSelection() does not work properly,
*
- in wxGTK 2.6.2 wxGetSelection() does not work properly,
- and wxChoice crashes if compiled in non unicode mode and uses utf8 codes
*
- and wxChoice crashes if compiled in non unicode mode and uses utf8 codes
*/
*/
#define EVT_KICAD_CHOICEBOX EVT_COMBOBOX
#define EVT_KICAD_CHOICEBOX EVT_COMBOBOX
class
WinEDAChoiceBox
:
public
wxComboBox
class
WinEDAChoiceBox
:
public
wxComboBox
{
{
public
:
public
:
WinEDAChoiceBox
(
wxWindow
*
parent
,
wxWindowID
id
,
WinEDAChoiceBox
(
wxWindow
*
parent
,
wxWindowID
id
,
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxDefaultSize
,
const
wxSize
&
size
=
wxDefaultSize
,
int
n
=
0
,
const
wxString
choices
[]
=
NULL
)
:
int
n
=
0
,
const
wxString
choices
[]
=
NULL
)
:
wxComboBox
(
parent
,
id
,
wxEmptyString
,
pos
,
size
,
wxComboBox
(
parent
,
id
,
wxEmptyString
,
pos
,
size
,
n
,
choices
,
wxCB_READONLY
)
n
,
choices
,
wxCB_READONLY
)
{
{
}
}
WinEDAChoiceBox
(
wxWindow
*
parent
,
wxWindowID
id
,
WinEDAChoiceBox
(
wxWindow
*
parent
,
wxWindowID
id
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
const
wxArrayString
&
choices
)
:
const
wxArrayString
&
choices
)
:
wxComboBox
(
parent
,
id
,
wxEmptyString
,
pos
,
size
,
wxComboBox
(
parent
,
id
,
wxEmptyString
,
pos
,
size
,
choices
,
wxCB_READONLY
)
choices
,
wxCB_READONLY
)
{
{
}
}
int
GetChoice
(
void
){
int
GetChoice
(
void
)
{
return
GetCurrentSelection
();
return
GetCurrentSelection
();
}
}
};
};
#endif
/* WXSTRUCT_H */
#endif
/* WXSTRUCT_H */
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