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

@@ -1039,13 +1039,8 @@ void wxPropertyGrid::DoBeginLabelEdit( unsigned int colIndex,
0,
colIndex);
wxWindowID id = tc->GetId();
tc->Connect(id, wxEVT_TEXT_ENTER,
wxCommandEventHandler(wxPropertyGrid::OnLabelEditorEnterPress),
NULL, this);
tc->Connect(id, wxEVT_KEY_DOWN,
wxKeyEventHandler(wxPropertyGrid::OnLabelEditorKeyPress),
NULL, this);
tc->Bind(wxEVT_TEXT_ENTER, &wxPropertyGrid::OnLabelEditorEnterPress, this);
tc->Bind(wxEVT_KEY_DOWN, &wxPropertyGrid::OnLabelEditorKeyPress, this);
tc->SetFocus();
@@ -1227,9 +1222,7 @@ void wxPropertyGrid::OnTLPChanging( wxWindow* newTLP )
// correct top-level window.
if ( m_tlp )
{
m_tlp->Disconnect( wxEVT_CLOSE_WINDOW,
wxCloseEventHandler(wxPropertyGrid::OnTLPClose),
NULL, this );
m_tlp->Unbind(wxEVT_CLOSE_WINDOW, &wxPropertyGrid::OnTLPClose, this);
m_tlpClosed = m_tlp;
m_tlpClosedTime = currentTime;
}
@@ -1240,9 +1233,7 @@ void wxPropertyGrid::OnTLPChanging( wxWindow* newTLP )
if ( newTLP != m_tlpClosed ||
m_tlpClosedTime+250 < currentTime )
{
newTLP->Connect( wxEVT_CLOSE_WINDOW,
wxCloseEventHandler(wxPropertyGrid::OnTLPClose),
NULL, this );
newTLP->Bind(wxEVT_CLOSE_WINDOW, &wxPropertyGrid::OnTLPClose, this);
m_tlpClosed = NULL;
}
else
@@ -3928,33 +3919,19 @@ void wxPropertyGrid::SetupChildEventHandling( wxWindow* argWnd )
if ( argWnd == m_wndEditor )
{
argWnd->Connect(id, wxEVT_MOTION,
wxMouseEventHandler(wxPropertyGrid::OnMouseMoveChild),
NULL, this);
argWnd->Connect(id, wxEVT_LEFT_UP,
wxMouseEventHandler(wxPropertyGrid::OnMouseUpChild),
NULL, this);
argWnd->Connect(id, wxEVT_LEFT_DOWN,
wxMouseEventHandler(wxPropertyGrid::OnMouseClickChild),
NULL, this);
argWnd->Connect(id, wxEVT_RIGHT_UP,
wxMouseEventHandler(wxPropertyGrid::OnMouseRightClickChild),
NULL, this);
argWnd->Connect(id, wxEVT_ENTER_WINDOW,
wxMouseEventHandler(wxPropertyGrid::OnMouseEntry),
NULL, this);
argWnd->Connect(id, wxEVT_LEAVE_WINDOW,
wxMouseEventHandler(wxPropertyGrid::OnMouseEntry),
NULL, this);
argWnd->Bind(wxEVT_MOTION, &wxPropertyGrid::OnMouseMoveChild, this, id);
argWnd->Bind(wxEVT_LEFT_UP, &wxPropertyGrid::OnMouseUpChild, this, id);
argWnd->Bind(wxEVT_LEFT_DOWN, &wxPropertyGrid::OnMouseClickChild, this, id);
argWnd->Bind(wxEVT_RIGHT_UP, &wxPropertyGrid::OnMouseRightClickChild, this, id);
argWnd->Bind(wxEVT_ENTER_WINDOW, &wxPropertyGrid::OnMouseEntry, this, id);
argWnd->Bind(wxEVT_LEAVE_WINDOW, &wxPropertyGrid::OnMouseEntry, this, id);
}
wxPropertyGridEditorEventForwarder* forwarder;
forwarder = new wxPropertyGridEditorEventForwarder(this);
argWnd->PushEventHandler(forwarder);
argWnd->Connect(id, wxEVT_KEY_DOWN,
wxCharEventHandler(wxPropertyGrid::OnChildKeyDown),
NULL, this);
argWnd->Bind(wxEVT_KEY_DOWN, &wxPropertyGrid::OnChildKeyDown, this, id);
}
void wxPropertyGrid::DeletePendingObjects()