From ff63c689d6f3ea0a896d1905e5b2d13877a601e1 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Sun, 18 Mar 2012 02:33:03 -0700 Subject: [PATCH] wxMSW no longer allows overriding OnPaintDrawImages, so remove the msw-specific drawing code from the GameListCtrl (it's rendered correctly by default) --- Source/Core/DolphinWX/Src/GameListCtrl.cpp | 51 ---------------------- Source/Core/DolphinWX/Src/GameListCtrl.h | 1 - 2 files changed, 52 deletions(-) diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index 3717ed4367..20322673a1 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -149,9 +149,6 @@ BEGIN_EVENT_TABLE(wxEmuStateTip, wxTipWindow) END_EVENT_TABLE() BEGIN_EVENT_TABLE(CGameListCtrl, wxListCtrl) -#ifdef _WIN32 - EVT_PAINT(CGameListCtrl::OnPaintDrawImages) -#endif EVT_SIZE(CGameListCtrl::OnSize) EVT_RIGHT_DOWN(CGameListCtrl::OnRightClick) EVT_LEFT_DOWN(CGameListCtrl::OnLeftClick) @@ -384,48 +381,6 @@ std::string CGameListCtrl::GetGameNames() const return m_gameList; } -#ifdef _WIN32 -// This draws our icons on top of the gamelist, it's only used on Windows -void CGameListCtrl::OnPaintDrawImages(wxPaintEvent& event) -{ - wxPaintDC dc(this); - - // Calls the default drawing code - wxControl::OnPaint(event); - - // Draw the flags, platform icons and emustate icons on top if there's games to show - if (m_ISOFiles.empty()) - return; - - // Retrieve the topmost shown item and get drawing offsets - const long - top_item = GetTopItem(), - bottom_item = std::min(top_item + GetCountPerPage() + 2, (long)GetItemCount()); - - int flagOffset = GetColumnWidth(0) + GetColumnWidth(1) + - GetColumnWidth(2) + GetColumnWidth(3); - int stateOffset = flagOffset + GetColumnWidth(4) + GetColumnWidth(5); - - // Only redraw shown lines - for (long i = top_item; i != bottom_item; ++i) - { - wxRect itemRect; - if (GetItemRect(i, itemRect)) - { - const int itemY = itemRect.GetTop(); - const GameListItem& rISOFile = *m_ISOFiles[GetItemData(i)]; - - m_imageListSmall->Draw(m_PlatformImageIndex[rISOFile.GetPlatform()], - dc, itemRect.GetX()+3, itemY); - m_imageListSmall->Draw(m_FlagImageIndex[rISOFile.GetCountry()], - dc, flagOffset, itemY); - m_imageListSmall->Draw(m_EmuStateImageIndex[rISOFile.GetEmuState()], - dc, stateOffset, itemY); - } - } -} -#endif - void CGameListCtrl::InsertItemInReportView(long _Index) { // When using wxListCtrl, there is no hope of per-column text colors. @@ -455,12 +410,8 @@ void CGameListCtrl::InsertItemInReportView(long _Index) m_gamePath.append(rISOFile.GetFileName() + '\n'); // Insert a first row with the platform image, that will be used as the Index -#ifndef _WIN32 long ItemIndex = InsertItem(_Index, wxEmptyString, m_PlatformImageIndex[rISOFile.GetPlatform()]); -#else - long ItemIndex = InsertItem(_Index, wxEmptyString, -1); -#endif if (rISOFile.GetImage().IsOk()) ImageIndex = m_imageListSmall->Add(rISOFile.GetImage()); @@ -516,13 +467,11 @@ void CGameListCtrl::InsertItemInReportView(long _Index) SetItem(_Index, COLUMN_TITLE, name, -1); SetItem(_Index, COLUMN_NOTES, description, -1); -#ifndef _WIN32 // Emulation state SetItemColumnImage(_Index, COLUMN_EMULATION_STATE, m_EmuStateImageIndex[rISOFile.GetEmuState()]); // Country SetItemColumnImage(_Index, COLUMN_COUNTRY, m_FlagImageIndex[rISOFile.GetCountry()]); -#endif // File size SetItem(_Index, COLUMN_SIZE, NiceSizeFormat(rISOFile.GetFileSize()), -1); diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.h b/Source/Core/DolphinWX/Src/GameListCtrl.h index 8fca14f632..274cfdb7ee 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.h +++ b/Source/Core/DolphinWX/Src/GameListCtrl.h @@ -99,7 +99,6 @@ private: DECLARE_EVENT_TABLE() // events - void OnPaintDrawImages(wxPaintEvent& event); void OnLeftClick(wxMouseEvent& event); void OnRightClick(wxMouseEvent& event); void OnMouseMotion(wxMouseEvent& event);