diff --git a/pcbnew/dialogs/dialog_copper_zones.cpp b/pcbnew/dialogs/dialog_copper_zones.cpp index f515a3fdc6..db10961e5e 100644 --- a/pcbnew/dialogs/dialog_copper_zones.cpp +++ b/pcbnew/dialogs/dialog_copper_zones.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -88,6 +89,7 @@ private: void OnButtonCancelClick( wxCommandEvent& event ) override; void OnClose( wxCloseEvent& event ) override; void OnCornerSmoothingModeChoice( wxCommandEvent& event ) override; + void OnUpdateUI( wxUpdateUIEvent& ) override; /** * Function AcceptOptions @@ -168,6 +170,8 @@ void DIALOG_COPPER_ZONE::initDialog() { BOARD* board = m_Parent->GetBoard(); + m_bitmapNoNetWarning->SetBitmap( KiBitmap( dialog_warning_xpm ) ); + wxString msg; if( m_settings.m_Zone_45_Only ) @@ -303,6 +307,11 @@ void DIALOG_COPPER_ZONE::initDialog() } +void DIALOG_COPPER_ZONE::OnUpdateUI( wxUpdateUIEvent& ) +{ + m_bNoNetWarning->Show( m_ListNetNameSelection->GetSelection() == 0 ); +} + void DIALOG_COPPER_ZONE::OnButtonCancelClick( wxCommandEvent& event ) { Close( true ); @@ -475,13 +484,6 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab return false; } - if( ii == 0 ) // the not connected option was selected: this is not a good practice: warn: - { - if( !IsOK( this, _( "You have chosen the \"not connected\" option. This will create " - "insulated copper islands. Are you sure ?" ) ) ) - return false; - } - wxString net_name = m_ListNetNameSelection->GetString( ii ); m_settings.m_NetcodeSelection = 0; diff --git a/pcbnew/dialogs/dialog_copper_zones_base.cpp b/pcbnew/dialogs/dialog_copper_zones_base.cpp index f84d257819..6bb48b0179 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.cpp +++ b/pcbnew/dialogs/dialog_copper_zones_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 22 2017) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -13,6 +13,7 @@ BEGIN_EVENT_TABLE( DIALOG_COPPER_ZONE_BASE, DIALOG_SHIM ) EVT_CLOSE( DIALOG_COPPER_ZONE_BASE::_wxFB_OnClose ) + EVT_UPDATE_UI( ID_NETNAME_SELECTION, DIALOG_COPPER_ZONE_BASE::_wxFB_OnUpdateUI ) EVT_CHOICE( ID_M_NETDISPLAYOPTION, DIALOG_COPPER_ZONE_BASE::_wxFB_OnNetSortingOptionSelected ) EVT_TEXT_ENTER( ID_TEXTCTRL_NETNAMES_FILTER, DIALOG_COPPER_ZONE_BASE::_wxFB_OnRunFiltersButtonClick ) EVT_TEXT_ENTER( ID_TEXTCTRL_NETNAMES_FILTER, DIALOG_COPPER_ZONE_BASE::_wxFB_OnRunFiltersButtonClick ) @@ -241,6 +242,18 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i m_OutlineAppearanceCtrl->SetSelection( 0 ); bSizerLowerRight->Add( m_OutlineAppearanceCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + m_bNoNetWarning = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapNoNetWarning = new wxStaticBitmap( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bNoNetWarning->Add( m_bitmapNoNetWarning, 0, wxTOP|wxBOTTOM|wxLEFT, 8 ); + + m_staticText18 = new wxStaticText( m_ExportableSetupSizer->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 ); + + + bSizerLowerRight->Add( m_bNoNetWarning, 1, wxEXPAND|wxTOP, 25 ); + m_ExportableSetupSizer->Add( bSizerLowerRight, 0, wxEXPAND, 5 ); diff --git a/pcbnew/dialogs/dialog_copper_zones_base.fbp b/pcbnew/dialogs/dialog_copper_zones_base.fbp index db585d6dcc..3871abd437 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.fbp +++ b/pcbnew/dialogs/dialog_copper_zones_base.fbp @@ -478,7 +478,7 @@ - + OnUpdateUI @@ -3244,6 +3244,181 @@ + + 25 + wxEXPAND|wxTOP + 1 + + + m_bNoNetWarning + wxHORIZONTAL + protected + + 8 + wxTOP|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_bitmapNoNetWarning + 1 + + + protected + 1 + + Resizable + 1 + + ; forward_declare + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + No net will result in an unconnected copper island. + + 0 + + + 0 + + 1 + m_staticText18 + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_copper_zones_base.h b/pcbnew/dialogs/dialog_copper_zones_base.h index eb219316da..ed761d7d5b 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.h +++ b/pcbnew/dialogs/dialog_copper_zones_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 22 2017) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -28,6 +28,10 @@ class TEXT_CTRL_EVAL; #include #include #include +#include +#include +#include +#include #include /////////////////////////////////////////////////////////////////////////// @@ -42,6 +46,7 @@ class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM // Private event handlers void _wxFB_OnClose( wxCloseEvent& event ){ OnClose( event ); } + void _wxFB_OnUpdateUI( wxUpdateUIEvent& event ){ OnUpdateUI( event ); } void _wxFB_OnNetSortingOptionSelected( wxCommandEvent& event ){ OnNetSortingOptionSelected( event ); } void _wxFB_OnRunFiltersButtonClick( wxCommandEvent& event ){ OnRunFiltersButtonClick( event ); } void _wxFB_OnCornerSmoothingModeChoice( wxCommandEvent& event ){ OnCornerSmoothingModeChoice( event ); } @@ -108,6 +113,9 @@ class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM wxChoice* m_OrientEdgesOpt; wxStaticText* m_staticTextStyle; wxChoice* m_OutlineAppearanceCtrl; + wxBoxSizer* m_bNoNetWarning; + wxStaticBitmap* m_bitmapNoNetWarning; + wxStaticText* m_staticText18; wxButton* m_ExportSetupButton; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; @@ -115,6 +123,7 @@ class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); } virtual void OnNetSortingOptionSelected( wxCommandEvent& event ) { event.Skip(); } virtual void OnRunFiltersButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnCornerSmoothingModeChoice( wxCommandEvent& event ) { event.Skip(); }