diff --git a/common/dialogs/panel_grid_settings.cpp b/common/dialogs/panel_grid_settings.cpp
index 8342b6a9b0..6a46d9116d 100644
--- a/common/dialogs/panel_grid_settings.cpp
+++ b/common/dialogs/panel_grid_settings.cpp
@@ -71,6 +71,18 @@ PANEL_GRID_SETTINGS::PANEL_GRID_SETTINGS( wxWindow* aParent, UNITS_PROVIDER* aUn
m_checkGridOverrideWires->Show( false );
m_gridOverrideWiresChoice->Show( false );
}
+
+ if( m_frameType == FRAME_GERBER )
+ {
+ m_overridesLabel->Show( false );
+ m_staticline3->Show( false );
+
+ m_checkGridOverrideText->Show( false );
+ m_gridOverrideTextChoice->Show( false );
+
+ m_checkGridOverrideGraphics->Show( false );
+ m_gridOverrideGraphicsChoice->Show( false );
+ }
}
int hk1 = ACTIONS::gridFast1.GetHotKey();
diff --git a/common/dialogs/panel_grid_settings_base.cpp b/common/dialogs/panel_grid_settings_base.cpp
index 284c981076..696f2d06c3 100644
--- a/common/dialogs/panel_grid_settings_base.cpp
+++ b/common/dialogs/panel_grid_settings_base.cpp
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
+// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -111,7 +111,7 @@ PANEL_GRID_SETTINGS_BASE::PANEL_GRID_SETTINGS_BASE( wxWindow* parent, wxWindowID
bSizerRightCol->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
wxFlexGridSizer* fgGridOverrides;
- fgGridOverrides = new wxFlexGridSizer( 0, 2, 4, 0 );
+ fgGridOverrides = new wxFlexGridSizer( 0, 2, 5, 0 );
fgGridOverrides->AddGrowableCol( 1 );
fgGridOverrides->SetFlexibleDirection( wxBOTH );
fgGridOverrides->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@@ -122,7 +122,7 @@ PANEL_GRID_SETTINGS_BASE::PANEL_GRID_SETTINGS_BASE( wxWindow* parent, wxWindowID
wxArrayString m_gridOverrideConnectedChoiceChoices;
m_gridOverrideConnectedChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_gridOverrideConnectedChoiceChoices, 0 );
m_gridOverrideConnectedChoice->SetSelection( 0 );
- fgGridOverrides->Add( m_gridOverrideConnectedChoice, 0, wxALL, 5 );
+ fgGridOverrides->Add( m_gridOverrideConnectedChoice, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_checkGridOverrideWires = new wxCheckBox( this, wxID_ANY, _("Wires:"), wxDefaultPosition, wxDefaultSize, 0 );
fgGridOverrides->Add( m_checkGridOverrideWires, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT, 8 );
@@ -130,7 +130,7 @@ PANEL_GRID_SETTINGS_BASE::PANEL_GRID_SETTINGS_BASE( wxWindow* parent, wxWindowID
wxArrayString m_gridOverrideWiresChoiceChoices;
m_gridOverrideWiresChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_gridOverrideWiresChoiceChoices, 0 );
m_gridOverrideWiresChoice->SetSelection( 0 );
- fgGridOverrides->Add( m_gridOverrideWiresChoice, 0, wxALL, 5 );
+ fgGridOverrides->Add( m_gridOverrideWiresChoice, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_checkGridOverrideVias = new wxCheckBox( this, wxID_ANY, _("Vias:"), wxDefaultPosition, wxDefaultSize, 0 );
fgGridOverrides->Add( m_checkGridOverrideVias, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT, 8 );
@@ -138,7 +138,7 @@ PANEL_GRID_SETTINGS_BASE::PANEL_GRID_SETTINGS_BASE( wxWindow* parent, wxWindowID
wxArrayString m_gridOverrideViasChoiceChoices;
m_gridOverrideViasChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_gridOverrideViasChoiceChoices, 0 );
m_gridOverrideViasChoice->SetSelection( 0 );
- fgGridOverrides->Add( m_gridOverrideViasChoice, 0, wxALL, 5 );
+ fgGridOverrides->Add( m_gridOverrideViasChoice, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_checkGridOverrideText = new wxCheckBox( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 );
fgGridOverrides->Add( m_checkGridOverrideText, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT, 8 );
@@ -146,7 +146,7 @@ PANEL_GRID_SETTINGS_BASE::PANEL_GRID_SETTINGS_BASE( wxWindow* parent, wxWindowID
wxArrayString m_gridOverrideTextChoiceChoices;
m_gridOverrideTextChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_gridOverrideTextChoiceChoices, 0 );
m_gridOverrideTextChoice->SetSelection( 0 );
- fgGridOverrides->Add( m_gridOverrideTextChoice, 0, wxALL, 5 );
+ fgGridOverrides->Add( m_gridOverrideTextChoice, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_checkGridOverrideGraphics = new wxCheckBox( this, wxID_ANY, _("Graphics:"), wxDefaultPosition, wxDefaultSize, 0 );
fgGridOverrides->Add( m_checkGridOverrideGraphics, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT, 8 );
@@ -154,7 +154,7 @@ PANEL_GRID_SETTINGS_BASE::PANEL_GRID_SETTINGS_BASE( wxWindow* parent, wxWindowID
wxArrayString m_gridOverrideGraphicsChoiceChoices;
m_gridOverrideGraphicsChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_gridOverrideGraphicsChoiceChoices, 0 );
m_gridOverrideGraphicsChoice->SetSelection( 0 );
- fgGridOverrides->Add( m_gridOverrideGraphicsChoice, 0, wxALL, 5 );
+ fgGridOverrides->Add( m_gridOverrideGraphicsChoice, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
bSizerRightCol->Add( fgGridOverrides, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 10 );
diff --git a/common/dialogs/panel_grid_settings_base.fbp b/common/dialogs/panel_grid_settings_base.fbp
index 2660fa64c2..9eeb29eeee 100644
--- a/common/dialogs/panel_grid_settings_base.fbp
+++ b/common/dialogs/panel_grid_settings_base.fbp
@@ -1,1833 +1,1860 @@
-
+
-
-
diff --git a/common/dialogs/panel_grid_settings_base.h b/common/dialogs/panel_grid_settings_base.h
index 245fc6f323..0f2094a48b 100644
--- a/common/dialogs/panel_grid_settings_base.h
+++ b/common/dialogs/panel_grid_settings_base.h
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
+// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp
index b014763608..868a5234df 100644
--- a/common/eda_base_frame.cpp
+++ b/common/eda_base_frame.cpp
@@ -1201,6 +1201,7 @@ void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParent
book->AddPage( new wxPanel( book ), _( "Gerber Viewer" ) );
book->AddLazySubPage( LAZY_CTOR( PANEL_GBR_DISPLAY_OPTIONS ), _( "Display Options" ) );
book->AddLazySubPage( LAZY_CTOR( PANEL_GBR_COLORS ), _( "Colors" ) );
+ book->AddLazySubPage( LAZY_CTOR( PANEL_GBR_GRIDS ), _( "Grids" ) );
book->AddLazySubPage( LAZY_CTOR( PANEL_GBR_EXCELLON_OPTIONS ), _( "Excellon Options" ) );
}
catch( ... )
diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp
index c9b16ffc28..2e75dd1a26 100644
--- a/common/tool/common_tools.cpp
+++ b/common/tool/common_tools.cpp
@@ -547,7 +547,7 @@ int COMMON_TOOLS::ToggleGridOverrides( const TOOL_EVENT& aEvent )
int COMMON_TOOLS::GridProperties( const TOOL_EVENT& aEvent )
{
auto showGridPrefs =
- [this]( wxString aParentName )
+ [this]( const wxString& aParentName )
{
m_frame->CallAfter(
[this, aParentName]()
@@ -563,6 +563,7 @@ int COMMON_TOOLS::GridProperties( const TOOL_EVENT& aEvent )
case FRAME_PCB_EDITOR: showGridPrefs( _( "PCB Editor" ) ); break;
case FRAME_FOOTPRINT_EDITOR: showGridPrefs( _( "Footprint Editor" ) ); break;
case FRAME_PL_EDITOR: showGridPrefs( _( "Drawing Sheet Editor" ) ); break;
+ case FRAME_GERBER: showGridPrefs( _( "Gerber Viewer" ) ); break;
default: wxFAIL_MSG( "Unknown frame: " + GetName() ); break;
}
diff --git a/gerbview/gerbview.cpp b/gerbview/gerbview.cpp
index 84050ddf23..7222861c23 100644
--- a/gerbview/gerbview.cpp
+++ b/gerbview/gerbview.cpp
@@ -39,6 +39,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -48,12 +49,13 @@ using json = nlohmann::json;
namespace GERBV {
-static struct IFACE : public KIFACE_BASE
+static struct IFACE : public KIFACE_BASE, public UNITS_PROVIDER
{
// Of course all are virtual overloads, implementations of the KIFACE.
IFACE( const char* aName, KIWAY::FACE_T aType ) :
- KIFACE_BASE( aName, aType )
+ KIFACE_BASE( aName, aType ),
+ UNITS_PROVIDER( gerbIUScale, EDA_UNITS::MILLIMETRES )
{}
bool OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway ) override;
@@ -61,7 +63,7 @@ static struct IFACE : public KIFACE_BASE
void OnKifaceEnd() override;
wxWindow* CreateKiWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway,
- int aCtlBits = 0 ) override
+ int aCtlBits = 0 ) override
{
switch( aClassId )
{
@@ -74,6 +76,18 @@ static struct IFACE : public KIFACE_BASE
case PANEL_GBR_EXCELLON_OPTIONS:
return new PANEL_GERBVIEW_EXCELLON_SETTINGS( aParent );
+ case PANEL_GBR_GRIDS:
+ {
+ SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
+ APP_SETTINGS_BASE* cfg = mgr.GetAppSettings();
+ EDA_BASE_FRAME* frame = aKiway->Player( FRAME_GERBER, false );
+
+ if( frame )
+ SetUserUnits( frame->GetUserUnits() );
+
+ return new PANEL_GRID_SETTINGS( aParent, this, frame, cfg, FRAME_GERBER );
+ }
+
case PANEL_GBR_COLORS:
return new PANEL_GERBVIEW_COLOR_SETTINGS( aParent );
diff --git a/include/frame_type.h b/include/frame_type.h
index c5b7bca780..77be547e80 100644
--- a/include/frame_type.h
+++ b/include/frame_type.h
@@ -103,6 +103,7 @@ enum FRAME_T
PANEL_GBR_DISPLAY_OPTIONS,
PANEL_GBR_EDIT_OPTIONS,
PANEL_GBR_EXCELLON_OPTIONS,
+ PANEL_GBR_GRIDS,
PANEL_GBR_COLORS,
PANEL_DS_DISPLAY_OPTIONS,