1st: add
Code: Select all
EVT_CHILD_FOCUS(IrrFrame::OnSetFocus)
Code: Select all
void IrrFrame::OnSetFocus(wxChildFocusEvent& event)
{
if(event.GetWindow() == ToolFrame)
{
irrWin->StopRendering();
}
}
But calling wxIrrlicht::StopRendering() inside this function caused the program to crash.
Next I tried to change wxIrrlicht::StartRendering so it looks like this:
Code: Select all
void wxIrrlicht::StartRendering(int milliseconds)
{
if(FindFocus() == this){ //added this if statement
m_Timer.Start(milliseconds);
}
}
But here's the meat of the problem: I need the wxIrrilcht control to continue rendering when the ToolFrame is in focus, so that the checkboxes and sliders can dynamically control what's on the screen. But I need it to stop rendering when the ToolFrame is being moved around the screen or being docked or undocked.
I tried adding
Code: Select all
EVT_MOVE_EVENT(OnMove)
Code: Select all
ToolFrame::OnMove(wxMoveEvent& event)
{
irrWin->StopRendering();
}
Thanks in advance
Brian