Commit 53b8a8ca authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: add the board thickness setup in dialog_layers_setup.cpp (mainly for the 3D viewer)

parent 4e210a2d
......@@ -322,6 +322,9 @@ DIALOG_LAYERS_SETUP::DIALOG_LAYERS_SETUP( wxTopLevelWindow* aParent, BOARD* aBoa
m_copperLayerCount = m_pcb->GetCopperLayerCount();
showCopperChoice( m_copperLayerCount );
setCopperLayerCheckBoxes( m_copperLayerCount );
m_staticTextBrdThicknessUnit->SetLabel( GetAbbreviatedUnitsLabel( g_UserUnit ) );
PutValueInLocalUnits( *m_textCtrlBrdThickness,
m_pcb->GetDesignSettings().GetBoardThickness() );
showBoardLayerNames();
......@@ -620,6 +623,13 @@ void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event )
}
}
int thickness = ValueFromTextCtrl( *m_textCtrlBrdThickness );
// Clamp the value between reasonable values
thickness = Clamp( Millimeter2iu( 0.1 ), thickness, Millimeter2iu( 3.0 ) );
m_pcb->GetDesignSettings().SetBoardThickness( thickness );
EndModal( wxID_OK );
}
}
......
......@@ -33,7 +33,7 @@ DIALOG_LAYERS_SETUP_BASE::DIALOG_LAYERS_SETUP_BASE( wxWindow* parent, wxWindowID
bPresetsSizer->Add( m_PresetsChoice, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bChoicesSizer->Add( bPresetsSizer, 1, wxEXPAND, 5 );
bChoicesSizer->Add( bPresetsSizer, 0, wxEXPAND, 5 );
wxBoxSizer* bCopperLayersSizer;
bCopperLayersSizer = new wxBoxSizer( wxVERTICAL );
......@@ -49,7 +49,33 @@ DIALOG_LAYERS_SETUP_BASE::DIALOG_LAYERS_SETUP_BASE( wxWindow* parent, wxWindowID
bCopperLayersSizer->Add( m_CopperLayersChoice, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bChoicesSizer->Add( bCopperLayersSizer, 1, wxEXPAND, 5 );
bChoicesSizer->Add( bCopperLayersSizer, 0, wxEXPAND, 5 );
wxBoxSizer* bBrdThicknessSizer;
bBrdThicknessSizer = new wxBoxSizer( wxVERTICAL );
m_staticTextBrdThickness = new wxStaticText( this, wxID_ANY, _("Board Thickness"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextBrdThickness->Wrap( -1 );
bBrdThicknessSizer->Add( m_staticTextBrdThickness, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
wxFlexGridSizer* fgSizerBrdThickness;
fgSizerBrdThickness = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizerBrdThickness->AddGrowableCol( 0 );
fgSizerBrdThickness->SetFlexibleDirection( wxBOTH );
fgSizerBrdThickness->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_textCtrlBrdThickness = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerBrdThickness->Add( m_textCtrlBrdThickness, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticTextBrdThicknessUnit = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextBrdThicknessUnit->Wrap( -1 );
fgSizerBrdThickness->Add( m_staticTextBrdThicknessUnit, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
bBrdThicknessSizer->Add( fgSizerBrdThickness, 1, wxEXPAND, 5 );
bChoicesSizer->Add( bBrdThicknessSizer, 1, wxEXPAND, 5 );
bMainSizer->Add( bChoicesSizer, 0, wxEXPAND, 5 );
......
This diff is collapsed.
......@@ -22,9 +22,9 @@ class DIALOG_SHIM;
#include <wx/settings.h>
#include <wx/choice.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
#include <wx/panel.h>
#include <wx/checkbox.h>
#include <wx/textctrl.h>
#include <wx/scrolwin.h>
#include <wx/button.h>
#include <wx/dialog.h>
......@@ -192,6 +192,9 @@ class DIALOG_LAYERS_SETUP_BASE : public DIALOG_SHIM
wxChoice* m_PresetsChoice;
wxStaticText* m_staticTextCopperLayers;
wxChoice* m_CopperLayersChoice;
wxStaticText* m_staticTextBrdThickness;
wxTextCtrl* m_textCtrlBrdThickness;
wxStaticText* m_staticTextBrdThicknessUnit;
wxStaticText* m_staticTextLayers;
wxPanel* m_TitlePanel;
wxScrolledWindow* m_LayersListPanel;
......
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