FrameTools: Add a wxPanel as the child of the RenderFrame.

Needed for hotkeys to be captured on Linux.
This commit is contained in:
Jules Blok 2014-08-02 13:55:23 +02:00
parent 7e83a0ea9b
commit 6ab6d07948
1 changed files with 5 additions and 1 deletions

View File

@ -970,12 +970,16 @@ void CFrame::StartGame(const std::string& filename)
else else
m_RenderFrame->SetWindowStyle(m_RenderFrame->GetWindowStyle() & ~wxSTAY_ON_TOP); m_RenderFrame->SetWindowStyle(m_RenderFrame->GetWindowStyle() & ~wxSTAY_ON_TOP);
m_RenderFrame->SetBackgroundColour(*wxBLACK);
m_RenderFrame->SetClientSize(size.GetWidth(), size.GetHeight()); m_RenderFrame->SetClientSize(size.GetWidth(), size.GetHeight());
m_RenderFrame->Bind(wxEVT_CLOSE_WINDOW, &CFrame::OnRenderParentClose, this); m_RenderFrame->Bind(wxEVT_CLOSE_WINDOW, &CFrame::OnRenderParentClose, this);
m_RenderFrame->Bind(wxEVT_ACTIVATE, &CFrame::OnActive, this); m_RenderFrame->Bind(wxEVT_ACTIVATE, &CFrame::OnActive, this);
m_RenderFrame->Bind(wxEVT_MOVE, &CFrame::OnRenderParentMove, this); m_RenderFrame->Bind(wxEVT_MOVE, &CFrame::OnRenderParentMove, this);
m_RenderParent = m_RenderFrame; m_RenderParent = m_RenderFrame;
// To capture key events the frame needs at least one child.
wxPanel* panel = new wxPanel(m_RenderFrame, IDM_MPANEL, wxDefaultPosition, wxDefaultSize, 0);
panel->SetBackgroundColour(*wxBLACK);
m_RenderFrame->Show(); m_RenderFrame->Show();
} }