From cbb3492d98f09d59fd0ddb3a756911c1abec0822 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 11 Sep 2018 16:28:57 +0100 Subject: [PATCH] Standardize Footprint Viewer and Footprint Browser. Add Display Settings to Footprint Browser. Make each of them OpenGL on OSX and Cairo on other platforms. Allow auto-zoom to be turned off and save last zoom setting. Make ordering of tools in htoolbar consistent. Standardize grid and zoom drop-downs. Fixes: lp:1791667 * https://bugs.launchpad.net/kicad/+bug/1791667 --- common/tool/actions.cpp | 4 + common/tool/common_tools.cpp | 21 + cvpcb/dialogs/dialog_display_options.cpp | 28 +- cvpcb/dialogs/dialog_display_options_base.cpp | 38 +- cvpcb/dialogs/dialog_display_options_base.fbp | 286 +- cvpcb/dialogs/dialog_display_options_base.h | 6 +- cvpcb/display_footprints_frame.cpp | 107 +- cvpcb/display_footprints_frame.h | 14 +- include/draw_frame.h | 7 +- include/pcb_base_frame.h | 84 +- include/tool/actions.h | 1 + include/tool/common_tools.h | 2 + pcbnew/CMakeLists.txt | 2 + .../dialog_fp_browser_display_options.cpp | 97 + .../dialog_fp_browser_display_options.h | 49 + ...dialog_fp_browser_display_options_base.cpp | 84 + ...dialog_fp_browser_display_options_base.fbp | 697 ++ .../dialog_fp_browser_display_options_base.h | 61 + ...log_global_edit_text_and_graphics_base.cpp | 4 +- ...log_global_edit_text_and_graphics_base.fbp | 6502 ++++++++--------- ...ialog_global_edit_text_and_graphics_base.h | 2 +- pcbnew/edit.cpp | 1 - pcbnew/footprint_edit_frame.cpp | 3 - pcbnew/footprint_edit_frame.h | 1 - pcbnew/footprint_preview_panel.cpp | 21 +- pcbnew/footprint_viewer_frame.cpp | 117 +- pcbnew/footprint_viewer_frame.h | 16 +- pcbnew/footprint_wizard_frame.cpp | 6 +- pcbnew/pcb_base_frame.cpp | 5 +- pcbnew/pcbnew.cpp | 2 +- pcbnew/pcbnew_id.h | 1 + pcbnew/tool_footprint_editor.cpp | 55 +- pcbnew/tool_footprint_viewer.cpp | 41 +- 33 files changed, 4434 insertions(+), 3931 deletions(-) create mode 100644 pcbnew/dialogs/dialog_fp_browser_display_options.cpp create mode 100644 pcbnew/dialogs/dialog_fp_browser_display_options.h create mode 100644 pcbnew/dialogs/dialog_fp_browser_display_options_base.cpp create mode 100644 pcbnew/dialogs/dialog_fp_browser_display_options_base.fbp create mode 100644 pcbnew/dialogs/dialog_fp_browser_display_options_base.h diff --git a/common/tool/actions.cpp b/common/tool/actions.cpp index 0aa24e8cb2..06cb7b9e02 100644 --- a/common/tool/actions.cpp +++ b/common/tool/actions.cpp @@ -43,6 +43,10 @@ TOOL_ACTION ACTIONS::zoomPreset( "common.Control.zoomPreset", AS_GLOBAL, 0, "", "" ); +TOOL_ACTION ACTIONS::centerContents( "common.Control.centerContents", + AS_GLOBAL, 0, + "", "" ); + // Grid control TOOL_ACTION ACTIONS::gridFast1( "common.Control.gridFast1", AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_GRID_TO_FASTGRID1 ), diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp index 09f966dc80..727fcd3361 100644 --- a/common/tool/common_tools.cpp +++ b/common/tool/common_tools.cpp @@ -164,6 +164,25 @@ int COMMON_TOOLS::ZoomFitScreen( const TOOL_EVENT& aEvent ) } +int COMMON_TOOLS::CenterContents( const TOOL_EVENT& aEvent ) +{ + EDA_DRAW_PANEL_GAL* galCanvas = m_frame->GetGalCanvas(); + BOX2I bBox = getModel()->ViewBBox(); + + if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 ) + bBox = galCanvas->GetDefaultViewBBox(); + + getView()->SetCenter( bBox.Centre() ); + + // Take scrollbars into account + VECTOR2D scrollbarSize = VECTOR2D( galCanvas->GetSize() - galCanvas->GetClientSize() ); + VECTOR2D worldScrollbarSize = getView()->ToWorld( scrollbarSize, false ); + getView()->SetCenter( getView()->GetCenter() + worldScrollbarSize / 2.0 ); + + return 0; +} + + int COMMON_TOOLS::ZoomPreset( const TOOL_EVENT& aEvent ) { unsigned int idx = aEvent.Parameter(); @@ -257,6 +276,8 @@ void COMMON_TOOLS::setTransitions() Go( &COMMON_TOOLS::ZoomFitScreen, ACTIONS::zoomFitScreen.MakeEvent() ); Go( &COMMON_TOOLS::ZoomPreset, ACTIONS::zoomPreset.MakeEvent() ); + Go( &COMMON_TOOLS::CenterContents, ACTIONS::centerContents.MakeEvent() ); + Go( &COMMON_TOOLS::GridNext, ACTIONS::gridNext.MakeEvent() ); Go( &COMMON_TOOLS::GridPrev, ACTIONS::gridPrev.MakeEvent() ); Go( &COMMON_TOOLS::GridPreset, ACTIONS::gridPreset.MakeEvent() ); diff --git a/cvpcb/dialogs/dialog_display_options.cpp b/cvpcb/dialogs/dialog_display_options.cpp index 7f8e32d568..9c8ff78c10 100644 --- a/cvpcb/dialogs/dialog_display_options.cpp +++ b/cvpcb/dialogs/dialog_display_options.cpp @@ -21,17 +21,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file cvpcb/dialogs/dialog_display_options.cpp - */ - #include -//#include #include #include #include -#include #include #include @@ -56,15 +50,12 @@ DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( DISPLAY_FO FinishDialogSettings();; } + DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::~DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( ) { } -/*! - * Control creation for DIALOG_FOOTPRINTS_DISPLAY_OPTIONS - */ - void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::initDialog() { /* mandatory to use escape key as cancel under wxGTK. */ @@ -77,17 +68,10 @@ void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::initDialog() m_ShowPadSketch->SetValue( not displ_opts->m_DisplayPadFill ); m_ShowPadNum->SetValue( displ_opts->m_DisplayPadNum ); - m_enableZoomNoCenter->SetValue( not m_Parent->GetCanvas()->GetEnableZoomNoCenter() ); - m_enableMousewheelPan->SetValue( m_Parent->GetCanvas()->GetEnableMousewheelPan() ); - m_enableAutoPan->SetValue( m_Parent->GetCanvas()->GetEnableAutoPan() ); + m_autoZoomOption->SetValue( m_Parent->GetAutoZoom() ); } - -/*! - * Update settings related to edges, text strings, and pads - */ - void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings( void ) { auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_Parent->GetDisplayOptions(); @@ -96,13 +80,9 @@ void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings( void ) displ_opts->m_DisplayModTextFill = not m_TextDisplayOption->GetValue(); displ_opts->m_DisplayPadNum = m_ShowPadNum->GetValue(); displ_opts->m_DisplayPadFill = not m_ShowPadSketch->GetValue(); + m_Parent->ApplyDisplaySettingsToGAL(); - m_Parent->GetCanvas()->SetEnableZoomNoCenter( not m_enableZoomNoCenter->GetValue() ); - m_Parent->GetCanvas()->SetEnableMousewheelPan( m_enableMousewheelPan->GetValue() ); - m_Parent->GetCanvas()->SetEnableAutoPan( m_enableAutoPan->GetValue() ); - - m_Parent->applyDisplaySettingsToGAL(); - m_Parent->GetCanvas()->Refresh(); + m_Parent->SetAutoZoom( m_autoZoomOption->GetValue() ); } diff --git a/cvpcb/dialogs/dialog_display_options_base.cpp b/cvpcb/dialogs/dialog_display_options_base.cpp index e29059ae6d..df4ace01c8 100644 --- a/cvpcb/dialogs/dialog_display_options_base.cpp +++ b/cvpcb/dialogs/dialog_display_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 11 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -20,10 +20,10 @@ DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); wxStaticBoxSizer* sbSizerDrawMode; - sbSizerDrawMode = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Draw Options:") ), wxVERTICAL ); + sbSizerDrawMode = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Drawing Options") ), wxVERTICAL ); m_EdgesDisplayOption = new wxCheckBox( sbSizerDrawMode->GetStaticBox(), wxID_ANY, _("Graphic items sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizerDrawMode->Add( m_EdgesDisplayOption, 0, wxALL, 5 ); + sbSizerDrawMode->Add( m_EdgesDisplayOption, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_TextDisplayOption = new wxCheckBox( sbSizerDrawMode->GetStaticBox(), wxID_ANY, _("Texts sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizerDrawMode->Add( m_TextDisplayOption, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); @@ -31,38 +31,30 @@ DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( m_ShowPadSketch = new wxCheckBox( sbSizerDrawMode->GetStaticBox(), ID_PADFILL_OPT, _("Pad sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizerDrawMode->Add( m_ShowPadSketch, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - m_ShowPadNum = new wxCheckBox( sbSizerDrawMode->GetStaticBox(), wxID_ANY, _("Show pad &number"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizerDrawMode->Add( m_ShowPadNum, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + sbSizerDrawMode->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + m_ShowPadNum = new wxCheckBox( sbSizerDrawMode->GetStaticBox(), wxID_ANY, _("Show pad &numbers"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerDrawMode->Add( m_ShowPadNum, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bUpperSizer->Add( sbSizerDrawMode, 1, wxEXPAND|wxALL, 5 ); wxStaticBoxSizer* sbSizerViewOpt; - sbSizerViewOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pan and Zoom:") ), wxVERTICAL ); + sbSizerViewOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Auto-zoom") ), wxVERTICAL ); - m_enableZoomNoCenter = new wxCheckBox( sbSizerViewOpt->GetStaticBox(), wxID_ANY, _("Center and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 ); - m_enableZoomNoCenter->SetToolTip( _("Center the cursor on screen when zooming.") ); - - sbSizerViewOpt->Add( m_enableZoomNoCenter, 0, wxEXPAND|wxALL, 5 ); - - m_enableMousewheelPan = new wxCheckBox( sbSizerViewOpt->GetStaticBox(), wxID_ANY, _("Use touchpad to pan"), wxDefaultPosition, wxDefaultSize, 0 ); - m_enableMousewheelPan->SetToolTip( _("Enable touchpad-friendly controls (pan with scroll action, zoom with Ctrl+scroll).") ); - - sbSizerViewOpt->Add( m_enableMousewheelPan, 0, wxALL, 5 ); - - m_enableAutoPan = new wxCheckBox( sbSizerViewOpt->GetStaticBox(), wxID_ANY, _("Pan while moving object"), wxDefaultPosition, wxDefaultSize, 0 ); - m_enableAutoPan->SetToolTip( _("When drawing a track or moving an item, pan when approaching the edge of the display.") ); - - sbSizerViewOpt->Add( m_enableAutoPan, 0, wxALL, 5 ); + m_autoZoomOption = new wxCheckBox( sbSizerViewOpt->GetStaticBox(), wxID_ANY, _("Zoom to fit when changing footprint"), wxDefaultPosition, wxDefaultSize, 0 ); + m_autoZoomOption->SetValue(true); + sbSizerViewOpt->Add( m_autoZoomOption, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - bUpperSizer->Add( sbSizerViewOpt, 0, wxALL|wxEXPAND, 5 ); + bUpperSizer->Add( sbSizerViewOpt, 1, wxALL|wxEXPAND, 5 ); - bSizerMain->Add( bUpperSizer, 1, wxEXPAND, 5 ); + bSizerMain->Add( bUpperSizer, 1, wxEXPAND|wxALL, 5 ); m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); diff --git a/cvpcb/dialogs/dialog_display_options_base.fbp b/cvpcb/dialogs/dialog_display_options_base.fbp index fb1844fa09..0f503c2b7d 100644 --- a/cvpcb/dialogs/dialog_display_options_base.fbp +++ b/cvpcb/dialogs/dialog_display_options_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,7 +14,6 @@ dialog_display_options_base 1000 none - 1 dialog_display_options_base @@ -55,20 +54,13 @@ - + - - - - - - - @@ -83,23 +75,17 @@ - - - - - - @@ -109,7 +95,7 @@ none 5 - wxEXPAND + wxEXPAND|wxALL 1 @@ -122,7 +108,7 @@ 1 wxID_ANY - Draw Options: + Drawing Options sbSizerDrawMode wxVERTICAL @@ -131,7 +117,7 @@ 5 - wxALL + wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -191,14 +177,7 @@ - - - - - - - @@ -286,14 +265,7 @@ - - - - - - - @@ -381,14 +353,7 @@ - - - - - - - @@ -416,7 +381,17 @@ 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + wxEXPAND|wxTOP|wxBOTTOM + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -447,7 +422,7 @@ 0 0 wxID_ANY - Show pad &number + Show pad &numbers 0 @@ -476,14 +451,7 @@ - - - - - - - @@ -514,10 +482,10 @@ 5 wxALL|wxEXPAND - 0 + 1 wxID_ANY - Pan and Zoom: + Auto-zoom sbSizerViewOpt wxVERTICAL @@ -526,7 +494,7 @@ 5 - wxEXPAND|wxALL + wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -542,7 +510,7 @@ 1 0 - 0 + 1 1 1 @@ -557,7 +525,7 @@ 0 0 wxID_ANY - Center and warp cursor on zoom + Zoom to fit when changing footprint 0 @@ -565,102 +533,7 @@ 0 1 - m_enableZoomNoCenter - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Center the cursor on screen when zooming. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Use touchpad to pan - - 0 - - - 0 - - 1 - m_enableMousewheelPan + m_autoZoomOption 1 @@ -673,7 +546,7 @@ ; forward_declare 0 - Enable touchpad-friendly controls (pan with scroll action, zoom with Ctrl+scroll). + wxFILTER_NONE wxDefaultValidator @@ -681,109 +554,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Pan while moving object - - 0 - - - 0 - - 1 - m_enableAutoPan - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - When drawing a track or moving an item, pan when approaching the edge of the display. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - @@ -815,7 +586,7 @@ 5 - wxEXPAND | wxALL + wxEXPAND|wxRIGHT|wxLEFT 0 1 @@ -869,14 +640,7 @@ - - - - - - - diff --git a/cvpcb/dialogs/dialog_display_options_base.h b/cvpcb/dialogs/dialog_display_options_base.h index 88fb332b50..790450ce54 100644 --- a/cvpcb/dialogs/dialog_display_options_base.h +++ b/cvpcb/dialogs/dialog_display_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 11 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -40,9 +40,7 @@ class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM wxCheckBox* m_TextDisplayOption; wxCheckBox* m_ShowPadSketch; wxCheckBox* m_ShowPadNum; - wxCheckBox* m_enableZoomNoCenter; - wxCheckBox* m_enableMousewheelPan; - wxCheckBox* m_enableAutoPan; + wxCheckBox* m_autoZoomOption; wxStaticLine* m_staticline1; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index 4d37a505da..df88fd5090 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -68,6 +68,8 @@ BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, PCB_BASE_FRAME ) EVT_CLOSE( DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow ) EVT_TOOL( ID_OPTIONS_SETUP, DISPLAY_FOOTPRINTS_FRAME::InstallOptionsDisplay ) EVT_TOOL( ID_CVPCB_SHOW3D_FRAME, DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame ) + EVT_CHOICE( ID_ON_ZOOM_SELECT, DISPLAY_FOOTPRINTS_FRAME::OnSelectZoom ) + EVT_CHOICE( ID_ON_GRID_SELECT, DISPLAY_FOOTPRINTS_FRAME::OnSelectGrid ) EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, DISPLAY_FOOTPRINTS_FRAME::OnUIToolSelection ) EVT_UPDATE_UI( ID_TB_MEASUREMENT_TOOL, DISPLAY_FOOTPRINTS_FRAME::OnUIToolSelection ) @@ -123,7 +125,12 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa ReCreateOptToolbar(); // Create GAL canvas +#ifdef __WXMAC__ + // Cairo renderer doesn't handle Retina displays + EDA_DRAW_PANEL_GAL::GAL_TYPE backend = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; +#else EDA_DRAW_PANEL_GAL::GAL_TYPE backend = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO; +#endif auto* gal_drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize, GetGalDisplayOptions(), backend ); SetGalCanvas( gal_drawPanel ); @@ -156,11 +163,12 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa m_toolManager->InvokeTool( "cvpcb.InteractiveSelection" ); auto& galOpts = GetGalDisplayOptions(); - galOpts.m_fullscreenCursor = true; - galOpts.m_forceDisplayCursor = true; galOpts.m_axesEnabled = true; + UseGalCanvas( true ); + + // Restore last zoom. (If auto-zooming we'll adjust when we load the footprint.) + GetGalCanvas()->GetView()->SetScale( m_lastZoom ); - UseGalCanvas( backend != EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ); updateView(); Show( true ); @@ -169,13 +177,10 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME() { - if( IsGalCanvasActive() ) - { - GetGalCanvas()->StopDrawing(); - GetGalCanvas()->GetView()->Clear(); - // Be sure any event cannot be fired after frame deletion: - GetGalCanvas()->SetEvtHandlerEnabled( false ); - } + GetGalCanvas()->StopDrawing(); + GetGalCanvas()->GetView()->Clear(); + // Be sure any event cannot be fired after frame deletion: + GetGalCanvas()->SetEvtHandlerEnabled( false ); // Be sure a active tool (if exists) is desactivated: if( m_toolManager ) @@ -273,7 +278,7 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar() m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize, KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT ); - m_mainToolBar->AddTool( ID_OPTIONS_SETUP, wxEmptyString, KiScaledBitmap( display_options_xpm, this ), + m_mainToolBar->AddTool( ID_OPTIONS_SETUP, wxEmptyString, KiScaledBitmap( config_xpm, this ), _( "Display options" ) ); m_mainToolBar->AddSeparator(); @@ -297,26 +302,56 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar() m_mainToolBar->AddTool( ID_CVPCB_SHOW3D_FRAME, wxEmptyString, KiScaledBitmap( three_d_xpm, this ), _( "3D Display (Alt+3)" ) ); + KiScaledSeparator( m_mainToolBar, this ); + + // Grid selection choice box. + m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT, + wxDefaultPosition, wxDefaultSize, 0, NULL ); + updateGridSelectBox(); + m_mainToolBar->AddControl( m_gridSelectBox ); + + KiScaledSeparator( m_mainToolBar, this ); + + // Zoom selection choice box. + m_zoomSelectBox = new wxChoice( m_mainToolBar, ID_ON_ZOOM_SELECT, + wxDefaultPosition, wxDefaultSize, 0, NULL ); + updateZoomSelectBox(); + m_mainToolBar->AddControl( m_zoomSelectBox ); + // after adding the buttons to the toolbar, must call Realize() to reflect // the changes m_mainToolBar->Realize(); } -void DISPLAY_FOOTPRINTS_FRAME::UseGalCanvas( bool aEnable ) +void DISPLAY_FOOTPRINTS_FRAME::LoadSettings( wxConfigBase* aCfg ) { - PCB_BASE_FRAME::UseGalCanvas( aEnable ); + PCB_BASE_FRAME::LoadSettings( aCfg ); + + m_configSettings.Load( aCfg ); // mainly, load the color config + + aCfg->Read( ConfigBaseName() + AUTO_ZOOM_KEY, &m_autoZoom, true ); + aCfg->Read( ConfigBaseName() + ZOOM_KEY, &m_lastZoom, 10.0 ); } -void DISPLAY_FOOTPRINTS_FRAME::applyDisplaySettingsToGAL() +void DISPLAY_FOOTPRINTS_FRAME::SaveSettings( wxConfigBase* aCfg ) { - auto view = GetGalCanvas()->GetView(); - auto painter = static_cast( view->GetPainter() ); - KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings(); - settings->LoadDisplayOptions( &m_DisplayOptions, false ); + PCB_BASE_FRAME::SaveSettings( aCfg ); - view->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); + aCfg->Write( ConfigBaseName() + AUTO_ZOOM_KEY, m_autoZoom ); + aCfg->Write( ConfigBaseName() + ZOOM_KEY, GetGalCanvas()->GetView()->GetScale() ); +} + + +void DISPLAY_FOOTPRINTS_FRAME::ApplyDisplaySettingsToGAL() +{ + auto painter = static_cast( GetGalCanvas()->GetView()->GetPainter() ); + KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings(); + settings->LoadDisplayOptions( &m_DisplayOptions, false ); + + GetGalCanvas()->GetView()->UpdateAllItems( KIGFX::ALL ); + GetGalCanvas()->Refresh(); } @@ -522,7 +557,7 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay() updateView(); UpdateStatusBar(); - Zoom_Automatique( false ); + GetCanvas()->Refresh(); Update3DView(); } @@ -530,15 +565,18 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay() void DISPLAY_FOOTPRINTS_FRAME::updateView() { - if( IsGalCanvasActive() ) - { - PCB_DRAW_PANEL_GAL* dp = static_cast( GetGalCanvas() ); - dp->UseColorScheme( &Settings().Colors() ); - dp->DisplayBoard( GetBoard() ); - m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); + PCB_DRAW_PANEL_GAL* dp = static_cast( GetGalCanvas() ); + dp->UseColorScheme( &Settings().Colors() ); + dp->DisplayBoard( GetBoard() ); + + m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); + + if( m_autoZoom ) m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); - UpdateMsgPanel(); - } + else + m_toolManager->RunAction( ACTIONS::centerContents, true ); + + UpdateMsgPanel(); } @@ -548,9 +586,7 @@ void DISPLAY_FOOTPRINTS_FRAME::UpdateMsgPanel() MSG_PANEL_ITEMS items; if( footprint ) - { footprint->GetMsgPanelInfo( m_UserUnits, items ); - } SetMsgPanel( items ); } @@ -558,15 +594,8 @@ void DISPLAY_FOOTPRINTS_FRAME::UpdateMsgPanel() void DISPLAY_FOOTPRINTS_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) { - if( !GetBoard() ) - return; - - m_canvas->DrawBackGround( DC ); - GetBoard()->Draw( m_canvas, DC, GR_COPY ); - - UpdateMsgPanel(); - - m_canvas->DrawCrossHair( DC ); + if( GetBoard() ) + UpdateMsgPanel(); } diff --git a/cvpcb/display_footprints_frame.h b/cvpcb/display_footprints_frame.h index 676b0eb626..a165af65ee 100644 --- a/cvpcb/display_footprints_frame.h +++ b/cvpcb/display_footprints_frame.h @@ -42,6 +42,9 @@ class CVPCB_MAINFRAME; */ class DISPLAY_FOOTPRINTS_FRAME : public PCB_BASE_FRAME { + bool m_autoZoom; + double m_lastZoom; + public: DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aParent ); ~DISPLAY_FOOTPRINTS_FRAME() override; @@ -74,15 +77,18 @@ public: */ void updateView(); - /// Updates the GAL with display settings changes - void applyDisplaySettingsToGAL(); + void LoadSettings( wxConfigBase* aCfg ) override; + void SaveSettings( wxConfigBase* aCfg ) override; - ///> @copydoc EDA_DRAW_FRAME::UseGalCanvas() - void UseGalCanvas( bool aEnable ) override; + /// Updates the GAL with display settings changes + void ApplyDisplaySettingsToGAL(); ///> @copydoc EDA_DRAW_FRAME::UpdateMsgPanel() void UpdateMsgPanel() override; + bool GetAutoZoom() const { return m_autoZoom; } + void SetAutoZoom( bool aEnable ) { m_autoZoom = aEnable; } + /** * Function IsGridVisible() , virtual * @return true if the grid must be shown diff --git a/include/draw_frame.h b/include/draw_frame.h index 0e029c9b3e..bcdc6a4a2c 100644 --- a/include/draw_frame.h +++ b/include/draw_frame.h @@ -129,15 +129,12 @@ protected: /// Key to control whether first run dialog is shown on startup long m_firstRunDialogSetting; - /// Choice box to choose the grid size. - wxChoice* m_gridSelectBox; - - /// Choice box to choose the zoom value. + wxChoice* m_gridSelectBox; wxChoice* m_zoomSelectBox; /// Auxiliary tool bar typically shown below the main tool bar at the top of the /// main window. - wxAuiToolBar* m_auxiliaryToolBar; + wxAuiToolBar* m_auxiliaryToolBar; /// The tool bar that contains the buttons for quick access to the application draw /// tools. It typically is located on the right side of the main window. diff --git a/include/pcb_base_frame.h b/include/pcb_base_frame.h index 43eff1ff50..0e554655a3 100644 --- a/include/pcb_base_frame.h +++ b/include/pcb_base_frame.h @@ -236,17 +236,6 @@ public: */ virtual bool CreateAndShow3D_Frame( bool aForceRecreateIfNotOwner ); - // Read/write functions: - EDA_ITEM* ReadDrawSegmentDescr( LINE_READER* aReader ); - int ReadListeSegmentDescr( LINE_READER* aReader, - TRACK* PtSegm, - int StructType, - int NumSegm ); - - int ReadSetup( LINE_READER* aReader ); - int ReadGeneralDescrPcb( LINE_READER* aReader ); - - /** * Function PcbGeneralLocateAndDisplay * searches for an item under the mouse cursor. @@ -420,31 +409,6 @@ public: bool aPadLayerFilter, bool aSaveForUndo ); - /** - * Function SelectFootprint - * displays a list of modules found in all libraries or a given library - * - * @param aWindow = the current window ( parent window ) - * - * @param aLibraryName = library to list (if aLibraryFullFilename is empty, then list all modules). - * This is a nickname for the FP_LIB_TABLE build. - * - * @param aMask = Display filter (wildcart)( Mask = wxEmptyString if not used ) - * - * @param aKeyWord = keyword list, to display a filtered list of module - * having one (or more) of these keywords in their - * keyword list ( aKeyWord = wxEmptyString if not used ) - * - * @param aTable is the #FP_LIB_TABLE to search. - * - * @return wxEmptyString if abort or fails, or the selected module name if Ok - */ - wxString SelectFootprint( EDA_DRAW_FRAME* aWindow, - const wxString& aLibraryName, - const wxString& aMask, - const wxString& aKeyWord, - FP_LIB_TABLE* aTable ); - /** * Function SelectFootprintFromLibTree * opens a dialog to select a footprint. @@ -497,12 +461,6 @@ public: */ void TraceModuleRatsNest( wxDC* aDC ); - /** - * Function Build_Board_Ratsnest. - * Calculates the full ratsnest depending only on pads. - */ - void Build_Board_Ratsnest(); - /** * function Displays the general ratsnest * Only ratsnest with the status bit CH_VISIBLE is set are displayed @@ -535,30 +493,6 @@ public: const wxPoint& aPosition, int aNet ); - /** - * Function TestForActiveLinksInRatsnest - * Explores the full rats nest list (which must exist) to determine - * the ACTIVE links in the full rats nest list - * When tracks exist between pads, a link can connect 2 pads already connected by a track - * and the link is said inactive. - * When a link connects 2 pads not already connected by a track, the link is said active. - * @param aNetCode = net code to test. If 0, test all nets - */ - void TestForActiveLinksInRatsnest( int aNetCode ); - - /** - * Function TestConnections - * tests the connections relative to all nets. - *

- * This function update the status of the ratsnest ( flag CH_ACTIF = 0 if a connection - * is found, = 1 else) track segments are assumed to be sorted by net codes. - * This is the case because when a new track is added, it is inserted in the linked list - * according to its net code. and when nets are changed (when a new netlist is read) - * tracks are sorted before using this function. - *

- */ - void TestConnections(); - /** * Function TestNetConnection * tests the connections relative to \a aNetCode. Track segments are assumed to be @@ -568,13 +502,6 @@ public: */ void TestNetConnection( wxDC* aDC, int aNetCode ); - /** - * Function RecalculateAllTracksNetcode - * search connections between tracks and pads and propagate pad net codes to the track - * segments. - */ - void ComputeLegacyConnections(); - /* Functions relative to Undo/redo commands: */ @@ -691,8 +618,6 @@ public: */ void SetPrevGrid() override; - void ClearSelection(); - ///> @copydoc EDA_DRAW_FRAME::UseGalCanvas virtual void UseGalCanvas( bool aEnable ) override; @@ -706,15 +631,12 @@ public: return m_configSettings; } - const PCB_GENERAL_SETTINGS& CSettings() const - { - return m_configSettings; - } - - ///> Key in KifaceSettings to store the canvas type. static const wxChar CANVAS_TYPE_KEY[]; + static const wxChar AUTO_ZOOM_KEY[]; + static const wxChar ZOOM_KEY[]; + DECLARE_EVENT_TABLE() }; diff --git a/include/tool/actions.h b/include/tool/actions.h index b4ccc9d058..9433510e8a 100644 --- a/include/tool/actions.h +++ b/include/tool/actions.h @@ -56,6 +56,7 @@ public: static TOOL_ACTION zoomFitScreen; static TOOL_ACTION zoomPreset; static TOOL_ACTION zoomTool; + static TOOL_ACTION centerContents; // Grid control static TOOL_ACTION gridFast1; diff --git a/include/tool/common_tools.h b/include/tool/common_tools.h index fd0f8d4c3d..ceac56112c 100644 --- a/include/tool/common_tools.h +++ b/include/tool/common_tools.h @@ -51,6 +51,8 @@ public: int ZoomFitScreen( const TOOL_EVENT& aEvent ); int ZoomPreset( const TOOL_EVENT& aEvent ); + int CenterContents( const TOOL_EVENT& aEvent ); + // Cursor control int ToggleCursor( const TOOL_EVENT& aEvent ); diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 22020800b7..18a62825cc 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -83,6 +83,8 @@ set( PCBNEW_DIALOGS dialogs/dialog_find_base.cpp dialogs/dialog_footprint_wizard_list.cpp dialogs/dialog_footprint_wizard_list_base.cpp + dialogs/dialog_fp_browser_display_options.cpp + dialogs/dialog_fp_browser_display_options_base.cpp dialogs/dialog_fp_plugin_options.cpp dialogs/dialog_fp_plugin_options_base.cpp dialogs/dialog_gen_footprint_position_file_base.cpp diff --git a/pcbnew/dialogs/dialog_fp_browser_display_options.cpp b/pcbnew/dialogs/dialog_fp_browser_display_options.cpp new file mode 100644 index 0000000000..ea8a46a022 --- /dev/null +++ b/pcbnew/dialogs/dialog_fp_browser_display_options.cpp @@ -0,0 +1,97 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#include +#include +#include + +#include + + +void FOOTPRINT_VIEWER_FRAME::InstallDisplayOptions( wxCommandEvent& event ) +{ + DIALOG_FP_BROWSER_DISPLAY_OPTIONS dlg( this ); + + dlg.ShowModal(); +} + + +DIALOG_FP_BROWSER_DISPLAY_OPTIONS::DIALOG_FP_BROWSER_DISPLAY_OPTIONS( FOOTPRINT_VIEWER_FRAME* aParent ) + : DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE( aParent ), + m_frame( aParent ) +{ + initDialog(); + m_sdbSizerOK->SetDefault(); + + FinishDialogSettings();; +} + + +DIALOG_FP_BROWSER_DISPLAY_OPTIONS::~DIALOG_FP_BROWSER_DISPLAY_OPTIONS( ) +{ +} + + +void DIALOG_FP_BROWSER_DISPLAY_OPTIONS::initDialog() +{ + /* mandatory to use escape key as cancel under wxGTK. */ + SetFocus(); + + auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_frame->GetDisplayOptions(); + + m_EdgesDisplayOption->SetValue( not displ_opts->m_DisplayModEdgeFill ); + m_TextDisplayOption->SetValue( not displ_opts->m_DisplayModTextFill ); + m_ShowPadSketch->SetValue( not displ_opts->m_DisplayPadFill ); + m_ShowPadNum->SetValue( displ_opts->m_DisplayPadNum ); + + m_autoZoomOption->SetValue( m_frame->GetAutoZoom() ); +} + + +void DIALOG_FP_BROWSER_DISPLAY_OPTIONS::UpdateObjectSettings() +{ + auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_frame->GetDisplayOptions(); + + displ_opts->m_DisplayModEdgeFill = not m_EdgesDisplayOption->GetValue(); + displ_opts->m_DisplayModTextFill = not m_TextDisplayOption->GetValue(); + displ_opts->m_DisplayPadNum = m_ShowPadNum->GetValue(); + displ_opts->m_DisplayPadFill = not m_ShowPadSketch->GetValue(); + m_frame->ApplyDisplaySettingsToGAL(); + + m_frame->SetAutoZoom( m_autoZoomOption->GetValue() ); +} + + +bool DIALOG_FP_BROWSER_DISPLAY_OPTIONS::TransferDataFromWindow() +{ + UpdateObjectSettings(); + return true; +} + + +void DIALOG_FP_BROWSER_DISPLAY_OPTIONS::OnApplyClick( wxCommandEvent& event ) +{ + UpdateObjectSettings(); +} diff --git a/pcbnew/dialogs/dialog_fp_browser_display_options.h b/pcbnew/dialogs/dialog_fp_browser_display_options.h new file mode 100644 index 0000000000..31d721c06c --- /dev/null +++ b/pcbnew/dialogs/dialog_fp_browser_display_options.h @@ -0,0 +1,49 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef DIALOG_FP_BROWSER_DISPLAY_OPTIONS_H +#define DIALOG_FP_BROWSER_DISPLAY_OPTIONS_H + +#include + + +class FOOTPRINT_VIEWER_FRAME; + + +class DIALOG_FP_BROWSER_DISPLAY_OPTIONS : public DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE +{ +private: + FOOTPRINT_VIEWER_FRAME* m_frame; + +public: + DIALOG_FP_BROWSER_DISPLAY_OPTIONS( FOOTPRINT_VIEWER_FRAME* aParent ); + ~DIALOG_FP_BROWSER_DISPLAY_OPTIONS(); + +private: + void initDialog(); + void UpdateObjectSettings(); + void OnApplyClick( wxCommandEvent& event ) override; + bool TransferDataFromWindow() override; +}; + +#endif // DIALOG_FP_BROWSER_DISPLAY_OPTIONS_H diff --git a/pcbnew/dialogs/dialog_fp_browser_display_options_base.cpp b/pcbnew/dialogs/dialog_fp_browser_display_options_base.cpp new file mode 100644 index 0000000000..723ad73c9c --- /dev/null +++ b/pcbnew/dialogs/dialog_fp_browser_display_options_base.cpp @@ -0,0 +1,84 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_fp_browser_display_options_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE::DIALOG_FP_BROWSER_DISPLAY_OPTIONS_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( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizerMain; + bSizerMain = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bUpperSizer; + bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxStaticBoxSizer* sbSizerDrawMode; + sbSizerDrawMode = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Drawing Options") ), wxVERTICAL ); + + m_EdgesDisplayOption = new wxCheckBox( sbSizerDrawMode->GetStaticBox(), wxID_ANY, _("Graphic items sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerDrawMode->Add( m_EdgesDisplayOption, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_TextDisplayOption = new wxCheckBox( sbSizerDrawMode->GetStaticBox(), wxID_ANY, _("Texts sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerDrawMode->Add( m_TextDisplayOption, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + + m_ShowPadSketch = new wxCheckBox( sbSizerDrawMode->GetStaticBox(), ID_PADFILL_OPT, _("Pad sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerDrawMode->Add( m_ShowPadSketch, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + + sbSizerDrawMode->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + m_ShowPadNum = new wxCheckBox( sbSizerDrawMode->GetStaticBox(), wxID_ANY, _("Show pad &numbers"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerDrawMode->Add( m_ShowPadNum, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bUpperSizer->Add( sbSizerDrawMode, 1, wxEXPAND|wxALL, 5 ); + + wxStaticBoxSizer* sbSizerViewOpt; + sbSizerViewOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Auto-zoom") ), wxVERTICAL ); + + m_autoZoomOption = new wxCheckBox( sbSizerViewOpt->GetStaticBox(), wxID_ANY, _("Zoom to fit when changing footprint"), wxDefaultPosition, wxDefaultSize, 0 ); + m_autoZoomOption->SetValue(true); + sbSizerViewOpt->Add( m_autoZoomOption, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bUpperSizer->Add( sbSizerViewOpt, 1, wxALL|wxEXPAND, 5 ); + + + bSizerMain->Add( bUpperSizer, 1, wxEXPAND|wxALL, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_sdbSizer = new wxStdDialogButtonSizer(); + m_sdbSizerOK = new wxButton( this, wxID_OK ); + m_sdbSizer->AddButton( m_sdbSizerOK ); + m_sdbSizerApply = new wxButton( this, wxID_APPLY ); + m_sdbSizer->AddButton( m_sdbSizerApply ); + m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer->AddButton( m_sdbSizerCancel ); + m_sdbSizer->Realize(); + + bSizerMain->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 ); + + + this->SetSizer( bSizerMain ); + this->Layout(); + bSizerMain->Fit( this ); + + // Connect Events + m_sdbSizerApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE::OnApplyClick ), NULL, this ); +} + +DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE::~DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE() +{ + // Disconnect Events + m_sdbSizerApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE::OnApplyClick ), NULL, this ); + +} diff --git a/pcbnew/dialogs/dialog_fp_browser_display_options_base.fbp b/pcbnew/dialogs/dialog_fp_browser_display_options_base.fbp new file mode 100644 index 0000000000..7b3fa5bbfd --- /dev/null +++ b/pcbnew/dialogs/dialog_fp_browser_display_options_base.fbp @@ -0,0 +1,697 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_fp_browser_display_options_base + 1000 + none + 1 + dialog_fp_browser_display_options_base + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE + + -1,-1 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Display Options + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizerMain + wxVERTICAL + none + + 5 + wxEXPAND|wxALL + 1 + + + bUpperSizer + wxHORIZONTAL + none + + 5 + wxEXPAND|wxALL + 1 + + wxID_ANY + Drawing Options + + sbSizerDrawMode + wxVERTICAL + 1 + none + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Graphic items sketch mode + + 0 + + + 0 + + 1 + m_EdgesDisplayOption + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Texts sketch mode + + 0 + + + 0 + + 1 + m_TextDisplayOption + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_PADFILL_OPT + Pad sketch mode + + 0 + + + 0 + + 1 + m_ShowPadSketch + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show pad &numbers + + 0 + + + 0 + + 1 + m_ShowPadNum + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 1 + + wxID_ANY + Auto-zoom + + sbSizerViewOpt + wxVERTICAL + 1 + none + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Zoom to fit when changing footprint + + 0 + + + 0 + + 1 + m_autoZoomOption + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxALL + 0 + + 1 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer + protected + OnApplyClick + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_fp_browser_display_options_base.h b/pcbnew/dialogs/dialog_fp_browser_display_options_base.h new file mode 100644 index 0000000000..c0414cf9fb --- /dev/null +++ b/pcbnew/dialogs/dialog_fp_browser_display_options_base.h @@ -0,0 +1,61 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE_H__ +#define __DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE_H__ + +#include +#include +#include +#include "dialog_shim.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +#define ID_PADFILL_OPT 1000 + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM +{ + private: + + protected: + wxCheckBox* m_EdgesDisplayOption; + wxCheckBox* m_TextDisplayOption; + wxCheckBox* m_ShowPadSketch; + wxCheckBox* m_ShowPadNum; + wxCheckBox* m_autoZoomOption; + wxStaticLine* m_staticline1; + wxStdDialogButtonSizer* m_sdbSizer; + wxButton* m_sdbSizerOK; + wxButton* m_sdbSizerApply; + wxButton* m_sdbSizerCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnApplyClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE(); + +}; + +#endif //__DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE_H__ diff --git a/pcbnew/dialogs/dialog_global_edit_text_and_graphics_base.cpp b/pcbnew/dialogs/dialog_global_edit_text_and_graphics_base.cpp index 3f66951846..475235c874 100644 --- a/pcbnew/dialogs/dialog_global_edit_text_and_graphics_base.cpp +++ b/pcbnew/dialogs/dialog_global_edit_text_and_graphics_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 2 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -216,7 +216,7 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_ m_grid = new wxGrid( sbAction->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE ); // Grid - m_grid->CreateGrid( 5, 7 ); + m_grid->CreateGrid( 6, 7 ); m_grid->EnableEditing( false ); m_grid->EnableGridLines( true ); m_grid->EnableDragGridSize( false ); diff --git a/pcbnew/dialogs/dialog_global_edit_text_and_graphics_base.fbp b/pcbnew/dialogs/dialog_global_edit_text_and_graphics_base.fbp index 1049dcd8be..2a66af58c0 100644 --- a/pcbnew/dialogs/dialog_global_edit_text_and_graphics_base.fbp +++ b/pcbnew/dialogs/dialog_global_edit_text_and_graphics_base.fbp @@ -1,3371 +1,3131 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - dialog_global_edit_text_and_graphics_base - 1000 - none - - 1 - dialog_global_edit_text_and_graphics - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT - - - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - - DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE - - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Edit Text and Graphic Properties - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnUpdateUI - - - bMainSizer - wxVERTICAL - none - - 10 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - wxID_ANY - Scope - - sbScope - wxVERTICAL - 1 - none - - - 5 - wxEXPAND - 0 - - 2 - wxBOTH - 0,1 - - 0 - - fgSizer3 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Footprint references - - 0 - - - 0 - - 1 - m_references - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - PCB text items - - 0 - - - 0 - - 1 - m_boardText - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Footprint values - - 0 - - - 0 - - 1 - m_values - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - PCB graphic items - - 0 - - - 0 - - 1 - m_boardGraphics - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Other footprint fields - - 0 - - - 0 - - 1 - m_otherFields - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Footprint graphic items - - 0 - - - 0 - - 1 - m_footprintGraphics - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - wxID_ANY - Filters - - sbFilters - wxVERTICAL - 1 - none - - - 5 - wxEXPAND|wxRIGHT - 0 - - 3 - wxBOTH - 1 - - 0 - - fgSizer2 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 3 - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Filter items by layer: - - 0 - - - 0 - - 1 - m_layerFilterOpt - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_layerFilter - 1 - - - protected - 1 - - Resizable - -1 - 1 - - - PCB_LAYER_BOX_SELECTOR; pcb_layer_box_selector.h; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - OnLayerFilterSelect - - - - - - - - - - - - - - - - - - - - - - - - - - - - 100 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Filter items by parent footprint: - - 0 - - - 0 - - 1 - m_footprintFilterOpt - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_footprintFilter - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnFootprintFilterText - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - - - - - 10 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 1 - - wxID_ANY - Action - - sbAction - wxVERTICAL - 1 - none - - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_SPECIFIED_NET_TO_NETCLASS_VALUES - Set to specified values: - - 0 - - - 0 - - 1 - m_setToSpecifiedValues - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 15 - wxEXPAND|wxBOTTOM|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_specifiedValues - 1 - - - protected - 1 - - Resizable - 1 - - ; forward_declare - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bSizer2 - wxVERTICAL - none - - 2 - wxEXPAND|wxTOP - 1 - - 5 - wxBOTH - - - 0 - - fgSizer1 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 3 - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Layer: - 0 - - 0 - - - 0 - - 1 - m_LayerLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_LayerCtrl - 1 - - - protected - 1 - - Resizable - -1 - 1 - - - PCB_LAYER_BOX_SELECTOR; pcb_layer_box_selector.h - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10 - wxEXPAND - 0 - - 0 - protected - 0 - - - - 30 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Visible - - 0 - - - 0 - - 1 - m_Visible - 1 - - - protected - 1 - - Resizable - 1 - - wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Line thickness: - 0 - - 0 - - - 0 - - 1 - m_lineWidthLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxRIGHT|wxLEFT|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 - m_LineWidthCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - unit - 0 - - 0 - - - 0 - - 1 - m_lineWidthUnits - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxEXPAND|wxTOP - 1 - - 0 - protected - 0 - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Text width: - 0 - - 0 - - - 0 - - 1 - m_SizeXlabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - 120,-1 - 1 - m_SizeXCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - unit - 0 - - 0 - - - 0 - - 1 - m_SizeXunit - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 20 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Italic - - 0 - - - 0 - - 1 - m_Italic - 1 - - - protected - 1 - - Resizable - 1 - - wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER - ; 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 - 1 - - 1 - - 0 - 0 - wxID_ANY - Text height: - 0 - - 0 - - - 0 - - 1 - m_SizeYlabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_SizeYCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - unit - 0 - - 0 - - - 0 - - 1 - m_SizeYunit - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 20 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Keep upright - - 0 - - - 0 - - 1 - m_keepUpright - 1 - - - protected - 1 - - Resizable - 1 - - wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Text thickness: - 0 - - 0 - - - 0 - - 1 - m_ThicknessLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_ThicknessCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - unit - 0 - - 0 - - - 0 - - 1 - m_ThicknessUnit - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_ALL_TRACKS_VIAS - Set to layer default values: - - 0 - - - 0 - - 1 - m_setToLayerDefaults - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 15 - wxEXPAND|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - 0 - - - - 1 - wxSYS_COLOUR_BTNFACE - ,90,90,11,70,0 - wxALIGN_LEFT - - wxALIGN_CENTRE - 0 - 1 - wxALIGN_CENTRE - 0 - - wxALIGN_CENTRE - 7 - 120,95,95,95,95,50,50 - - 1 - 0 - Dock - 0 - Left - 0 - 0 - 0 - 0 - 0 - 1 - - 1 - - - 1 - 0 - 0 - wxID_ANY - - - - 0 - 0 - - 0 - - - 0 - - 1 - m_grid - 1 - - - protected - 1 - - Resizable - wxALIGN_CENTRE - 0 - - wxALIGN_CENTRE - - 5 - 1 - - - 0 - - - - wxBORDER_SIMPLE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnSizeNetclassGrid - - - - - 5 - wxEXPAND|wxBOTTOM - 0 - - 0 - protected - 0 - - - - - - 5 - wxALL|wxEXPAND - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizerButtons - protected - - - - - - - - - - - - - - + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_global_edit_text_and_graphics_base + 1000 + none + 1 + dialog_global_edit_text_and_graphics + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE + + -1,-1 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Edit Text and Graphic Properties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnUpdateUI + + + bMainSizer + wxVERTICAL + none + + 10 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + wxID_ANY + Scope + + sbScope + wxVERTICAL + 1 + none + + + 5 + wxEXPAND + 0 + + 2 + wxBOTH + 0,1 + + 0 + + fgSizer3 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 0 + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Footprint references + + 0 + + + 0 + + 1 + m_references + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + PCB text items + + 0 + + + 0 + + 1 + m_boardText + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Footprint values + + 0 + + + 0 + + 1 + m_values + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + PCB graphic items + + 0 + + + 0 + + 1 + m_boardGraphics + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Other footprint fields + + 0 + + + 0 + + 1 + m_otherFields + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Footprint graphic items + + 0 + + + 0 + + 1 + m_footprintGraphics + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + wxID_ANY + Filters + + sbFilters + wxVERTICAL + 1 + none + + + 5 + wxEXPAND|wxRIGHT + 0 + + 3 + wxBOTH + 1 + + 0 + + fgSizer2 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 3 + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Filter items by layer: + + 0 + + + 0 + + 1 + m_layerFilterOpt + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_layerFilter + 1 + + + protected + 1 + + Resizable + -1 + 1 + + + PCB_LAYER_BOX_SELECTOR; pcb_layer_box_selector.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + OnLayerFilterSelect + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Filter items by parent footprint: + + 0 + + + 0 + + 1 + m_footprintFilterOpt + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_footprintFilter + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnFootprintFilterText + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + + + + + 10 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 1 + + wxID_ANY + Action + + sbAction + wxVERTICAL + 1 + none + + + 5 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_SPECIFIED_NET_TO_NETCLASS_VALUES + Set to specified values: + + 0 + + + 0 + + 1 + m_setToSpecifiedValues + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 15 + wxEXPAND|wxBOTTOM|wxLEFT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_specifiedValues + 1 + + + protected + 1 + + Resizable + 1 + + ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer2 + wxVERTICAL + none + + 2 + wxEXPAND|wxTOP + 1 + + 5 + wxBOTH + + + 0 + + fgSizer1 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 3 + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Layer: + + 0 + + + 0 + + 1 + m_LayerLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_LayerCtrl + 1 + + + protected + 1 + + Resizable + -1 + 1 + + + PCB_LAYER_BOX_SELECTOR; pcb_layer_box_selector.h + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + wxEXPAND + 0 + + 0 + protected + 0 + + + + 30 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Visible + + 0 + + + 0 + + 1 + m_Visible + 1 + + + protected + 1 + + Resizable + 1 + + wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Line thickness: + + 0 + + + 0 + + 1 + m_lineWidthLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT|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 + m_LineWidthCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + unit + + 0 + + + 0 + + 1 + m_lineWidthUnits + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND|wxTOP + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Text width: + + 0 + + + 0 + + 1 + m_SizeXlabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + 120,-1 + 1 + m_SizeXCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + unit + + 0 + + + 0 + + 1 + m_SizeXunit + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 20 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Italic + + 0 + + + 0 + + 1 + m_Italic + 1 + + + protected + 1 + + Resizable + 1 + + wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER + ; 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 + 1 + + 1 + + 0 + 0 + wxID_ANY + Text height: + + 0 + + + 0 + + 1 + m_SizeYlabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_SizeYCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + unit + + 0 + + + 0 + + 1 + m_SizeYunit + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 20 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Keep upright + + 0 + + + 0 + + 1 + m_keepUpright + 1 + + + protected + 1 + + Resizable + 1 + + wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Text thickness: + + 0 + + + 0 + + 1 + m_ThicknessLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_ThicknessCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + unit + + 0 + + + 0 + + 1 + m_ThicknessUnit + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_ALL_TRACKS_VIAS + Set to layer default values: + + 0 + + + 0 + + 1 + m_setToLayerDefaults + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 15 + wxEXPAND|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + 0 + + + + 1 + wxSYS_COLOUR_BTNFACE + ,90,90,11,70,0 + wxALIGN_LEFT + + wxALIGN_CENTRE + 0 + 1 + wxALIGN_CENTRE + 0 + + wxALIGN_CENTRE + 7 + 120,95,95,95,95,50,50 + + 1 + 0 + Dock + 0 + Left + 0 + 0 + 0 + 0 + 0 + 1 + + 1 + + + 1 + 0 + 0 + wxID_ANY + + + + 0 + 0 + + 0 + + + 0 + + 1 + m_grid + 1 + + + protected + 1 + + Resizable + wxALIGN_CENTRE + 0 + + wxALIGN_CENTRE + + 6 + 1 + + + 0 + + + + wxBORDER_SIMPLE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnSizeNetclassGrid + + + + + 5 + wxEXPAND|wxBOTTOM + 0 + + 0 + protected + 0 + + + + + + 5 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizerButtons + protected + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_global_edit_text_and_graphics_base.h b/pcbnew/dialogs/dialog_global_edit_text_and_graphics_base.h index 63e3e56d7a..2a3ceb0f01 100644 --- a/pcbnew/dialogs/dialog_global_edit_text_and_graphics_base.h +++ b/pcbnew/dialogs/dialog_global_edit_text_and_graphics_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 2 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index f51475eaf9..fdd9b7ab4e 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -233,7 +233,6 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) if( !viewer ) { viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER, true ); - viewer->Zoom_Automatique( false ); } else { diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 94610abe61..d45e7408fe 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -270,7 +270,6 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent, // ReCreateMenuBar(); // UseGalCanvas() will do this for us. ReCreateHToolbar(); - ReCreateAuxiliaryToolbar(); ReCreateVToolbar(); ReCreateOptToolbar(); @@ -289,7 +288,6 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent, // Horizontal items; layers 4 - 6 m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) ); - m_auimgr.AddPane( m_auxiliaryToolBar, EDA_PANE().HToolbar().Name( "AuxToolbar" ).Top().Layer(4) ); m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) ); // Vertical items; layers 1 - 3 @@ -986,7 +984,6 @@ void FOOTPRINT_EDIT_FRAME::CommonSettingsChanged() PCB_BASE_EDIT_FRAME::CommonSettingsChanged(); ReCreateHToolbar(); - ReCreateAuxiliaryToolbar(); ReCreateVToolbar(); ReCreateOptToolbar(); Layout(); diff --git a/pcbnew/footprint_edit_frame.h b/pcbnew/footprint_edit_frame.h index 7775fc2153..06014384a3 100644 --- a/pcbnew/footprint_edit_frame.h +++ b/pcbnew/footprint_edit_frame.h @@ -121,7 +121,6 @@ public: void ReCreateVToolbar() override; void ReCreateOptToolbar() override; - void ReCreateAuxiliaryToolbar() override; void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) override; /** diff --git a/pcbnew/footprint_preview_panel.cpp b/pcbnew/footprint_preview_panel.cpp index 143ac20035..d2f01b4235 100644 --- a/pcbnew/footprint_preview_panel.cpp +++ b/pcbnew/footprint_preview_panel.cpp @@ -243,13 +243,13 @@ public: }; -FOOTPRINT_PREVIEW_PANEL::FOOTPRINT_PREVIEW_PANEL( - KIWAY* aKiway, wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTIONS& aOpts, GAL_TYPE aGalType ) +FOOTPRINT_PREVIEW_PANEL::FOOTPRINT_PREVIEW_PANEL( KIWAY* aKiway, wxWindow* aParent, + KIGFX::GAL_DISPLAY_OPTIONS& aOpts, + GAL_TYPE aGalType ) : PCB_DRAW_PANEL_GAL ( aParent, -1, wxPoint( 0, 0 ), wxSize(200, 200), aOpts, aGalType ), KIWAY_HOLDER( aKiway ), m_footprintDisplayed( true ) { - m_iface = std::make_shared(); m_iface->SetPanel( this ); m_loader = new FP_LOADER_THREAD( m_iface ); @@ -266,7 +266,7 @@ FOOTPRINT_PREVIEW_PANEL::FOOTPRINT_PREVIEW_PANEL( SyncLayersVisibility( &*m_dummyBoard ); Raise(); - Show(true); + Show( true ); StartDrawing(); Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( FOOTPRINT_PREVIEW_PANEL::OnLoaderThreadUpdate ), NULL, this ); @@ -300,9 +300,9 @@ void FOOTPRINT_PREVIEW_PANEL::CacheFootprint( LIB_ID const& aFPID ) void FOOTPRINT_PREVIEW_PANEL::renderFootprint( MODULE *module ) { GetView()->Clear(); - module->SetParent ( &*m_dummyBoard ); + module->SetParent( &*m_dummyBoard ); - GetView()->Add ( module ); + GetView()->Add( module ); GetView()->SetVisible( module, true ); GetView()->Update( module, KIGFX::ALL ); @@ -368,6 +368,11 @@ FOOTPRINT_PREVIEW_PANEL* FOOTPRINT_PREVIEW_PANEL::New( KIWAY* aKiway, wxWindow* { KIGFX::GAL_DISPLAY_OPTIONS gal_opts; - return new FOOTPRINT_PREVIEW_PANEL( - aKiway, aParent, gal_opts, EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO ); +#ifdef __WXMAC__ + // Cairo renderer doesn't handle Retina displays + EDA_DRAW_PANEL_GAL::GAL_TYPE backend = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; +#else + EDA_DRAW_PANEL_GAL::GAL_TYPE backend = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO; +#endif + return new FOOTPRINT_PREVIEW_PANEL( aKiway, aParent, gal_opts, backend ); } diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 84381ff8c8..a9e405b2e1 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2012-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2008-2016 Wayne Stambaugh - * Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2004-2018 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -41,7 +41,7 @@ #include #include #include - +#include #include #include @@ -89,10 +89,16 @@ BEGIN_EVENT_TABLE( FOOTPRINT_VIEWER_FRAME, EDA_DRAW_FRAME ) // Toolbar events EVT_TOOL( ID_MODVIEW_SELECT_PART, FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint ) + EVT_TOOL( ID_MODVIEW_OPTIONS, FOOTPRINT_VIEWER_FRAME::InstallDisplayOptions ) EVT_TOOL( ID_MODVIEW_NEXT, FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList ) EVT_TOOL( ID_MODVIEW_PREVIOUS, FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList ) EVT_TOOL( ID_MODVIEW_EXPORT_TO_BOARD, FOOTPRINT_VIEWER_FRAME::ExportSelectedFootprint ) EVT_TOOL( ID_MODVIEW_SHOW_3D_VIEW, FOOTPRINT_VIEWER_FRAME::Show3D_Frame ) + EVT_CHOICE( ID_ON_ZOOM_SELECT, FOOTPRINT_VIEWER_FRAME::OnSelectZoom ) + EVT_CHOICE( ID_ON_GRID_SELECT, FOOTPRINT_VIEWER_FRAME::OnSelectGrid ) + + EVT_UPDATE_UI( ID_ON_GRID_SELECT, FOOTPRINT_VIEWER_FRAME::OnUpdateSelectGrid ) + EVT_UPDATE_UI( ID_ON_ZOOM_SELECT, FOOTPRINT_VIEWER_FRAME::OnUpdateSelectZoom ) // listbox events EVT_LISTBOX( ID_MODVIEW_LIB_LIST, FOOTPRINT_VIEWER_FRAME::ClickOnLibList ) @@ -114,26 +120,20 @@ END_EVENT_TABLE() * If it still happens, it could be better to use wxSTAY_ON_TOP * instead of wxFRAME_FLOAT_ON_PARENT */ -#ifdef __WINDOWS__ -#define MODAL_MODE_EXTRASTYLE wxFRAME_FLOAT_ON_PARENT // could be wxSTAY_ON_TOP if issues -#else -#define MODAL_MODE_EXTRASTYLE wxFRAME_FLOAT_ON_PARENT -#endif + +#define PARENT_STYLE ( KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT ) +#define MODAL_STYLE ( KICAD_DEFAULT_DRAWFRAME_STYLE | wxSTAY_ON_TOP ) +#define NONMODAL_STYLE ( KICAD_DEFAULT_DRAWFRAME_STYLE ) FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, - FRAME_T aFrameType, - EDA_DRAW_PANEL_GAL::GAL_TYPE aBackend ) : + FRAME_T aFrameType ) : PCB_BASE_FRAME( aKiway, aParent, aFrameType, _( "Footprint Library Browser" ), wxDefaultPosition, wxDefaultSize, - aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL ? - aParent ? - KICAD_DEFAULT_DRAWFRAME_STYLE | MODAL_MODE_EXTRASTYLE - : KICAD_DEFAULT_DRAWFRAME_STYLE | wxSTAY_ON_TOP - : KICAD_DEFAULT_DRAWFRAME_STYLE, - aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL ? - FOOTPRINT_VIEWER_FRAME_NAME_MODAL - : FOOTPRINT_VIEWER_FRAME_NAME ) + aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL ? ( aParent ? PARENT_STYLE : MODAL_STYLE ) + : NONMODAL_STYLE, + aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL ? FOOTPRINT_VIEWER_FRAME_NAME_MODAL + : FOOTPRINT_VIEWER_FRAME_NAME ) { wxASSERT( aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL || aFrameType == FRAME_PCB_MODULE_VIEWER ); @@ -193,8 +193,14 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent UpdateTitle(); // Create GAL canvas +#ifdef __WXMAC__ + // Cairo renderer doesn't handle Retina displays + EDA_DRAW_PANEL_GAL::GAL_TYPE backend = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; +#else + EDA_DRAW_PANEL_GAL::GAL_TYPE backend = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO; +#endif PCB_DRAW_PANEL_GAL* drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize, - GetGalDisplayOptions(), aBackend ); + GetGalDisplayOptions(), backend ); SetGalCanvas( drawPanel ); // Create the manager and dispatcher & route draw panel events to the dispatcher @@ -243,15 +249,12 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent // call Update()() to reflect the changes m_auimgr.Update(); - // Now Drawpanel is sized, we can use BestZoom to show the component (if any) -#ifdef USE_WX_GRAPHICS_CONTEXT - GetScreen()->SetScalingFactor( BestZoom() ); -#else - Zoom_Automatique( false ); -#endif - GetGalCanvas()->GetGAL()->SetAxesEnabled( true ); - UseGalCanvas( aBackend != EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ); + UseGalCanvas( true ); + + // Restore last zoom. (If auto-zooming we'll adjust when we load the footprint.) + GetGalCanvas()->GetView()->SetScale( m_lastZoom ); + updateView(); if( !IsModal() ) // For modal mode, calling ShowModal() will show this frame @@ -264,20 +267,21 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent FOOTPRINT_VIEWER_FRAME::~FOOTPRINT_VIEWER_FRAME() { + GetGalCanvas()->StopDrawing(); + GetGalCanvas()->GetView()->Clear(); + // Be sure any event cannot be fired after frame deletion: + GetGalCanvas()->SetEvtHandlerEnabled( false ); } void FOOTPRINT_VIEWER_FRAME::OnCloseWindow( wxCloseEvent& Event ) { - DBG(printf( "%s:\n", __func__ );) - // A workaround to avoid flicker, in modal mode when modview frame is destroyed, // when the aui toolbar is not docked (i.e. shown in a miniframe) // (usefull on windows only) m_mainToolBar->SetFocus(); - if( IsGalCanvasActive() ) - GetGalCanvas()->StopDrawing(); + GetGalCanvas()->StopDrawing(); if( IsModal() ) { @@ -334,7 +338,6 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList() } ReCreateFootprintList(); - ReCreateHToolbar(); m_canvas->Refresh(); } @@ -396,7 +399,6 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& event ) ReCreateFootprintList(); UpdateTitle(); - ReCreateHToolbar(); } @@ -442,10 +444,8 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList( wxCommandEvent& event ) UpdateTitle(); - if( IsGalCanvasActive() ) - updateView(); + updateView(); - Zoom_Automatique( false ); m_canvas->Refresh(); Update3D_Frame(); } @@ -501,14 +501,21 @@ void FOOTPRINT_VIEWER_FRAME::ExportSelectedFootprint( wxCommandEvent& event ) void FOOTPRINT_VIEWER_FRAME::LoadSettings( wxConfigBase* aCfg ) { - EDA_DRAW_FRAME::LoadSettings( aCfg ); + PCB_BASE_FRAME::LoadSettings( aCfg ); + m_configSettings.Load( aCfg ); // mainly, load the color config + + aCfg->Read( ConfigBaseName() + AUTO_ZOOM_KEY, &m_autoZoom, true ); + aCfg->Read( ConfigBaseName() + ZOOM_KEY, &m_lastZoom, 10.0 ); } void FOOTPRINT_VIEWER_FRAME::SaveSettings( wxConfigBase* aCfg ) { - EDA_DRAW_FRAME::SaveSettings( aCfg ); + PCB_BASE_FRAME::SaveSettings( aCfg ); + + aCfg->Write( ConfigBaseName() + AUTO_ZOOM_KEY, m_autoZoom ); + aCfg->Write( ConfigBaseName() + ZOOM_KEY, GetGalCanvas()->GetView()->GetScale() ); } @@ -798,13 +805,11 @@ void FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint( int aMode ) Update3D_Frame(); - if( IsGalCanvasActive() ) - updateView(); + updateView(); } - UpdateTitle(); - Zoom_Automatique( false ); + m_canvas->Refresh(); } @@ -839,17 +844,31 @@ void FOOTPRINT_VIEWER_FRAME::UpdateMsgPanel() } +void FOOTPRINT_VIEWER_FRAME::ApplyDisplaySettingsToGAL() +{ + auto painter = static_cast( GetGalCanvas()->GetView()->GetPainter() ); + KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings(); + settings->LoadDisplayOptions( &m_DisplayOptions, false ); + + GetGalCanvas()->GetView()->UpdateAllItems( KIGFX::ALL ); + GetGalCanvas()->Refresh(); +} + + void FOOTPRINT_VIEWER_FRAME::updateView() { - if( IsGalCanvasActive() ) - { - auto dp = static_cast( GetGalCanvas() ); - dp->UseColorScheme( &Settings().Colors() ); - dp->DisplayBoard( GetBoard() ); - m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); + auto dp = static_cast( GetGalCanvas() ); + dp->UseColorScheme( &Settings().Colors() ); + dp->DisplayBoard( GetBoard() ); + + m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); + + if( m_autoZoom ) m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); - UpdateMsgPanel(); - } + else + m_toolManager->RunAction( ACTIONS::centerContents, true ); + + UpdateMsgPanel(); } diff --git a/pcbnew/footprint_viewer_frame.h b/pcbnew/footprint_viewer_frame.h index 99290c5176..13c266416f 100644 --- a/pcbnew/footprint_viewer_frame.h +++ b/pcbnew/footprint_viewer_frame.h @@ -48,15 +48,22 @@ class FOOTPRINT_VIEWER_FRAME : public PCB_BASE_FRAME friend struct PCB::IFACE; // constructor called from here only protected: - FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType, - EDA_DRAW_PANEL_GAL::GAL_TYPE aBackend ); + FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType ); public: ~FOOTPRINT_VIEWER_FRAME(); + PCB_GENERAL_SETTINGS& GetConfigSettings() { return m_configSettings; } + + /// Updates the GAL with display settings changes + void ApplyDisplaySettingsToGAL(); + virtual COLOR4D GetGridColor() override; + bool GetAutoZoom() const { return m_autoZoom; } + void SetAutoZoom( bool aEnable ) { m_autoZoom = aEnable; } + /** * redraws the message panel. * display the current footprint info, or @@ -86,6 +93,9 @@ private: wxListBox* m_libList; // The list of libs names wxListBox* m_footprintList; // The list of footprint names + bool m_autoZoom; + double m_lastZoom; + const wxString getCurNickname(); void setCurNickname( const wxString& aNickname ); @@ -123,6 +133,8 @@ private: void DClickOnFootprintList( wxCommandEvent& event ); void OnSetRelativeOffset( wxCommandEvent& event ); + void InstallDisplayOptions( wxCommandEvent& event ); + bool GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KEY aHotKey = 0 ) override; ///> @copydoc EDA_DRAW_FRAME::GetHotKeyDescription() diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index bb8ba6b7fb..8039e93ffd 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -178,8 +178,12 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, ReCreateVToolbar(); // Create GAL canvas +#ifdef __WXMAC__ + // Cairo renderer doesn't handle Retina displays + EDA_DRAW_PANEL_GAL::GAL_TYPE backend = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; +#else EDA_DRAW_PANEL_GAL::GAL_TYPE backend = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO; - //EDA_DRAW_PANEL_GAL::GAL_TYPE backend = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE; +#endif PCB_DRAW_PANEL_GAL* gal_drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize, GetGalDisplayOptions(), backend ); SetGalCanvas( gal_drawPanel ); diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 0ec4e5fbab..ff96f457fd 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -62,6 +62,8 @@ #include const wxChar PCB_BASE_FRAME::CANVAS_TYPE_KEY[] = wxT( "canvas_type" ); +const wxChar PCB_BASE_FRAME::AUTO_ZOOM_KEY[] = wxT( "AutoZoom" ); +const wxChar PCB_BASE_FRAME::ZOOM_KEY[] = wxT( "Zoom" ); // Configuration entry names. static const wxChar UserGridSizeXEntry[] = wxT( "PcbUserGrid_X" ); @@ -736,7 +738,7 @@ void PCB_BASE_FRAME::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent ) void PCB_BASE_FRAME::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent ) { - if( m_zoomSelectBox == NULL || m_auxiliaryToolBar == NULL ) + if( m_zoomSelectBox == NULL || m_zoomSelectBox->GetParent() == NULL ) return; int current = 0; // display Auto if no match found @@ -1070,6 +1072,7 @@ void PCB_BASE_FRAME::updateGridSelectBox() m_gridSelectBox->SetSelection( icurr ); } + void PCB_BASE_FRAME::updateZoomSelectBox() { if( m_zoomSelectBox == NULL ) diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index ae98e67a6e..966bac0d44 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -145,7 +145,7 @@ static struct IFACE : public KIFACE_I return new FOOTPRINT_EDIT_FRAME( aKiway, aParent, backend ); case FRAME_PCB_MODULE_VIEWER: case FRAME_PCB_MODULE_VIEWER_MODAL: - return new FOOTPRINT_VIEWER_FRAME( aKiway, aParent, FRAME_T( aClassId ), backend ); + return new FOOTPRINT_VIEWER_FRAME( aKiway, aParent, FRAME_T( aClassId ) ); } } diff --git a/pcbnew/pcbnew_id.h b/pcbnew/pcbnew_id.h index 53f1678d90..192c5962c8 100644 --- a/pcbnew/pcbnew_id.h +++ b/pcbnew/pcbnew_id.h @@ -369,6 +369,7 @@ enum pcbnew_ids ID_MODVIEW_LIB_LIST, ID_MODVIEW_FOOTPRINT_LIST, ID_MODVIEW_SELECT_PART, + ID_MODVIEW_OPTIONS, ID_MODVIEW_PREVIOUS, ID_MODVIEW_NEXT, ID_MODVIEW_SHOW_3D_VIEW, diff --git a/pcbnew/tool_footprint_editor.cpp b/pcbnew/tool_footprint_editor.cpp index 418f8e126f..6d1d56dc3c 100644 --- a/pcbnew/tool_footprint_editor.cpp +++ b/pcbnew/tool_footprint_editor.cpp @@ -112,6 +112,22 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar() _( "Check footprint" ) ); #endif + KiScaledSeparator( m_mainToolBar, this ); + + // Grid selection choice box. + m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT, + wxDefaultPosition, wxDefaultSize, 0, NULL ); + updateGridSelectBox(); + m_mainToolBar->AddControl( m_gridSelectBox ); + + KiScaledSeparator( m_mainToolBar, this ); + + // Zoom selection choice box. + m_zoomSelectBox = new wxChoice( m_mainToolBar, ID_ON_ZOOM_SELECT, + wxDefaultPosition, wxDefaultSize, 0, NULL ); + updateZoomSelectBox(); + m_mainToolBar->AddControl( m_zoomSelectBox ); + // after adding the buttons to the toolbar, must call Realize() to reflect the changes m_mainToolBar->Realize(); } @@ -196,16 +212,9 @@ void FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar() KiScaledBitmap( unit_mm_xpm, this ), _( "Set units to millimeters" ), wxITEM_CHECK ); -#ifndef __APPLE__ m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString, KiScaledBitmap( cursor_shape_xpm, this ), _( "Change cursor shape" ), wxITEM_CHECK ); -#else - m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString, - KiScaledBitmap( cursor_shape_xpm, this ), - _( "Change cursor shape (not supported in Legacy Toolset)" ), - wxITEM_CHECK ); -#endif KiScaledSeparator( m_optionsToolBar, this ); m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString, @@ -229,35 +238,3 @@ void FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar() } -void FOOTPRINT_EDIT_FRAME::ReCreateAuxiliaryToolbar() -{ - if( m_auxiliaryToolBar ) - m_auxiliaryToolBar->Clear(); - else - m_auxiliaryToolBar = new wxAuiToolBar( this, ID_AUX_TOOLBAR, wxDefaultPosition, wxDefaultSize, - KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT ); - - // Set up toolbar - KiScaledSeparator( m_auxiliaryToolBar, this ); - - // Grid selection choice box. - m_gridSelectBox = new wxChoice( m_auxiliaryToolBar, - ID_ON_GRID_SELECT, - wxDefaultPosition, wxDefaultSize, - 0, NULL ); - // Update tool bar to reflect setting. - updateGridSelectBox(); - m_auxiliaryToolBar->AddControl( m_gridSelectBox ); - - // Zoom selection choice box. - KiScaledSeparator( m_auxiliaryToolBar, this ); - m_zoomSelectBox = new wxChoice( m_auxiliaryToolBar, - ID_ON_ZOOM_SELECT, - wxDefaultPosition, wxDefaultSize, - 0, NULL ); - updateZoomSelectBox(); - m_auxiliaryToolBar->AddControl( m_zoomSelectBox ); - - // after adding the buttons to the toolbar, must call Realize() to reflect the changes - m_auxiliaryToolBar->Realize(); -} diff --git a/pcbnew/tool_footprint_viewer.cpp b/pcbnew/tool_footprint_viewer.cpp index d7caa96196..40acbe9e4b 100644 --- a/pcbnew/tool_footprint_viewer.cpp +++ b/pcbnew/tool_footprint_viewer.cpp @@ -54,6 +54,12 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateHToolbar() KiScaledSeparator( m_mainToolBar, this ); + m_mainToolBar->AddTool( ID_MODVIEW_OPTIONS, wxEmptyString, + KiScaledBitmap( config_xpm, this ), + _( "Display options" ) ); + + m_mainToolBar->AddSeparator(); + m_mainToolBar->AddTool( ID_MODVIEW_PREVIOUS, wxEmptyString, KiScaledBitmap( lib_previous_xpm, this ), _( "Display previous footprint" ) ); @@ -64,11 +70,9 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateHToolbar() KiScaledSeparator( m_mainToolBar, this ); - m_mainToolBar->AddTool( ID_MODVIEW_SHOW_3D_VIEW, wxEmptyString, - KiScaledBitmap( three_d_xpm, this ), - _( "Show footprint in 3D viewer" ) ); - - KiScaledSeparator( m_mainToolBar, this ); + msg = AddHotkeyName( _( "Redraw view" ), g_Module_Viewer_Hotkeys_Descr, HK_ZOOM_REDRAW ); + m_mainToolBar->AddTool( ID_VIEWER_ZOOM_REDRAW, wxEmptyString, + KiScaledBitmap( zoom_redraw_xpm, this ), msg ); msg = AddHotkeyName( _( "Zoom in" ), g_Module_Viewer_Hotkeys_Descr, HK_ZOOM_IN, IS_COMMENT ); m_mainToolBar->AddTool( ID_VIEWER_ZOOM_IN, wxEmptyString, @@ -78,22 +82,39 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateHToolbar() m_mainToolBar->AddTool( ID_VIEWER_ZOOM_OUT, wxEmptyString, KiScaledBitmap( zoom_out_xpm, this ), msg ); - msg = AddHotkeyName( _( "Redraw view" ), g_Module_Viewer_Hotkeys_Descr, HK_ZOOM_REDRAW ); - m_mainToolBar->AddTool( ID_VIEWER_ZOOM_REDRAW, wxEmptyString, - KiScaledBitmap( zoom_redraw_xpm, this ), msg ); - msg = AddHotkeyName( _( "Zoom to fit" ), g_Module_Viewer_Hotkeys_Descr, HK_ZOOM_AUTO ); m_mainToolBar->AddTool( ID_VIEWER_ZOOM_PAGE, wxEmptyString, KiScaledBitmap( zoom_fit_in_page_xpm, this ), msg ); + KiScaledSeparator( m_mainToolBar, this ); + + m_mainToolBar->AddTool( ID_MODVIEW_SHOW_3D_VIEW, wxEmptyString, + KiScaledBitmap( three_d_xpm, this ), + _( "Show footprint in 3D viewer" ) ); + if( IsModal() ) { - KiScaledSeparator( m_mainToolBar, this ); m_mainToolBar->AddTool( ID_MODVIEW_EXPORT_TO_BOARD, wxEmptyString, KiScaledBitmap( export_footprint_names_xpm, this ), _( "Insert footprint in board" ) ); } + KiScaledSeparator( m_mainToolBar, this ); + + // Grid selection choice box. + m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT, + wxDefaultPosition, wxDefaultSize, 0, NULL ); + updateGridSelectBox(); + m_mainToolBar->AddControl( m_gridSelectBox ); + + KiScaledSeparator( m_mainToolBar, this ); + + // Zoom selection choice box. + m_zoomSelectBox = new wxChoice( m_mainToolBar, ID_ON_ZOOM_SELECT, + wxDefaultPosition, wxDefaultSize, 0, NULL ); + updateZoomSelectBox(); + m_mainToolBar->AddControl( m_zoomSelectBox ); + // after adding the buttons to the toolbar, must call Realize() to // reflect the changes m_mainToolBar->Realize();