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
af048ff2
Commit
af048ff2
authored
Dec 20, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Italic option for pcb texts
parent
f1eb69a1
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
244 additions
and
221 deletions
+244
-221
dialog_edit_label.cpp
eeschema/dialog_edit_label.cpp
+3
-3
wxPcbStruct.h
include/wxPcbStruct.h
+1
-2
CMakeLists.txt
pcbnew/CMakeLists.txt
+2
-1
class_pcb_text.cpp
pcbnew/class_pcb_text.cpp
+16
-8
dialog_pcb_text_properties.cpp
pcbnew/dialog_pcb_text_properties.cpp
+30
-201
edit.cpp
pcbnew/edit.cpp
+1
-2
edit_pcb_text.cpp
pcbnew/edit_pcb_text.cpp
+187
-0
makefile.include
pcbnew/makefile.include
+3
-2
onleftclick.cpp
pcbnew/onleftclick.cpp
+1
-2
No files found.
eeschema/dialog_edit_label.cpp
View file @
af048ff2
...
...
@@ -26,6 +26,8 @@ void DialogLabelEditor::OnInitDialog( wxInitDialogEvent& event )
{
wxString
msg
;
SetFont
(
*
g_DialogFont
);
m_TextLabel
->
SetValue
(
m_CurrentText
->
m_Text
);
m_TextLabel
->
SetFocus
();
...
...
@@ -64,9 +66,7 @@ wxString msg;
msg
=
ReturnStringFromValue
(
g_UnitMetric
,
m_CurrentText
->
m_Size
.
x
,
m_Parent
->
m_InternalUnits
);
m_TextSize
->
SetValue
(
msg
);
SetFocus
();
if
(
m_CurrentText
->
Type
()
!=
TYPE_SCH_GLOBALLABEL
&&
m_CurrentText
->
Type
()
!=
TYPE_SCH_HIERLABEL
)
m_TextShape
->
Show
(
false
);
...
...
include/wxPcbStruct.h
View file @
af048ff2
...
...
@@ -453,8 +453,7 @@ public:
void
Delete_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
StartMoveTextePcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
Place_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
);
void
InstallTextPCBOptionsFrame
(
TEXTE_PCB
*
TextPCB
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
void
InstallTextPCBOptionsFrame
(
TEXTE_PCB
*
TextPCB
,
wxDC
*
DC
);
// Graphic Segments type DRAWSEGMENT
void
Start_Move_DrawItem
(
DRAWSEGMENT
*
drawitem
,
wxDC
*
DC
);
...
...
pcbnew/CMakeLists.txt
View file @
af048ff2
...
...
@@ -56,6 +56,7 @@ set(PCBNEW_SRCS
# dialog_graphic_items_options.cpp
# dialog_initpcb.cpp
# dialog_netlist.cpp
dialog_pcb_text_properties.cpp
zones_non_copper_type_functions.cpp
dialog_non_copper_zones_properties_base.cpp
dialog_pad_properties.cpp
...
...
@@ -74,6 +75,7 @@ set(PCBNEW_SRCS
editmod.cpp
editrack.cpp
editrack-part2.cpp
edit_pcb_text.cpp
edit_track_width.cpp
edtxtmod.cpp
export_gencad.cpp
...
...
@@ -114,7 +116,6 @@ set(PCBNEW_SRCS
pcbframe.cpp
pcbnew.cpp
pcbplot.cpp
pcbtexte.cpp
plotgerb.cpp
plothpgl.cpp
plotps.cpp
...
...
pcbnew/class_pcb_text.cpp
View file @
af048ff2
/************************************/
/*
fonctions de la classe TEXTE_PCB
*/
/************************************/
/************************************
*********************
/
/*
class TEXTE_PCB : texts on copper or technical layers
*/
/************************************
*********************
/
#include "fctsys.h"
#include "wxstruct.h"
...
...
@@ -40,7 +40,7 @@ void TEXTE_PCB::Copy( TEXTE_PCB* source )
m_Layer
=
source
->
m_Layer
;
m_Width
=
source
->
m_Width
;
m_Attributs
=
source
->
m_Attributs
;
m_Italic
=
source
->
m_Italic
;
m_Italic
=
source
->
m_Italic
;
m_HJustify
=
source
->
m_HJustify
;
m_VJustify
=
source
->
m_VJustify
;
...
...
@@ -53,7 +53,7 @@ int TEXTE_PCB::ReadTextePcbDescr( FILE* File, int* LineNum )
/****************************************************************/
{
char
text
[
1024
],
Line
[
1024
];
int
dummy
;
char
style
[
256
]
;
while
(
GetLine
(
File
,
Line
,
LineNum
)
!=
NULL
)
{
...
...
@@ -77,13 +77,18 @@ int TEXTE_PCB::ReadTextePcbDescr( FILE* File, int* LineNum )
}
if
(
strncmp
(
Line
,
"De"
,
2
)
==
0
)
{
sscanf
(
Line
+
2
,
" %d %d %lX %d
\n
"
,
&
m_Layer
,
&
m_Miroir
,
&
m_TimeStamp
,
&
dummy
);
style
[
0
]
=
0
;
sscanf
(
Line
+
2
,
" %d %d %lX %s
\n
"
,
&
m_Layer
,
&
m_Miroir
,
&
m_TimeStamp
,
style
);
if
(
m_Layer
<
FIRST_COPPER_LAYER
)
m_Layer
=
FIRST_COPPER_LAYER
;
if
(
m_Layer
>
LAST_NO_COPPER_LAYER
)
m_Layer
=
LAST_NO_COPPER_LAYER
;
if
(
strnicmp
(
style
,
"Italic"
,
6
)
==
0
)
m_Italic
=
1
;
else
m_Italic
=
0
;
continue
;
}
}
...
...
@@ -92,7 +97,9 @@ int TEXTE_PCB::ReadTextePcbDescr( FILE* File, int* LineNum )
}
/*****************************************/
bool
TEXTE_PCB
::
Save
(
FILE
*
aFile
)
const
/*****************************************/
{
if
(
GetState
(
DELETED
)
)
return
true
;
...
...
@@ -101,6 +108,7 @@ bool TEXTE_PCB::Save( FILE* aFile ) const
return
true
;
bool
rc
=
false
;
const
char
*
style
=
m_Italic
?
"Italic"
:
"Normal"
;
if
(
fprintf
(
aFile
,
"$TEXTPCB
\n
"
)
!=
sizeof
(
"$TEXTPCB
\n
"
)
-
1
)
goto
out
;
...
...
@@ -108,7 +116,7 @@ bool TEXTE_PCB::Save( FILE* aFile ) const
fprintf
(
aFile
,
"Te
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
m_Text
)
);
fprintf
(
aFile
,
"Po %d %d %d %d %d %d
\n
"
,
m_Pos
.
x
,
m_Pos
.
y
,
m_Size
.
x
,
m_Size
.
y
,
m_Width
,
m_Orient
);
fprintf
(
aFile
,
"De %d %d %lX %
d
\n
"
,
m_Layer
,
m_Miroir
,
m_TimeStamp
,
0
);
fprintf
(
aFile
,
"De %d %d %lX %
s
\n
"
,
m_Layer
,
m_Miroir
,
m_TimeStamp
,
style
);
if
(
fprintf
(
aFile
,
"$EndTEXTPCB
\n
"
)
!=
sizeof
(
"$EndTEXTPCB
\n
"
)
-
1
)
goto
out
;
...
...
pcbnew/
pcbtexte
.cpp
→
pcbnew/
dialog_pcb_text_properties
.cpp
View file @
af048ff2
This diff is collapsed.
Click to expand it.
pcbnew/edit.cpp
View file @
af048ff2
...
...
@@ -784,8 +784,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
case
ID_POPUP_PCB_EDIT_TEXTEPCB
:
InstallTextPCBOptionsFrame
(
(
TEXTE_PCB
*
)
GetCurItem
(),
&
dc
,
pos
);
InstallTextPCBOptionsFrame
(
(
TEXTE_PCB
*
)
GetCurItem
(),
&
dc
);
DrawPanel
->
MouseToCursorSchema
();
break
;
...
...
pcbnew/edit_pcb_text.cpp
0 → 100644
View file @
af048ff2
/*********************************************************************/
/* Edition of texts on copper and technical layers (TEXTE_PCB class) */
/*********************************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "pcbnew.h"
#include "protos.h"
/* Local functions */
static
void
Move_Texte_Pcb
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
bool
erase
);
static
void
Abort_Edit_Pcb_Text
(
WinEDA_DrawPanel
*
Panel
,
wxDC
*
DC
);
/* Local variables : */
static
wxPoint
old_pos
;
// initial position of the text when moving it
/*************************************************************/
void
Abort_Edit_Pcb_Text
(
WinEDA_DrawPanel
*
Panel
,
wxDC
*
DC
)
/*************************************************************/
/*
* Routine de sortie du menu edit texte Pcb
* Si un texte est selectionne, ses coord initiales sont regenerees
*/
{
TEXTE_PCB
*
TextePcb
;
TextePcb
=
(
TEXTE_PCB
*
)
Panel
->
GetScreen
()
->
GetCurItem
();
if
(
TextePcb
)
{
TextePcb
->
Draw
(
Panel
,
DC
,
GR_XOR
);
TextePcb
->
m_Pos
=
old_pos
;
TextePcb
->
Draw
(
Panel
,
DC
,
GR_OR
);
TextePcb
->
m_Flags
=
0
;
}
Panel
->
ManageCurseur
=
NULL
;
Panel
->
ForceCloseManageCurseur
=
NULL
;
((
WinEDA_PcbFrame
*
)
Panel
->
m_Parent
)
->
SetCurItem
(
NULL
);
}
/*********************************************************************/
void
WinEDA_PcbFrame
::
Place_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
)
/*********************************************************************/
/*
* Place the current text being moving
*/
{
if
(
TextePcb
==
NULL
)
return
;
TextePcb
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
DrawPanel
->
ManageCurseur
=
NULL
;
DrawPanel
->
ForceCloseManageCurseur
=
NULL
;
SetCurItem
(
NULL
);
GetScreen
()
->
SetModify
();
TextePcb
->
m_Flags
=
0
;
}
/***********************************************************************/
void
WinEDA_PcbFrame
::
StartMoveTextePcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
)
/***********************************************************************/
/* Initialise parameters to move a pcb text
*/
{
if
(
TextePcb
==
NULL
)
return
;
old_pos
=
TextePcb
->
m_Pos
;
TextePcb
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
TextePcb
->
m_Flags
|=
IS_MOVED
;
TextePcb
->
Display_Infos
(
this
);
DrawPanel
->
ManageCurseur
=
Move_Texte_Pcb
;
DrawPanel
->
ForceCloseManageCurseur
=
Abort_Edit_Pcb_Text
;
SetCurItem
(
TextePcb
);
DrawPanel
->
ManageCurseur
(
DrawPanel
,
DC
,
FALSE
);
}
/*************************************************************************/
static
void
Move_Texte_Pcb
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
bool
erase
)
/*************************************************************************/
/* Routine deplacant le texte PCB suivant le curseur de la souris */
{
TEXTE_PCB
*
TextePcb
=
(
TEXTE_PCB
*
)
panel
->
GetScreen
()
->
GetCurItem
();
if
(
TextePcb
==
NULL
)
return
;
/* effacement du texte : */
if
(
erase
)
TextePcb
->
Draw
(
panel
,
DC
,
GR_XOR
);
TextePcb
->
m_Pos
=
panel
->
GetScreen
()
->
m_Curseur
;
/* Redessin du Texte */
TextePcb
->
Draw
(
panel
,
DC
,
GR_XOR
);
}
/**********************************************************************/
void
WinEDA_PcbFrame
::
Delete_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
)
/**********************************************************************/
{
if
(
TextePcb
==
NULL
)
return
;
TextePcb
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
/* Suppression du texte en Memoire*/
TextePcb
->
DeleteStructure
();
DrawPanel
->
ManageCurseur
=
NULL
;
DrawPanel
->
ForceCloseManageCurseur
=
NULL
;
SetCurItem
(
NULL
);
}
/*******************************************************/
TEXTE_PCB
*
WinEDA_PcbFrame
::
Create_Texte_Pcb
(
wxDC
*
DC
)
/*******************************************************/
{
TEXTE_PCB
*
TextePcb
;
TextePcb
=
new
TEXTE_PCB
(
m_Pcb
);
/* Chainage de la nouvelle structure en debut de liste */
m_Pcb
->
Add
(
TextePcb
);
/* Mise a jour des caracteristiques */
TextePcb
->
m_Flags
=
IS_NEW
;
TextePcb
->
SetLayer
(
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
);
TextePcb
->
m_Miroir
=
1
;
if
(
TextePcb
->
GetLayer
()
==
COPPER_LAYER_N
)
TextePcb
->
m_Miroir
=
0
;
TextePcb
->
m_Size
=
g_DesignSettings
.
m_PcbTextSize
;
TextePcb
->
m_Pos
=
GetScreen
()
->
m_Curseur
;
TextePcb
->
m_Width
=
g_DesignSettings
.
m_PcbTextWidth
;
InstallTextPCBOptionsFrame
(
TextePcb
,
DC
);
if
(
TextePcb
->
m_Text
.
IsEmpty
()
)
{
TextePcb
->
DeleteStructure
();
TextePcb
=
NULL
;
}
else
StartMoveTextePcb
(
TextePcb
,
DC
);
return
TextePcb
;
}
/***********************************************************************/
void
WinEDA_PcbFrame
::
Rotate_Texte_Pcb
(
TEXTE_PCB
*
TextePcb
,
wxDC
*
DC
)
/***********************************************************************/
{
int
angle
=
900
;
int
drawmode
=
GR_XOR
;
if
(
TextePcb
==
NULL
)
return
;
/* effacement du texte : */
TextePcb
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
TextePcb
->
m_Orient
+=
angle
;
if
(
TextePcb
->
m_Orient
>=
3600
)
TextePcb
->
m_Orient
-=
3600
;
if
(
TextePcb
->
m_Orient
<
0
)
TextePcb
->
m_Orient
+=
3600
;
/* Redessin du Texte */
TextePcb
->
Draw
(
DrawPanel
,
DC
,
drawmode
);
TextePcb
->
Display_Infos
(
this
);
GetScreen
()
->
SetModify
();
}
pcbnew/makefile.include
View file @
af048ff2
...
...
@@ -30,6 +30,7 @@ OBJECTS= $(TARGET).o classpcb.o\
block_module_editor.o
\
dialog_pad_properties.o
\
dialog_pad_properties_base.o
\
dialog_pcb_text_properties.o
\
onrightclick.o
\
onleftclick.o
\
modedit_onclick.o
\
...
...
@@ -72,7 +73,7 @@ OBJECTS= $(TARGET).o classpcb.o\
tracemod.o
\
trpiste.o
\
surbrill.o
\
pcbtexte
.o
\
edit_pcb_text
.o
\
locate.o
\
modules.o
\
loadcmp.o
\
...
...
@@ -198,7 +199,7 @@ trpiste.o: trpiste.cpp
surbrill.o
:
surbrill.cpp
pcbtexte.o
:
pcbtexte
.cpp
edit_pcb_text.o
:
edit_pcb_text
.cpp
locate.o
:
locate.cpp
...
...
pcbnew/onleftclick.cpp
View file @
af048ff2
...
...
@@ -372,8 +372,7 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
break
;
case
TYPE_TEXTE
:
InstallTextPCBOptionsFrame
(
(
TEXTE_PCB
*
)
DrawStruct
,
DC
,
(
(
TEXTE_PCB
*
)
DrawStruct
)
->
m_Pos
);
InstallTextPCBOptionsFrame
(
(
TEXTE_PCB
*
)
DrawStruct
,
DC
);
DrawPanel
->
MouseToCursorSchema
();
break
;
...
...
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