Remove CPanel.

Let the RenderFrame handle those messages.
This commit is contained in:
Jules Blok 2014-06-15 12:12:19 +02:00
parent 1b70bebb5a
commit 66fec6d0bd
2 changed files with 18 additions and 70 deletions

View File

@ -78,57 +78,6 @@ extern "C" {
#include "DolphinWX/resources/Dolphin.c" // NOLINT: Dolphin icon
};
#ifdef _WIN32
// I could not use FindItemByHWND() instead of this, it crashed on that occasion I used it */
HWND MSWGetParent_(HWND Parent)
{
return GetParent(Parent);
}
#endif
// ---------------
// The CPanel class to receive MSWWindowProc messages from the video backend.
BEGIN_EVENT_TABLE(CPanel, wxPanel)
END_EVENT_TABLE()
CPanel::CPanel(
wxWindow *parent,
wxWindowID id
)
: wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, 0) // disables wxTAB_TRAVERSAL because it was breaking hotkeys
{
}
#ifdef _WIN32
WXLRESULT CPanel::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
switch (nMsg)
{
case WM_USER:
switch (wParam)
{
case WM_USER_STOP:
main_frame->DoStop();
break;
case WM_USER_SETCURSOR:
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor &&
main_frame->RendererHasFocus() && Core::GetState() == Core::CORE_RUN)
SetCursor(wxCURSOR_BLANK);
else
SetCursor(wxNullCursor);
break;
}
break;
default:
// By default let wxWidgets do what it normally does with this event
return wxPanel::MSWWindowProc(nMsg, wParam, lParam);
}
return 0;
}
#endif
CRenderFrame::CRenderFrame(wxFrame* parent, wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, long style)
@ -213,6 +162,23 @@ WXLRESULT CRenderFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPa
}
break;
case WM_USER:
switch (wParam)
{
case WM_USER_STOP:
main_frame->DoStop();
break;
case WM_USER_SETCURSOR:
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor &&
main_frame->RendererHasFocus() && Core::GetState() == Core::CORE_RUN)
SetCursor(wxCURSOR_BLANK);
else
SetCursor(wxNullCursor);
break;
}
break;
case WM_CLOSE:
// Let Core finish initializing before accepting any WM_CLOSE messages
if (!Core::IsRunning()) break;
@ -384,7 +350,7 @@ CFrame::CFrame(wxFrame* parent,
// ---------------
// Main panel
// This panel is the parent for rendering and it holds the gamelistctrl
m_Panel = new CPanel(this, IDM_MPANEL);
m_Panel = new wxPanel(this, IDM_MPANEL, wxDefaultPosition, wxDefaultSize, 0);
m_GameListCtrl = new CGameListCtrl(m_Panel, LIST_CTRL,
wxDefaultPosition, wxDefaultSize,

View File

@ -50,24 +50,6 @@ class wxListEvent;
class wxMenuItem;
class wxWindow;
// The CPanel class to receive MSWWindowProc messages from the video backend.
class CPanel : public wxPanel
{
public:
CPanel(
wxWindow* parent,
wxWindowID id = wxID_ANY
);
private:
DECLARE_EVENT_TABLE();
#ifdef _WIN32
// Receive WndProc messages
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
#endif
};
class CRenderFrame : public wxFrame
{
public: