Hello alls,
I would like to have a controller control my windows Event So i do it like this:
class WindowController
{
WindowController(wxWindow* window)
{
window->Connect(wxEVT_LEFT_DOWN,(wxObjectEventFunction)&WindowController::OnMouseButtonDown);
window->Connect(wxEVT_LEFT_UP,(wxObjectEventFunction)&WindowController::OnMouseButtonUp);
window->Connect(wxEVT_MOTION,(wxObjectEventFunction)&WindowController::OnMouseMove);
}
OnMouseButtonUp(wxMouseEvent& event);
OnMouseButtonDown(wxMouseEvent& event);
OnMouseMove(wxMouseEvent& event);
}
And a Window Class normal
class MyWindow::public wxWindow
{
WindowController* mController;
MyWindow(wxWindow*parent):wxWindow(parent,wxIDAny)
{
mController = new WindowController(this);
}
}
The problem is when i capture the input in my OnMouseButtonDown Controller Function, it crashs.
My Question is : Do my Controller Class have to be a wxEvtHandler Derivate to be able to manage that?
Thx in advance. |