From 1152b0462c3d5a2bc7da035e08dad5cabb2cfa32 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 10 Mar 2024 18:21:29 +0000 Subject: [PATCH] Grid properties for GerbView. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17372 --- common/dialogs/panel_grid_settings.cpp | 12 + common/dialogs/panel_grid_settings_base.cpp | 14 +- common/dialogs/panel_grid_settings_base.fbp | 3673 ++++++++++--------- common/dialogs/panel_grid_settings_base.h | 2 +- common/eda_base_frame.cpp | 1 + common/tool/common_tools.cpp | 3 +- gerbview/gerbview.cpp | 20 +- include/frame_type.h | 1 + 8 files changed, 1891 insertions(+), 1835 deletions(-) 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 @@ - + - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - panel_grid_settings_base - 1000 - none - - - 1 - panel_grid_settings_base - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT - - - 1 - 1 - impl_virtual - - - 0 - wxID_ANY - + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + panel_grid_settings_base + 1000 + none + + + 1 + panel_grid_settings_base + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 0 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_GRID_SETTINGS_BASE + + -1,-1 + RESETTABLE_PANEL; widgets/resettable_panel.h; forward_declare + + 0 + + + wxTAB_TRAVERSAL + + + bSizerMain + wxVERTICAL + none + + 8 + wxEXPAND|wxTOP + 1 + - PANEL_GRID_SETTINGS_BASE - - -1,-1 - RESETTABLE_PANEL; widgets/resettable_panel.h; forward_declare - - 0 - - - wxTAB_TRAVERSAL - + bSizerColumns + wxHORIZONTAL + none + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + - bSizerMain + bSizerLeftCol wxVERTICAL none - - 8 - wxEXPAND|wxTOP - 1 - - - bSizerColumns - wxHORIZONTAL - none - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - - bSizerLeftCol - wxVERTICAL - none - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Grids: - 0 - - 0 - - - 0 - - 1 - m_gridsLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 3 - wxEXPAND|wxBOTTOM|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - 240,-1 - 1 - m_currentGridCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT - 0 - - - bSizerGridButtons - wxHORIZONTAL - none - - 5 - wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Add Grid - - 0 - - 0 - - - 0 - - 1 - m_addGridButton - 1 - - - protected - 1 - - - - Resizable - 1 - - - STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnAddGrid - - - - 5 - wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Move grid up in list - - 0 - - 0 - - - 0 - - 1 - m_moveUpButton - 1 - - - protected - 1 - - - - Resizable - 1 - - - STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnMoveGridUp - - - - 5 - - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Move grid up in list - - 0 - - 0 - - - 0 - - 1 - m_moveDownButton - 1 - - - protected - 1 - - - - Resizable - 1 - - - STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnMoveGridDown - - - - 5 - wxEXPAND - 0 - - 0 - protected - 25 - - - - 5 - - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Remove Grid - - 0 - - 0 - - - 0 - - 1 - m_removeGridButton - 1 - - - protected - 1 - - - - Resizable - 1 - - - STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnRemoveGrid - - - - - - - - 5 - wxEXPAND - 0 - - 0 - protected - 16 - - - - 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - - bSizerRightCol - wxVERTICAL - none - - 12 - wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Fast Grid Switching - 0 - - 0 - - - 0 - - 1 - m_staticText21 - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 2 - wxEXPAND|wxTOP|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline2 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 10 - wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT - 0 - - 3 - wxBOTH - 1 - - 5 - - fgSizer3 - wxFLEX_GROWMODE_SPECIFIED - none - 2 - 6 - - 8 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Grid 1: - 0 - - 0 - - - 0 - - 1 - m_staticTextGrid1 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - -1,-1 - 1 - m_grid1Ctrl - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - (hotkey) - 0 - - 0 - - - 0 - - 1 - m_grid1HotKey - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - 8 - wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Grid 2: - 0 - - 0 - - - 0 - - 1 - m_staticTextGrid2 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - -1,-1 - 1 - m_grid2Ctrl - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - (hotkey) - 0 - - 0 - - - 0 - - 1 - m_grid2HotKey - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - 13 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Grid Overrides - 0 - - 0 - - - 0 - - 1 - m_overridesLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 2 - wxEXPAND|wxTOP|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline3 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 10 - wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT - 0 - - 2 - wxBOTH - 1 - - 0 - - fgGridOverrides - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 4 - - 8 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Connected items: - - 0 - - - 0 - - 1 - m_checkGridOverrideConnected - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_gridOverrideConnectedChoice - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 8 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Wires: - - 0 - - - 0 - - 1 - m_checkGridOverrideWires - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_gridOverrideWiresChoice - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 8 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Vias: - - 0 - - - 0 - - 1 - m_checkGridOverrideVias - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_gridOverrideViasChoice - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 8 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Text: - - 0 - - - 0 - - 1 - m_checkGridOverrideText - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_gridOverrideTextChoice - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 8 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Graphics: - - 0 - - - 0 - - 1 - m_checkGridOverrideGraphics - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_gridOverrideGraphicsChoice - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Grids: + 0 + + 0 + + + 0 + + 1 + m_gridsLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + 3 + wxEXPAND|wxBOTTOM|wxLEFT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + 240,-1 + 1 + m_currentGridCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT + 0 + + + bSizerGridButtons + wxHORIZONTAL + none + + 5 + wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Add Grid + + 0 + + 0 + + + 0 + + 1 + m_addGridButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddGrid + + + + 5 + wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Move grid up in list + + 0 + + 0 + + + 0 + + 1 + m_moveUpButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnMoveGridUp + + + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Move grid up in list + + 0 + + 0 + + + 0 + + 1 + m_moveDownButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnMoveGridDown + + + + 5 + wxEXPAND + 0 + + 0 + protected + 25 + + + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Remove Grid + + 0 + + 0 + + + 0 + + 1 + m_removeGridButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnRemoveGrid + + + + + + + 5 + wxEXPAND + 0 + + 0 + protected + 16 + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + + bSizerRightCol + wxVERTICAL + none + + 12 + wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Fast Grid Switching + 0 + + 0 + + + 0 + + 1 + m_staticText21 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 2 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline2 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 10 + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT + 0 + + 3 + wxBOTH + 1 + + 5 + + fgSizer3 + wxFLEX_GROWMODE_SPECIFIED + none + 2 + 6 + + 8 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Grid 1: + 0 + + 0 + + + 0 + + 1 + m_staticTextGrid1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxEXPAND|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + -1,-1 + 1 + m_grid1Ctrl + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + (hotkey) + 0 + + 0 + + + 0 + + 1 + m_grid1HotKey + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + 8 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Grid 2: + 0 + + 0 + + + 0 + + 1 + m_staticTextGrid2 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + -1,-1 + 1 + m_grid2Ctrl + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + (hotkey) + 0 + + 0 + + + 0 + + 1 + m_grid2HotKey + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + 13 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Grid Overrides + 0 + + 0 + + + 0 + + 1 + m_overridesLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 2 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline3 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 10 + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT + 0 + + 2 + wxBOTH + 1 + + 0 + + fgGridOverrides + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 5 + + 8 + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Connected items: + + 0 + + + 0 + + 1 + m_checkGridOverrideConnected + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_gridOverrideConnectedChoice + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 8 + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Wires: + + 0 + + + 0 + + 1 + m_checkGridOverrideWires + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_gridOverrideWiresChoice + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 8 + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Vias: + + 0 + + + 0 + + 1 + m_checkGridOverrideVias + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_gridOverrideViasChoice + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 8 + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Text: + + 0 + + + 0 + + 1 + m_checkGridOverrideText + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_gridOverrideTextChoice + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 8 + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Graphics: + + 0 + + + 0 + + 1 + m_checkGridOverrideGraphics + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_gridOverrideGraphicsChoice + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + 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,