From 66fec6d0bd8c90a96bbd28773199fba392ea9b2e Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Sun, 15 Jun 2014 12:12:19 +0200 Subject: [PATCH] Remove CPanel. Let the RenderFrame handle those messages. --- Source/Core/DolphinWX/Frame.cpp | 70 +++++++++------------------------ Source/Core/DolphinWX/Frame.h | 18 --------- 2 files changed, 18 insertions(+), 70 deletions(-) diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index b57f18ad69..94698837dc 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -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, diff --git a/Source/Core/DolphinWX/Frame.h b/Source/Core/DolphinWX/Frame.h index d4024c8c22..3ae9216c11 100644 --- a/Source/Core/DolphinWX/Frame.h +++ b/Source/Core/DolphinWX/Frame.h @@ -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: