From d5f136cd7ea193586957cde1b1e67c77477c92ca Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 14 Apr 2019 22:29:52 +0100 Subject: [PATCH] Polish export-related changes to List Nets Dialog. --- .../dialog_select_net_from_list_base.cpp | 61 +-- .../dialog_select_net_from_list_base.fbp | 367 +++++++++++++----- .../dialog_select_net_from_list_base.h | 29 +- 3 files changed, 327 insertions(+), 130 deletions(-) diff --git a/pcbnew/dialogs/dialog_select_net_from_list_base.cpp b/pcbnew/dialogs/dialog_select_net_from_list_base.cpp index 16e29b3b97..ee52ad53e3 100644 --- a/pcbnew/dialogs/dialog_select_net_from_list_base.cpp +++ b/pcbnew/dialogs/dialog_select_net_from_list_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -12,60 +12,69 @@ DIALOG_SELECT_NET_FROM_LIST_BASE::DIALOG_SELECT_NET_FROM_LIST_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( wxSize( -1,-1 ), wxDefaultSize ); - + wxBoxSizer* bSizerMain; bSizerMain = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* bTopSizer; bTopSizer = new wxBoxSizer( wxHORIZONTAL ); - + m_staticTextFilter = new wxStaticText( this, wxID_ANY, _("Net name filter:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextFilter->Wrap( -1 ); bTopSizer->Add( m_staticTextFilter, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_textCtrlFilter = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); bTopSizer->Add( m_textCtrlFilter, 1, wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP, 5 ); - - + + bTopSizer->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 ); - + m_cbShowZeroPad = new wxCheckBox( this, wxID_ANY, _("Show zero pad nets"), wxDefaultPosition, wxDefaultSize, 0 ); - m_cbShowZeroPad->SetValue(true); + m_cbShowZeroPad->SetValue(true); bTopSizer->Add( m_cbShowZeroPad, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + bSizerMain->Add( bTopSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_Export = new wxButton( this, wxID_ANY, _("Export"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerMain->Add( m_Export, 0, wxALL, 5 ); - + m_netsList = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); m_netsList->SetMinSize( wxSize( 400,300 ) ); - + bSizerMain->Add( m_netsList, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 ); - + + wxBoxSizer* bSizerBottom; + bSizerBottom = new wxBoxSizer( wxHORIZONTAL ); + + m_Export = new wxButton( this, wxID_ANY, _("Export..."), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerBottom->Add( m_Export, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerBottom->Add( 0, 0, 1, wxEXPAND, 5 ); + m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); m_sdbSizer->AddButton( m_sdbSizerOK ); m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); - - bSizerMain->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 ); - - + + bSizerBottom->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 ); + + + bSizerMain->Add( bSizerBottom, 0, wxEXPAND|wxLEFT, 5 ); + + this->SetSizer( bSizerMain ); this->Layout(); bSizerMain->Fit( this ); - + this->Centre( wxBOTH ); - + // Connect Events m_textCtrlFilter->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onFilterChange ), NULL, this ); m_cbShowZeroPad->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onFilterChange ), NULL, this ); - m_Export->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onExport ), NULL, this ); m_netsList->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onSelChanged ), NULL, this ); m_netsList->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onListSize ), NULL, this ); + m_Export->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onExport ), NULL, this ); } DIALOG_SELECT_NET_FROM_LIST_BASE::~DIALOG_SELECT_NET_FROM_LIST_BASE() @@ -73,8 +82,8 @@ DIALOG_SELECT_NET_FROM_LIST_BASE::~DIALOG_SELECT_NET_FROM_LIST_BASE() // Disconnect Events m_textCtrlFilter->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onFilterChange ), NULL, this ); m_cbShowZeroPad->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onFilterChange ), NULL, this ); - m_Export->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onExport ), NULL, this ); m_netsList->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onSelChanged ), NULL, this ); m_netsList->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onListSize ), NULL, this ); - + m_Export->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onExport ), NULL, this ); + } diff --git a/pcbnew/dialogs/dialog_select_net_from_list_base.fbp b/pcbnew/dialogs/dialog_select_net_from_list_base.fbp index 8605e18b87..f8b6495337 100644 --- a/pcbnew/dialogs/dialog_select_net_from_list_base.fbp +++ b/pcbnew/dialogs/dialog_select_net_from_list_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,7 +14,6 @@ dialog_select_net_from_list_base 1000 none - 1 dialog_select_net_from_list_base @@ -53,6 +52,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizerMain @@ -100,7 +135,6 @@ 0 wxID_ANY Net name filter: - 0 0 @@ -126,6 +160,29 @@ -1 + + + + + + + + + + + + + + + + + + + + + + + @@ -190,7 +247,33 @@ + + + + + + + + + + + + + + + + + + + + + + onFilterChange + + + + @@ -265,84 +348,34 @@ + onFilterChange + + + + + + + + + + + + + + + + + + + + + + - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Export - - 0 - - 0 - - - 0 - - 1 - m_Export - 1 - - - protected - 1 - - - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - onExport - - 10 wxEXPAND|wxRIGHT|wxLEFT @@ -368,26 +401,182 @@ + + + + + + + + + + + + + + + + + + onSelChanged + + + + + + + + + + + + + + + + + + + + onListSize + - + 5 - wxALL|wxEXPAND + wxEXPAND|wxLEFT 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 + - m_sdbSizer - protected + bSizerBottom + wxHORIZONTAL + none + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Export... + + 0 + + + 0 + + 1 + m_Export + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + onExport + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer + protected + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_select_net_from_list_base.h b/pcbnew/dialogs/dialog_select_net_from_list_base.h index af44b8a6ca..a49334fdf2 100644 --- a/pcbnew/dialogs/dialog_select_net_from_list_base.h +++ b/pcbnew/dialogs/dialog_select_net_from_list_base.h @@ -1,11 +1,12 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#pragma once +#ifndef __DIALOG_SELECT_NET_FROM_LIST_BASE_H__ +#define __DIALOG_SELECT_NET_FROM_LIST_BASE_H__ #include #include @@ -20,11 +21,8 @@ #include #include #include -#include -#include -#include -#include #include +#include #include /////////////////////////////////////////////////////////////////////////// @@ -36,28 +34,29 @@ class DIALOG_SELECT_NET_FROM_LIST_BASE : public DIALOG_SHIM { private: - + protected: wxStaticText* m_staticTextFilter; wxTextCtrl* m_textCtrlFilter; wxCheckBox* m_cbShowZeroPad; - wxButton* m_Export; wxDataViewListCtrl* m_netsList; + wxButton* m_Export; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; - + // Virtual event handlers, overide them in your derived class virtual void onFilterChange( wxCommandEvent& event ) { event.Skip(); } - virtual void onExport( wxMouseEvent& event ) { event.Skip(); } virtual void onSelChanged( wxDataViewEvent& event ) { event.Skip(); } virtual void onListSize( wxSizeEvent& event ) { event.Skip(); } - - + virtual void onExport( wxMouseEvent& event ) { event.Skip(); } + + public: - - DIALOG_SELECT_NET_FROM_LIST_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Nets"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + + DIALOG_SELECT_NET_FROM_LIST_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Nets"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_SELECT_NET_FROM_LIST_BASE(); - + }; +#endif //__DIALOG_SELECT_NET_FROM_LIST_BASE_H__