Commit c087883d authored by Marco Mattila's avatar Marco Mattila

Move layers into a wxCheckListBox in pcbnew plot dialog.

parent a609f260
...@@ -26,13 +26,13 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -26,13 +26,13 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_staticText121 = new wxStaticText( this, wxID_ANY, _("Plot format:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText121 = new wxStaticText( this, wxID_ANY, _("Plot format:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText121->Wrap( -1 ); m_staticText121->Wrap( -1 );
bSizer27->Add( m_staticText121, 0, wxALL, 5 ); bSizer27->Add( m_staticText121, 0, wxTOP, 5 );
wxString m_plotFormatOptChoices[] = { _("HPGL"), _("Gerber"), _("Postscript"), _("Postscript A4"), _("DXF") }; wxString m_plotFormatOptChoices[] = { _("HPGL"), _("Gerber"), _("Postscript"), _("Postscript A4"), _("DXF") };
int m_plotFormatOptNChoices = sizeof( m_plotFormatOptChoices ) / sizeof( wxString ); int m_plotFormatOptNChoices = sizeof( m_plotFormatOptChoices ) / sizeof( wxString );
m_plotFormatOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 0 ); m_plotFormatOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 0 );
m_plotFormatOpt->SetSelection( 0 ); m_plotFormatOpt->SetSelection( 0 );
bSizer27->Add( m_plotFormatOpt, 0, wxALL, 5 ); bSizer27->Add( m_plotFormatOpt, 0, 0, 5 );
bSizer26->Add( bSizer27, 0, wxEXPAND, 5 ); bSizer26->Add( bSizer27, 0, wxEXPAND, 5 );
...@@ -41,7 +41,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -41,7 +41,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output directory:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output directory:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextDir->Wrap( -1 ); m_staticTextDir->Wrap( -1 );
bSizer28->Add( m_staticTextDir, 0, wxALL|wxEXPAND, 5 ); bSizer28->Add( m_staticTextDir, 0, wxEXPAND|wxLEFT|wxTOP, 5 );
wxBoxSizer* bSizer29; wxBoxSizer* bSizer29;
bSizer29 = new wxBoxSizer( wxHORIZONTAL ); bSizer29 = new wxBoxSizer( wxHORIZONTAL );
...@@ -63,18 +63,9 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -63,18 +63,9 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
wxBoxSizer* bUpperSizer; wxBoxSizer* bUpperSizer;
bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbLayersSizer; m_LayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers") ), wxHORIZONTAL );
sbLayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers") ), wxHORIZONTAL );
m_CopperLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Copper Layers") ), wxVERTICAL ); bUpperSizer->Add( m_LayersSizer, 1, wxALL, 3 );
sbLayersSizer->Add( m_CopperLayersBoxSizer, 1, wxALL, 5 );
m_TechnicalLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Technical Layers") ), wxVERTICAL );
sbLayersSizer->Add( m_TechnicalLayersBoxSizer, 1, wxALL, 5 );
bUpperSizer->Add( sbLayersSizer, 1, wxALL, 3 );
m_PlotOptionsSizer = new wxBoxSizer( wxVERTICAL ); m_PlotOptionsSizer = new wxBoxSizer( wxVERTICAL );
...@@ -135,7 +126,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -135,7 +126,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
int m_drillShapeOptNChoices = sizeof( m_drillShapeOptChoices ) / sizeof( wxString ); int m_drillShapeOptNChoices = sizeof( m_drillShapeOptChoices ) / sizeof( wxString );
m_drillShapeOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 0 ); m_drillShapeOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 0 );
m_drillShapeOpt->SetSelection( 0 ); m_drillShapeOpt->SetSelection( 0 );
bSizer15->Add( m_drillShapeOpt, 0, wxEXPAND, 5 ); bSizer15->Add( m_drillShapeOpt, 0, wxEXPAND|wxLEFT, 5 );
m_staticText12 = new wxStaticText( this, wxID_ANY, _("Scaling:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText12 = new wxStaticText( this, wxID_ANY, _("Scaling:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText12->Wrap( -1 ); m_staticText12->Wrap( -1 );
...@@ -145,7 +136,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -145,7 +136,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
int m_scaleOptNChoices = sizeof( m_scaleOptChoices ) / sizeof( wxString ); int m_scaleOptNChoices = sizeof( m_scaleOptChoices ) / sizeof( wxString );
m_scaleOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 0 ); m_scaleOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 0 );
m_scaleOpt->SetSelection( 0 ); m_scaleOpt->SetSelection( 0 );
bSizer15->Add( m_scaleOpt, 0, wxEXPAND, 5 ); bSizer15->Add( m_scaleOpt, 0, wxEXPAND|wxLEFT, 5 );
m_staticText13 = new wxStaticText( this, wxID_ANY, _("Plot mode:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText13 = new wxStaticText( this, wxID_ANY, _("Plot mode:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText13->Wrap( -1 ); m_staticText13->Wrap( -1 );
...@@ -155,7 +146,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -155,7 +146,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
int m_plotModeOptNChoices = sizeof( m_plotModeOptChoices ) / sizeof( wxString ); int m_plotModeOptNChoices = sizeof( m_plotModeOptChoices ) / sizeof( wxString );
m_plotModeOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotModeOptNChoices, m_plotModeOptChoices, 0 ); m_plotModeOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotModeOptNChoices, m_plotModeOptChoices, 0 );
m_plotModeOpt->SetSelection( 0 ); m_plotModeOpt->SetSelection( 0 );
bSizer15->Add( m_plotModeOpt, 0, wxEXPAND, 5 ); bSizer15->Add( m_plotModeOpt, 0, wxEXPAND|wxLEFT, 5 );
m_textDefaultPenSize = new wxStaticText( this, wxID_ANY, _("Default linewidth"), wxDefaultPosition, wxDefaultSize, 0 ); m_textDefaultPenSize = new wxStaticText( this, wxID_ANY, _("Default linewidth"), wxDefaultPosition, wxDefaultSize, 0 );
m_textDefaultPenSize->Wrap( -1 ); m_textDefaultPenSize->Wrap( -1 );
...@@ -166,7 +157,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -166,7 +157,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_linesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_linesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_linesWidth->SetToolTip( _("Line width for, e.g., sheet references.") ); m_linesWidth->SetToolTip( _("Line width for, e.g., sheet references.") );
bSizer15->Add( m_linesWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bSizer15->Add( m_linesWidth, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 );
bSizer14->Add( bSizer15, 1, wxALL, 3 ); bSizer14->Add( bSizer15, 1, wxALL, 3 );
...@@ -316,9 +307,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -316,9 +307,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_plotButton->SetDefault(); m_plotButton->SetDefault();
bSizer191->Add( m_plotButton, 0, wxALL, 5 ); bSizer191->Add( m_plotButton, 0, wxALL, 5 );
m_buttonSaveOpt = new wxButton( this, ID_SAVE_OPT_PLOT, _("Apply Settings"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer191->Add( m_buttonSaveOpt, 0, wxALL, 5 );
m_buttonDrill = new wxButton( this, ID_CREATE_DRILL_FILE, _("Generate Drill File"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonDrill = new wxButton( this, ID_CREATE_DRILL_FILE, _("Generate Drill File"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer191->Add( m_buttonDrill, 0, wxALL, 5 ); bSizer191->Add( m_buttonDrill, 0, wxALL, 5 );
...@@ -340,7 +328,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -340,7 +328,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this );
m_scaleOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this ); m_scaleOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this );
m_plotButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this ); m_plotButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this );
m_buttonSaveOpt->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::applyPlotSettings ), NULL, this );
m_buttonDrill->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); m_buttonDrill->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this );
m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this );
} }
...@@ -354,7 +341,6 @@ DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE() ...@@ -354,7 +341,6 @@ DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE()
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this );
m_scaleOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this ); m_scaleOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this );
m_plotButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this ); m_plotButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this );
m_buttonSaveOpt->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::applyPlotSettings ), NULL, this );
m_buttonDrill->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); m_buttonDrill->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this );
m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this );
......
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxTOP</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="0"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag"></property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="0"> <object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
...@@ -321,7 +321,7 @@ ...@@ -321,7 +321,7 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND|wxLEFT|wxTOP</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="0"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
...@@ -600,48 +600,20 @@ ...@@ -600,48 +600,20 @@
<property name="name">bUpperSizer</property> <property name="name">bUpperSizer</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="1">
<property name="border">3</property> <property name="border">3</property>
<property name="flag">wxALL</property> <property name="flag">wxALL</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="0"> <object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Layers</property> <property name="label">Layers</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">sbLayersSizer</property> <property name="name">m_LayersSizer</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property>
<property name="label">Copper Layers</property>
<property name="minimum_size"></property>
<property name="name">m_CopperLayersBoxSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property>
<property name="label">Technical Layers</property>
<property name="minimum_size"></property>
<property name="name">m_TechnicalLayersBoxSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</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"></property> <property name="flag"></property>
...@@ -1467,7 +1439,7 @@ ...@@ -1467,7 +1439,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="0"> <object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
...@@ -1635,7 +1607,7 @@ ...@@ -1635,7 +1607,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="0"> <object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
...@@ -1803,7 +1775,7 @@ ...@@ -1803,7 +1775,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="0"> <object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
...@@ -1971,7 +1943,7 @@ ...@@ -1971,7 +1943,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property> <property name="flag">wxBOTTOM|wxEXPAND|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
...@@ -3760,91 +3732,6 @@ ...@@ -3760,91 +3732,6 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></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">ID_SAVE_OPT_PLOT</property>
<property name="label">Apply Settings</property>
<property name="layer"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_buttonSaveOpt</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="position"></property>
<property name="resize">Resizable</property>
<property name="row"></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">applyPlotSettings</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 class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxALL</property>
......
...@@ -39,7 +39,6 @@ class DIALOG_PLOT_BASE : public wxDialog ...@@ -39,7 +39,6 @@ class DIALOG_PLOT_BASE : public wxDialog
ID_ALLOW_PRINT_PAD_ON_SILKSCREEN = 1000, ID_ALLOW_PRINT_PAD_ON_SILKSCREEN = 1000,
ID_PRINT_REF, ID_PRINT_REF,
ID_MIROR_OPT, ID_MIROR_OPT,
ID_SAVE_OPT_PLOT,
ID_CREATE_DRILL_FILE, ID_CREATE_DRILL_FILE,
}; };
...@@ -49,8 +48,7 @@ class DIALOG_PLOT_BASE : public wxDialog ...@@ -49,8 +48,7 @@ class DIALOG_PLOT_BASE : public wxDialog
wxStaticText* m_staticTextDir; wxStaticText* m_staticTextDir;
wxTextCtrl* m_outputDirectoryName; wxTextCtrl* m_outputDirectoryName;
wxButton* m_browseButton; wxButton* m_browseButton;
wxStaticBoxSizer* m_CopperLayersBoxSizer; wxStaticBoxSizer* m_LayersSizer;
wxStaticBoxSizer* m_TechnicalLayersBoxSizer;
wxBoxSizer* m_PlotOptionsSizer; wxBoxSizer* m_PlotOptionsSizer;
wxCheckBox* m_plotSheetRef; wxCheckBox* m_plotSheetRef;
wxCheckBox* m_plotPads_on_Silkscreen; wxCheckBox* m_plotPads_on_Silkscreen;
...@@ -90,7 +88,6 @@ class DIALOG_PLOT_BASE : public wxDialog ...@@ -90,7 +88,6 @@ class DIALOG_PLOT_BASE : public wxDialog
wxTextCtrl* m_messagesBox; wxTextCtrl* m_messagesBox;
wxButton* m_plotButton; wxButton* m_plotButton;
wxButton* m_buttonSaveOpt;
wxButton* m_buttonDrill; wxButton* m_buttonDrill;
wxButton* m_buttonQuit; wxButton* m_buttonQuit;
...@@ -101,7 +98,6 @@ class DIALOG_PLOT_BASE : public wxDialog ...@@ -101,7 +98,6 @@ class DIALOG_PLOT_BASE : public wxDialog
virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSetScaleOpt( wxCommandEvent& event ) { event.Skip(); } virtual void OnSetScaleOpt( wxCommandEvent& event ) { event.Skip(); }
virtual void Plot( wxCommandEvent& event ) { event.Skip(); } virtual void Plot( wxCommandEvent& event ) { event.Skip(); }
virtual void applyPlotSettings( wxCommandEvent& event ) { event.Skip(); }
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); } virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); }
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); } virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }
......
...@@ -57,7 +57,8 @@ class DIALOG_PLOT : public DIALOG_PLOT_BASE ...@@ -57,7 +57,8 @@ class DIALOG_PLOT : public DIALOG_PLOT_BASE
public: public:
WinEDA_PcbFrame* m_Parent; WinEDA_PcbFrame* m_Parent;
wxConfig* m_Config; wxConfig* m_Config;
wxCheckBox* m_BoxSelectLayer[LAYER_COUNT]; // wxCheckBox list to select/deselec layers to plot std::vector<int> layerList; // List to hold CheckListBox layer numbers
wxCheckListBox* layerCheckListBox;
double m_XScaleAdjust; double m_XScaleAdjust;
double m_YScaleAdjust; double m_YScaleAdjust;
...@@ -102,7 +103,7 @@ private: ...@@ -102,7 +103,7 @@ private:
void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ); void OnOutputDirectoryBrowseClicked( wxCommandEvent& event );
void SetPlotFormat( wxCommandEvent& event ); void SetPlotFormat( wxCommandEvent& event );
void OnSetScaleOpt( wxCommandEvent& event ); void OnSetScaleOpt( wxCommandEvent& event );
void applyPlotSettings( wxCommandEvent& event ); void applyPlotSettings();
void CreateDrillFile( wxCommandEvent& event ); void CreateDrillFile( wxCommandEvent& event );
}; };
...@@ -115,6 +116,10 @@ DIALOG_PLOT::DIALOG_PLOT( WinEDA_PcbFrame* parent ) : ...@@ -115,6 +116,10 @@ DIALOG_PLOT::DIALOG_PLOT( WinEDA_PcbFrame* parent ) :
m_Parent = parent; m_Parent = parent;
m_Config = wxGetApp().m_EDA_Config; m_Config = wxGetApp().m_EDA_Config;
layerCheckListBox = new wxCheckListBox( this, wxID_ANY );
m_LayersSizer->Add( layerCheckListBox, 0, wxGROW | wxALL, 1 );
Init_Dialog(); Init_Dialog();
GetSizer()->Fit( this ); GetSizer()->Fit( this );
...@@ -169,40 +174,24 @@ void DIALOG_PLOT::Init_Dialog() ...@@ -169,40 +174,24 @@ void DIALOG_PLOT::Init_Dialog()
m_plotPSNegativeOpt->SetValue( g_PcbPlotOptions.m_PlotPSNegative ); m_plotPSNegativeOpt->SetValue( g_PcbPlotOptions.m_PlotPSNegative );
// Create layer list.
int layer;
for( layer = 0; layer < NB_LAYERS; ++layer )
{
if( !board->IsLayerEnabled( layer ) )
m_BoxSelectLayer[layer] = NULL;
else
m_BoxSelectLayer[layer] =
new wxCheckBox( this, -1, board->GetLayerName( layer ) );
}
// Add wxCheckBoxes in layers lists dialog
// List layers in same order than in setup layers dialog // List layers in same order than in setup layers dialog
// (Front or Top to Back or Bottom) // (Front or Top to Back or Bottom)
DECLARE_LAYERS_ORDER_LIST( layersOrder ); DECLARE_LAYERS_ORDER_LIST( layersOrder );
int layer_idx; int layerIndex, checkIndex, layer;
for( layer_idx = 0; layer_idx < NB_LAYERS; ++layer_idx ) for( layerIndex = 0; layerIndex < NB_LAYERS; layerIndex++ )
{ {
layer = layersOrder[layer_idx]; layer = layersOrder[layerIndex];
wxASSERT( layer < NB_LAYERS ); wxASSERT( layer < NB_LAYERS );
if( m_BoxSelectLayer[layer] == NULL ) if( !board->IsLayerEnabled( layer ) )
continue; continue;
if( layer < NB_COPPER_LAYERS ) layerList.push_back( layer );
m_CopperLayersBoxSizer->Add( m_BoxSelectLayer[layer], checkIndex = layerCheckListBox->Append( board->GetLayerName( layer ) );
0, wxGROW | wxALL, 1 );
else
m_TechnicalLayersBoxSizer->Add( m_BoxSelectLayer[layer],
0, wxGROW | wxALL, 1 );
if( g_PcbPlotOptions.GetLayerSelection() & ( 1 << layer ) ) if( g_PcbPlotOptions.GetLayerSelection() & ( 1 << layer ) )
m_BoxSelectLayer[layer]->SetValue( true ); layerCheckListBox->Check( checkIndex );
} }
// Option for using proper Gerber extensions // Option for using proper Gerber extensions
...@@ -269,6 +258,7 @@ void DIALOG_PLOT::OnQuit( wxCommandEvent& event ) ...@@ -269,6 +258,7 @@ void DIALOG_PLOT::OnQuit( wxCommandEvent& event )
void DIALOG_PLOT::OnClose( wxCloseEvent& event ) void DIALOG_PLOT::OnClose( wxCloseEvent& event )
{ {
applyPlotSettings();
EndModal( 0 ); EndModal( 0 );
} }
...@@ -438,7 +428,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) ...@@ -438,7 +428,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
} }
void DIALOG_PLOT::applyPlotSettings( wxCommandEvent& event ) void DIALOG_PLOT::applyPlotSettings()
{ {
PCB_PLOT_PARAMS tempOptions; PCB_PLOT_PARAMS tempOptions;
...@@ -549,14 +539,11 @@ void DIALOG_PLOT::applyPlotSettings( wxCommandEvent& event ) ...@@ -549,14 +539,11 @@ void DIALOG_PLOT::applyPlotSettings( wxCommandEvent& event )
tempOptions.m_PlotFormat = m_plotFormatOpt->GetSelection(); tempOptions.m_PlotFormat = m_plotFormatOpt->GetSelection();
long selectedLayers = 0; long selectedLayers = 0;
long mask = 1; unsigned int i;
int layer; for( i = 0; i < layerList.size(); i++ )
for( layer = 0; layer < NB_LAYERS; layer++, mask <<= 1 )
{ {
if( m_BoxSelectLayer[layer] == NULL ) if( layerCheckListBox->IsChecked( i ) )
continue; selectedLayers |= (1 << layerList[i]);
if( m_BoxSelectLayer[layer]->GetValue() )
selectedLayers |= mask;
} }
tempOptions.SetLayerSelection( selectedLayers ); tempOptions.SetLayerSelection( selectedLayers );
...@@ -584,7 +571,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event ) ...@@ -584,7 +571,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
BOARD* board = m_Parent->GetBoard(); BOARD* board = m_Parent->GetBoard();
applyPlotSettings( event ); applyPlotSettings();
// Create output directory if it does not exist // Create output directory if it does not exist
wxFileName outputDir = wxFileName::DirName( m_outputDirectoryName->GetValue() ); wxFileName outputDir = wxFileName::DirName( m_outputDirectoryName->GetValue() );
...@@ -680,14 +667,13 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event ) ...@@ -680,14 +667,13 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
DisplayInfoMessage( this, DisplayInfoMessage( this,
_( "Warning: Scale option set to a very large value" ) ); _( "Warning: Scale option set to a very large value" ) );
long mask = 1; unsigned int i;
for( layer = 0; layer < NB_LAYERS; layer++, mask <<= 1 ) for( i = 0; i < layerList.size(); i++ )
{ {
if( m_BoxSelectLayer[layer] == NULL )
continue;
bool success = false; bool success = false;
if( m_BoxSelectLayer[layer]->GetValue() ) if( layerCheckListBox->IsChecked( i ) )
{ {
layer = layerList[i];
fn = m_Parent->GetScreen()->GetFileName(); fn = m_Parent->GetScreen()->GetFileName();
fn.SetPath( outputDir.GetPath() ); fn.SetPath( outputDir.GetPath() );
......
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