Use Bind() instead of Connect() in wxWidgets code

Use more modern function which allows to avoid wxXXXEventHandler()
macros use.

No real changes.
This commit is contained in:
Vadim Zeitlin
2018-05-28 22:10:56 +02:00
parent 8c8ff2c24d
commit d4f380e16e
48 changed files with 168 additions and 363 deletions

View File

@@ -88,15 +88,15 @@ bool wxGenericHyperlinkCtrl::Create(wxWindow *parent, wxWindowID id,
// behave correctly (as we intercept events doing things which interfere
// with GTK+'s native handling):
Connect( wxEVT_PAINT, wxPaintEventHandler(wxGenericHyperlinkCtrl::OnPaint) );
Connect( wxEVT_SET_FOCUS, wxFocusEventHandler(wxGenericHyperlinkCtrl::OnFocus) );
Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler(wxGenericHyperlinkCtrl::OnFocus) );
Connect( wxEVT_CHAR, wxKeyEventHandler(wxGenericHyperlinkCtrl::OnChar) );
Connect( wxEVT_LEAVE_WINDOW, wxMouseEventHandler(wxGenericHyperlinkCtrl::OnLeaveWindow) );
Bind( wxEVT_PAINT, &wxGenericHyperlinkCtrl::OnPaint, this);
Bind( wxEVT_SET_FOCUS, &wxGenericHyperlinkCtrl::OnFocus, this);
Bind( wxEVT_KILL_FOCUS, &wxGenericHyperlinkCtrl::OnFocus, this);
Bind( wxEVT_CHAR, &wxGenericHyperlinkCtrl::OnChar, this);
Bind( wxEVT_LEAVE_WINDOW, &wxGenericHyperlinkCtrl::OnLeaveWindow, this);
Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler(wxGenericHyperlinkCtrl::OnLeftDown) );
Connect( wxEVT_LEFT_UP, wxMouseEventHandler(wxGenericHyperlinkCtrl::OnLeftUp) );
Connect( wxEVT_MOTION, wxMouseEventHandler(wxGenericHyperlinkCtrl::OnMotion) );
Bind( wxEVT_LEFT_DOWN, &wxGenericHyperlinkCtrl::OnLeftDown, this);
Bind( wxEVT_LEFT_UP, &wxGenericHyperlinkCtrl::OnLeftUp, this);
Bind( wxEVT_MOTION, &wxGenericHyperlinkCtrl::OnMotion, this);
ConnectMenuHandlers();
@@ -118,9 +118,9 @@ void wxGenericHyperlinkCtrl::Init()
void wxGenericHyperlinkCtrl::ConnectMenuHandlers()
{
// Connect the event handlers for the context menu.
Connect( wxEVT_RIGHT_UP, wxMouseEventHandler(wxGenericHyperlinkCtrl::OnRightUp) );
Connect( wxHYPERLINK_POPUP_COPY_ID, wxEVT_MENU,
wxCommandEventHandler(wxGenericHyperlinkCtrl::OnPopUpCopy) );
Bind( wxEVT_RIGHT_UP, &wxGenericHyperlinkCtrl::OnRightUp, this);
Bind( wxEVT_MENU, &wxGenericHyperlinkCtrl::OnPopUpCopy, this,
wxHYPERLINK_POPUP_COPY_ID);
}
wxSize wxGenericHyperlinkCtrl::DoGetBestClientSize() const