diff --git a/common/validators.cpp b/common/validators.cpp index c5c0074c65..e3877b1b3f 100644 --- a/common/validators.cpp +++ b/common/validators.cpp @@ -185,7 +185,7 @@ void ENV_VAR_NAME_VALIDATOR::OnChar( wxKeyEvent& aEvent ) if( textCtrl ) { textCtrl->Connect( textCtrl->GetId(), wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) &ENV_VAR_NAME_VALIDATOR::OnTextChanged ); + wxCommandEventHandler( ENV_VAR_NAME_VALIDATOR::OnTextChanged ) ); } } diff --git a/include/kiway_express.h b/include/kiway_express.h index 0682bbc93a..dfb0b102c9 100644 --- a/include/kiway_express.h +++ b/include/kiway_express.h @@ -88,16 +88,11 @@ private: typedef void ( wxEvtHandler::*kiwayExpressFunction )( KIWAY_EXPRESS& ); -#define wxKiwayExressHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(kiwayExpressFunction, &func) - +/// Typecast an event handler for the KIWAY_EXPRESS event class +#define kiwayExpressHandler( func ) wxEVENT_HANDLER_CAST( kiwayExpressFunction, func ) +/// Event table definition for the KIWAY_EXPRESS event class #define EVT_KIWAY_EXPRESS( func ) \ - DECLARE_EVENT_TABLE_ENTRY( \ - KIWAY_EXPRESS::wxEVENT_ID, -1, -1, \ - (wxObjectEventFunction) \ - (kiwayExpressFunction) & func, \ - (wxObject*) NULL ), - + wx__DECLARE_EVT0( KIWAY_EXPRESS::wxEVENT_ID, kiwayExpressHandler( func ) ) #endif // KIWAY_EXPRESS_H_ diff --git a/pcbnew/swig/pcbnew_action_plugins.cpp b/pcbnew/swig/pcbnew_action_plugins.cpp index 0ea1132200..48851e674f 100644 --- a/pcbnew/swig/pcbnew_action_plugins.cpp +++ b/pcbnew/swig/pcbnew_action_plugins.cpp @@ -374,8 +374,7 @@ void PCB_EDIT_FRAME::buildActionPluginMenus( ACTION_MENU* actionMenu ) item = AddMenuItem( actionMenu, wxID_ANY, ap->GetName(), ap->GetDescription(), bitmap ); Connect( item->GetId(), wxEVT_COMMAND_MENU_SELECTED, - (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & - PCB_EDIT_FRAME::OnActionPluginMenu ); + wxCommandEventHandler( PCB_EDIT_FRAME::OnActionPluginMenu ) ); ACTION_PLUGINS::SetActionMenu( ii, item->GetId() ); } @@ -410,8 +409,7 @@ void PCB_EDIT_FRAME::AddActionPluginTools() wxID_ANY, wxEmptyString, bitmap, ap->GetName() ); Connect( button->GetId(), wxEVT_COMMAND_MENU_SELECTED, - (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & - PCB_EDIT_FRAME::OnActionPluginButton ); + wxCommandEventHandler( PCB_EDIT_FRAME::OnActionPluginButton ) ); // Link action plugin to button ACTION_PLUGINS::SetActionButton( ap, button->GetId() );