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
85604886
Commit
85604886
authored
Apr 21, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Printing functions fixes, and other minor enhancements
parent
e846be13
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1988 additions
and
1893 deletions
+1988
-1893
dialog_print_using_printer_base.cpp
eeschema/dialog_print_using_printer_base.cpp
+74
-74
dialog_print_using_printer_base.fbp
eeschema/dialog_print_using_printer_base.fbp
+415
-415
dialog_print_using_printer_base.h
eeschema/dialog_print_using_printer_base.h
+55
-55
wxPcbStruct.h
include/wxPcbStruct.h
+13
-0
dialog_print_using_printer.cpp
pcbnew/dialog_print_using_printer.cpp
+2
-2
dialog_print_using_printer_base.cpp
pcbnew/dialog_print_using_printer_base.cpp
+165
-165
dialog_print_using_printer_base.fbp
pcbnew/dialog_print_using_printer_base.fbp
+1099
-1099
dialog_print_using_printer_base.h
pcbnew/dialog_print_using_printer_base.h
+82
-82
print_board_functions.cpp
pcbnew/print_board_functions.cpp
+80
-1
printout_controler.cpp
pcbnew/printout_controler.cpp
+3
-0
No files found.
eeschema/dialog_print_using_printer_base.cpp
View file @
85604886
...
...
@@ -36,16 +36,16 @@ DIALOG_PRINT_USING_PRINTER_BASE::DIALOG_PRINT_USING_PRINTER_BASE( wxWindow* pare
bbuttonsSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_buttonPageSetup
=
new
wxButton
(
this
,
wxID_ANY
,
_
(
"Page Setup"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bbuttonsSizer
->
Add
(
m_buttonPageSetup
,
0
,
wxALIGN_CENTER_HORIZONTAL
|
wxALL
,
5
);
bbuttonsSizer
->
Add
(
m_buttonPageSetup
,
0
,
wxALIGN_CENTER_HORIZONTAL
|
wxALL
|
wxEXPAND
,
5
);
m_buttonPreview
=
new
wxButton
(
this
,
wxID_ANY
,
_
(
"Preview"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bbuttonsSizer
->
Add
(
m_buttonPreview
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
bbuttonsSizer
->
Add
(
m_buttonPreview
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
|
wxEXPAND
,
5
);
m_buttonPrint
=
new
wxButton
(
this
,
wxID_ANY
,
_
(
"Print"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bbuttonsSizer
->
Add
(
m_buttonPrint
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
bbuttonsSizer
->
Add
(
m_buttonPrint
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
|
wxEXPAND
,
5
);
m_buttonQuit
=
new
wxButton
(
this
,
wxID_CANCEL
,
_
(
"Close"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bbuttonsSizer
->
Add
(
m_buttonQuit
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
bbuttonsSizer
->
Add
(
m_buttonQuit
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
|
wxEXPAND
,
5
);
bMainSizer
->
Add
(
bbuttonsSizer
,
0
,
wxALL
,
12
);
...
...
eeschema/dialog_print_using_printer_base.fbp
View file @
85604886
...
...
@@ -201,7 +201,7 @@
<property
name=
"permission"
>
none
</property>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxALIGN_CENTER_HORIZONTAL|wxALL
</property>
<property
name=
"flag"
>
wxALIGN_CENTER_HORIZONTAL|wxALL
|wxEXPAND
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wxButton"
expanded=
"1"
>
<property
name=
"bg"
></property>
...
...
@@ -253,7 +253,7 @@
</object>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxALL|wxALIGN_CENTER_HORIZONTAL
</property>
<property
name=
"flag"
>
wxALL|wxALIGN_CENTER_HORIZONTAL
|wxEXPAND
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wxButton"
expanded=
"1"
>
<property
name=
"bg"
></property>
...
...
@@ -305,7 +305,7 @@
</object>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxALL|wxALIGN_CENTER_HORIZONTAL
</property>
<property
name=
"flag"
>
wxALL|wxALIGN_CENTER_HORIZONTAL
|wxEXPAND
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wxButton"
expanded=
"1"
>
<property
name=
"bg"
></property>
...
...
@@ -357,7 +357,7 @@
</object>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxALL|wxALIGN_CENTER_HORIZONTAL
</property>
<property
name=
"flag"
>
wxALL|wxALIGN_CENTER_HORIZONTAL
|wxEXPAND
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wxButton"
expanded=
"1"
>
<property
name=
"bg"
></property>
...
...
eeschema/dialog_print_using_printer_base.h
View file @
85604886
include/wxPcbStruct.h
View file @
85604886
...
...
@@ -1040,6 +1040,19 @@ public:
*/
void
ToPrinter
(
wxCommandEvent
&
event
);
/** Virtual function PrintPage
* used to print a page
* Print the page pointed by ActiveScreen, set by the calling print function
* @param aDC = wxDC given by the calling print function
* @param aPrint_Sheet_Ref = true to print page references
* @param aPrintMask = not used here
* @param aPrintMirrorMode = not used here (Set when printing in mirror mode)
* @param aData = a pointer on an auxiliary data (NULL if not used)
*/
virtual
void
PrintPage
(
wxDC
*
aDC
,
bool
aPrint_Sheet_Ref
,
int
aPrintMask
,
bool
aPrintMirrorMode
,
void
*
aData
=
NULL
);
// BOARD handling
/** function Clear_Pcb()
...
...
pcbnew/dialog_print_using_printer.cpp
View file @
85604886
...
...
@@ -59,7 +59,7 @@ public:
private
:
void
OnCloseWindow
(
wxCloseEvent
&
event
);
void
OnP
rint
Setup
(
wxCommandEvent
&
event
);
void
OnP
age
Setup
(
wxCommandEvent
&
event
);
void
OnPrintPreview
(
wxCommandEvent
&
event
);
void
OnPrintButtonClick
(
wxCommandEvent
&
event
);
...
...
@@ -414,7 +414,7 @@ void DIALOG_PRINT_USING_PRINTER::SetPenWidth()
/**********************************************************/
void
DIALOG_PRINT_USING_PRINTER
::
OnP
rint
Setup
(
wxCommandEvent
&
event
)
void
DIALOG_PRINT_USING_PRINTER
::
OnP
age
Setup
(
wxCommandEvent
&
event
)
/**********************************************************/
/* Open a dialog box for printer setup (printer options, page size ...)
...
...
pcbnew/dialog_print_using_printer_base.cpp
View file @
85604886
...
...
@@ -148,7 +148,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare
// Connect Events
this
->
Connect
(
wxEVT_CLOSE_WINDOW
,
wxCloseEventHandler
(
DIALOG_PRINT_USING_PRINTER_base
::
OnCloseWindow
)
);
m_buttonOption
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PRINT_USING_PRINTER_base
::
OnP
rintSetup
),
NULL
,
this
);
m_buttonOption
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PRINT_USING_PRINTER_base
::
OnP
ageSetup
),
NULL
,
this
);
m_buttonPreview
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PRINT_USING_PRINTER_base
::
OnPrintPreview
),
NULL
,
this
);
m_buttonPrint
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PRINT_USING_PRINTER_base
::
OnPrintButtonClick
),
NULL
,
this
);
m_buttonQuit
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PRINT_USING_PRINTER_base
::
OnButtonCancelClick
),
NULL
,
this
);
...
...
@@ -158,7 +158,7 @@ DIALOG_PRINT_USING_PRINTER_base::~DIALOG_PRINT_USING_PRINTER_base()
{
// Disconnect Events
this
->
Disconnect
(
wxEVT_CLOSE_WINDOW
,
wxCloseEventHandler
(
DIALOG_PRINT_USING_PRINTER_base
::
OnCloseWindow
)
);
m_buttonOption
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PRINT_USING_PRINTER_base
::
OnP
rintSetup
),
NULL
,
this
);
m_buttonOption
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PRINT_USING_PRINTER_base
::
OnP
ageSetup
),
NULL
,
this
);
m_buttonPreview
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PRINT_USING_PRINTER_base
::
OnPrintPreview
),
NULL
,
this
);
m_buttonPrint
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PRINT_USING_PRINTER_base
::
OnPrintButtonClick
),
NULL
,
this
);
m_buttonQuit
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PRINT_USING_PRINTER_base
::
OnButtonCancelClick
),
NULL
,
this
);
...
...
pcbnew/dialog_print_using_printer_base.fbp
View file @
85604886
...
...
@@ -899,7 +899,7 @@
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
<event
name=
"OnButtonClick"
>
OnP
rintSetup
</event>
<event
name=
"OnButtonClick"
>
OnP
ageSetup
</event>
<event
name=
"OnChar"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
...
...
pcbnew/dialog_print_using_printer_base.h
View file @
85604886
...
...
@@ -67,7 +67,7 @@ class DIALOG_PRINT_USING_PRINTER_base : public wxDialog
// Virtual event handlers, overide them in your derived class
virtual
void
OnCloseWindow
(
wxCloseEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnP
rintSetup
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnP
ageSetup
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnPrintPreview
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnPrintButtonClick
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnButtonCancelClick
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
...
...
pcbnew/print_board_functions.cpp
View file @
85604886
...
...
@@ -19,8 +19,87 @@ static void Print_Module( WinEDA_DrawPanel* aPanel, wxDC* aDC, MODULE* aModule,
int
aDraw_mode
,
int
aMasklayer
,
PRINT_PARAMETERS
::
DrillShapeOptT
aDrillShapeOpt
);
/** Function WinEDA_ModuleEditFrame::PrintPage
* Used to print the board (on printer, or when creating SVF files).
* Print the board, but only layers allowed by aPrintMaskLayer
* @param aDC = the print device context
* @param aPrint_Sheet_Ref = true to print frame references
* @param aPrint_Sheet_Ref = a 32 bits mask: bit n = 1 -> layer n is printed
* @param aPrintMirrorMode = true to plot mirrored
* @param aData = a pointer to an optional data (NULL if not used)
*/
void
WinEDA_ModuleEditFrame
::
PrintPage
(
wxDC
*
aDC
,
bool
aPrint_Sheet_Ref
,
int
aPrintMaskLayer
,
bool
aPrintMirrorMode
,
void
*
aData
)
{
MODULE
*
Module
;
int
drawmode
=
GR_COPY
;
DISPLAY_OPTIONS
save_opt
;
BOARD
*
Pcb
=
GetBoard
();
int
defaultPenSize
=
50
;
PRINT_PARAMETERS
*
printParameters
=
(
PRINT_PARAMETERS
*
)
aData
;
// can be null
PRINT_PARAMETERS
::
DrillShapeOptT
drillShapeOpt
=
PRINT_PARAMETERS
::
FULL_DRILL_SHAPE
;
if
(
printParameters
)
defaultPenSize
=
printParameters
->
m_PenDefaultSize
;
save_opt
=
DisplayOpt
;
DisplayOpt
.
ContrastModeDisplay
=
false
;
DisplayOpt
.
DisplayPadFill
=
true
;
DisplayOpt
.
DisplayViaFill
=
true
;
m_DisplayPadFill
=
DisplayOpt
.
DisplayPadFill
;
m_DisplayViaFill
=
DisplayOpt
.
DisplayViaFill
;
m_DisplayPadNum
=
DisplayOpt
.
DisplayPadNum
=
false
;
bool
nctmp
=
GetBoard
()
->
IsElementVisible
(
NO_CONNECTS_VISIBLE
);
GetBoard
()
->
SetElementVisibility
(
NO_CONNECTS_VISIBLE
,
false
);
DisplayOpt
.
DisplayPadIsol
=
false
;
DisplayOpt
.
DisplayModEdge
=
FILLED
;
DisplayOpt
.
DisplayModText
=
FILLED
;
m_DisplayPcbTrackFill
=
DisplayOpt
.
DisplayPcbTrackFill
=
FILLED
;
DisplayOpt
.
ShowTrackClearanceMode
=
DO_NOT_SHOW_CLEARANCE
;
DisplayOpt
.
DisplayDrawItems
=
FILLED
;
DisplayOpt
.
DisplayZonesMode
=
0
;
DisplayOpt
.
DisplayNetNamesMode
=
0
;
DrawPanel
->
m_PrintIsMirrored
=
aPrintMirrorMode
;
// The OR mode is used in color mode, but be aware the backgroud *must be
// BLACK. In the print page dialog, we first print in BLACK, and after
// reprint in color, on the black "local" backgroud, in OR mode the black
// print is not made before, only a white page is printed
if
(
GetGRForceBlackPenState
()
==
false
)
drawmode
=
GR_OR
;
// Draw footprints, this is done at last in order to print the pad holes in
// white (or g_DrawBgColor) after the tracks and zones
Module
=
(
MODULE
*
)
Pcb
->
m_Modules
;
int
tmp
=
D_PAD
::
m_PadSketchModePenSize
;
D_PAD
::
m_PadSketchModePenSize
=
defaultPenSize
;
for
(
;
Module
!=
NULL
;
Module
=
Module
->
Next
()
)
{
Print_Module
(
DrawPanel
,
aDC
,
Module
,
drawmode
,
aPrintMaskLayer
,
drillShapeOpt
);
}
D_PAD
::
m_PadSketchModePenSize
=
tmp
;
if
(
aPrint_Sheet_Ref
)
TraceWorkSheet
(
aDC
,
GetScreen
(),
defaultPenSize
);
DrawPanel
->
m_PrintIsMirrored
=
false
;
DisplayOpt
=
save_opt
;
m_DisplayPcbTrackFill
=
DisplayOpt
.
DisplayPcbTrackFill
;
m_DisplayPadFill
=
DisplayOpt
.
DisplayPadFill
;
m_DisplayViaFill
=
DisplayOpt
.
DisplayViaFill
;
m_DisplayPadNum
=
DisplayOpt
.
DisplayPadNum
;
GetBoard
()
->
SetElementVisibility
(
NO_CONNECTS_VISIBLE
,
nctmp
);
}
/** Function PrintPage
/**
WinEDA_PcbFrame::
Function PrintPage
* Used to print the board (on printer, or when creating SVF files).
* Print the board, but only layers allowed by aPrintMaskLayer
* @param aDC = the print device context
...
...
pcbnew/printout_controler.cpp
View file @
85604886
...
...
@@ -240,6 +240,9 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage()
if
(
userscale
==
1.0
)
{
// We want a 1:1 scale and margins for printing
MapScreenSizeToPaper
(
);
// Fine scale adjust
dc
->
SetUserScale
(
accurate_Xscale
,
accurate_Yscale
);
}
...
...
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