Replace Connect() with Bind() in all samples and utils too
Still use Connect() in unit tests which were written explicitly for it and in EventConnector, which can't use Bind() as it uses a variable for the event type. No real changes, just use the newer and more convenient function.
This commit is contained in:
@@ -49,7 +49,7 @@ public:
|
||||
SetVirtualSize( WIDTH, HEIGHT );
|
||||
SetBackgroundColour( *wxWHITE );
|
||||
|
||||
Connect(wxEVT_PAINT, wxPaintEventHandler(MySimpleCanvas::OnPaint));
|
||||
Bind(wxEVT_PAINT, &MySimpleCanvas::OnPaint, this);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -125,10 +125,8 @@ public:
|
||||
mbar->Append(menuFile, "&File");
|
||||
SetMenuBar( mbar );
|
||||
|
||||
Connect(wxID_DELETE, wxEVT_MENU,
|
||||
wxCommandEventHandler(MyCanvasFrame::OnDeleteAll));
|
||||
Connect(wxID_NEW, wxEVT_MENU,
|
||||
wxCommandEventHandler(MyCanvasFrame::OnInsertNew));
|
||||
Bind(wxEVT_MENU, &MyCanvasFrame::OnDeleteAll, this, wxID_DELETE);
|
||||
Bind(wxEVT_MENU, &MyCanvasFrame::OnInsertNew, this, wxID_NEW);
|
||||
|
||||
Show();
|
||||
}
|
||||
@@ -197,7 +195,7 @@ public:
|
||||
{
|
||||
m_owner = parent;
|
||||
|
||||
Connect(wxEVT_PAINT, wxPaintEventHandler(MySubColLabels::OnPaint));
|
||||
Bind(wxEVT_PAINT, &MySubColLabels::OnPaint, this);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -232,7 +230,7 @@ public:
|
||||
{
|
||||
m_owner = parent;
|
||||
|
||||
Connect(wxEVT_PAINT, wxPaintEventHandler(MySubRowLabels::OnPaint));
|
||||
Bind(wxEVT_PAINT, &MySubRowLabels::OnPaint, this);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -289,7 +287,7 @@ public:
|
||||
|
||||
SetBackgroundColour("WHEAT");
|
||||
|
||||
Connect(wxEVT_PAINT, wxPaintEventHandler(MySubCanvas::OnPaint));
|
||||
Bind(wxEVT_PAINT, &MySubCanvas::OnPaint, this);
|
||||
}
|
||||
|
||||
// override the base class function so that when this window is scrolled,
|
||||
@@ -396,7 +394,7 @@ public:
|
||||
|
||||
SetScrollbars(10, 10, 50, 50);
|
||||
|
||||
Connect(wxEVT_SIZE, wxSizeEventHandler(MySubScrolledWindow::OnSize));
|
||||
Bind(wxEVT_SIZE, &MySubScrolledWindow::OnSize, this);
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -808,8 +806,8 @@ MySizerScrolledWindow::MySizerScrolledWindow(wxWindow *parent)
|
||||
|
||||
SetSizer( sizer );
|
||||
|
||||
Connect(wxID_RESIZE_FRAME, wxEVT_BUTTON,
|
||||
wxCommandEventHandler(MySizerScrolledWindow::OnResizeClick));
|
||||
Bind(wxEVT_BUTTON, &MySizerScrolledWindow::OnResizeClick, this,
|
||||
wxID_RESIZE_FRAME);
|
||||
}
|
||||
|
||||
void MySizerScrolledWindow::OnResizeClick(wxCommandEvent &WXUNUSED(event))
|
||||
|
Reference in New Issue
Block a user