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
b080f860
Commit
b080f860
authored
Nov 16, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: enhanced dialog for SVG export
parent
e435a104
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
474 additions
and
269 deletions
+474
-269
dialog_SVG_print.cpp
pcbnew/dialogs/dialog_SVG_print.cpp
+114
-60
dialog_SVG_print.h
pcbnew/dialogs/dialog_SVG_print.h
+9
-5
dialog_SVG_print_base.cpp
pcbnew/dialogs/dialog_SVG_print_base.cpp
+24
-13
dialog_SVG_print_base.fbp
pcbnew/dialogs/dialog_SVG_print_base.fbp
+274
-175
dialog_SVG_print_base.h
pcbnew/dialogs/dialog_SVG_print_base.h
+9
-7
dialog_plot.cpp
pcbnew/dialogs/dialog_plot.cpp
+1
-1
pcbplot.cpp
pcbnew/pcbplot.cpp
+13
-8
pcbplot.h
pcbnew/pcbplot.h
+30
-0
No files found.
pcbnew/dialogs/dialog_SVG_print.cpp
View file @
b080f860
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include <class_pcb_screen.h>
#include <class_pcb_screen.h>
#include <base_units.h>
#include <base_units.h>
#include <convert_from_iu.h>
#include <convert_from_iu.h>
#include <wildcards_and_files_ext.h>
#include <pcbnew.h>
#include <pcbnew.h>
#include <pcbplot.h>
#include <pcbplot.h>
...
@@ -56,15 +57,14 @@
...
@@ -56,15 +57,14 @@
static
long
s_SelectedLayers
=
LAYER_BACK
|
LAYER_FRONT
|
static
long
s_SelectedLayers
=
LAYER_BACK
|
LAYER_FRONT
|
SILKSCREEN_LAYER_FRONT
|
SILKSCREEN_LAYER_BACK
;
SILKSCREEN_LAYER_FRONT
|
SILKSCREEN_LAYER_BACK
;
/*
/*!
* DIALOG_SVG_PRINT functions
* DIALOG_SVG_PRINT functions
*/
*/
DIALOG_SVG_PRINT
::
DIALOG_SVG_PRINT
(
EDA_DRAW_FRAME
*
parent
)
:
DIALOG_SVG_PRINT
::
DIALOG_SVG_PRINT
(
EDA_DRAW_FRAME
*
parent
)
:
DIALOG_SVG_PRINT_base
(
parent
)
DIALOG_SVG_PRINT_base
(
parent
)
{
{
m_
P
arent
=
(
PCB_BASE_FRAME
*
)
parent
;
m_
p
arent
=
(
PCB_BASE_FRAME
*
)
parent
;
m_
C
onfig
=
wxGetApp
().
GetSettings
();
m_
c
onfig
=
wxGetApp
().
GetSettings
();
initDialog
();
initDialog
();
GetSizer
()
->
SetSizeHints
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
Centre
();
Centre
();
...
@@ -75,16 +75,21 @@ bool DIALOG_SVG_PRINT::m_oneFileOnly = false;
...
@@ -75,16 +75,21 @@ bool DIALOG_SVG_PRINT::m_oneFileOnly = false;
void
DIALOG_SVG_PRINT
::
initDialog
()
void
DIALOG_SVG_PRINT
::
initDialog
()
{
{
if
(
m_Config
)
m_board
=
m_parent
->
GetBoard
();
if
(
m_config
)
{
{
m_
C
onfig
->
Read
(
PLOTSVGMODECOLOR_KEY
,
&
m_printBW
,
false
);
m_
c
onfig
->
Read
(
PLOTSVGMODECOLOR_KEY
,
&
m_printBW
,
false
);
long
ltmp
;
long
ltmp
;
m_
C
onfig
->
Read
(
PLOTSVGPAGESIZEOPT_KEY
,
&
ltmp
,
0
);
m_
c
onfig
->
Read
(
PLOTSVGPAGESIZEOPT_KEY
,
&
ltmp
,
0
);
m_rbSvgPageSizeOpt
->
SetSelection
(
ltmp
);
m_rbSvgPageSizeOpt
->
SetSelection
(
ltmp
);
m_
C
onfig
->
Read
(
PLOTSVGPLOT_BRD_EDGE_KEY
,
&
ltmp
,
1
);
m_
c
onfig
->
Read
(
PLOTSVGPLOT_BRD_EDGE_KEY
,
&
ltmp
,
1
);
m_PrintBoardEdgesCtrl
->
SetValue
(
ltmp
);
m_PrintBoardEdgesCtrl
->
SetValue
(
ltmp
);
}
}
m_outputDirectory
=
m_parent
->
GetPlotSettings
().
GetOutputDirectory
();
m_outputDirectoryName
->
SetValue
(
m_outputDirectory
);
if
(
m_printBW
)
if
(
m_printBW
)
m_ModeColorOption
->
SetSelection
(
1
);
m_ModeColorOption
->
SetSelection
(
1
);
else
else
...
@@ -99,16 +104,14 @@ void DIALOG_SVG_PRINT::initDialog()
...
@@ -99,16 +104,14 @@ void DIALOG_SVG_PRINT::initDialog()
ReturnStringFromValue
(
g_UserUnit
,
g_DrawDefaultLineThickness
)
);
ReturnStringFromValue
(
g_UserUnit
,
g_DrawDefaultLineThickness
)
);
// Create layers list
// Create layers list
BOARD
*
board
=
m_Parent
->
GetBoard
();
int
layer
;
int
layer
;
for
(
layer
=
0
;
layer
<
NB_LAYERS
;
++
layer
)
for
(
layer
=
0
;
layer
<
NB_LAYERS
;
++
layer
)
{
{
if
(
!
board
->
IsLayerEnabled
(
layer
)
)
if
(
!
m_
board
->
IsLayerEnabled
(
layer
)
)
m_
B
oxSelectLayer
[
layer
]
=
NULL
;
m_
b
oxSelectLayer
[
layer
]
=
NULL
;
else
else
m_
B
oxSelectLayer
[
layer
]
=
m_
b
oxSelectLayer
[
layer
]
=
new
wxCheckBox
(
this
,
-
1
,
board
->
GetLayerName
(
layer
)
);
new
wxCheckBox
(
this
,
-
1
,
m_
board
->
GetLayerName
(
layer
)
);
}
}
// Add wxCheckBoxes in layers lists dialog
// Add wxCheckBoxes in layers lists dialog
...
@@ -122,27 +125,27 @@ void DIALOG_SVG_PRINT::initDialog()
...
@@ -122,27 +125,27 @@ void DIALOG_SVG_PRINT::initDialog()
wxASSERT
(
layer
<
NB_LAYERS
);
wxASSERT
(
layer
<
NB_LAYERS
);
if
(
m_
B
oxSelectLayer
[
layer
]
==
NULL
)
if
(
m_
b
oxSelectLayer
[
layer
]
==
NULL
)
continue
;
continue
;
long
mask
=
1
<<
layer
;
long
mask
=
1
<<
layer
;
if
(
mask
&
s_SelectedLayers
)
if
(
mask
&
s_SelectedLayers
)
m_
B
oxSelectLayer
[
layer
]
->
SetValue
(
true
);
m_
b
oxSelectLayer
[
layer
]
->
SetValue
(
true
);
if
(
layer
<
16
)
if
(
layer
<
16
)
m_CopperLayersBoxSizer
->
Add
(
m_
B
oxSelectLayer
[
layer
],
m_CopperLayersBoxSizer
->
Add
(
m_
b
oxSelectLayer
[
layer
],
0
,
0
,
wxGROW
|
wxALL
,
wxGROW
|
wxALL
,
1
);
1
);
else
else
m_TechnicalBoxSizer
->
Add
(
m_
B
oxSelectLayer
[
layer
],
m_TechnicalBoxSizer
->
Add
(
m_
b
oxSelectLayer
[
layer
],
0
,
0
,
wxGROW
|
wxALL
,
wxGROW
|
wxALL
,
1
);
1
);
}
}
if
(
m_
C
onfig
)
if
(
m_
c
onfig
)
{
{
wxString
layerKey
;
wxString
layerKey
;
...
@@ -150,17 +153,53 @@ void DIALOG_SVG_PRINT::initDialog()
...
@@ -150,17 +153,53 @@ void DIALOG_SVG_PRINT::initDialog()
{
{
bool
option
;
bool
option
;
if
(
m_
B
oxSelectLayer
[
layer
]
==
NULL
)
if
(
m_
b
oxSelectLayer
[
layer
]
==
NULL
)
continue
;
continue
;
layerKey
.
Printf
(
OPTKEY_LAYERBASE
,
layer
);
layerKey
.
Printf
(
OPTKEY_LAYERBASE
,
layer
);
if
(
m_
C
onfig
->
Read
(
layerKey
,
&
option
)
)
if
(
m_
c
onfig
->
Read
(
layerKey
,
&
option
)
)
m_
B
oxSelectLayer
[
layer
]
->
SetValue
(
option
);
m_
b
oxSelectLayer
[
layer
]
->
SetValue
(
option
);
}
}
}
}
}
}
void
DIALOG_SVG_PRINT
::
OnOutputDirectoryBrowseClicked
(
wxCommandEvent
&
event
)
{
// Build the absolute path of current output plot directory
// to preselect it when opening the dialog.
wxFileName
fn
(
m_outputDirectoryName
->
GetValue
()
);
wxString
path
;
if
(
fn
.
IsRelative
()
)
path
=
wxGetCwd
()
+
fn
.
GetPathSeparator
()
+
m_outputDirectoryName
->
GetValue
();
else
path
=
m_outputDirectoryName
->
GetValue
();
wxDirDialog
dirDialog
(
this
,
_
(
"Select Output Directory"
),
path
);
if
(
dirDialog
.
ShowModal
()
==
wxID_CANCEL
)
return
;
wxFileName
dirName
=
wxFileName
::
DirName
(
dirDialog
.
GetPath
()
);
wxMessageDialog
dialog
(
this
,
_
(
"Use a relative path? "
),
_
(
"Plot Output Directory"
),
wxYES_NO
|
wxICON_QUESTION
|
wxYES_DEFAULT
);
if
(
dialog
.
ShowModal
()
==
wxID_YES
)
{
wxString
boardFilePath
=
(
(
wxFileName
)
m_board
->
GetFileName
()
).
GetPath
();
if
(
!
dirName
.
MakeRelativeTo
(
boardFilePath
)
)
wxMessageBox
(
_
(
"Cannot make path relative (target volume different from board file volume)!"
),
_
(
"Plot Output Directory"
),
wxOK
|
wxICON_ERROR
);
}
m_outputDirectoryName
->
SetValue
(
dirName
.
GetFullPath
()
);
m_outputDirectory
=
m_outputDirectoryName
->
GetValue
();
}
void
DIALOG_SVG_PRINT
::
SetPenWidth
()
void
DIALOG_SVG_PRINT
::
SetPenWidth
()
{
{
...
@@ -182,8 +221,15 @@ void DIALOG_SVG_PRINT::SetPenWidth()
...
@@ -182,8 +221,15 @@ void DIALOG_SVG_PRINT::SetPenWidth()
void
DIALOG_SVG_PRINT
::
ExportSVGFile
(
bool
aOnlyOneFile
)
void
DIALOG_SVG_PRINT
::
ExportSVGFile
(
bool
aOnlyOneFile
)
{
{
wxFileName
fn
;
m_outputDirectory
=
m_outputDirectoryName
->
GetValue
();
wxString
msg
;
// Create output directory if it does not exist (also transform it in
// absolute form). Bail if it fails
wxFileName
outputDir
=
wxFileName
::
DirName
(
m_outputDirectory
);
wxString
boardFilename
=
m_board
->
GetFileName
();
if
(
!
EnsureOutputDirectory
(
&
outputDir
,
boardFilename
,
m_messagesBox
)
)
return
;
m_printMirror
=
m_printMirrorOpt
->
GetValue
();
m_printMirror
=
m_printMirrorOpt
->
GetValue
();
m_printBW
=
m_ModeColorOption
->
GetSelection
();
m_printBW
=
m_ModeColorOption
->
GetSelection
();
...
@@ -194,45 +240,41 @@ void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile )
...
@@ -194,45 +240,41 @@ void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile )
for
(
int
layer
=
0
;
layer
<
NB_LAYERS
;
layer
++
)
for
(
int
layer
=
0
;
layer
<
NB_LAYERS
;
layer
++
)
{
{
if
(
m_
BoxSelectLayer
[
layer
]
&&
m_B
oxSelectLayer
[
layer
]
->
GetValue
()
)
if
(
m_
boxSelectLayer
[
layer
]
&&
m_b
oxSelectLayer
[
layer
]
->
GetValue
()
)
printMaskLayer
|=
1
<<
layer
;
printMaskLayer
|=
1
<<
layer
;
}
}
wxString
msg
;
for
(
int
layer
=
0
;
layer
<
NB_LAYERS
;
layer
++
)
for
(
int
layer
=
0
;
layer
<
NB_LAYERS
;
layer
++
)
{
{
int
currlayer_mask
=
1
<<
layer
;
int
currlayer_mask
=
1
<<
layer
;
if
(
(
printMaskLayer
&
currlayer_mask
)
==
0
)
if
(
(
printMaskLayer
&
currlayer_mask
)
==
0
)
continue
;
continue
;
fn
=
m_FileNameCtrl
->
GetValue
();
wxString
suffix
=
m_board
->
GetLayerName
(
layer
,
false
);
if
(
!
fn
.
IsOk
()
)
fn
=
m_Parent
->
GetBoard
()
->
GetFileName
();
if
(
aOnlyOneFile
)
if
(
aOnlyOneFile
)
{
{
m_
P
rintMaskLayer
=
printMaskLayer
;
m_
p
rintMaskLayer
=
printMaskLayer
;
fn
.
SetName
(
fn
.
GetName
()
+
wxT
(
"-brd"
)
);
suffix
=
wxT
(
"-brd"
);
}
}
else
else
{
{
m_PrintMaskLayer
=
currlayer_mask
;
m_printMaskLayer
=
currlayer_mask
;
wxString
suffix
=
m_Parent
->
GetBoard
()
->
GetLayerName
(
layer
,
false
);
suffix
=
m_board
->
GetLayerName
(
layer
,
false
);
suffix
.
Trim
();
// remove leading and trailing spaces if any
suffix
.
Trim
(
false
);
fn
.
SetName
(
fn
.
GetName
()
+
wxT
(
"-"
)
+
suffix
);
}
}
fn
.
SetExt
(
wxT
(
"svg"
)
);
wxFileName
fn
(
boardFilename
);
BuildPlotFileName
(
&
fn
,
outputDir
.
GetPath
(),
suffix
,
SVGFileExtension
);
if
(
m_PrintBoardEdgesCtrl
->
IsChecked
()
)
if
(
m_PrintBoardEdgesCtrl
->
IsChecked
()
)
m_
P
rintMaskLayer
|=
EDGE_LAYER
;
m_
p
rintMaskLayer
|=
EDGE_LAYER
;
if
(
CreateSVGFile
(
fn
.
GetFullPath
()
)
)
if
(
CreateSVGFile
(
fn
.
GetFullPath
()
)
)
msg
.
Printf
(
_
(
"Plot: %s OK
\n
"
),
GetChars
(
fn
.
GetFullPath
()
)
);
msg
.
Printf
(
_
(
"Plot: %s OK
\n
"
),
GetChars
(
fn
.
GetFullPath
()
)
);
else
// Error
else
// Error
msg
.
Printf
(
_
(
"** Unable to create %s **
\n
"
),
GetChars
(
fn
.
GetFullPath
()
)
);
msg
.
Printf
(
_
(
"** Unable to create %s **
\n
"
),
GetChars
(
fn
.
GetFullPath
()
)
);
m_
M
essagesBox
->
AppendText
(
msg
);
m_
m
essagesBox
->
AppendText
(
msg
);
if
(
aOnlyOneFile
)
if
(
aOnlyOneFile
)
break
;
break
;
...
@@ -243,14 +285,12 @@ void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile )
...
@@ -243,14 +285,12 @@ void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile )
// Actual SVG file export function.
// Actual SVG file export function.
bool
DIALOG_SVG_PRINT
::
CreateSVGFile
(
const
wxString
&
aFullFileName
)
bool
DIALOG_SVG_PRINT
::
CreateSVGFile
(
const
wxString
&
aFullFileName
)
{
{
BOARD
*
brd
=
m_Parent
->
GetBoard
();
PCB_PLOT_PARAMS
m_plotOpts
;
PCB_PLOT_PARAMS
m_plotOpts
;
m_plotOpts
.
SetPlotFrameRef
(
PrintPageRef
()
);
m_plotOpts
.
SetPlotFrameRef
(
PrintPageRef
()
);
// Adding drill marks, for copper layers
// Adding drill marks, for copper layers
if
(
(
m_
P
rintMaskLayer
&
ALL_CU_LAYERS
)
)
if
(
(
m_
p
rintMaskLayer
&
ALL_CU_LAYERS
)
)
m_plotOpts
.
SetDrillMarksType
(
PCB_PLOT_PARAMS
::
FULL_DRILL_SHAPE
);
m_plotOpts
.
SetDrillMarksType
(
PCB_PLOT_PARAMS
::
FULL_DRILL_SHAPE
);
else
else
m_plotOpts
.
SetDrillMarksType
(
PCB_PLOT_PARAMS
::
NO_DRILL_SHAPE
);
m_plotOpts
.
SetDrillMarksType
(
PCB_PLOT_PARAMS
::
NO_DRILL_SHAPE
);
...
@@ -263,36 +303,36 @@ bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName )
...
@@ -263,36 +303,36 @@ bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName )
m_plotOpts
.
SetReferenceColor
(
color
);
m_plotOpts
.
SetReferenceColor
(
color
);
m_plotOpts
.
SetValueColor
(
color
);
m_plotOpts
.
SetValueColor
(
color
);
PAGE_INFO
pageInfo
=
b
rd
->
GetPageSettings
();
PAGE_INFO
pageInfo
=
m_boa
rd
->
GetPageSettings
();
wxPoint
axisorigin
=
b
rd
->
GetOriginAxisPosition
();
wxPoint
axisorigin
=
m_boa
rd
->
GetOriginAxisPosition
();
if
(
PageIsBoardBoundarySize
()
)
if
(
PageIsBoardBoundarySize
()
)
{
{
EDA_RECT
bbox
=
b
rd
->
ComputeBoundingBox
();
EDA_RECT
bbox
=
m_boa
rd
->
ComputeBoundingBox
();
PAGE_INFO
currpageInfo
=
b
rd
->
GetPageSettings
();
PAGE_INFO
currpageInfo
=
m_boa
rd
->
GetPageSettings
();
currpageInfo
.
SetWidthMils
(
bbox
.
GetWidth
()
/
IU_PER_MILS
);
currpageInfo
.
SetWidthMils
(
bbox
.
GetWidth
()
/
IU_PER_MILS
);
currpageInfo
.
SetHeightMils
(
bbox
.
GetHeight
()
/
IU_PER_MILS
);
currpageInfo
.
SetHeightMils
(
bbox
.
GetHeight
()
/
IU_PER_MILS
);
b
rd
->
SetPageSettings
(
currpageInfo
);
m_boa
rd
->
SetPageSettings
(
currpageInfo
);
m_plotOpts
.
SetUseAuxOrigin
(
true
);
m_plotOpts
.
SetUseAuxOrigin
(
true
);
wxPoint
origin
=
bbox
.
GetOrigin
();
wxPoint
origin
=
bbox
.
GetOrigin
();
b
rd
->
SetOriginAxisPosition
(
origin
);
m_boa
rd
->
SetOriginAxisPosition
(
origin
);
}
}
LOCALE_IO
toggle
;
LOCALE_IO
toggle
;
SVG_PLOTTER
*
plotter
=
(
SVG_PLOTTER
*
)
StartPlotBoard
(
b
rd
,
SVG_PLOTTER
*
plotter
=
(
SVG_PLOTTER
*
)
StartPlotBoard
(
m_boa
rd
,
&
m_plotOpts
,
aFullFileName
,
&
m_plotOpts
,
aFullFileName
,
wxEmptyString
);
wxEmptyString
);
if
(
plotter
)
if
(
plotter
)
{
{
plotter
->
SetColorMode
(
m_ModeColorOption
->
GetSelection
()
==
0
);
plotter
->
SetColorMode
(
m_ModeColorOption
->
GetSelection
()
==
0
);
PlotStandardLayer
(
brd
,
plotter
,
m_PrintMaskLayer
,
m_plotOpts
);
PlotStandardLayer
(
m_board
,
plotter
,
m_printMaskLayer
,
m_plotOpts
);
plotter
->
EndPlot
();
}
}
plotter
->
EndPlot
();
delete
plotter
;
delete
plotter
;
b
rd
->
SetOriginAxisPosition
(
axisorigin
);
m_boa
rd
->
SetOriginAxisPosition
(
axisorigin
);
b
rd
->
SetPageSettings
(
pageInfo
);
m_boa
rd
->
SetPageSettings
(
pageInfo
);
return
true
;
return
true
;
}
}
...
@@ -316,23 +356,37 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event )
...
@@ -316,23 +356,37 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event )
m_printBW
=
m_ModeColorOption
->
GetSelection
();
m_printBW
=
m_ModeColorOption
->
GetSelection
();
m_oneFileOnly
=
m_rbFileOpt
->
GetSelection
()
==
1
;
m_oneFileOnly
=
m_rbFileOpt
->
GetSelection
()
==
1
;
if
(
m_
C
onfig
)
if
(
m_
c
onfig
)
{
{
m_
C
onfig
->
Write
(
PLOTSVGMODECOLOR_KEY
,
m_printBW
);
m_
c
onfig
->
Write
(
PLOTSVGMODECOLOR_KEY
,
m_printBW
);
m_
C
onfig
->
Write
(
PLOTSVGPAGESIZEOPT_KEY
,
m_rbSvgPageSizeOpt
->
GetSelection
()
);
m_
c
onfig
->
Write
(
PLOTSVGPAGESIZEOPT_KEY
,
m_rbSvgPageSizeOpt
->
GetSelection
()
);
m_
C
onfig
->
Write
(
PLOTSVGPLOT_BRD_EDGE_KEY
,
m_PrintBoardEdgesCtrl
->
GetValue
()
);
m_
c
onfig
->
Write
(
PLOTSVGPLOT_BRD_EDGE_KEY
,
m_PrintBoardEdgesCtrl
->
GetValue
()
);
wxString
layerKey
;
wxString
layerKey
;
for
(
int
layer
=
0
;
layer
<
NB_LAYERS
;
++
layer
)
for
(
int
layer
=
0
;
layer
<
NB_LAYERS
;
++
layer
)
{
{
if
(
m_
B
oxSelectLayer
[
layer
]
==
NULL
)
if
(
m_
b
oxSelectLayer
[
layer
]
==
NULL
)
continue
;
continue
;
layerKey
.
Printf
(
OPTKEY_LAYERBASE
,
layer
);
layerKey
.
Printf
(
OPTKEY_LAYERBASE
,
layer
);
m_
Config
->
Write
(
layerKey
,
m_B
oxSelectLayer
[
layer
]
->
IsChecked
()
);
m_
config
->
Write
(
layerKey
,
m_b
oxSelectLayer
[
layer
]
->
IsChecked
()
);
}
}
}
}
// Set output directory and replace backslashes with forward ones
wxString
dirStr
;
dirStr
=
m_outputDirectoryName
->
GetValue
();
dirStr
.
Replace
(
wxT
(
"
\\
"
),
wxT
(
"/"
)
);
if
(
dirStr
!=
m_parent
->
GetPlotSettings
().
GetOutputDirectory
()
)
{
PCB_PLOT_PARAMS
tempOptions
(
m_parent
->
GetPlotSettings
()
);
tempOptions
.
SetOutputDirectory
(
dirStr
);
m_parent
->
SetPlotSettings
(
tempOptions
);
m_parent
->
OnModify
();
}
EndModal
(
0
);
EndModal
(
0
);
}
}
pcbnew/dialogs/dialog_SVG_print.h
View file @
b080f860
...
@@ -14,11 +14,14 @@ class wxConfig;
...
@@ -14,11 +14,14 @@ class wxConfig;
class
DIALOG_SVG_PRINT
:
public
DIALOG_SVG_PRINT_base
class
DIALOG_SVG_PRINT
:
public
DIALOG_SVG_PRINT_base
{
{
private
:
private
:
PCB_BASE_FRAME
*
m_Parent
;
PCB_BASE_FRAME
*
m_parent
;
wxConfig
*
m_Config
;
BOARD
*
m_board
;
long
m_PrintMaskLayer
;
wxConfig
*
m_config
;
wxCheckBox
*
m_BoxSelectLayer
[
32
];
long
m_printMaskLayer
;
bool
m_printBW
;
wxCheckBox
*
m_boxSelectLayer
[
32
];
bool
m_printBW
;
wxString
m_outputDirectory
;
// Static member to store options
// Static member to store options
static
bool
m_printMirror
;
static
bool
m_printMirror
;
static
bool
m_oneFileOnly
;
static
bool
m_oneFileOnly
;
...
@@ -32,6 +35,7 @@ private:
...
@@ -32,6 +35,7 @@ private:
void
initDialog
(
);
void
initDialog
(
);
void
OnButtonPlot
(
wxCommandEvent
&
event
);
void
OnButtonPlot
(
wxCommandEvent
&
event
);
void
OnButtonCancelClick
(
wxCommandEvent
&
event
);
void
OnButtonCancelClick
(
wxCommandEvent
&
event
);
void
OnOutputDirectoryBrowseClicked
(
wxCommandEvent
&
event
);
void
SetPenWidth
();
void
SetPenWidth
();
void
ExportSVGFile
(
bool
aOnlyOneFile
);
void
ExportSVGFile
(
bool
aOnlyOneFile
);
bool
PageIsBoardBoundarySize
()
bool
PageIsBoardBoundarySize
()
...
...
pcbnew/dialogs/dialog_SVG_print_base.cpp
View file @
b080f860
...
@@ -16,6 +16,25 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
...
@@ -16,6 +16,25 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
wxBoxSizer
*
bMainSizer
;
wxBoxSizer
*
bMainSizer
;
bMainSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
bMainSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_staticTextDir
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Output directory:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticTextDir
->
Wrap
(
-
1
);
bMainSizer
->
Add
(
m_staticTextDir
,
0
,
wxTOP
|
wxRIGHT
|
wxLEFT
,
5
);
wxBoxSizer
*
bSizer4
;
bSizer4
=
new
wxBoxSizer
(
wxHORIZONTAL
);
m_outputDirectoryName
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_outputDirectoryName
->
SetToolTip
(
_
(
"Enter a filename if you do not want to use default file names
\n
Can be used only when printing the current sheet"
)
);
m_outputDirectoryName
->
SetMinSize
(
wxSize
(
450
,
-
1
)
);
bSizer4
->
Add
(
m_outputDirectoryName
,
1
,
wxRIGHT
|
wxLEFT
|
wxALIGN_CENTER_VERTICAL
,
5
);
m_browseButton
=
new
wxButton
(
this
,
wxID_ANY
,
_
(
"Browse..."
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bSizer4
->
Add
(
m_browseButton
,
0
,
wxRIGHT
|
wxLEFT
|
wxALIGN_CENTER_VERTICAL
,
5
);
bMainSizer
->
Add
(
bSizer4
,
0
,
wxEXPAND
|
wxBOTTOM
,
5
);
wxBoxSizer
*
bUpperSizer
;
wxBoxSizer
*
bUpperSizer
;
bUpperSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
bUpperSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
...
@@ -94,24 +113,14 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
...
@@ -94,24 +113,14 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
bMainSizer
->
Add
(
bUpperSizer
,
0
,
wxEXPAND
,
5
);
bMainSizer
->
Add
(
bUpperSizer
,
0
,
wxEXPAND
,
5
);
m_staticText1
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Filename:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticText1
->
Wrap
(
-
1
);
bMainSizer
->
Add
(
m_staticText1
,
0
,
wxTOP
|
wxRIGHT
|
wxLEFT
,
5
);
m_FileNameCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_FileNameCtrl
->
SetToolTip
(
_
(
"Enter a filename if you do not want to use default file names
\n
Can be used only when printing the current sheet"
)
);
m_FileNameCtrl
->
SetMinSize
(
wxSize
(
450
,
-
1
)
);
bMainSizer
->
Add
(
m_FileNameCtrl
,
0
,
wxEXPAND
|
wxBOTTOM
|
wxRIGHT
|
wxLEFT
,
5
);
m_staticText2
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Messages:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticText2
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Messages:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticText2
->
Wrap
(
-
1
);
m_staticText2
->
Wrap
(
-
1
);
bMainSizer
->
Add
(
m_staticText2
,
0
,
wxTOP
|
wxRIGHT
|
wxLEFT
,
5
);
bMainSizer
->
Add
(
m_staticText2
,
0
,
wxTOP
|
wxRIGHT
|
wxLEFT
,
5
);
m_
M
essagesBox
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
wxTE_MULTILINE
);
m_
m
essagesBox
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
wxTE_MULTILINE
);
m_
M
essagesBox
->
SetMinSize
(
wxSize
(
-
1
,
100
)
);
m_
m
essagesBox
->
SetMinSize
(
wxSize
(
-
1
,
100
)
);
bMainSizer
->
Add
(
m_
M
essagesBox
,
1
,
wxBOTTOM
|
wxRIGHT
|
wxLEFT
|
wxEXPAND
,
5
);
bMainSizer
->
Add
(
m_
m
essagesBox
,
1
,
wxBOTTOM
|
wxRIGHT
|
wxLEFT
|
wxEXPAND
,
5
);
this
->
SetSizer
(
bMainSizer
);
this
->
SetSizer
(
bMainSizer
);
...
@@ -119,6 +128,7 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
...
@@ -119,6 +128,7 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
// Connect Events
// Connect Events
this
->
Connect
(
wxEVT_CLOSE_WINDOW
,
wxCloseEventHandler
(
DIALOG_SVG_PRINT_base
::
OnCloseWindow
)
);
this
->
Connect
(
wxEVT_CLOSE_WINDOW
,
wxCloseEventHandler
(
DIALOG_SVG_PRINT_base
::
OnCloseWindow
)
);
m_browseButton
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_SVG_PRINT_base
::
OnOutputDirectoryBrowseClicked
),
NULL
,
this
);
m_buttonCreateFile
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_SVG_PRINT_base
::
OnButtonPlot
),
NULL
,
this
);
m_buttonCreateFile
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_SVG_PRINT_base
::
OnButtonPlot
),
NULL
,
this
);
m_buttonQuit
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_SVG_PRINT_base
::
OnButtonCancelClick
),
NULL
,
this
);
m_buttonQuit
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_SVG_PRINT_base
::
OnButtonCancelClick
),
NULL
,
this
);
}
}
...
@@ -127,6 +137,7 @@ DIALOG_SVG_PRINT_base::~DIALOG_SVG_PRINT_base()
...
@@ -127,6 +137,7 @@ DIALOG_SVG_PRINT_base::~DIALOG_SVG_PRINT_base()
{
{
// Disconnect Events
// Disconnect Events
this
->
Disconnect
(
wxEVT_CLOSE_WINDOW
,
wxCloseEventHandler
(
DIALOG_SVG_PRINT_base
::
OnCloseWindow
)
);
this
->
Disconnect
(
wxEVT_CLOSE_WINDOW
,
wxCloseEventHandler
(
DIALOG_SVG_PRINT_base
::
OnCloseWindow
)
);
m_browseButton
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_SVG_PRINT_base
::
OnOutputDirectoryBrowseClicked
),
NULL
,
this
);
m_buttonCreateFile
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_SVG_PRINT_base
::
OnButtonPlot
),
NULL
,
this
);
m_buttonCreateFile
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_SVG_PRINT_base
::
OnButtonPlot
),
NULL
,
this
);
m_buttonQuit
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_SVG_PRINT_base
::
OnButtonCancelClick
),
NULL
,
this
);
m_buttonQuit
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_SVG_PRINT_base
::
OnButtonCancelClick
),
NULL
,
this
);
...
...
pcbnew/dialogs/dialog_SVG_print_base.fbp
View file @
b080f860
...
@@ -91,6 +91,279 @@
...
@@ -91,6 +91,279 @@
<property
name=
"name"
>
bMainSizer
</property>
<property
name=
"name"
>
bMainSizer
</property>
<property
name=
"orient"
>
wxVERTICAL
</property>
<property
name=
"orient"
>
wxVERTICAL
</property>
<property
name=
"permission"
>
none
</property>
<property
name=
"permission"
>
none
</property>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxTOP|wxRIGHT|wxLEFT
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wxStaticText"
expanded=
"1"
>
<property
name=
"BottomDockable"
>
1
</property>
<property
name=
"LeftDockable"
>
1
</property>
<property
name=
"RightDockable"
>
1
</property>
<property
name=
"TopDockable"
>
1
</property>
<property
name=
"aui_layer"
></property>
<property
name=
"aui_name"
></property>
<property
name=
"aui_position"
></property>
<property
name=
"aui_row"
></property>
<property
name=
"best_size"
></property>
<property
name=
"bg"
></property>
<property
name=
"caption"
></property>
<property
name=
"caption_visible"
>
1
</property>
<property
name=
"center_pane"
>
0
</property>
<property
name=
"close_button"
>
1
</property>
<property
name=
"context_help"
></property>
<property
name=
"context_menu"
>
1
</property>
<property
name=
"default_pane"
>
0
</property>
<property
name=
"dock"
>
Dock
</property>
<property
name=
"dock_fixed"
>
0
</property>
<property
name=
"docking"
>
Left
</property>
<property
name=
"enabled"
>
1
</property>
<property
name=
"fg"
></property>
<property
name=
"floatable"
>
1
</property>
<property
name=
"font"
></property>
<property
name=
"gripper"
>
0
</property>
<property
name=
"hidden"
>
0
</property>
<property
name=
"id"
>
wxID_ANY
</property>
<property
name=
"label"
>
Output directory:
</property>
<property
name=
"max_size"
></property>
<property
name=
"maximize_button"
>
0
</property>
<property
name=
"maximum_size"
></property>
<property
name=
"min_size"
></property>
<property
name=
"minimize_button"
>
0
</property>
<property
name=
"minimum_size"
></property>
<property
name=
"moveable"
>
1
</property>
<property
name=
"name"
>
m_staticTextDir
</property>
<property
name=
"pane_border"
>
1
</property>
<property
name=
"pane_position"
></property>
<property
name=
"pane_size"
></property>
<property
name=
"permission"
>
protected
</property>
<property
name=
"pin_button"
>
1
</property>
<property
name=
"pos"
></property>
<property
name=
"resize"
>
Resizable
</property>
<property
name=
"show"
>
1
</property>
<property
name=
"size"
></property>
<property
name=
"style"
></property>
<property
name=
"subclass"
></property>
<property
name=
"toolbar_pane"
>
0
</property>
<property
name=
"tooltip"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
<property
name=
"wrap"
>
-1
</property>
<event
name=
"OnChar"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
<event
name=
"OnKeyDown"
></event>
<event
name=
"OnKeyUp"
></event>
<event
name=
"OnKillFocus"
></event>
<event
name=
"OnLeaveWindow"
></event>
<event
name=
"OnLeftDClick"
></event>
<event
name=
"OnLeftDown"
></event>
<event
name=
"OnLeftUp"
></event>
<event
name=
"OnMiddleDClick"
></event>
<event
name=
"OnMiddleDown"
></event>
<event
name=
"OnMiddleUp"
></event>
<event
name=
"OnMotion"
></event>
<event
name=
"OnMouseEvents"
></event>
<event
name=
"OnMouseWheel"
></event>
<event
name=
"OnPaint"
></event>
<event
name=
"OnRightDClick"
></event>
<event
name=
"OnRightDown"
></event>
<event
name=
"OnRightUp"
></event>
<event
name=
"OnSetFocus"
></event>
<event
name=
"OnSize"
></event>
<event
name=
"OnUpdateUI"
></event>
</object>
</object>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxEXPAND|wxBOTTOM
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wxBoxSizer"
expanded=
"1"
>
<property
name=
"minimum_size"
></property>
<property
name=
"name"
>
bSizer4
</property>
<property
name=
"orient"
>
wxHORIZONTAL
</property>
<property
name=
"permission"
>
none
</property>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL
</property>
<property
name=
"proportion"
>
1
</property>
<object
class=
"wxTextCtrl"
expanded=
"1"
>
<property
name=
"BottomDockable"
>
1
</property>
<property
name=
"LeftDockable"
>
1
</property>
<property
name=
"RightDockable"
>
1
</property>
<property
name=
"TopDockable"
>
1
</property>
<property
name=
"aui_layer"
></property>
<property
name=
"aui_name"
></property>
<property
name=
"aui_position"
></property>
<property
name=
"aui_row"
></property>
<property
name=
"best_size"
></property>
<property
name=
"bg"
></property>
<property
name=
"caption"
></property>
<property
name=
"caption_visible"
>
1
</property>
<property
name=
"center_pane"
>
0
</property>
<property
name=
"close_button"
>
1
</property>
<property
name=
"context_help"
></property>
<property
name=
"context_menu"
>
1
</property>
<property
name=
"default_pane"
>
0
</property>
<property
name=
"dock"
>
Dock
</property>
<property
name=
"dock_fixed"
>
0
</property>
<property
name=
"docking"
>
Left
</property>
<property
name=
"enabled"
>
1
</property>
<property
name=
"fg"
></property>
<property
name=
"floatable"
>
1
</property>
<property
name=
"font"
></property>
<property
name=
"gripper"
>
0
</property>
<property
name=
"hidden"
>
0
</property>
<property
name=
"id"
>
wxID_ANY
</property>
<property
name=
"max_size"
></property>
<property
name=
"maximize_button"
>
0
</property>
<property
name=
"maximum_size"
></property>
<property
name=
"maxlength"
>
0
</property>
<property
name=
"min_size"
></property>
<property
name=
"minimize_button"
>
0
</property>
<property
name=
"minimum_size"
>
450,-1
</property>
<property
name=
"moveable"
>
1
</property>
<property
name=
"name"
>
m_outputDirectoryName
</property>
<property
name=
"pane_border"
>
1
</property>
<property
name=
"pane_position"
></property>
<property
name=
"pane_size"
></property>
<property
name=
"permission"
>
protected
</property>
<property
name=
"pin_button"
>
1
</property>
<property
name=
"pos"
></property>
<property
name=
"resize"
>
Resizable
</property>
<property
name=
"show"
>
1
</property>
<property
name=
"size"
></property>
<property
name=
"style"
></property>
<property
name=
"subclass"
></property>
<property
name=
"toolbar_pane"
>
0
</property>
<property
name=
"tooltip"
>
Enter a filename if you do not want to use default file names


Can be used only when printing the current sheet
</property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"value"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
<event
name=
"OnChar"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
<event
name=
"OnKeyDown"
></event>
<event
name=
"OnKeyUp"
></event>
<event
name=
"OnKillFocus"
></event>
<event
name=
"OnLeaveWindow"
></event>
<event
name=
"OnLeftDClick"
></event>
<event
name=
"OnLeftDown"
></event>
<event
name=
"OnLeftUp"
></event>
<event
name=
"OnMiddleDClick"
></event>
<event
name=
"OnMiddleDown"
></event>
<event
name=
"OnMiddleUp"
></event>
<event
name=
"OnMotion"
></event>
<event
name=
"OnMouseEvents"
></event>
<event
name=
"OnMouseWheel"
></event>
<event
name=
"OnPaint"
></event>
<event
name=
"OnRightDClick"
></event>
<event
name=
"OnRightDown"
></event>
<event
name=
"OnRightUp"
></event>
<event
name=
"OnSetFocus"
></event>
<event
name=
"OnSize"
></event>
<event
name=
"OnText"
></event>
<event
name=
"OnTextEnter"
></event>
<event
name=
"OnTextMaxLen"
></event>
<event
name=
"OnTextURL"
></event>
<event
name=
"OnUpdateUI"
></event>
</object>
</object>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wxButton"
expanded=
"1"
>
<property
name=
"BottomDockable"
>
1
</property>
<property
name=
"LeftDockable"
>
1
</property>
<property
name=
"RightDockable"
>
1
</property>
<property
name=
"TopDockable"
>
1
</property>
<property
name=
"aui_layer"
></property>
<property
name=
"aui_name"
></property>
<property
name=
"aui_position"
></property>
<property
name=
"aui_row"
></property>
<property
name=
"best_size"
></property>
<property
name=
"bg"
></property>
<property
name=
"caption"
></property>
<property
name=
"caption_visible"
>
1
</property>
<property
name=
"center_pane"
>
0
</property>
<property
name=
"close_button"
>
1
</property>
<property
name=
"context_help"
></property>
<property
name=
"context_menu"
>
1
</property>
<property
name=
"default"
>
0
</property>
<property
name=
"default_pane"
>
0
</property>
<property
name=
"dock"
>
Dock
</property>
<property
name=
"dock_fixed"
>
0
</property>
<property
name=
"docking"
>
Left
</property>
<property
name=
"enabled"
>
1
</property>
<property
name=
"fg"
></property>
<property
name=
"floatable"
>
1
</property>
<property
name=
"font"
></property>
<property
name=
"gripper"
>
0
</property>
<property
name=
"hidden"
>
0
</property>
<property
name=
"id"
>
wxID_ANY
</property>
<property
name=
"label"
>
Browse...
</property>
<property
name=
"max_size"
></property>
<property
name=
"maximize_button"
>
0
</property>
<property
name=
"maximum_size"
></property>
<property
name=
"min_size"
></property>
<property
name=
"minimize_button"
>
0
</property>
<property
name=
"minimum_size"
></property>
<property
name=
"moveable"
>
1
</property>
<property
name=
"name"
>
m_browseButton
</property>
<property
name=
"pane_border"
>
1
</property>
<property
name=
"pane_position"
></property>
<property
name=
"pane_size"
></property>
<property
name=
"permission"
>
protected
</property>
<property
name=
"pin_button"
>
1
</property>
<property
name=
"pos"
></property>
<property
name=
"resize"
>
Resizable
</property>
<property
name=
"show"
>
1
</property>
<property
name=
"size"
></property>
<property
name=
"style"
></property>
<property
name=
"subclass"
></property>
<property
name=
"toolbar_pane"
>
0
</property>
<property
name=
"tooltip"
></property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
<event
name=
"OnButtonClick"
>
OnOutputDirectoryBrowseClicked
</event>
<event
name=
"OnChar"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
<event
name=
"OnKeyDown"
></event>
<event
name=
"OnKeyUp"
></event>
<event
name=
"OnKillFocus"
></event>
<event
name=
"OnLeaveWindow"
></event>
<event
name=
"OnLeftDClick"
></event>
<event
name=
"OnLeftDown"
></event>
<event
name=
"OnLeftUp"
></event>
<event
name=
"OnMiddleDClick"
></event>
<event
name=
"OnMiddleDown"
></event>
<event
name=
"OnMiddleUp"
></event>
<event
name=
"OnMotion"
></event>
<event
name=
"OnMouseEvents"
></event>
<event
name=
"OnMouseWheel"
></event>
<event
name=
"OnPaint"
></event>
<event
name=
"OnRightDClick"
></event>
<event
name=
"OnRightDown"
></event>
<event
name=
"OnRightUp"
></event>
<event
name=
"OnSetFocus"
></event>
<event
name=
"OnSize"
></event>
<event
name=
"OnUpdateUI"
></event>
</object>
</object>
</object>
</object>
<object
class=
"sizeritem"
expanded=
"1"
>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxEXPAND
</property>
<property
name=
"flag"
>
wxEXPAND
</property>
...
@@ -965,180 +1238,6 @@
...
@@ -965,180 +1238,6 @@
</object>
</object>
</object>
</object>
</object>
</object>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxTOP|wxRIGHT|wxLEFT
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wxStaticText"
expanded=
"1"
>
<property
name=
"BottomDockable"
>
1
</property>
<property
name=
"LeftDockable"
>
1
</property>
<property
name=
"RightDockable"
>
1
</property>
<property
name=
"TopDockable"
>
1
</property>
<property
name=
"aui_layer"
></property>
<property
name=
"aui_name"
></property>
<property
name=
"aui_position"
></property>
<property
name=
"aui_row"
></property>
<property
name=
"best_size"
></property>
<property
name=
"bg"
></property>
<property
name=
"caption"
></property>
<property
name=
"caption_visible"
>
1
</property>
<property
name=
"center_pane"
>
0
</property>
<property
name=
"close_button"
>
1
</property>
<property
name=
"context_help"
></property>
<property
name=
"context_menu"
>
1
</property>
<property
name=
"default_pane"
>
0
</property>
<property
name=
"dock"
>
Dock
</property>
<property
name=
"dock_fixed"
>
0
</property>
<property
name=
"docking"
>
Left
</property>
<property
name=
"enabled"
>
1
</property>
<property
name=
"fg"
></property>
<property
name=
"floatable"
>
1
</property>
<property
name=
"font"
></property>
<property
name=
"gripper"
>
0
</property>
<property
name=
"hidden"
>
0
</property>
<property
name=
"id"
>
wxID_ANY
</property>
<property
name=
"label"
>
Filename:
</property>
<property
name=
"max_size"
></property>
<property
name=
"maximize_button"
>
0
</property>
<property
name=
"maximum_size"
></property>
<property
name=
"min_size"
></property>
<property
name=
"minimize_button"
>
0
</property>
<property
name=
"minimum_size"
></property>
<property
name=
"moveable"
>
1
</property>
<property
name=
"name"
>
m_staticText1
</property>
<property
name=
"pane_border"
>
1
</property>
<property
name=
"pane_position"
></property>
<property
name=
"pane_size"
></property>
<property
name=
"permission"
>
protected
</property>
<property
name=
"pin_button"
>
1
</property>
<property
name=
"pos"
></property>
<property
name=
"resize"
>
Resizable
</property>
<property
name=
"show"
>
1
</property>
<property
name=
"size"
></property>
<property
name=
"style"
></property>
<property
name=
"subclass"
></property>
<property
name=
"toolbar_pane"
>
0
</property>
<property
name=
"tooltip"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
<property
name=
"wrap"
>
-1
</property>
<event
name=
"OnChar"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
<event
name=
"OnKeyDown"
></event>
<event
name=
"OnKeyUp"
></event>
<event
name=
"OnKillFocus"
></event>
<event
name=
"OnLeaveWindow"
></event>
<event
name=
"OnLeftDClick"
></event>
<event
name=
"OnLeftDown"
></event>
<event
name=
"OnLeftUp"
></event>
<event
name=
"OnMiddleDClick"
></event>
<event
name=
"OnMiddleDown"
></event>
<event
name=
"OnMiddleUp"
></event>
<event
name=
"OnMotion"
></event>
<event
name=
"OnMouseEvents"
></event>
<event
name=
"OnMouseWheel"
></event>
<event
name=
"OnPaint"
></event>
<event
name=
"OnRightDClick"
></event>
<event
name=
"OnRightDown"
></event>
<event
name=
"OnRightUp"
></event>
<event
name=
"OnSetFocus"
></event>
<event
name=
"OnSize"
></event>
<event
name=
"OnUpdateUI"
></event>
</object>
</object>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wxTextCtrl"
expanded=
"1"
>
<property
name=
"BottomDockable"
>
1
</property>
<property
name=
"LeftDockable"
>
1
</property>
<property
name=
"RightDockable"
>
1
</property>
<property
name=
"TopDockable"
>
1
</property>
<property
name=
"aui_layer"
></property>
<property
name=
"aui_name"
></property>
<property
name=
"aui_position"
></property>
<property
name=
"aui_row"
></property>
<property
name=
"best_size"
></property>
<property
name=
"bg"
></property>
<property
name=
"caption"
></property>
<property
name=
"caption_visible"
>
1
</property>
<property
name=
"center_pane"
>
0
</property>
<property
name=
"close_button"
>
1
</property>
<property
name=
"context_help"
></property>
<property
name=
"context_menu"
>
1
</property>
<property
name=
"default_pane"
>
0
</property>
<property
name=
"dock"
>
Dock
</property>
<property
name=
"dock_fixed"
>
0
</property>
<property
name=
"docking"
>
Left
</property>
<property
name=
"enabled"
>
1
</property>
<property
name=
"fg"
></property>
<property
name=
"floatable"
>
1
</property>
<property
name=
"font"
></property>
<property
name=
"gripper"
>
0
</property>
<property
name=
"hidden"
>
0
</property>
<property
name=
"id"
>
wxID_ANY
</property>
<property
name=
"max_size"
></property>
<property
name=
"maximize_button"
>
0
</property>
<property
name=
"maximum_size"
></property>
<property
name=
"maxlength"
>
0
</property>
<property
name=
"min_size"
></property>
<property
name=
"minimize_button"
>
0
</property>
<property
name=
"minimum_size"
>
450,-1
</property>
<property
name=
"moveable"
>
1
</property>
<property
name=
"name"
>
m_FileNameCtrl
</property>
<property
name=
"pane_border"
>
1
</property>
<property
name=
"pane_position"
></property>
<property
name=
"pane_size"
></property>
<property
name=
"permission"
>
protected
</property>
<property
name=
"pin_button"
>
1
</property>
<property
name=
"pos"
></property>
<property
name=
"resize"
>
Resizable
</property>
<property
name=
"show"
>
1
</property>
<property
name=
"size"
></property>
<property
name=
"style"
></property>
<property
name=
"subclass"
></property>
<property
name=
"toolbar_pane"
>
0
</property>
<property
name=
"tooltip"
>
Enter a filename if you do not want to use default file names


Can be used only when printing the current sheet
</property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"value"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
<event
name=
"OnChar"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
<event
name=
"OnKeyDown"
></event>
<event
name=
"OnKeyUp"
></event>
<event
name=
"OnKillFocus"
></event>
<event
name=
"OnLeaveWindow"
></event>
<event
name=
"OnLeftDClick"
></event>
<event
name=
"OnLeftDown"
></event>
<event
name=
"OnLeftUp"
></event>
<event
name=
"OnMiddleDClick"
></event>
<event
name=
"OnMiddleDown"
></event>
<event
name=
"OnMiddleUp"
></event>
<event
name=
"OnMotion"
></event>
<event
name=
"OnMouseEvents"
></event>
<event
name=
"OnMouseWheel"
></event>
<event
name=
"OnPaint"
></event>
<event
name=
"OnRightDClick"
></event>
<event
name=
"OnRightDown"
></event>
<event
name=
"OnRightUp"
></event>
<event
name=
"OnSetFocus"
></event>
<event
name=
"OnSize"
></event>
<event
name=
"OnText"
></event>
<event
name=
"OnTextEnter"
></event>
<event
name=
"OnTextMaxLen"
></event>
<event
name=
"OnTextURL"
></event>
<event
name=
"OnUpdateUI"
></event>
</object>
</object>
<object
class=
"sizeritem"
expanded=
"1"
>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxTOP|wxRIGHT|wxLEFT
</property>
<property
name=
"flag"
>
wxTOP|wxRIGHT|wxLEFT
</property>
...
@@ -1262,7 +1361,7 @@
...
@@ -1262,7 +1361,7 @@
<property
name=
"minimize_button"
>
0
</property>
<property
name=
"minimize_button"
>
0
</property>
<property
name=
"minimum_size"
>
-1,100
</property>
<property
name=
"minimum_size"
>
-1,100
</property>
<property
name=
"moveable"
>
1
</property>
<property
name=
"moveable"
>
1
</property>
<property
name=
"name"
>
m_
M
essagesBox
</property>
<property
name=
"name"
>
m_
m
essagesBox
</property>
<property
name=
"pane_border"
>
1
</property>
<property
name=
"pane_border"
>
1
</property>
<property
name=
"pane_position"
></property>
<property
name=
"pane_position"
></property>
<property
name=
"pane_size"
></property>
<property
name=
"pane_size"
></property>
...
...
pcbnew/dialogs/dialog_SVG_print_base.h
View file @
b080f860
...
@@ -13,17 +13,17 @@
...
@@ -13,17 +13,17 @@
#include <wx/intl.h>
#include <wx/intl.h>
#include "dialog_shim.h"
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/string.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/gdicmn.h>
#include <wx/stattext.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/radiobox.h>
#include <wx/radiobox.h>
#include <wx/checkbox.h>
#include <wx/checkbox.h>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
...
@@ -41,6 +41,9 @@ class DIALOG_SVG_PRINT_base : public DIALOG_SHIM
...
@@ -41,6 +41,9 @@ class DIALOG_SVG_PRINT_base : public DIALOG_SHIM
wxID_PRINT_BOARD
=
1000
wxID_PRINT_BOARD
=
1000
};
};
wxStaticText
*
m_staticTextDir
;
wxTextCtrl
*
m_outputDirectoryName
;
wxButton
*
m_browseButton
;
wxStaticBoxSizer
*
m_CopperLayersBoxSizer
;
wxStaticBoxSizer
*
m_CopperLayersBoxSizer
;
wxStaticBoxSizer
*
m_TechnicalBoxSizer
;
wxStaticBoxSizer
*
m_TechnicalBoxSizer
;
wxStaticText
*
m_TextPenWidth
;
wxStaticText
*
m_TextPenWidth
;
...
@@ -52,13 +55,12 @@ class DIALOG_SVG_PRINT_base : public DIALOG_SHIM
...
@@ -52,13 +55,12 @@ class DIALOG_SVG_PRINT_base : public DIALOG_SHIM
wxRadioBox
*
m_rbFileOpt
;
wxRadioBox
*
m_rbFileOpt
;
wxButton
*
m_buttonCreateFile
;
wxButton
*
m_buttonCreateFile
;
wxButton
*
m_buttonQuit
;
wxButton
*
m_buttonQuit
;
wxStaticText
*
m_staticText1
;
wxTextCtrl
*
m_FileNameCtrl
;
wxStaticText
*
m_staticText2
;
wxStaticText
*
m_staticText2
;
wxTextCtrl
*
m_
M
essagesBox
;
wxTextCtrl
*
m_
m
essagesBox
;
// Virtual event handlers, overide them in your derived class
// Virtual event handlers, overide them in your derived class
virtual
void
OnCloseWindow
(
wxCloseEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
OnCloseWindow
(
wxCloseEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
OnOutputDirectoryBrowseClicked
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
OnButtonPlot
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
OnButtonPlot
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
OnButtonCancelClick
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
OnButtonCancelClick
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
...
...
pcbnew/dialogs/dialog_plot.cpp
View file @
b080f860
...
@@ -271,7 +271,7 @@ void DIALOG_PLOT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
...
@@ -271,7 +271,7 @@ void DIALOG_PLOT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
if
(
!
dirName
.
MakeRelativeTo
(
boardFilePath
)
)
if
(
!
dirName
.
MakeRelativeTo
(
boardFilePath
)
)
wxMessageBox
(
_
(
wxMessageBox
(
_
(
"Cannot make path relative (target volume different from board file volume)!"
),
"Cannot make path relative (target volume different from board file volume)!"
),
_
(
"Plot Output Directory"
),
wxOK
|
wxICON_ERROR
);
_
(
"Plot Output Directory"
),
wxOK
|
wxICON_ERROR
);
}
}
...
...
pcbnew/pcbplot.cpp
View file @
b080f860
...
@@ -111,8 +111,9 @@ static wxString GetGerberExtension( int layer )/*{{{*/
...
@@ -111,8 +111,9 @@ static wxString GetGerberExtension( int layer )/*{{{*/
/* Complete a plot filename: forces the output directory,
/* Complete a plot filename: forces the output directory,
* add a suffix to the name and sets the specified extension
* add a suffix to the name and sets the specified extension
* the suffix is usually the layer name
* the suffix is usually the layer name
* replaces not allowed chars in suffix by '_'
*/
*/
static
void
BuildPlotFileName
(
wxFileName
*
aFilename
,
void
BuildPlotFileName
(
wxFileName
*
aFilename
,
const
wxString
&
aOutputDir
,
const
wxString
&
aOutputDir
,
const
wxString
&
aSuffix
,
const
wxString
&
aSuffix
,
const
wxString
&
aExtension
)
const
wxString
&
aExtension
)
...
@@ -139,10 +140,13 @@ static void BuildPlotFileName( wxFileName *aFilename,
...
@@ -139,10 +140,13 @@ static void BuildPlotFileName( wxFileName *aFilename,
aFilename
->
SetName
(
aFilename
->
GetName
()
+
wxT
(
"-"
)
+
suffix
);
aFilename
->
SetName
(
aFilename
->
GetName
()
+
wxT
(
"-"
)
+
suffix
);
}
}
/** Fix the output directory pathname to absolute and ensure it exists */
/*
static
bool
EnsureOutputDirectory
(
wxFileName
*
aOutputDir
,
/*{{{*/
* Fix the output directory pathname to absolute and ensure it exists
const
wxString
&
aBoardFilename
,
* (Creates it if not exists)
wxTextCtrl
*
aMessageBox
)
*/
bool
EnsureOutputDirectory
(
wxFileName
*
aOutputDir
,
const
wxString
&
aBoardFilename
,
wxTextCtrl
*
aMessageBox
)
{
{
wxString
boardFilePath
=
wxFileName
(
aBoardFilename
).
GetPath
();
wxString
boardFilePath
=
wxFileName
(
aBoardFilename
).
GetPath
();
...
@@ -171,13 +175,14 @@ static bool EnsureOutputDirectory( wxFileName *aOutputDir, /*{{{*/
...
@@ -171,13 +175,14 @@ static bool EnsureOutputDirectory( wxFileName *aOutputDir, /*{{{*/
}
}
else
else
{
{
wxMessageBox
(
_
(
"Cannot create output directory!"
),
if
(
aMessageBox
)
_
(
"Plot"
),
wxOK
|
wxICON_ERROR
);
wxMessageBox
(
_
(
"Cannot create output directory!"
),
_
(
"Plot"
),
wxOK
|
wxICON_ERROR
);
return
false
;
return
false
;
}
}
}
}
return
true
;
return
true
;
}
/*}}}*/
}
/*
/*
* DIALOG_PLOT:Plot
* DIALOG_PLOT:Plot
...
...
pcbnew/pcbplot.h
View file @
b080f860
...
@@ -187,6 +187,36 @@ void PlotSilkScreen( BOARD *aBoard, PLOTTER* aPlotter, long aLayerMask,
...
@@ -187,6 +187,36 @@ void PlotSilkScreen( BOARD *aBoard, PLOTTER* aPlotter, long aLayerMask,
const
PCB_PLOT_PARAMS
&
aPlotOpt
);
const
PCB_PLOT_PARAMS
&
aPlotOpt
);
/**
* Function EnsureOutputDirectory (helper function)
* Fix the output directory pathname to absolute and ensure it exists
* (Creates it if not exists)
* @param aOutputDir = the wxFileName to modify
* (contains the absolute or relative to the board path
* @param aBoardFilename = the board full filename
* @param aMessageBox = a wxMessageBox to show meesage (can be NULL)
*/
bool
EnsureOutputDirectory
(
wxFileName
*
aOutputDir
,
const
wxString
&
aBoardFilename
,
wxTextCtrl
*
aMessageBox
);
/**
* Function BuildPlotFileName (helper function)
* Complete a plot filename: forces the output directory,
* add a suffix to the name and sets the specified extension
* the suffix is usually the layer name
* replaces not allowed chars in suffix by '_'
* @param aFilename = the wxFileName to initialize
* Contians the base filename
* @param aOutputDir = the path
* @param aSuffix = the suffix to add to the base filename
* @param aExtension = the file extension
*/
void
BuildPlotFileName
(
wxFileName
*
aFilename
,
const
wxString
&
aOutputDir
,
const
wxString
&
aSuffix
,
const
wxString
&
aExtension
);
// PLOTGERB.CPP
// PLOTGERB.CPP
void
SelectD_CODE_For_LineDraw
(
PLOTTER
*
plotter
,
int
aSize
);
void
SelectD_CODE_For_LineDraw
(
PLOTTER
*
plotter
,
int
aSize
);
...
...
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