diff --git a/common/basicframe.cpp b/common/basicframe.cpp index 45ad2f4d87..417bbc6edf 100644 --- a/common/basicframe.cpp +++ b/common/basicframe.cpp @@ -631,3 +631,18 @@ void EDA_BASE_FRAME::CheckForAutoSaveFile( const wxFileName& aFileName, wxRemoveFile( autoSaveFileName.GetFullPath() ); } } + + +bool EDA_BASE_FRAME::PostCommandMenuEvent( int evt_type ) +{ + if( evt_type != 0 ) + { + wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED ); + evt.SetEventObject( this ); + evt.SetId( evt_type ); + wxPostEvent( this, evt ); + return true; + } + + return false; +} diff --git a/include/wxstruct.h b/include/wxstruct.h index 1292150b4f..35d4af9249 100644 --- a/include/wxstruct.h +++ b/include/wxstruct.h @@ -406,6 +406,15 @@ public: * redraws the menus and what not in current language. */ virtual void ShowChangedLanguage(); + + + /** + * Function PostCommandMenuEvent + * + * Post a menu event to the frame, which can be used to trigger actions + * bound to menu items. + */ + bool PostCommandMenuEvent( int evt_type ); }; diff --git a/pcbnew/pcb_base_edit_frame.cpp b/pcbnew/pcb_base_edit_frame.cpp index 3383c5388e..2580985b9d 100644 --- a/pcbnew/pcb_base_edit_frame.cpp +++ b/pcbnew/pcb_base_edit_frame.cpp @@ -39,21 +39,6 @@ void PCB_BASE_EDIT_FRAME::SetRotationAngle( int aRotationAngle ) } -bool PCB_BASE_EDIT_FRAME::PostCommandMenuEvent( int evt_type ) -{ - if( evt_type != 0 ) - { - wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED ); - evt.SetEventObject( this ); - evt.SetId( evt_type ); - wxPostEvent( this, evt ); - return true; - } - - return false; -} - - void PCB_BASE_EDIT_FRAME::UseGalCanvas( bool aEnable ) { PCB_BASE_FRAME::UseGalCanvas( aEnable ); diff --git a/pcbnew/pcb_base_edit_frame.h b/pcbnew/pcb_base_edit_frame.h index db6f31066c..ef68feebdf 100644 --- a/pcbnew/pcb_base_edit_frame.h +++ b/pcbnew/pcb_base_edit_frame.h @@ -156,8 +156,6 @@ public: */ void SetRotationAngle( int aRotationAngle ); - bool PostCommandMenuEvent( int evt_type ); - ///> @copydoc EDA_DRAW_FRAME::UseGalCanvas() void UseGalCanvas( bool aEnable ) override;