Remove debugging and add grouping box for Nets & Net Filters.

Fixes: lp:1782766
* https://bugs.launchpad.net/kicad/+bug/1782766

(cherry picked from commit a75f376)
This commit is contained in:
Jeff Young 2018-07-22 11:17:35 +01:00
parent 7cce283fea
commit d32fb68fa9
4 changed files with 806 additions and 962 deletions

View File

@ -31,75 +31,66 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
wxBoxSizer* m_OptionsBoxSizer;
m_OptionsBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* m_layerSizer;
m_layerSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizer2;
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layer") ), wxVERTICAL );
m_staticTextLayers = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextLayers->Wrap( -1 );
m_layerSizer->Add( m_staticTextLayers, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_layers = new wxDataViewListCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_NO_HEADER|wxSUNKEN_BORDER );
m_layers->SetMinSize( wxSize( 80,-1 ) );
m_layers = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_NO_HEADER|wxSUNKEN_BORDER );
m_layerSizer->Add( m_layers, 1, wxEXPAND|wxRIGHT, 5 );
sbSizer2->Add( m_layers, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_OptionsBoxSizer->Add( m_layerSizer, 0, wxEXPAND|wxTOP|wxRIGHT, 5 );
m_OptionsBoxSizer->Add( sbSizer2, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerNets;
bSizerNets = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizer3;
sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Net") ), wxHORIZONTAL );
m_staticTextNets = new wxStaticText( this, wxID_ANY, _("Net:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextNets->Wrap( -1 );
bSizerNets->Add( m_staticTextNets, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListNetNameSelection = new wxListBox( this, ID_NETNAME_SELECTION, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
bSizerNets->Add( m_ListNetNameSelection, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_OptionsBoxSizer->Add( bSizerNets, 1, wxEXPAND|wxTOP|wxLEFT, 5 );
m_ListNetNameSelection = new wxListBox( sbSizer3->GetStaticBox(), ID_NETNAME_SELECTION, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
sbSizer3->Add( m_ListNetNameSelection, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bFilteringSizer;
bFilteringSizer = new wxBoxSizer( wxVERTICAL );
m_staticTextDisplay = new wxStaticText( this, wxID_ANY, _("Hide nets matching:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextDisplay = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Hide nets matching:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextDisplay->Wrap( -1 );
bFilteringSizer->Add( m_staticTextDisplay, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
bFilteringSizer->Add( m_staticTextDisplay, 0, wxRIGHT|wxLEFT, 5 );
m_DoNotShowNetNameFilter = new wxTextCtrl( this, ID_TEXTCTRL_NETNAMES_FILTER, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
m_DoNotShowNetNameFilter = new wxTextCtrl( sbSizer3->GetStaticBox(), ID_TEXTCTRL_NETNAMES_FILTER, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
m_DoNotShowNetNameFilter->SetToolTip( _("Pattern to filter net names in filtered list.\nNet names matching this pattern are not displayed.") );
m_DoNotShowNetNameFilter->SetMinSize( wxSize( 180,-1 ) );
bFilteringSizer->Add( m_DoNotShowNetNameFilter, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticTextVFilter = new wxStaticText( this, wxID_ANY, _("Show nets matching:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextVFilter = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Show nets matching:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextVFilter->Wrap( -1 );
bFilteringSizer->Add( m_staticTextVFilter, 0, wxRIGHT|wxLEFT, 5 );
m_ShowNetNameFilter = new wxTextCtrl( this, ID_TEXTCTRL_NETNAMES_FILTER, _("*"), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
m_ShowNetNameFilter = new wxTextCtrl( sbSizer3->GetStaticBox(), ID_TEXTCTRL_NETNAMES_FILTER, _("*"), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
m_ShowNetNameFilter->SetToolTip( _("Pattern to filter net names in filtered list.\nOnly net names matching this pattern are displayed.") );
bFilteringSizer->Add( m_ShowNetNameFilter, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_buttonRunFilter = new wxButton( this, wxID_APPLY_FILTERS, _("Apply Filters"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonRunFilter = new wxButton( sbSizer3->GetStaticBox(), wxID_APPLY_FILTERS, _("Apply Filters"), wxDefaultPosition, wxDefaultSize, 0 );
bFilteringSizer->Add( m_buttonRunFilter, 0, wxALL|wxEXPAND, 5 );
bFilteringSizer->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_showAllNetsOpt = new wxCheckBox( this, wxID_ANY, _("Show all nets"), wxDefaultPosition, wxDefaultSize, 0 );
m_showAllNetsOpt = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Show all nets"), wxDefaultPosition, wxDefaultSize, 0 );
bFilteringSizer->Add( m_showAllNetsOpt, 0, wxALL, 5 );
bFilteringSizer->Add( 0, 0, 0, wxEXPAND|wxTOP, 5 );
m_sortByPadsOpt = new wxCheckBox( this, wxID_ANY, _("Sort nets by pad count"), wxDefaultPosition, wxDefaultSize, 0 );
m_sortByPadsOpt = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Sort nets by pad count"), wxDefaultPosition, wxDefaultSize, 0 );
bFilteringSizer->Add( m_sortByPadsOpt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_bNoNetWarning = new wxBoxSizer( wxHORIZONTAL );
m_bitmapNoNetWarning = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmapNoNetWarning = new wxStaticBitmap( sbSizer3->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bNoNetWarning->Add( m_bitmapNoNetWarning, 0, wxTOP|wxBOTTOM|wxLEFT, 8 );
m_staticText18 = new wxStaticText( this, wxID_ANY, _("No net will result\nin an unconnected \ncopper island."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText18 = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("No net will result\nin an unconnected \ncopper island."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText18->Wrap( -1 );
m_bNoNetWarning->Add( m_staticText18, 0, wxALL, 5 );
@ -107,10 +98,13 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
bFilteringSizer->Add( m_bNoNetWarning, 1, wxEXPAND|wxTOP, 20 );
m_OptionsBoxSizer->Add( bFilteringSizer, 0, wxEXPAND|wxTOP, 20 );
sbSizer3->Add( bFilteringSizer, 0, wxEXPAND, 20 );
m_MainBoxSizer->Add( m_OptionsBoxSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 );
m_OptionsBoxSizer->Add( sbSizer3, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_MainBoxSizer->Add( m_OptionsBoxSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxStaticBoxSizer* m_ExportableSetupSizer;
m_ExportableSetupSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Settings") ), wxHORIZONTAL );
@ -166,7 +160,10 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
gbSizer1->AddGrowableCol( 1 );
m_ExportableSetupSizer->Add( gbSizer1, 1, wxEXPAND|wxRIGHT, 20 );
m_ExportableSetupSizer->Add( gbSizer1, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_ExportableSetupSizer->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxGridBagSizer* gbSizer2;
gbSizer2 = new wxGridBagSizer( 0, 0 );
@ -238,7 +235,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
gbSizer2->AddGrowableCol( 1 );
m_ExportableSetupSizer->Add( gbSizer2, 1, wxEXPAND|wxLEFT, 5 );
m_ExportableSetupSizer->Add( gbSizer2, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_MainBoxSizer->Add( m_ExportableSetupSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );

File diff suppressed because it is too large Load Diff

View File

@ -12,15 +12,16 @@
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/dataview.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/dataview.h>
#include <wx/string.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/listbox.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/checkbox.h>
@ -31,7 +32,6 @@
#include <wx/choice.h>
#include <wx/spinctrl.h>
#include <wx/gbsizer.h>
#include <wx/statbox.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
@ -72,9 +72,7 @@ class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM
};
wxBoxSizer* m_MainBoxSizer;
wxStaticText* m_staticTextLayers;
wxDataViewListCtrl* m_layers;
wxStaticText* m_staticTextNets;
wxListBox* m_ListNetNameSelection;
wxStaticText* m_staticTextDisplay;
wxTextCtrl* m_DoNotShowNetNameFilter;

View File

@ -154,7 +154,7 @@ void ZONE_SETTINGS::SetCornerRadius( int aRadius )
#ifdef __WXOSX_MAC__
const static wxSize LAYER_BITMAP_SIZE( 28, 28 ); // wxCocoa impl unhappy if this isn't square...
#else
const static wxSize LAYER_BITMAP_SIZE( 24, 18 );
const static wxSize LAYER_BITMAP_SIZE( 24, 16 );
#endif
// A helper for setting up a dialog list for specifying zone layers. Used by all three
@ -197,19 +197,16 @@ void ZONE_SETTINGS::SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME*
aList->SetToggleValue( true, (unsigned) aList->GetItemCount() - 1, 0 );
}
int checkColWidth = 22;
int layerColWidth = textWidth + LAYER_BITMAP_SIZE.x + 12;
int checkColSize = 22;
int layerColSize = textWidth + LAYER_BITMAP_SIZE.x + 15;
// You'd think the fact that m_layers is a list would encourage wxWidgets not to save room
// for the tree expanders... but you'd be wrong. Force indent to 0.
aList->SetIndent( 0 );
aList->SetMinClientSize( wxSize( checkColWidth + layerColWidth, aList->GetMinClientSize().y ) );
aList->SetMinClientSize( wxSize( checkColSize + layerColSize, aList->GetMinClientSize().y ) );
checkColumn->SetWidth( checkColWidth );
layerColumn->SetWidth( layerColWidth );
int afterCheckColWidth = checkColumn->GetWidth();
int afterLayerColWidth = layerColumn->GetWidth();
checkColumn->SetWidth( checkColSize );
layerColumn->SetWidth( layerColSize );
}