diff --git a/common/dialogs/dialog_paste_special.cpp b/common/dialogs/dialog_paste_special.cpp index 94d096abca..28b94f7aa1 100644 --- a/common/dialogs/dialog_paste_special.cpp +++ b/common/dialogs/dialog_paste_special.cpp @@ -29,7 +29,7 @@ static PASTE_MODE g_paste_mode = PASTE_MODE::UNIQUE_ANNOTATIONS; DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* aParent, PASTE_MODE* aMode, - wxString aReplacement ) : + const wxString& aReplacement ) : DIALOG_PASTE_SPECIAL_BASE( aParent ), m_mode( aMode ) { @@ -45,7 +45,7 @@ DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* aParent, "with '%s'." ), aReplacement ) ); - m_sdbSizerOK->SetFocus(); + m_pasteOptions->SetFocus(); // Now all widgets have the size fixed, call FinishDialogSettings finishDialogSettings(); @@ -64,3 +64,11 @@ bool DIALOG_PASTE_SPECIAL::TransferDataFromWindow() g_paste_mode = *m_mode = static_cast( m_pasteOptions->GetSelection() ); return true; } + + +void DIALOG_PASTE_SPECIAL::onRadioBoxEvent( wxCommandEvent& event ) +{ + event.Skip(); + + m_sdbSizerOK->SetFocus(); +} diff --git a/common/dialogs/dialog_paste_special_base.cpp b/common/dialogs/dialog_paste_special_base.cpp index a747a3976a..eae8c444ff 100644 --- a/common/dialogs/dialog_paste_special_base.cpp +++ b/common/dialogs/dialog_paste_special_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) +// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -45,12 +45,12 @@ DIALOG_PASTE_SPECIAL_BASE::DIALOG_PASTE_SPECIAL_BASE( wxWindow* parent, wxWindow this->Centre( wxBOTH ); // Connect Events - m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PASTE_SPECIAL_BASE::onOKButton ), NULL, this ); + m_pasteOptions->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PASTE_SPECIAL_BASE::onRadioBoxEvent ), NULL, this ); } DIALOG_PASTE_SPECIAL_BASE::~DIALOG_PASTE_SPECIAL_BASE() { // Disconnect Events - m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PASTE_SPECIAL_BASE::onOKButton ), NULL, this ); + m_pasteOptions->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PASTE_SPECIAL_BASE::onRadioBoxEvent ), NULL, this ); } diff --git a/common/dialogs/dialog_paste_special_base.fbp b/common/dialogs/dialog_paste_special_base.fbp index 4b52515854..6f1b6c19f9 100644 --- a/common/dialogs/dialog_paste_special_base.fbp +++ b/common/dialogs/dialog_paste_special_base.fbp @@ -1,163 +1,165 @@ - + - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - dialog_paste_special_base - 1000 - none - - - 1 - dialog_paste_special - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT - - wxBOTH - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - -1,-1 - DIALOG_PASTE_SPECIAL_BASE - - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Paste Special - - 0 - - - - + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_paste_special_base + 1000 + none + + + 1 + dialog_paste_special + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 0 + 1 + impl_virtual + + + + 0 + wxID_ANY + + -1,-1 + DIALOG_PASTE_SPECIAL_BASE + + -1,-1 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Paste Special + + 0 + + + + + + m_mainSizer + wxVERTICAL + none + + 10 + wxALL|wxEXPAND + 1 + + + optionsSizer + wxVERTICAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Assign unique reference designators to pasted symbols" "Keep existing reference designators, even if they are duplicated" "Clear reference designators on all pasted symbols" + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Paste Options + 1 + + 0 + + + 0 - m_mainSizer - wxVERTICAL - none - - 10 - wxALL|wxEXPAND - 1 - - - optionsSizer - wxVERTICAL - none - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Assign unique reference designators to pasted symbols" "Keep existing reference designators, even if they are duplicated" "Clear reference designators on all pasted symbols" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Paste Options - 1 - - 0 - - - 0 - - 1 - m_pasteOptions - 1 - - - protected - 1 - - Resizable - 1 - 1 - - wxRA_SPECIFY_COLS - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - 6 - wxALL|wxEXPAND - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer - protected - onOKButton - - + 1 + m_pasteOptions + 1 + + + protected + 1 + + Resizable + 1 + 1 + + wxRA_SPECIFY_COLS + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onRadioBoxEvent + + + + 6 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer + protected + + + + diff --git a/common/dialogs/dialog_paste_special_base.h b/common/dialogs/dialog_paste_special_base.h index b3ff58d61c..f56e0f4050 100644 --- a/common/dialogs/dialog_paste_special_base.h +++ b/common/dialogs/dialog_paste_special_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) +// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -38,7 +38,7 @@ class DIALOG_PASTE_SPECIAL_BASE : public DIALOG_SHIM wxButton* m_sdbSizerCancel; // Virtual event handlers, override them in your derived class - virtual void onOKButton( wxCommandEvent& event ) { event.Skip(); } + virtual void onRadioBoxEvent( wxCommandEvent& event ) { event.Skip(); } public: diff --git a/include/dialogs/dialog_paste_special.h b/include/dialogs/dialog_paste_special.h index ce4867628f..7017512611 100644 --- a/include/dialogs/dialog_paste_special.h +++ b/include/dialogs/dialog_paste_special.h @@ -45,11 +45,14 @@ class DIALOG_PASTE_SPECIAL : public DIALOG_PASTE_SPECIAL_BASE public: DIALOG_PASTE_SPECIAL( wxWindow* aParent, PASTE_MODE* aMode, - wxString aReplacement = wxT( "?" ) ); + const wxString& aReplacement = wxS( "?" ) ); bool TransferDataToWindow() override; bool TransferDataFromWindow() override; +protected: + virtual void onRadioBoxEvent( wxCommandEvent& event ) override; + private: PASTE_MODE* m_mode; };