Commit f8490ff4 authored by Dick Hollenbeck's avatar Dick Hollenbeck

Remove g_PcbPlotOptions, use wxformbuilder to subclass DIALOG_SHIM on several dialogs

parent e4309287
...@@ -18,7 +18,7 @@ Documentation/doxygen ...@@ -18,7 +18,7 @@ Documentation/doxygen
*.cmake *.cmake
*.bak *.bak
common/pcb_plot_params_keywords.cpp common/pcb_plot_params_keywords.cpp
common/pcb_plot_params_lexer.h include/pcb_plot_params_lexer.h
pcbnew/specctra_keywords.cpp pcbnew/specctra_keywords.cpp
pcbnew/specctra_lexer.h pcbnew/specctra_lexer.h
new/html new/html
......
...@@ -254,7 +254,6 @@ set(INC_AFTER ...@@ -254,7 +254,6 @@ set(INC_AFTER
############ ############
# Binaries # # Binaries #
############ ############
add_subdirectory(3d-viewer)
if( USE_PNG_BITMAPS ) if( USE_PNG_BITMAPS )
add_subdirectory(bitmaps_png) add_subdirectory(bitmaps_png)
...@@ -262,8 +261,8 @@ else() ...@@ -262,8 +261,8 @@ else()
add_subdirectory(bitmaps_xpm) add_subdirectory(bitmaps_xpm)
endif() endif()
add_subdirectory(common) add_subdirectory(common)
add_subdirectory(3d-viewer)
add_subdirectory(cvpcb) add_subdirectory(cvpcb)
add_subdirectory(eeschema) add_subdirectory(eeschema)
add_subdirectory(gerbview) add_subdirectory(gerbview)
......
...@@ -113,6 +113,7 @@ set(PCB_COMMON_SRCS ...@@ -113,6 +113,7 @@ set(PCB_COMMON_SRCS
../pcbnew/classpcb.cpp ../pcbnew/classpcb.cpp
../pcbnew/collectors.cpp ../pcbnew/collectors.cpp
../pcbnew/sel_layer.cpp ../pcbnew/sel_layer.cpp
../pcbnew/pcb_plot_params.cpp
pcb_plot_params_keywords.cpp pcb_plot_params_keywords.cpp
dialogs/dialog_page_settings.cpp dialogs/dialog_page_settings.cpp
) )
...@@ -142,7 +143,7 @@ make_lexer( ...@@ -142,7 +143,7 @@ make_lexer(
# auto-generate pcb_plot_params_lexer.h and pcb_plot_params_keywords.cpp # auto-generate pcb_plot_params_lexer.h and pcb_plot_params_keywords.cpp
make_lexer( make_lexer(
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params.keywords ${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params.keywords
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params_lexer.h ${PROJECT_SOURCE_DIR}/include/pcb_plot_params_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params_keywords.cpp ${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params_keywords.cpp
PCBPLOTPARAMS_T PCBPLOTPARAMS_T
) )
......
...@@ -438,9 +438,9 @@ limits\n%.1f - %.1f %s!\nSelect another custom paper size?" ), ...@@ -438,9 +438,9 @@ limits\n%.1f - %.1f %s!\nSelect another custom paper size?" ),
PAGE_INFO::SetCustomWidthMils( m_layout_size.x ); PAGE_INFO::SetCustomWidthMils( m_layout_size.x );
PAGE_INFO::SetCustomHeightMils( m_layout_size.y ); PAGE_INFO::SetCustomHeightMils( m_layout_size.y );
m_pageInfo.SetWidthMils( m_layout_size.x ); m_pageInfo.SetWidthMils( m_layout_size.x );
m_pageInfo.SetHeightMils( m_layout_size.y ); m_pageInfo.SetHeightMils( m_layout_size.y );
m_pageInfo.SetPortrait( m_layout_size.x < m_layout_size.y );
} }
} }
else else
......
...@@ -139,22 +139,21 @@ extern const wxString g_SchematicBackupFileExtension; ...@@ -139,22 +139,21 @@ extern const wxString g_SchematicBackupFileExtension;
extern LayerStruct g_LayerDescr; extern LayerStruct g_LayerDescr;
extern bool g_EditPinByPinIsOn; /* True to prevent displacing /// True to prevent displacing pins, when they are at the same position.
* pins, when they are at the extern bool g_EditPinByPinIsOn;
* same position. */
/**
extern int g_DrawDefaultLineThickness; /* Default line (in Eeschema * Default line (in Eeschema units) thickness used to draw/plot items having a
* units) thickness used to * default thickness line value (i.e. = 0 ).
* draw/plot items having a * 0 = single pixel line width.
* default thickness line */
* value (i.e. = 0 ). extern int g_DrawDefaultLineThickness;
* 0 = single pixel line width
*/
/// Color to draw selected items
// Color to draw selected items
extern int g_ItemSelectetColor; extern int g_ItemSelectetColor;
// Color to draw items flagged invisible, in libedit (they are invisible in Eeschema /// Color to draw items flagged invisible, in libedit (they are invisible in Eeschema
extern int g_InvisibleItemColor; extern int g_InvisibleItemColor;
/* Global Variables */ /* Global Variables */
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
* @brief Classes used in Pcbnew, CvPcb and GerbView. * @brief Classes used in Pcbnew, CvPcb and GerbView.
*/ */
#ifndef WX_BASE_PCB_FRAME_H #ifndef WX_BASE_PCB_FRAME_H_
#define WX_BASE_PCB_FRAME_H #define WX_BASE_PCB_FRAME_H_
#include <vector> #include <vector>
...@@ -59,6 +59,8 @@ class GENERAL_COLLECTOR; ...@@ -59,6 +59,8 @@ class GENERAL_COLLECTOR;
class GENERAL_COLLECTORS_GUIDE; class GENERAL_COLLECTORS_GUIDE;
class BOARD_DESIGN_SETTINGS; class BOARD_DESIGN_SETTINGS;
class ZONE_SETTINGS; class ZONE_SETTINGS;
class PCB_PLOT_PARAMS;
/** /**
* class PCB_BASE_FRAME * class PCB_BASE_FRAME
...@@ -138,6 +140,14 @@ public: ...@@ -138,6 +140,14 @@ public:
const ZONE_SETTINGS& GetZoneSettings() const; const ZONE_SETTINGS& GetZoneSettings() const;
void SetZoneSettings( const ZONE_SETTINGS& aSettings ); void SetZoneSettings( const ZONE_SETTINGS& aSettings );
/**
* Function GetPlotSettings
* returns the PCB_PLOT_PARAMS for the BOARD owned by this frame.
* Overloaded in FOOTPRINT_EDIT_FRAME.
*/
virtual const PCB_PLOT_PARAMS& GetPlotSettings() const;
virtual void SetPlotSettings( const PCB_PLOT_PARAMS& aSettings );
/** /**
* Function SetBoard * Function SetBoard
* sets the m_Pcb member in such as way as to ensure deleting any previous * sets the m_Pcb member in such as way as to ensure deleting any previous
...@@ -674,4 +684,4 @@ public: ...@@ -674,4 +684,4 @@ public:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif /* WX_BASE_PCB_FRAME_H */ #endif // WX_BASE_PCB_FRAME_H_
...@@ -161,7 +161,6 @@ set(PCBNEW_SRCS ...@@ -161,7 +161,6 @@ set(PCBNEW_SRCS
netlist_reader_kicad.cpp netlist_reader_kicad.cpp
onleftclick.cpp onleftclick.cpp
onrightclick.cpp onrightclick.cpp
pcb_plot_params.cpp
pcbnew.cpp pcbnew.cpp
pcbnew_config.cpp pcbnew_config.cpp
pcbplot.cpp pcbplot.cpp
......
...@@ -205,6 +205,20 @@ void PCB_BASE_FRAME::SetZoneSettings( const ZONE_SETTINGS& aSettings ) ...@@ -205,6 +205,20 @@ void PCB_BASE_FRAME::SetZoneSettings( const ZONE_SETTINGS& aSettings )
} }
const PCB_PLOT_PARAMS& PCB_BASE_FRAME::GetPlotSettings() const
{
wxASSERT( m_Pcb );
return m_Pcb->GetPlotOptions();
}
void PCB_BASE_FRAME::SetPlotSettings( const PCB_PLOT_PARAMS& aSettings )
{
wxASSERT( m_Pcb );
m_Pcb->SetPlotOptions( aSettings );
}
EDA_RECT PCB_BASE_FRAME::GetBoardBoundingBox( bool aBoardEdgesOnly ) const EDA_RECT PCB_BASE_FRAME::GetBoardBoundingBox( bool aBoardEdgesOnly ) const
{ {
wxASSERT( m_Pcb ); wxASSERT( m_Pcb );
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <common.h> // PAGE_INFO #include <common.h> // PAGE_INFO
#include <class_title_block.h> #include <class_title_block.h>
#include <class_zone_settings.h> #include <class_zone_settings.h>
#include <pcb_plot_params.h>
class PCB_BASE_FRAME; class PCB_BASE_FRAME;
class PCB_EDIT_FRAME; class PCB_EDIT_FRAME;
...@@ -180,6 +180,7 @@ private: ...@@ -180,6 +180,7 @@ private:
COLORS_DESIGN_SETTINGS* m_colorsSettings; COLORS_DESIGN_SETTINGS* m_colorsSettings;
PAGE_INFO m_paper; PAGE_INFO m_paper;
TITLE_BLOCK m_titles; ///< text in lower right of screen and plots TITLE_BLOCK m_titles; ///< text in lower right of screen and plots
PCB_PLOT_PARAMS m_plotOptions;
/// Position of the origin axis, which is used in exports mostly /// Position of the origin axis, which is used in exports mostly
wxPoint m_originAxisPosition; wxPoint m_originAxisPosition;
...@@ -543,6 +544,9 @@ public: ...@@ -543,6 +544,9 @@ public:
const PAGE_INFO& GetPageSettings() const { return m_paper; } const PAGE_INFO& GetPageSettings() const { return m_paper; }
void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; } void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
const PCB_PLOT_PARAMS& GetPlotOptions() const { return m_plotOptions; }
void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; }
const wxPoint& GetOriginAxisPosition() const { return m_originAxisPosition; } const wxPoint& GetOriginAxisPosition() const { return m_originAxisPosition; }
void SetOriginAxisPosition( const wxPoint& aPosition ) { m_originAxisPosition = aPosition; } void SetOriginAxisPosition( const wxPoint& aPosition ) { m_originAxisPosition = aPosition; }
......
...@@ -51,7 +51,7 @@ class BOARD; ...@@ -51,7 +51,7 @@ class BOARD;
* Enum MODULE_ATTR_T * Enum MODULE_ATTR_T
* is the set of attributes allowed within a MODULE, using MODULE::SetAttributes() * is the set of attributes allowed within a MODULE, using MODULE::SetAttributes()
* and MODULE::GetAttributes(). These are to be ORed together when calling * and MODULE::GetAttributes(). These are to be ORed together when calling
* MODULE::SetAttrbute() * MODULE::SetAttributes()
*/ */
enum MODULE_ATTR_T enum MODULE_ATTR_T
{ {
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
#define WIDTH_MAX_VALUE 500 #define WIDTH_MAX_VALUE 500
#define WIDTH_MIN_VALUE 1 #define WIDTH_MIN_VALUE 1
extern int g_DrawDefaultLineThickness;
// Local variables: // Local variables:
static PRINT_PARAMETERS s_Parameters; static PRINT_PARAMETERS s_Parameters;
static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT | static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT |
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 30 2011) // C++ code generated with wxFormBuilder (version Mar 19 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_GEN_MODULE_POSITION_FILE_BASE_H__ #ifndef __DIALOG_GEN_MODULE_POSITION_FILE_BASE_H__
#define __DIALOG_GEN_MODULE_POSITION_FILE_BASE_H__ #define __DIALOG_GEN_MODULE_POSITION_FILE_BASE_H__
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include "dialog_shim.h"
#include <wx/stattext.h> #include <wx/string.h>
#include <wx/gdicmn.h> #include <wx/stattext.h>
#include <wx/font.h> #include <wx/gdicmn.h>
#include <wx/colour.h> #include <wx/font.h>
#include <wx/settings.h> #include <wx/colour.h>
#include <wx/textctrl.h> #include <wx/settings.h>
#include <wx/button.h> #include <wx/textctrl.h>
#include <wx/sizer.h> #include <wx/button.h>
#include <wx/radiobox.h> #include <wx/sizer.h>
#include <wx/statbox.h> #include <wx/radiobox.h>
#include <wx/dialog.h> #include <wx/statbox.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_GEN_MODULE_POSITION_BASE ///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_GEN_MODULE_POSITION_BASE
class DIALOG_GEN_MODULE_POSITION_BASE : public wxDialog ///////////////////////////////////////////////////////////////////////////////
{ class DIALOG_GEN_MODULE_POSITION_BASE : public DIALOG_SHIM
private: {
private:
protected:
wxBoxSizer* m_MainSizer; protected:
wxStaticText* m_staticTextDir; wxBoxSizer* m_MainSizer;
wxTextCtrl* m_outputDirectoryName; wxStaticText* m_staticTextDir;
wxButton* m_browseButton; wxTextCtrl* m_outputDirectoryName;
wxRadioBox* m_radioBoxUnits; wxButton* m_browseButton;
wxRadioBox* m_radioBoxFilesCount; wxRadioBox* m_radioBoxUnits;
wxRadioBox* m_radioBoxForceSmd; wxRadioBox* m_radioBoxFilesCount;
wxTextCtrl* m_messagesBox; wxRadioBox* m_radioBoxForceSmd;
wxStdDialogButtonSizer* m_sdbSizerButtons; wxTextCtrl* m_messagesBox;
wxButton* m_sdbSizerButtonsOK; wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsCancel; wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } // Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); } virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnCancelButton( wxCommandEvent& event ) { event.Skip(); } virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKButton( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancelButton( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKButton( wxCommandEvent& event ) { event.Skip(); }
public:
public:
DIALOG_GEN_MODULE_POSITION_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Position Files:"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 501,340 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GEN_MODULE_POSITION_BASE(); DIALOG_GEN_MODULE_POSITION_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Position Files:"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GEN_MODULE_POSITION_BASE();
};
};
#endif //__DIALOG_GEN_MODULE_POSITION_FILE_BASE_H__
#endif //__DIALOG_GEN_MODULE_POSITION_FILE_BASE_H__
...@@ -55,6 +55,7 @@ static DRILL_PRECISION precisionListForInches[] = ...@@ -55,6 +55,7 @@ static DRILL_PRECISION precisionListForInches[] =
{ {
DRILL_PRECISION( 2, 3 ), DRILL_PRECISION( 2, 4 ) DRILL_PRECISION( 2, 3 ), DRILL_PRECISION( 2, 4 )
}; };
static DRILL_PRECISION precisionListForMetric[] = static DRILL_PRECISION precisionListForMetric[] =
{ {
DRILL_PRECISION( 3, 2 ), DRILL_PRECISION( 3, 3 ) DRILL_PRECISION( 3, 2 ), DRILL_PRECISION( 3, 3 )
...@@ -64,12 +65,12 @@ static DRILL_PRECISION precisionListForMetric[] = ...@@ -64,12 +65,12 @@ static DRILL_PRECISION precisionListForMetric[] =
DIALOG_GENDRILL::DIALOG_GENDRILL( PCB_EDIT_FRAME* parent ) : DIALOG_GENDRILL::DIALOG_GENDRILL( PCB_EDIT_FRAME* parent ) :
DIALOG_GENDRILL_BASE( parent ) DIALOG_GENDRILL_BASE( parent )
{ {
m_Parent = parent; m_parent = parent;
m_board = parent->GetBoard();
SetReturnCode( 1 ); SetReturnCode( 1 );
initDialog(); initDialog();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Centre();
} }
...@@ -83,9 +84,6 @@ int DIALOG_GENDRILL:: m_PrecisionFormat = 1; ...@@ -83,9 +84,6 @@ int DIALOG_GENDRILL:: m_PrecisionFormat = 1;
bool DIALOG_GENDRILL::m_createRpt = false; bool DIALOG_GENDRILL::m_createRpt = false;
int DIALOG_GENDRILL::m_createMap = 0; int DIALOG_GENDRILL::m_createMap = 0;
/*!
* DIALOG_GENDRILL destructor
*/
DIALOG_GENDRILL::~DIALOG_GENDRILL() DIALOG_GENDRILL::~DIALOG_GENDRILL()
{ {
...@@ -93,13 +91,8 @@ DIALOG_GENDRILL::~DIALOG_GENDRILL() ...@@ -93,13 +91,8 @@ DIALOG_GENDRILL::~DIALOG_GENDRILL()
} }
/*!
* Member initialisation
*/
void DIALOG_GENDRILL::initDialog() void DIALOG_GENDRILL::initDialog()
{ {
SetFocus(); // Under wxGTK: mandatory to close dialog by the ESC key
wxConfig* Config = wxGetApp().GetSettings(); wxConfig* Config = wxGetApp().GetSettings();
if( Config ) if( Config )
...@@ -116,11 +109,10 @@ void DIALOG_GENDRILL::initDialog() ...@@ -116,11 +109,10 @@ void DIALOG_GENDRILL::initDialog()
} }
/* some param values initialization before display dialog window void DIALOG_GENDRILL::InitDisplayParams()
*/
void DIALOG_GENDRILL::InitDisplayParams( void )
{ {
wxString msg; wxString msg;
const PCB_PLOT_PARAMS& plot_opts = m_board->GetPlotOptions();
m_Choice_Unit->SetSelection( m_UnitDrillIsInch ? 1 : 0 ); m_Choice_Unit->SetSelection( m_UnitDrillIsInch ? 1 : 0 );
m_Choice_Precision->SetSelection( m_PrecisionFormat ); m_Choice_Precision->SetSelection( m_PrecisionFormat );
...@@ -146,11 +138,11 @@ void DIALOG_GENDRILL::InitDisplayParams( void ) ...@@ -146,11 +138,11 @@ void DIALOG_GENDRILL::InitDisplayParams( void )
m_MicroViaDrillValue->SetLabel( _( "Use Netclasses values" ) ); m_MicroViaDrillValue->SetLabel( _( "Use Netclasses values" ) );
msg.Empty(); msg.Empty();
msg << g_PcbPlotOptions.m_HPGLPenNum; msg << plot_opts.m_HPGLPenNum;
m_PenNum->SetValue( msg ); m_PenNum->SetValue( msg );
msg.Empty(); msg.Empty();
msg << g_PcbPlotOptions.m_HPGLPenSpeed; msg << plot_opts.m_HPGLPenSpeed;
m_PenSpeed->SetValue( msg ); m_PenSpeed->SetValue( msg );
// See if we have some buried vias or/and microvias, and display // See if we have some buried vias or/and microvias, and display
...@@ -159,7 +151,7 @@ void DIALOG_GENDRILL::InitDisplayParams( void ) ...@@ -159,7 +151,7 @@ void DIALOG_GENDRILL::InitDisplayParams( void )
m_microViasCount = 0; m_microViasCount = 0;
m_blindOrBuriedViasCount = 0; m_blindOrBuriedViasCount = 0;
for( TRACK* track = m_Parent->GetBoard()->m_Track; track != NULL; track = track->Next() ) for( TRACK* track = m_parent->GetBoard()->m_Track; track != NULL; track = track->Next() )
{ {
if( track->Type() != PCB_VIA_T ) if( track->Type() != PCB_VIA_T )
continue; continue;
...@@ -178,7 +170,7 @@ void DIALOG_GENDRILL::InitDisplayParams( void ) ...@@ -178,7 +170,7 @@ void DIALOG_GENDRILL::InitDisplayParams( void )
m_platedPadsHoleCount = 0; m_platedPadsHoleCount = 0;
m_notplatedPadsHoleCount = 0; m_notplatedPadsHoleCount = 0;
for( MODULE* module = m_Parent->GetBoard()->m_Modules; module != NULL; module = module->Next() ) for( MODULE* module = m_parent->GetBoard()->m_Modules; module; module = module->Next() )
{ {
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() ) for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() )
{ {
...@@ -228,39 +220,30 @@ void DIALOG_GENDRILL::InitDisplayParams( void ) ...@@ -228,39 +220,30 @@ void DIALOG_GENDRILL::InitDisplayParams( void )
} }
// Save drill options:
void DIALOG_GENDRILL::UpdateConfig() void DIALOG_GENDRILL::UpdateConfig()
{ {
SetParams(); SetParams();
wxConfig* Config = wxGetApp().GetSettings(); wxConfig* config = wxGetApp().GetSettings();
if( Config ) if( config )
{ {
Config->Write( ZerosFormatKey, m_ZerosFormat ); config->Write( ZerosFormatKey, m_ZerosFormat );
Config->Write( PrecisionKey, m_PrecisionFormat ); config->Write( PrecisionKey, m_PrecisionFormat );
Config->Write( MirrorKey, m_Mirror ); config->Write( MirrorKey, m_Mirror );
Config->Write( MinimalHeaderKey, m_MinimalHeader ); config->Write( MinimalHeaderKey, m_MinimalHeader );
Config->Write( UnitDrillInchKey, m_UnitDrillIsInch ); config->Write( UnitDrillInchKey, m_UnitDrillIsInch );
Config->Write( DrillOriginIsAuxAxisKey, m_DrillOriginIsAuxAxis ); config->Write( DrillOriginIsAuxAxisKey, m_DrillOriginIsAuxAxis );
} }
} }
/*!
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_RADIOBOX
*/
void DIALOG_GENDRILL::OnSelDrillUnitsSelected( wxCommandEvent& event ) void DIALOG_GENDRILL::OnSelDrillUnitsSelected( wxCommandEvent& event )
{ {
UpdatePrecisionOptions(); UpdatePrecisionOptions();
} }
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
*/
void DIALOG_GENDRILL::OnOkClick( wxCommandEvent& event ) void DIALOG_GENDRILL::OnOkClick( wxCommandEvent& event )
{ {
GenDrillAndReportFiles(); GenDrillAndReportFiles();
...@@ -268,10 +251,6 @@ void DIALOG_GENDRILL::OnOkClick( wxCommandEvent& event ) ...@@ -268,10 +251,6 @@ void DIALOG_GENDRILL::OnOkClick( wxCommandEvent& event )
} }
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE
*/
void DIALOG_GENDRILL::OnCancelClick( wxCommandEvent& event ) void DIALOG_GENDRILL::OnCancelClick( wxCommandEvent& event )
{ {
UpdateConfig(); // Save drill options: UpdateConfig(); // Save drill options:
...@@ -279,10 +258,6 @@ void DIALOG_GENDRILL::OnCancelClick( wxCommandEvent& event ) ...@@ -279,10 +258,6 @@ void DIALOG_GENDRILL::OnCancelClick( wxCommandEvent& event )
} }
/*!
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_SEL_ZEROS_FMT
*/
void DIALOG_GENDRILL::OnSelZerosFmtSelected( wxCommandEvent& event ) void DIALOG_GENDRILL::OnSelZerosFmtSelected( wxCommandEvent& event )
{ {
UpdatePrecisionOptions(); UpdatePrecisionOptions();
...@@ -311,11 +286,13 @@ void DIALOG_GENDRILL::UpdatePrecisionOptions() ...@@ -311,11 +286,13 @@ void DIALOG_GENDRILL::UpdatePrecisionOptions()
} }
void DIALOG_GENDRILL::SetParams( void ) void DIALOG_GENDRILL::SetParams()
{ {
wxString msg; wxString msg;
long ltmp; long ltmp;
PCB_PLOT_PARAMS plot_opts = m_board->GetPlotOptions();
m_createMap = m_Choice_Drill_Map->GetSelection(); m_createMap = m_Choice_Drill_Map->GetSelection();
m_createRpt = m_Choice_Drill_Report->GetSelection(); m_createRpt = m_Choice_Drill_Report->GetSelection();
...@@ -329,17 +306,17 @@ void DIALOG_GENDRILL::SetParams( void ) ...@@ -329,17 +306,17 @@ void DIALOG_GENDRILL::SetParams( void )
msg = m_PenSpeed->GetValue(); msg = m_PenSpeed->GetValue();
if( msg.ToLong( &ltmp ) ) if( msg.ToLong( &ltmp ) )
g_PcbPlotOptions.m_HPGLPenSpeed = ltmp; plot_opts.m_HPGLPenSpeed = ltmp;
msg = m_PenNum->GetValue(); msg = m_PenNum->GetValue();
if( msg.ToLong( &ltmp ) ) if( msg.ToLong( &ltmp ) )
g_PcbPlotOptions.m_HPGLPenNum = ltmp; plot_opts.m_HPGLPenNum = ltmp;
if( m_Choice_Drill_Offset->GetSelection() == 0 ) if( m_Choice_Drill_Offset->GetSelection() == 0 )
m_FileDrillOffset = wxPoint( 0, 0 ); m_FileDrillOffset = wxPoint( 0, 0 );
else else
m_FileDrillOffset = m_Parent->GetOriginAxisPosition(); m_FileDrillOffset = m_parent->GetOriginAxisPosition();
// get precision // get precision
int idx = m_Choice_Precision->GetSelection(); int idx = m_Choice_Precision->GetSelection();
...@@ -348,4 +325,6 @@ void DIALOG_GENDRILL::SetParams( void ) ...@@ -348,4 +325,6 @@ void DIALOG_GENDRILL::SetParams( void )
m_Precision = precisionListForInches[idx]; m_Precision = precisionListForInches[idx];
else else
m_Precision = precisionListForMetric[idx]; m_Precision = precisionListForMetric[idx];
m_board->SetPlotOptions( plot_opts );
} }
...@@ -26,14 +26,17 @@ ...@@ -26,14 +26,17 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef _DIALOG_GENDRILL_H_ #ifndef DIALOG_GENDRILL_H_
#define _DIALOG_GENDRILL_H_ #define DIALOG_GENDRILL_H_
#include <dialog_gendrill_base.h> #include <dialog_gendrill_base.h>
class DIALOG_GENDRILL : public DIALOG_GENDRILL_BASE class DIALOG_GENDRILL : public DIALOG_GENDRILL_BASE
{ {
public: public:
DIALOG_GENDRILL( PCB_EDIT_FRAME* parent );
~DIALOG_GENDRILL();
static int m_UnitDrillIsInch; static int m_UnitDrillIsInch;
static int m_ZerosFormat; static int m_ZerosFormat;
static int m_PrecisionFormat; static int m_PrecisionFormat;
...@@ -44,23 +47,21 @@ public: ...@@ -44,23 +47,21 @@ public:
DRILL_PRECISION m_Precision; // Selected precision for drill files DRILL_PRECISION m_Precision; // Selected precision for drill files
wxPoint m_FileDrillOffset; // Drill offset: 0,0 for absolute coordiantes, or auxialry axis origin wxPoint m_FileDrillOffset; // Drill offset: 0,0 for absolute coordiantes, or auxialry axis origin
private: private:
PCB_EDIT_FRAME* m_Parent; PCB_EDIT_FRAME* m_parent;
BOARD* m_board;
int m_platedPadsHoleCount; int m_platedPadsHoleCount;
int m_notplatedPadsHoleCount; int m_notplatedPadsHoleCount;
int m_throughViasCount; int m_throughViasCount;
int m_microViasCount; int m_microViasCount;
int m_blindOrBuriedViasCount; int m_blindOrBuriedViasCount;
static bool m_createRpt; // true to create a drill file report static bool m_createRpt; // true to create a drill file report
static int m_createMap; // > 0 to create a map file report static int m_createMap; // > 0 to create a map file report
public:
DIALOG_GENDRILL( PCB_EDIT_FRAME* parent );
~DIALOG_GENDRILL();
private:
// Initialises member variables
void initDialog(); void initDialog();
void InitDisplayParams( void ); void InitDisplayParams( void );
...@@ -92,4 +93,4 @@ private: ...@@ -92,4 +93,4 @@ private:
DRILL_PRECISION GetPrecison(); DRILL_PRECISION GetPrecison();
}; };
#endif // _DIALOG_GENDRILL_H_ #endif // DIALOG_GENDRILL_H_
This diff is collapsed.
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 30 2011) // C++ code generated with wxFormBuilder (version Mar 19 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_GENDRILL_BASE_H__ #ifndef __DIALOG_GENDRILL_BASE_H__
#define __DIALOG_GENDRILL_BASE_H__ #define __DIALOG_GENDRILL_BASE_H__
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include "dialog_shim.h"
#include <wx/radiobox.h> #include <wx/string.h>
#include <wx/gdicmn.h> #include <wx/radiobox.h>
#include <wx/font.h> #include <wx/gdicmn.h>
#include <wx/colour.h> #include <wx/font.h>
#include <wx/settings.h> #include <wx/colour.h>
#include <wx/sizer.h> #include <wx/settings.h>
#include <wx/stattext.h> #include <wx/sizer.h>
#include <wx/textctrl.h> #include <wx/stattext.h>
#include <wx/statbox.h> #include <wx/textctrl.h>
#include <wx/checkbox.h> #include <wx/statbox.h>
#include <wx/button.h> #include <wx/checkbox.h>
#include <wx/dialog.h> #include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_GENDRILL_BASE ///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_GENDRILL_BASE
class DIALOG_GENDRILL_BASE : public wxDialog ///////////////////////////////////////////////////////////////////////////////
{ class DIALOG_GENDRILL_BASE : public DIALOG_SHIM
private: {
private:
protected:
wxRadioBox* m_Choice_Unit; protected:
wxRadioBox* m_Choice_Zeros_Format; wxRadioBox* m_Choice_Unit;
wxRadioBox* m_Choice_Precision; wxRadioBox* m_Choice_Zeros_Format;
wxRadioBox* m_Choice_Drill_Offset; wxRadioBox* m_Choice_Precision;
wxRadioBox* m_Choice_Drill_Map; wxRadioBox* m_Choice_Drill_Offset;
wxRadioBox* m_Choice_Drill_Report; wxRadioBox* m_Choice_Drill_Map;
wxStaticText* m_staticText1; wxRadioBox* m_Choice_Drill_Report;
wxTextCtrl* m_PenSpeed; wxStaticText* m_staticText1;
wxStaticText* m_staticText2; wxTextCtrl* m_PenSpeed;
wxTextCtrl* m_PenNum; wxStaticText* m_staticText2;
wxCheckBox* m_Check_Mirror; wxTextCtrl* m_PenNum;
wxCheckBox* m_Check_Minimal; wxCheckBox* m_Check_Mirror;
wxStaticBoxSizer* m_DefaultViasDrillSizer; wxCheckBox* m_Check_Minimal;
wxStaticText* m_ViaDrillValue; wxStaticBoxSizer* m_DefaultViasDrillSizer;
wxStaticBoxSizer* m_MicroViasDrillSizer; wxStaticText* m_ViaDrillValue;
wxStaticText* m_MicroViaDrillValue; wxStaticBoxSizer* m_MicroViasDrillSizer;
wxStaticText* m_PlatedPadsCountInfoMsg; wxStaticText* m_MicroViaDrillValue;
wxStaticText* m_NotPlatedPadsCountInfoMsg; wxStaticText* m_PlatedPadsCountInfoMsg;
wxStaticText* m_ThroughViasInfoMsg; wxStaticText* m_NotPlatedPadsCountInfoMsg;
wxStaticText* m_MicroViasInfoMsg; wxStaticText* m_ThroughViasInfoMsg;
wxStaticText* m_BuriedViasInfoMsg; wxStaticText* m_MicroViasInfoMsg;
wxButton* m_OkButton; wxStaticText* m_BuriedViasInfoMsg;
wxButton* m_CancelButton; wxButton* m_OkButton;
wxButton* m_CancelButton;
// Virtual event handlers, overide them in your derived class
virtual void OnSelDrillUnitsSelected( wxCommandEvent& event ) { event.Skip(); } // Virtual event handlers, overide them in your derived class
virtual void OnSelZerosFmtSelected( wxCommandEvent& event ) { event.Skip(); } virtual void OnSelDrillUnitsSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnSelZerosFmtSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
public:
public:
DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Drill Files Generation"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 447,385 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GENDRILL_BASE(); DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Drill Files Generation"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GENDRILL_BASE();
};
};
#endif //__DIALOG_GENDRILL_BASE_H__
#endif //__DIALOG_GENDRILL_BASE_H__
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#include <dialog_graphic_items_options.h> #include <dialog_graphic_items_options.h>
extern int g_DrawDefaultLineThickness;
void PCB_EDIT_FRAME::OnConfigurePcbOptions( wxCommandEvent& aEvent ) void PCB_EDIT_FRAME::OnConfigurePcbOptions( wxCommandEvent& aEvent )
{ {
......
This diff is collapsed.
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 17 2010) // C++ code generated with wxFormBuilder (version Mar 19 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_plot_base__ #ifndef __DIALOG_PLOT_BASE_H__
#define __dialog_plot_base__ #define __DIALOG_PLOT_BASE_H__
#include <wx/intl.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/string.h> #include <wx/intl.h>
#include <wx/stattext.h> #include "dialog_shim.h"
#include <wx/gdicmn.h> #include <wx/string.h>
#include <wx/font.h> #include <wx/stattext.h>
#include <wx/colour.h> #include <wx/gdicmn.h>
#include <wx/settings.h> #include <wx/font.h>
#include <wx/choice.h> #include <wx/colour.h>
#include <wx/sizer.h> #include <wx/settings.h>
#include <wx/textctrl.h> #include <wx/choice.h>
#include <wx/button.h> #include <wx/sizer.h>
#include <wx/checklst.h> #include <wx/textctrl.h>
#include <wx/statbox.h> #include <wx/button.h>
#include <wx/checkbox.h> #include <wx/checklst.h>
#include <wx/dialog.h> #include <wx/statbox.h>
#include <wx/checkbox.h>
/////////////////////////////////////////////////////////////////////////// #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PLOT_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_PLOT_BASE : public wxDialog /// Class DIALOG_PLOT_BASE
{ ///////////////////////////////////////////////////////////////////////////////
private: class DIALOG_PLOT_BASE : public DIALOG_SHIM
{
protected: private:
enum
{ protected:
ID_ALLOW_PRINT_PAD_ON_SILKSCREEN = 1000, enum
ID_PRINT_REF, {
ID_MIROR_OPT, ID_ALLOW_PRINT_PAD_ON_SILKSCREEN = 1000,
ID_CREATE_DRILL_FILE, ID_PRINT_REF,
}; ID_MIROR_OPT,
ID_CREATE_DRILL_FILE
wxBoxSizer* m_MainSizer; };
wxStaticText* m_staticText121;
wxChoice* m_plotFormatOpt; wxBoxSizer* m_MainSizer;
wxStaticText* m_staticTextDir; wxStaticText* m_staticText121;
wxTextCtrl* m_outputDirectoryName; wxChoice* m_plotFormatOpt;
wxButton* m_browseButton; wxStaticText* m_staticTextDir;
wxStaticBoxSizer* m_LayersSizer; wxTextCtrl* m_outputDirectoryName;
wxCheckListBox* m_layerCheckListBox; wxButton* m_browseButton;
wxBoxSizer* m_PlotOptionsSizer; wxStaticBoxSizer* m_LayersSizer;
wxCheckBox* m_plotSheetRef; wxCheckListBox* m_layerCheckListBox;
wxCheckBox* m_plotPads_on_Silkscreen; wxBoxSizer* m_PlotOptionsSizer;
wxCheckBox* m_plotModuleValueOpt; wxCheckBox* m_plotSheetRef;
wxCheckBox* m_plotModuleRefOpt; wxCheckBox* m_plotPads_on_Silkscreen;
wxCheckBox* m_plotTextOther; wxCheckBox* m_plotModuleValueOpt;
wxCheckBox* m_plotInvisibleText; wxCheckBox* m_plotModuleRefOpt;
wxCheckBox* m_plotNoViaOnMaskOpt; wxCheckBox* m_plotTextOther;
wxCheckBox* m_plotMirrorOpt; wxCheckBox* m_plotInvisibleText;
wxStaticText* m_staticText11; wxCheckBox* m_plotNoViaOnMaskOpt;
wxChoice* m_drillShapeOpt; wxCheckBox* m_plotMirrorOpt;
wxStaticText* m_staticText12; wxStaticText* m_staticText11;
wxChoice* m_scaleOpt; wxChoice* m_drillShapeOpt;
wxStaticText* m_staticText13; wxStaticText* m_staticText12;
wxChoice* m_plotModeOpt; wxChoice* m_scaleOpt;
wxStaticText* m_textDefaultPenSize; wxStaticText* m_staticText13;
wxTextCtrl* m_linesWidth; wxChoice* m_plotModeOpt;
wxStaticBoxSizer* m_GerberOptionsSizer; wxStaticText* m_textDefaultPenSize;
wxCheckBox* m_useGerberExtensions; wxTextCtrl* m_linesWidth;
wxCheckBox* m_excludeEdgeLayerOpt; wxStaticBoxSizer* m_GerberOptionsSizer;
wxCheckBox* m_subtractMaskFromSilk; wxCheckBox* m_useGerberExtensions;
wxCheckBox* m_useAuxOriginCheckBox; wxCheckBox* m_excludeEdgeLayerOpt;
wxStaticBoxSizer* m_HPGLOptionsSizer; wxCheckBox* m_subtractMaskFromSilk;
wxStaticText* m_textPenSize; wxCheckBox* m_useAuxOriginCheckBox;
wxTextCtrl* m_HPGLPenSizeOpt; wxStaticBoxSizer* m_HPGLOptionsSizer;
wxStaticText* m_textPenOvr; wxStaticText* m_textPenSize;
wxTextCtrl* m_HPGLPenOverlayOpt; wxTextCtrl* m_HPGLPenSizeOpt;
wxStaticText* m_textPenSpeed; wxStaticText* m_textPenOvr;
wxTextCtrl* m_HPGLPenSpeedOpt; wxTextCtrl* m_HPGLPenOverlayOpt;
wxStaticBoxSizer* m_PSOptionsSizer; wxStaticText* m_textPenSpeed;
wxStaticText* m_staticText7; wxTextCtrl* m_HPGLPenSpeedOpt;
wxTextCtrl* m_fineAdjustXscaleOpt; wxStaticBoxSizer* m_PSOptionsSizer;
wxStaticText* m_staticText8; wxStaticText* m_staticText7;
wxTextCtrl* m_fineAdjustYscaleOpt; wxTextCtrl* m_fineAdjustXscaleOpt;
wxStaticText* m_textPSFineAdjustWidth; wxStaticText* m_staticText8;
wxTextCtrl* m_PSFineAdjustWidthOpt; wxTextCtrl* m_fineAdjustYscaleOpt;
wxCheckBox* m_plotPSNegativeOpt; wxStaticText* m_textPSFineAdjustWidth;
wxCheckBox* m_forcePSA4OutputOpt; wxTextCtrl* m_PSFineAdjustWidthOpt;
wxTextCtrl* m_messagesBox; wxCheckBox* m_plotPSNegativeOpt;
wxButton* m_plotButton; wxCheckBox* m_forcePSA4OutputOpt;
wxButton* m_buttonDrill; wxTextCtrl* m_messagesBox;
wxButton* m_buttonQuit; wxButton* m_plotButton;
wxButton* m_buttonDrill;
// Virtual event handlers, overide them in your derived class wxButton* m_buttonQuit;
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); } // Virtual event handlers, overide them in your derived class
virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); } virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnSetScaleOpt( wxCommandEvent& event ) { event.Skip(); } virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); }
virtual void Plot( wxCommandEvent& event ) { event.Skip(); } virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); } virtual void OnSetScaleOpt( wxCommandEvent& event ) { event.Skip(); }
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); } virtual void Plot( wxCommandEvent& event ) { event.Skip(); }
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); }
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 474,747 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); public:
~DIALOG_PLOT_BASE();
DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
}; ~DIALOG_PLOT_BASE();
#endif //__dialog_plot_base__ };
#endif //__DIALOG_PLOT_BASE_H__
/****************************************/
/* File: dialog_print_for_modedit.cpp */ /* File: dialog_print_for_modedit.cpp */
/****************************************/
// Set this to 1 if you want to test PostScript printing under MSW. // Set this to 1 if you want to test PostScript printing under MSW.
#define wxTEST_POSTSCRIPT_IN_MSW 1 #define wxTEST_POSTSCRIPT_IN_MSW 1
...@@ -30,23 +30,27 @@ static wxPrintData* s_PrintData; ...@@ -30,23 +30,27 @@ static wxPrintData* s_PrintData;
static wxPageSetupDialogData* s_pageSetupData = (wxPageSetupDialogData*) NULL; static wxPageSetupDialogData* s_pageSetupData = (wxPageSetupDialogData*) NULL;
/* Dialog to print schematic. Class derived from DIALOG_PRINT_FOR_MODEDIT_BASE /**
* created by wxFormBuilder * Class DIALOG_PRINT_FOR_MODEDIT
* is derived from DIALOG_PRINT_FOR_MODEDIT_BASE which is created by wxFormBuilder.
*/ */
class DIALOG_PRINT_FOR_MODEDIT : public DIALOG_PRINT_FOR_MODEDIT_BASE class DIALOG_PRINT_FOR_MODEDIT : public DIALOG_PRINT_FOR_MODEDIT_BASE
{ {
private:
EDA_DRAW_FRAME* m_Parent;
wxConfig* m_Config;
public: public:
DIALOG_PRINT_FOR_MODEDIT( EDA_DRAW_FRAME* parent ); DIALOG_PRINT_FOR_MODEDIT( PCB_BASE_FRAME* parent );
~DIALOG_PRINT_FOR_MODEDIT() {};
private: private:
PCB_BASE_FRAME* m_parent;
wxConfig* m_config;
void OnCloseWindow( wxCloseEvent& event ); void OnCloseWindow( wxCloseEvent& event );
/// Open a dialog box for printer setup (printer options, page size ...)
void OnPrintSetup( wxCommandEvent& event ); void OnPrintSetup( wxCommandEvent& event );
void OnPrintPreview( wxCommandEvent& event ); void OnPrintPreview( wxCommandEvent& event );
/// Called on activate Print button
void OnPrintButtonClick( wxCommandEvent& event ); void OnPrintButtonClick( wxCommandEvent& event );
void OnButtonCancelClick( wxCommandEvent& event ) { Close(); } void OnButtonCancelClick( wxCommandEvent& event ) { Close(); }
...@@ -54,12 +58,7 @@ private: ...@@ -54,12 +58,7 @@ private:
}; };
/*************************************************************/
void FOOTPRINT_EDIT_FRAME::ToPrinter( wxCommandEvent& event ) void FOOTPRINT_EDIT_FRAME::ToPrinter( wxCommandEvent& event )
/*************************************************************/
/* Virtual function:
* Display the print dialog
*/
{ {
if( s_PrintData == NULL ) // First print if( s_PrintData == NULL ) // First print
{ {
...@@ -74,34 +73,27 @@ void FOOTPRINT_EDIT_FRAME::ToPrinter( wxCommandEvent& event ) ...@@ -74,34 +73,27 @@ void FOOTPRINT_EDIT_FRAME::ToPrinter( wxCommandEvent& event )
s_PrintData->SetOrientation( GetPageSettings().IsPortrait() ? wxPORTRAIT : wxLANDSCAPE ); s_PrintData->SetOrientation( GetPageSettings().IsPortrait() ? wxPORTRAIT : wxLANDSCAPE );
DIALOG_PRINT_FOR_MODEDIT* frame = new DIALOG_PRINT_FOR_MODEDIT( this ); DIALOG_PRINT_FOR_MODEDIT dlg( this );
frame->ShowModal(); dlg.ShowModal();
frame->Destroy();
} }
/*************************************************************************************/
DIALOG_PRINT_FOR_MODEDIT::DIALOG_PRINT_FOR_MODEDIT( EDA_DRAW_FRAME* parent ) : DIALOG_PRINT_FOR_MODEDIT::DIALOG_PRINT_FOR_MODEDIT( PCB_BASE_FRAME* parent ) :
DIALOG_PRINT_FOR_MODEDIT_BASE( parent ) DIALOG_PRINT_FOR_MODEDIT_BASE( parent )
/*************************************************************************************/
{ {
m_Parent = parent; m_parent = parent;
s_Parameters.m_ForceCentered = true; s_Parameters.m_ForceCentered = true;
m_Config = wxGetApp().GetSettings(); m_config = wxGetApp().GetSettings();
InitValues(); InitValues();
m_buttonPrint->SetDefault(); m_buttonPrint->SetDefault();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Center();
} }
/************************************************************************/
void DIALOG_PRINT_FOR_MODEDIT::InitValues( ) void DIALOG_PRINT_FOR_MODEDIT::InitValues( )
/************************************************************************/
{ {
SetFocus();
if( s_pageSetupData == NULL ) if( s_pageSetupData == NULL )
{ {
s_pageSetupData = new wxPageSetupDialogData; s_pageSetupData = new wxPageSetupDialogData;
...@@ -115,13 +107,12 @@ void DIALOG_PRINT_FOR_MODEDIT::InitValues( ) ...@@ -115,13 +107,12 @@ void DIALOG_PRINT_FOR_MODEDIT::InitValues( )
// Read the scale adjust option // Read the scale adjust option
int scale_Select = 3; // default selected scale = ScaleList[3] = 1 int scale_Select = 3; // default selected scale = ScaleList[3] = 1
if( m_Config ) if( m_config )
{ {
m_Config->Read( OPTKEY_PRINT_MODULE_SCALE, &scale_Select ); m_config->Read( OPTKEY_PRINT_MODULE_SCALE, &scale_Select );
m_Config->Read( OPTKEY_PRINT_MONOCHROME_MODE, &s_Parameters.m_Print_Black_and_White, 1); m_config->Read( OPTKEY_PRINT_MONOCHROME_MODE, &s_Parameters.m_Print_Black_and_White, 1);
} }
extern int g_DrawDefaultLineThickness;
s_Parameters.m_PenDefaultSize = g_DrawDefaultLineThickness; s_Parameters.m_PenDefaultSize = g_DrawDefaultLineThickness;
m_ScaleOption->SetSelection( scale_Select ); m_ScaleOption->SetSelection( scale_Select );
...@@ -130,25 +121,20 @@ void DIALOG_PRINT_FOR_MODEDIT::InitValues( ) ...@@ -130,25 +121,20 @@ void DIALOG_PRINT_FOR_MODEDIT::InitValues( )
} }
/********************************************************************/
void DIALOG_PRINT_FOR_MODEDIT::OnCloseWindow( wxCloseEvent& event ) void DIALOG_PRINT_FOR_MODEDIT::OnCloseWindow( wxCloseEvent& event )
/********************************************************************/
{ {
if( m_Config ) if( m_config )
{ {
m_Config->Write( OPTKEY_PRINT_MODULE_SCALE, m_ScaleOption->GetSelection() ); m_config->Write( OPTKEY_PRINT_MODULE_SCALE, m_ScaleOption->GetSelection() );
m_Config->Write( OPTKEY_PRINT_MONOCHROME_MODE, s_Parameters.m_Print_Black_and_White); m_config->Write( OPTKEY_PRINT_MONOCHROME_MODE, s_Parameters.m_Print_Black_and_White);
} }
EndModal( 0 ); EndModal( 0 );
} }
/**********************************************************/
void DIALOG_PRINT_FOR_MODEDIT::OnPrintSetup( wxCommandEvent& event )
/**********************************************************/
/* Open a dialog box for printer setup (printer options, page size ...) void DIALOG_PRINT_FOR_MODEDIT::OnPrintSetup( wxCommandEvent& event )
*/
{ {
wxPrintDialogData printDialogData( *s_PrintData ); wxPrintDialogData printDialogData( *s_PrintData );
...@@ -163,9 +149,9 @@ void DIALOG_PRINT_FOR_MODEDIT::OnPrintSetup( wxCommandEvent& event ) ...@@ -163,9 +149,9 @@ void DIALOG_PRINT_FOR_MODEDIT::OnPrintSetup( wxCommandEvent& event )
} }
/************************************************************/
void DIALOG_PRINT_FOR_MODEDIT::OnPrintPreview( wxCommandEvent& event ) void DIALOG_PRINT_FOR_MODEDIT::OnPrintPreview( wxCommandEvent& event )
/************************************************************/
/* Open and display a previewer frame for printing /* Open and display a previewer frame for printing
*/ */
...@@ -176,8 +162,8 @@ void DIALOG_PRINT_FOR_MODEDIT::OnPrintPreview( wxCommandEvent& event ) ...@@ -176,8 +162,8 @@ void DIALOG_PRINT_FOR_MODEDIT::OnPrintPreview( wxCommandEvent& event )
// Pass two printout objects: for preview, and possible printing. // Pass two printout objects: for preview, and possible printing.
wxString title = _( "Print Preview" ); wxString title = _( "Print Preview" );
wxPrintPreview* preview = wxPrintPreview* preview =
new wxPrintPreview( new BOARD_PRINTOUT_CONTROLER( s_Parameters, m_Parent, title ), new wxPrintPreview( new BOARD_PRINTOUT_CONTROLER( s_Parameters, m_parent, title ),
new BOARD_PRINTOUT_CONTROLER( s_Parameters, m_Parent, title ), new BOARD_PRINTOUT_CONTROLER( s_Parameters, m_parent, title ),
s_PrintData ); s_PrintData );
if( preview == NULL ) if( preview == NULL )
...@@ -187,9 +173,9 @@ void DIALOG_PRINT_FOR_MODEDIT::OnPrintPreview( wxCommandEvent& event ) ...@@ -187,9 +173,9 @@ void DIALOG_PRINT_FOR_MODEDIT::OnPrintPreview( wxCommandEvent& event )
} }
// Uses the parent position and size. // Uses the parent position and size.
// @todo uses last position and size ans store them when exit in m_Config // @todo uses last position and size ans store them when exit in m_config
wxPoint WPos = m_Parent->GetPosition(); wxPoint WPos = m_parent->GetPosition();
wxSize WSize = m_Parent->GetSize(); wxSize WSize = m_parent->GetSize();
wxPreviewFrame* frame = new wxPreviewFrame( preview, this, title, WPos, WSize ); wxPreviewFrame* frame = new wxPreviewFrame( preview, this, title, WPos, WSize );
...@@ -198,24 +184,23 @@ void DIALOG_PRINT_FOR_MODEDIT::OnPrintPreview( wxCommandEvent& event ) ...@@ -198,24 +184,23 @@ void DIALOG_PRINT_FOR_MODEDIT::OnPrintPreview( wxCommandEvent& event )
} }
/***************************************************************************/
void DIALOG_PRINT_FOR_MODEDIT::OnPrintButtonClick( wxCommandEvent& event ) void DIALOG_PRINT_FOR_MODEDIT::OnPrintButtonClick( wxCommandEvent& event )
/***************************************************************************/
/* Called on activate Print button
*/
{ {
PCB_PLOT_PARAMS plot_opts = m_parent->GetPlotSettings();
s_Parameters.m_Print_Black_and_White = m_ModeColorOption->GetSelection(); s_Parameters.m_Print_Black_and_White = m_ModeColorOption->GetSelection();
s_Parameters.m_PrintScale = s_ScaleList[m_ScaleOption->GetSelection()]; s_Parameters.m_PrintScale = s_ScaleList[m_ScaleOption->GetSelection()];
g_PcbPlotOptions.m_FineScaleAdjustX = s_Parameters.m_XScaleAdjust; plot_opts.m_FineScaleAdjustX = s_Parameters.m_XScaleAdjust;
g_PcbPlotOptions.m_FineScaleAdjustY = s_Parameters.m_YScaleAdjust; plot_opts.m_FineScaleAdjustY = s_Parameters.m_YScaleAdjust;
g_PcbPlotOptions.m_PlotScale = s_Parameters.m_PrintScale; plot_opts.m_PlotScale = s_Parameters.m_PrintScale;
m_parent->SetPlotSettings( plot_opts );
wxPrintDialogData printDialogData( *s_PrintData ); wxPrintDialogData printDialogData( *s_PrintData );
wxPrinter printer( &printDialogData ); wxPrinter printer( &printDialogData );
BOARD_PRINTOUT_CONTROLER printout( s_Parameters, m_Parent, _( "Print Footprint" ) ); BOARD_PRINTOUT_CONTROLER printout( s_Parameters, m_parent, _( "Print Footprint" ) );
#if !defined(__WINDOWS__) && !wxCHECK_VERSION(2,9,0) #if !defined(__WINDOWS__) && !wxCHECK_VERSION(2,9,0)
wxDC* dc = printout.GetDC(); wxDC* dc = printout.GetDC();
...@@ -232,4 +217,6 @@ void DIALOG_PRINT_FOR_MODEDIT::OnPrintButtonClick( wxCommandEvent& event ) ...@@ -232,4 +217,6 @@ void DIALOG_PRINT_FOR_MODEDIT::OnPrintButtonClick( wxCommandEvent& event )
{ {
*s_PrintData = printer.GetPrintDialogData().GetPrintData(); *s_PrintData = printer.GetPrintDialogData().GetPrintData();
} }
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 30 2011) // C++ code generated with wxFormBuilder (version Mar 19 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "dialog_print_for_modedit_base.h" #include "dialog_print_for_modedit_base.h"
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
DIALOG_PRINT_FOR_MODEDIT_BASE::DIALOG_PRINT_FOR_MODEDIT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) DIALOG_PRINT_FOR_MODEDIT_BASE::DIALOG_PRINT_FOR_MODEDIT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{ {
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
wxBoxSizer* bMainSizer; wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxHORIZONTAL ); bMainSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bmiddleLeftSizer; wxBoxSizer* bmiddleLeftSizer;
bmiddleLeftSizer = new wxBoxSizer( wxVERTICAL ); bmiddleLeftSizer = new wxBoxSizer( wxVERTICAL );
wxString m_ScaleOptionChoices[] = { _("fit in page"), _("Scale 0.5"), _("Scale 0.7"), _("Scale 1"), _("Scale 1.4"), _("Scale 2"), _("Scale 3"), _("Scale 4"), _("Scale 8"), _("Scale 16") }; wxString m_ScaleOptionChoices[] = { _("fit in page"), _("Scale 0.5"), _("Scale 0.7"), _("Scale 1"), _("Scale 1.4"), _("Scale 2"), _("Scale 3"), _("Scale 4"), _("Scale 8"), _("Scale 16") };
int m_ScaleOptionNChoices = sizeof( m_ScaleOptionChoices ) / sizeof( wxString ); int m_ScaleOptionNChoices = sizeof( m_ScaleOptionChoices ) / sizeof( wxString );
m_ScaleOption = new wxRadioBox( this, wxID_ANY, _("Approx. Scale:"), wxDefaultPosition, wxDefaultSize, m_ScaleOptionNChoices, m_ScaleOptionChoices, 1, wxRA_SPECIFY_COLS ); m_ScaleOption = new wxRadioBox( this, wxID_ANY, _("Approx. Scale:"), wxDefaultPosition, wxDefaultSize, m_ScaleOptionNChoices, m_ScaleOptionChoices, 1, wxRA_SPECIFY_COLS );
m_ScaleOption->SetSelection( 3 ); m_ScaleOption->SetSelection( 3 );
bmiddleLeftSizer->Add( m_ScaleOption, 0, wxALL, 5 ); bmiddleLeftSizer->Add( m_ScaleOption, 0, wxALL, 5 );
bMainSizer->Add( bmiddleLeftSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( bmiddleLeftSizer, 0, wxEXPAND, 5 );
wxBoxSizer* bmiddleRightSizer;
bmiddleRightSizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* bmiddleRightSizer;
bmiddleRightSizer = new wxBoxSizer( wxVERTICAL );
wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and white") };
int m_ModeColorOptionNChoices = sizeof( m_ModeColorOptionChoices ) / sizeof( wxString ); wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and white") };
m_ModeColorOption = new wxRadioBox( this, wxID_PRINT_MODE, _("Print Mode"), wxDefaultPosition, wxDefaultSize, m_ModeColorOptionNChoices, m_ModeColorOptionChoices, 1, wxRA_SPECIFY_COLS ); int m_ModeColorOptionNChoices = sizeof( m_ModeColorOptionChoices ) / sizeof( wxString );
m_ModeColorOption->SetSelection( 1 ); m_ModeColorOption = new wxRadioBox( this, wxID_PRINT_MODE, _("Print Mode"), wxDefaultPosition, wxDefaultSize, m_ModeColorOptionNChoices, m_ModeColorOptionChoices, 1, wxRA_SPECIFY_COLS );
m_ModeColorOption->SetToolTip( _("Choose if you want to draw the sheet like it appears on screen,\nor in black and white mode, better to print it when using black and white printers") ); m_ModeColorOption->SetSelection( 1 );
m_ModeColorOption->SetToolTip( _("Choose if you want to draw the sheet like it appears on screen,\nor in black and white mode, better to print it when using black and white printers") );
bmiddleRightSizer->Add( m_ModeColorOption, 0, wxALL|wxEXPAND, 5 );
bmiddleRightSizer->Add( m_ModeColorOption, 0, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bmiddleRightSizer, 1, 0, 5 );
wxBoxSizer* bbuttonsSizer; bMainSizer->Add( bmiddleRightSizer, 1, 0, 5 );
bbuttonsSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bbuttonsSizer;
m_buttonOption = new wxButton( this, wxID_PRINT_OPTIONS, _("Page Options"), wxDefaultPosition, wxDefaultSize, 0 ); bbuttonsSizer = new wxBoxSizer( wxVERTICAL );
bbuttonsSizer->Add( m_buttonOption, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonOption = new wxButton( this, wxID_PRINT_OPTIONS, _("Page Options"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonPreview = new wxButton( this, wxID_PREVIEW, _("Preview"), wxDefaultPosition, wxDefaultSize, 0 ); bbuttonsSizer->Add( m_buttonOption, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bbuttonsSizer->Add( m_buttonPreview, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonPreview = new wxButton( this, wxID_PREVIEW, _("Preview"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonPrint = new wxButton( this, wxID_PRINT_ALL, _("Print"), wxDefaultPosition, wxDefaultSize, 0 ); bbuttonsSizer->Add( m_buttonPreview, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bbuttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonPrint = new wxButton( this, wxID_PRINT_ALL, _("Print"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); bbuttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bbuttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
bMainSizer->Add( bbuttonsSizer, 0, 0, 5 ); bbuttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
this->SetSizer( bMainSizer );
this->Layout(); bMainSizer->Add( bbuttonsSizer, 0, 0, 5 );
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnCloseWindow ) ); this->SetSizer( bMainSizer );
m_buttonOption->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnPrintSetup ), NULL, this ); this->Layout();
m_buttonPreview->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnPrintPreview ), NULL, this ); bMainSizer->Fit( this );
m_buttonPrint->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnPrintButtonClick ), NULL, this );
m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnButtonCancelClick ), NULL, this ); this->Centre( wxBOTH );
}
// Connect Events
DIALOG_PRINT_FOR_MODEDIT_BASE::~DIALOG_PRINT_FOR_MODEDIT_BASE() this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnCloseWindow ) );
{ m_buttonOption->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnPrintSetup ), NULL, this );
// Disconnect Events m_buttonPreview->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnPrintPreview ), NULL, this );
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnCloseWindow ) ); m_buttonPrint->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnPrintButtonClick ), NULL, this );
m_buttonOption->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnPrintSetup ), NULL, this ); m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnButtonCancelClick ), NULL, this );
m_buttonPreview->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnPrintPreview ), NULL, this ); }
m_buttonPrint->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnPrintButtonClick ), NULL, this );
m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnButtonCancelClick ), NULL, this ); DIALOG_PRINT_FOR_MODEDIT_BASE::~DIALOG_PRINT_FOR_MODEDIT_BASE()
{
} // Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnCloseWindow ) );
m_buttonOption->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnPrintSetup ), NULL, this );
m_buttonPreview->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnPrintPreview ), NULL, this );
m_buttonPrint->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnPrintButtonClick ), NULL, this );
m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_FOR_MODEDIT_BASE::OnButtonCancelClick ), NULL, this );
}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 30 2011) // C++ code generated with wxFormBuilder (version Mar 19 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_PRINT_FOR_MODEDIT_BASE_H__ #ifndef __DIALOG_PRINT_FOR_MODEDIT_BASE_H__
#define __DIALOG_PRINT_FOR_MODEDIT_BASE_H__ #define __DIALOG_PRINT_FOR_MODEDIT_BASE_H__
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include "dialog_shim.h"
#include <wx/radiobox.h> #include <wx/string.h>
#include <wx/gdicmn.h> #include <wx/radiobox.h>
#include <wx/font.h> #include <wx/gdicmn.h>
#include <wx/colour.h> #include <wx/font.h>
#include <wx/settings.h> #include <wx/colour.h>
#include <wx/sizer.h> #include <wx/settings.h>
#include <wx/button.h> #include <wx/sizer.h>
#include <wx/dialog.h> #include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PRINT_FOR_MODEDIT_BASE ///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_PRINT_FOR_MODEDIT_BASE
class DIALOG_PRINT_FOR_MODEDIT_BASE : public wxDialog ///////////////////////////////////////////////////////////////////////////////
{ class DIALOG_PRINT_FOR_MODEDIT_BASE : public DIALOG_SHIM
private: {
private:
protected:
enum protected:
{ enum
wxID_PRINT_MODE = 1000, {
wxID_PRINT_OPTIONS, wxID_PRINT_MODE = 1000,
wxID_PRINT_ALL, wxID_PRINT_OPTIONS,
}; wxID_PRINT_ALL
};
wxRadioBox* m_ScaleOption;
wxRadioBox* m_ModeColorOption; wxRadioBox* m_ScaleOption;
wxButton* m_buttonOption; wxRadioBox* m_ModeColorOption;
wxButton* m_buttonPreview; wxButton* m_buttonOption;
wxButton* m_buttonPrint; wxButton* m_buttonPreview;
wxButton* m_buttonQuit; wxButton* m_buttonPrint;
wxButton* m_buttonQuit;
// Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); } // Virtual event handlers, overide them in your derived class
virtual void OnPrintSetup( wxCommandEvent& event ) { event.Skip(); } virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
virtual void OnPrintPreview( wxCommandEvent& event ) { event.Skip(); } virtual void OnPrintSetup( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPrintButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnPrintPreview( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnPrintButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCancelClick( wxCommandEvent& event ) { event.Skip(); }
public:
public:
DIALOG_PRINT_FOR_MODEDIT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Print"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 375,254 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PRINT_FOR_MODEDIT_BASE(); DIALOG_PRINT_FOR_MODEDIT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Print"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PRINT_FOR_MODEDIT_BASE();
};
};
#endif //__DIALOG_PRINT_FOR_MODEDIT_BASE_H__
#endif //__DIALOG_PRINT_FOR_MODEDIT_BASE_H__
...@@ -37,6 +37,9 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, ...@@ -37,6 +37,9 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
wxPoint offset; wxPoint offset;
wxString msg; wxString msg;
PLOTTER* plotter = NULL; PLOTTER* plotter = NULL;
const PCB_PLOT_PARAMS& plot_opts = aPcb->GetPlotOptions();
LOCALE_IO toggle; // use standard notation for float numbers LOCALE_IO toggle; // use standard notation for float numbers
// Calculate dimensions and center of PCB // Calculate dimensions and center of PCB
...@@ -58,53 +61,53 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, ...@@ -58,53 +61,53 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
break; break;
case PLOT_FORMAT_HPGL: // Scale for HPGL format. case PLOT_FORMAT_HPGL: // Scale for HPGL format.
{ {
offset.x = 0; offset.x = 0;
offset.y = 0; offset.y = 0;
scale = 1; scale = 1;
HPGL_PLOTTER* hpgl_plotter = new HPGL_PLOTTER; HPGL_PLOTTER* hpgl_plotter = new HPGL_PLOTTER;
plotter = hpgl_plotter; plotter = hpgl_plotter;
hpgl_plotter->set_pen_number( g_PcbPlotOptions.m_HPGLPenNum ); hpgl_plotter->set_pen_number( plot_opts.m_HPGLPenNum );
hpgl_plotter->set_pen_speed( g_PcbPlotOptions.m_HPGLPenSpeed ); hpgl_plotter->set_pen_speed( plot_opts.m_HPGLPenSpeed );
hpgl_plotter->set_pen_overlap( 0 ); hpgl_plotter->set_pen_overlap( 0 );
plotter->SetPageSettings( aSheet ); plotter->SetPageSettings( aSheet );
plotter->set_viewport( offset, scale, 0 ); plotter->set_viewport( offset, scale, 0 );
} }
break; break;
case PLOT_FORMAT_POST: case PLOT_FORMAT_POST:
{ {
PAGE_INFO pageA4( wxT( "A4" ) ); PAGE_INFO pageA4( wxT( "A4" ) );
wxSize pageSizeIU = pageA4.GetSizeIU(); wxSize pageSizeIU = pageA4.GetSizeIU();
// Keep size for drill legend // Keep size for drill legend
double Xscale = (double) ( pageSizeIU.x * 0.8 ) / dX; double Xscale = (double) ( pageSizeIU.x * 0.8 ) / dX;
double Yscale = (double) ( pageSizeIU.y * 0.6 ) / dY; double Yscale = (double) ( pageSizeIU.y * 0.6 ) / dY;
scale = MIN( Xscale, Yscale ); scale = MIN( Xscale, Yscale );
offset.x = (int) ( (double) BoardCentre.x - ( (double) pageSizeIU.x / 2.0 ) / scale ); offset.x = (int) ( (double) BoardCentre.x - ( (double) pageSizeIU.x / 2.0 ) / scale );
offset.y = (int) ( (double) BoardCentre.y - ( (double) pageSizeIU.y / 2.0 ) / scale ); offset.y = (int) ( (double) BoardCentre.y - ( (double) pageSizeIU.y / 2.0 ) / scale );
offset.y += pageSizeIU.y / 8; // offset to legend offset.y += pageSizeIU.y / 8; // offset to legend
PS_PLOTTER* ps_plotter = new PS_PLOTTER; PS_PLOTTER* ps_plotter = new PS_PLOTTER;
plotter = ps_plotter; plotter = ps_plotter;
ps_plotter->SetPageSettings( pageA4 ); ps_plotter->SetPageSettings( pageA4 );
plotter->set_viewport( offset, scale, 0 ); plotter->set_viewport( offset, scale, 0 );
}
break; break;
}
case PLOT_FORMAT_DXF: case PLOT_FORMAT_DXF:
{ {
offset.x = 0; offset.x = 0;
offset.y = 0; offset.y = 0;
scale = 1; scale = 1;
DXF_PLOTTER* dxf_plotter = new DXF_PLOTTER; DXF_PLOTTER* dxf_plotter = new DXF_PLOTTER;
plotter = dxf_plotter; plotter = dxf_plotter;
plotter->SetPageSettings( aSheet ); plotter->SetPageSettings( aSheet );
plotter->set_viewport( offset, scale, 0 ); plotter->set_viewport( offset, scale, 0 );
}
break; break;
}
default: default:
wxASSERT( false ); wxASSERT( false );
...@@ -122,19 +125,19 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, ...@@ -122,19 +125,19 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
switch( PtStruct->Type() ) switch( PtStruct->Type() )
{ {
case PCB_LINE_T: case PCB_LINE_T:
PlotDrawSegment( plotter, (DRAWSEGMENT*) PtStruct, EDGE_LAYER, FILLED ); PlotDrawSegment( plotter, plot_opts, (DRAWSEGMENT*) PtStruct, EDGE_LAYER, FILLED );
break; break;
case PCB_TEXT_T: case PCB_TEXT_T:
PlotTextePcb( plotter, (TEXTE_PCB*) PtStruct, EDGE_LAYER, FILLED ); PlotTextePcb( plotter, plot_opts, (TEXTE_PCB*) PtStruct, EDGE_LAYER, FILLED );
break; break;
case PCB_DIMENSION_T: case PCB_DIMENSION_T:
PlotDimension( plotter, (DIMENSION*) PtStruct, EDGE_LAYER, FILLED ); PlotDimension( plotter, plot_opts, (DIMENSION*) PtStruct, EDGE_LAYER, FILLED );
break; break;
case PCB_TARGET_T: case PCB_TARGET_T:
PlotPcbTarget( plotter, (PCB_TARGET*) PtStruct, EDGE_LAYER, FILLED ); PlotPcbTarget( plotter, plot_opts, (PCB_TARGET*) PtStruct, EDGE_LAYER, FILLED );
break; break;
case PCB_MARKER_T: // do not draw case PCB_MARKER_T: // do not draw
...@@ -182,7 +185,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, ...@@ -182,7 +185,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
plotY += intervalle; plotY += intervalle;
plot_diam = (int) ( aToolListBuffer[ii].m_Diameter ); plot_diam = (int) aToolListBuffer[ii].m_Diameter;
x = (int) ( (double) plotX - 200.0 * CharScale - (double)plot_diam / 2.0 ); x = (int) ( (double) plotX - 200.0 * CharScale - (double)plot_diam / 2.0 );
y = (int) ( (double) plotY + (double) CharSize * CharScale ); y = (int) ( (double) plotY + (double) CharSize * CharScale );
plotter->marker( wxPoint( x, y ), plot_diam, ii ); plotter->marker( wxPoint( x, y ), plot_diam, ii );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment