From e9a9a269b412f29190fbb9a43111f9b755035e23 Mon Sep 17 00:00:00 2001 From: Chris Pavlina Date: Tue, 10 May 2016 16:47:37 -0400 Subject: [PATCH] pcbnew legacy: remove option to hide via drill Via drills are now shown in all cases, matching GAL behavior, and the option no longer exists in the preferences dialog. --- include/pcbstruct.h | 15 +-- pcbnew/class_track.cpp | 71 +++++--------- pcbnew/classpcb.cpp | 1 - pcbnew/dialogs/dialog_display_options.cpp | 9 +- .../dialogs/dialog_display_options_base.cpp | 34 +++---- .../dialogs/dialog_display_options_base.fbp | 94 +------------------ pcbnew/dialogs/dialog_display_options_base.h | 8 +- pcbnew/pcbnew_config.cpp | 4 - 8 files changed, 45 insertions(+), 191 deletions(-) diff --git a/include/pcbstruct.h b/include/pcbstruct.h index 4920709c3a..ce411a9292 100644 --- a/include/pcbstruct.h +++ b/include/pcbstruct.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2007-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors. + * Copyright (C) 1992-2016 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 @@ -31,15 +31,6 @@ #define PCBSTRUCT_H_ -/// Values for m_DisplayViaMode member: -enum VIA_DISPLAY_MODE_T { - VIA_HOLE_NOT_SHOW = 0, - VIA_SPECIAL_HOLE_SHOW, - ALL_VIA_HOLE_SHOW, - OPT_VIA_HOLE_END -}; - - /** * Enum TRACE_CLEARANCE_DISPLAY_MODE_T * is the set of values for DISPLAY_OPTIONS.ShowTrackClearanceMode parameter option. @@ -82,10 +73,6 @@ public: /// How trace clearances are displayed. @see TRACE_CLEARANCE_DISPLAY_MODE_T. TRACE_CLEARANCE_DISPLAY_MODE_T m_ShowTrackClearanceMode; - VIA_DISPLAY_MODE_T m_DisplayViaMode; /* 0 do not show via hole, - * 1 show via hole for non default value - * 2 show all via hole */ - bool m_DisplayPolarCood; int m_DisplayZonesMode; int m_DisplayNetNamesMode; /* 0 do not show netnames, diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 08997b7eb6..9e0654cd5a 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -4,7 +4,7 @@ * Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck * Copyright (C) 2012 Wayne Stambaugh - * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2016 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 @@ -845,60 +845,35 @@ void VIA::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode, const w GRCircle( panel->GetClipBox(), aDC, m_Start + aOffset, inner_radius, 0, color ); } - // Draw the via hole if the display option allows it - if( displ_opts->m_DisplayViaMode != VIA_HOLE_NOT_SHOW ) + if( fillvia ) { - // Display all drill holes requested or Display non default holes requested - bool show_hole = displ_opts->m_DisplayViaMode == ALL_VIA_HOLE_SHOW; + bool blackpenstate = false; - if( !show_hole ) + if( screen->m_IsPrinting ) { - NETINFO_ITEM* net = GetNet(); - int drill_class_value = 0; - if( net ) - { - if( GetViaType() == VIA_MICROVIA ) - drill_class_value = net->GetMicroViaDrillSize(); - else - drill_class_value = net->GetViaDrillSize(); - } - - show_hole = GetDrillValue() != drill_class_value; + blackpenstate = GetGRForceBlackPenState(); + GRForceBlackPen( false ); + color = WHITE; + } + else + { + color = BLACK; // or DARKGRAY; } - if( show_hole ) - { - if( fillvia ) - { - bool blackpenstate = false; + if( (aDrawMode & GR_XOR) == 0) + GRSetDrawMode( aDC, GR_COPY ); - if( screen->m_IsPrinting ) - { - blackpenstate = GetGRForceBlackPenState(); - GRForceBlackPen( false ); - color = WHITE; - } - else - { - color = BLACK; // or DARKGRAY; - } + if( aDC->LogicalToDeviceXRel( drill_radius ) > MIN_DRAW_WIDTH ) // Draw hole if large enough. + GRFilledCircle( panel->GetClipBox(), aDC, m_Start.x + aOffset.x, + m_Start.y + aOffset.y, drill_radius, 0, color, color ); - if( (aDrawMode & GR_XOR) == 0) - GRSetDrawMode( aDC, GR_COPY ); - - if( aDC->LogicalToDeviceXRel( drill_radius ) > MIN_DRAW_WIDTH ) // Draw hole if large enough. - GRFilledCircle( panel->GetClipBox(), aDC, m_Start.x + aOffset.x, - m_Start.y + aOffset.y, drill_radius, 0, color, color ); - - if( screen->m_IsPrinting ) - GRForceBlackPen( blackpenstate ); - } - else - { - if( drill_radius < inner_radius ) // We can show the via hole - GRCircle( panel->GetClipBox(), aDC, m_Start + aOffset, drill_radius, 0, color ); - } - } + if( screen->m_IsPrinting ) + GRForceBlackPen( blackpenstate ); + } + else + { + if( drill_radius < inner_radius ) // We can show the via hole + GRCircle( panel->GetClipBox(), aDC, m_Start + aOffset, drill_radius, 0, color ); } if( ShowClearance( displ_opts, this ) ) diff --git a/pcbnew/classpcb.cpp b/pcbnew/classpcb.cpp index a856da99be..367f8af956 100644 --- a/pcbnew/classpcb.cpp +++ b/pcbnew/classpcb.cpp @@ -211,7 +211,6 @@ DISPLAY_OPTIONS::DISPLAY_OPTIONS() m_DisplayModTextFill = FILLED; m_DisplayPcbTrackFill = FILLED; // false = sketch , true = filled m_ShowTrackClearanceMode = SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS; - m_DisplayViaMode = VIA_HOLE_NOT_SHOW; m_DisplayPolarCood = false; /* false = display absolute coordinates, * true = display polar cordinates */ diff --git a/pcbnew/dialogs/dialog_display_options.cpp b/pcbnew/dialogs/dialog_display_options.cpp index b974a302ef..285cbe9157 100644 --- a/pcbnew/dialogs/dialog_display_options.cpp +++ b/pcbnew/dialogs/dialog_display_options.cpp @@ -1,12 +1,8 @@ -/** - * @file pcbnew/dialogs/dialog_general_options.cpp - */ - /* * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr - * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2016 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 @@ -101,7 +97,6 @@ void DIALOG_DISPLAY_OPTIONS::init() m_Show_Page_Limits->SetValue( m_Parent->ShowPageLimits() ); - m_OptDisplayViaHole->SetSelection( displ_opts->m_DisplayViaMode ); m_OptDisplayModTexts->SetValue( displ_opts->m_DisplayModTextFill == SKETCH ); m_OptDisplayModOutlines->SetValue( displ_opts->m_DisplayModEdgeFill == SKETCH ); m_OptDisplayPadClearence->SetValue( displ_opts->m_DisplayPadIsol ); @@ -128,8 +123,6 @@ void DIALOG_DISPLAY_OPTIONS::OnOkClick(wxCommandEvent& event) displ_opts->m_DisplayPcbTrackFill = not m_OptDisplayTracks->GetValue(); - displ_opts->m_DisplayViaMode = (VIA_DISPLAY_MODE_T) m_OptDisplayViaHole->GetSelection(); - switch ( m_OptDisplayTracksClearance->GetSelection() ) { case 0: diff --git a/pcbnew/dialogs/dialog_display_options_base.cpp b/pcbnew/dialogs/dialog_display_options_base.cpp index 2033a7be48..fe37fa2f1e 100644 --- a/pcbnew/dialogs/dialog_display_options_base.cpp +++ b/pcbnew/dialogs/dialog_display_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 5 2014) +// C++ code generated with wxFormBuilder (version May 10 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -22,20 +22,12 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi wxStaticBoxSizer* sLeftBoxSizer; sLeftBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Tracks and Vias:") ), wxVERTICAL ); - m_OptDisplayTracks = new wxCheckBox( this, wxID_ANY, _("Show tracks in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptDisplayTracks = new wxCheckBox( sLeftBoxSizer->GetStaticBox(), wxID_ANY, _("Show tracks in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); sLeftBoxSizer->Add( m_OptDisplayTracks, 0, wxALL, 5 ); - m_OptDisplayVias = new wxCheckBox( this, wxID_ANY, _("Show vias in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptDisplayVias = new wxCheckBox( sLeftBoxSizer->GetStaticBox(), wxID_ANY, _("Show vias in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); sLeftBoxSizer->Add( m_OptDisplayVias, 0, wxALL, 5 ); - wxString m_OptDisplayViaHoleChoices[] = { _("Never"), _("Defined holes"), _("Always") }; - int m_OptDisplayViaHoleNChoices = sizeof( m_OptDisplayViaHoleChoices ) / sizeof( wxString ); - m_OptDisplayViaHole = new wxRadioBox( this, ID_VIAS_HOLES, _("Show Via Holes:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayViaHoleNChoices, m_OptDisplayViaHoleChoices, 1, wxRA_SPECIFY_COLS ); - m_OptDisplayViaHole->SetSelection( 0 ); - m_OptDisplayViaHole->SetToolTip( _("Show or hide via holes.\nIf Defined Holes is selected, only the non default size holes are shown") ); - - sLeftBoxSizer->Add( m_OptDisplayViaHole, 1, wxALL|wxEXPAND, 5 ); - bupperSizer->Add( sLeftBoxSizer, 0, wxEXPAND|wxALL, 5 ); @@ -44,7 +36,7 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi wxString m_ShowNetNamesOptionChoices[] = { _("Do not show"), _("On pads"), _("On tracks"), _("On pads and tracks") }; int m_ShowNetNamesOptionNChoices = sizeof( m_ShowNetNamesOptionChoices ) / sizeof( wxString ); - m_ShowNetNamesOption = new wxRadioBox( this, wxID_ANY, _("Show Net Names:"), wxDefaultPosition, wxDefaultSize, m_ShowNetNamesOptionNChoices, m_ShowNetNamesOptionChoices, 1, wxRA_SPECIFY_COLS ); + m_ShowNetNamesOption = new wxRadioBox( sbMiddleLeftSizer->GetStaticBox(), wxID_ANY, _("Show Net Names:"), wxDefaultPosition, wxDefaultSize, m_ShowNetNamesOptionNChoices, m_ShowNetNamesOptionChoices, 1, wxRA_SPECIFY_COLS ); m_ShowNetNamesOption->SetSelection( 0 ); m_ShowNetNamesOption->SetToolTip( _("Show or hide net names on pads and/or tracks") ); @@ -52,7 +44,7 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi wxString m_OptDisplayTracksClearanceChoices[] = { _("Never"), _("New track"), _("New track with via area"), _("New and edited tracks with via area"), _("Always") }; int m_OptDisplayTracksClearanceNChoices = sizeof( m_OptDisplayTracksClearanceChoices ) / sizeof( wxString ); - m_OptDisplayTracksClearance = new wxRadioBox( this, ID_SHOW_CLEARANCE, _("Show Track Clearance:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayTracksClearanceNChoices, m_OptDisplayTracksClearanceChoices, 1, wxRA_SPECIFY_COLS ); + m_OptDisplayTracksClearance = new wxRadioBox( sbMiddleLeftSizer->GetStaticBox(), ID_SHOW_CLEARANCE, _("Show Track Clearance:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayTracksClearanceNChoices, m_OptDisplayTracksClearanceChoices, 1, wxRA_SPECIFY_COLS ); m_OptDisplayTracksClearance->SetSelection( 0 ); m_OptDisplayTracksClearance->SetToolTip( _("Show or hide the track and via clearance area.\nIf New track is selected, track clearance area is shown only when creating the track.") ); @@ -67,25 +59,25 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi wxStaticBoxSizer* sfootprintSizer; sfootprintSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprints:") ), wxVERTICAL ); - m_OptDisplayModOutlines = new wxCheckBox( this, wxID_ANY, _("Show outlines in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptDisplayModOutlines = new wxCheckBox( sfootprintSizer->GetStaticBox(), wxID_ANY, _("Show outlines in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); sfootprintSizer->Add( m_OptDisplayModOutlines, 0, wxALL, 5 ); m_OptDisplayModTexts - = new wxCheckBox( this, wxID_ANY, _("Show text in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); + = new wxCheckBox( sfootprintSizer->GetStaticBox(), wxID_ANY, _("Show text in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); sfootprintSizer->Add( m_OptDisplayModTexts , 0, wxALL, 5 ); - m_OptDisplayPads = new wxCheckBox( this, wxID_ANY, _("Show pads in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptDisplayPads = new wxCheckBox( sfootprintSizer->GetStaticBox(), wxID_ANY, _("Show pads in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); sfootprintSizer->Add( m_OptDisplayPads, 0, wxALL, 5 ); - m_OptDisplayPadClearence = new wxCheckBox( this, wxID_ANY, _("Show pad clearance"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptDisplayPadClearence = new wxCheckBox( sfootprintSizer->GetStaticBox(), wxID_ANY, _("Show pad clearance"), wxDefaultPosition, wxDefaultSize, 0 ); sfootprintSizer->Add( m_OptDisplayPadClearence, 0, wxALL, 5 ); - m_OptDisplayPadNumber = new wxCheckBox( this, wxID_ANY, _("Show pad number"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptDisplayPadNumber = new wxCheckBox( sfootprintSizer->GetStaticBox(), wxID_ANY, _("Show pad number"), wxDefaultPosition, wxDefaultSize, 0 ); m_OptDisplayPadNumber->SetValue(true); sfootprintSizer->Add( m_OptDisplayPadNumber, 0, wxALL, 5 ); - m_OptDisplayPadNoConn = new wxCheckBox( this, wxID_ANY, _("Show pad no net connection indicator"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptDisplayPadNoConn = new wxCheckBox( sfootprintSizer->GetStaticBox(), wxID_ANY, _("Show pad no net connection indicator"), wxDefaultPosition, wxDefaultSize, 0 ); m_OptDisplayPadNoConn->SetValue(true); sfootprintSizer->Add( m_OptDisplayPadNoConn, 0, wxALL, 5 ); @@ -95,11 +87,11 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi wxStaticBoxSizer* s_otherSizer; s_otherSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Other:") ), wxVERTICAL ); - m_OptDisplayDrawings = new wxCheckBox( this, wxID_ANY, _("Show graphic items in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptDisplayDrawings = new wxCheckBox( s_otherSizer->GetStaticBox(), wxID_ANY, _("Show graphic items in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); m_OptDisplayDrawings->SetValue(true); s_otherSizer->Add( m_OptDisplayDrawings, 0, wxALL, 5 ); - m_Show_Page_Limits = new wxCheckBox( this, wxID_ANY, _("Show page limits"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Show_Page_Limits = new wxCheckBox( s_otherSizer->GetStaticBox(), wxID_ANY, _("Show page limits"), wxDefaultPosition, wxDefaultSize, 0 ); m_Show_Page_Limits->SetValue(true); s_otherSizer->Add( m_Show_Page_Limits, 0, wxALL, 5 ); diff --git a/pcbnew/dialogs/dialog_display_options_base.fbp b/pcbnew/dialogs/dialog_display_options_base.fbp index cc4821f1c3..89a814b440 100644 --- a/pcbnew/dialogs/dialog_display_options_base.fbp +++ b/pcbnew/dialogs/dialog_display_options_base.fbp @@ -112,6 +112,7 @@ sLeftBoxSizer wxVERTICAL + 1 none @@ -290,96 +291,6 @@ - - 5 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Never" "Defined holes" "Always" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_VIAS_HOLES - Show Via Holes: - 1 - - 0 - - - 0 - - 1 - m_OptDisplayViaHole - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Show or hide via holes. If Defined Holes is selected, only the non default size holes are shown - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -392,6 +303,7 @@ sbMiddleLeftSizer wxVERTICAL + 1 none @@ -595,6 +507,7 @@ sfootprintSizer wxVERTICAL + 1 none @@ -1137,6 +1050,7 @@ s_otherSizer wxVERTICAL + 1 none diff --git a/pcbnew/dialogs/dialog_display_options_base.h b/pcbnew/dialogs/dialog_display_options_base.h index 3f180e9ac5..4765f629b8 100644 --- a/pcbnew/dialogs/dialog_display_options_base.h +++ b/pcbnew/dialogs/dialog_display_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 5 2014) +// C++ code generated with wxFormBuilder (version May 10 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -20,9 +20,9 @@ class DIALOG_SHIM; #include #include #include -#include #include #include +#include #include #include #include @@ -39,13 +39,11 @@ class DIALOG_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM protected: enum { - ID_VIAS_HOLES = 1000, - ID_SHOW_CLEARANCE + ID_SHOW_CLEARANCE = 1000 }; wxCheckBox* m_OptDisplayTracks; wxCheckBox* m_OptDisplayVias; - wxRadioBox* m_OptDisplayViaHole; wxRadioBox* m_ShowNetNamesOption; wxRadioBox* m_OptDisplayTracksClearance; wxCheckBox* m_OptDisplayModOutlines; diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index 9a1ab0eba7..d485ead163 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -337,10 +337,6 @@ PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetConfigurationSettings() m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "DisplayPolarCoords" ), &displ_opts->m_DisplayPolarCood, false ) ); // Display options and modes: - m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "ViaHoleDisplayMode" ), - (int*) &displ_opts->m_DisplayViaMode, - VIA_SPECIAL_HOLE_SHOW, VIA_HOLE_NOT_SHOW, - OPT_VIA_HOLE_END - 1 ) ); m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "ShowNetNamesMode" ), &displ_opts->m_DisplayNetNamesMode, 3, 0, 3 ) ); m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "DisplayTrackFilled" ),