2015-05-24 06:55:12 +02:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-18 01:08:10 +02:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 05:43:35 +02:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 05:46:09 +01:00
|
|
|
|
2014-02-10 19:54:46 +01:00
|
|
|
#pragma once
|
2008-12-08 05:46:09 +01:00
|
|
|
|
2014-02-22 23:36:30 +01:00
|
|
|
#include <cstddef>
|
|
|
|
#include <string>
|
2008-12-08 05:46:09 +01:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <wx/listctrl.h>
|
2009-09-25 18:29:00 +02:00
|
|
|
#include <wx/tipwin.h>
|
2008-12-08 05:46:09 +01:00
|
|
|
|
2014-02-17 11:18:15 +01:00
|
|
|
#include "DolphinWX/ISOFile.h"
|
2014-02-22 23:36:30 +01:00
|
|
|
|
2009-09-25 18:29:00 +02:00
|
|
|
class wxEmuStateTip : public wxTipWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxEmuStateTip(wxWindow* parent, const wxString& text, wxEmuStateTip** windowPtr)
|
2014-11-09 01:26:20 +01:00
|
|
|
: wxTipWindow(parent, text, 70, (wxTipWindow**)windowPtr)
|
|
|
|
{
|
|
|
|
Bind(wxEVT_KEY_DOWN, &wxEmuStateTip::OnKeyDown, this);
|
|
|
|
}
|
|
|
|
|
2009-09-25 18:29:00 +02:00
|
|
|
// wxTipWindow doesn't correctly handle KeyEvents and crashes... we must overload that.
|
|
|
|
void OnKeyDown(wxKeyEvent& event) { event.StopPropagation(); Close(); }
|
|
|
|
};
|
|
|
|
|
2008-12-08 05:46:09 +01:00
|
|
|
class CGameListCtrl : public wxListCtrl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
CGameListCtrl(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
|
|
|
|
~CGameListCtrl();
|
|
|
|
|
2014-03-08 01:54:44 +01:00
|
|
|
void Update() override;
|
2009-04-15 22:19:25 +02:00
|
|
|
|
2008-12-08 05:46:09 +01:00
|
|
|
void BrowseForDirectory();
|
2015-12-17 12:39:32 +01:00
|
|
|
const GameListItem* GetISO(size_t index) const;
|
|
|
|
const GameListItem* GetSelectedISO() const;
|
|
|
|
std::vector<const GameListItem*> GetAllSelectedISOs() const;
|
2008-12-08 05:46:09 +01:00
|
|
|
|
2016-01-06 22:25:30 +01:00
|
|
|
static bool IsHidingItems();
|
|
|
|
|
2008-12-08 05:46:09 +01:00
|
|
|
enum
|
|
|
|
{
|
2012-12-17 12:08:45 +01:00
|
|
|
COLUMN_DUMMY = 0,
|
|
|
|
COLUMN_PLATFORM,
|
2009-09-25 18:29:00 +02:00
|
|
|
COLUMN_BANNER,
|
2008-12-08 05:46:09 +01:00
|
|
|
COLUMN_TITLE,
|
2015-04-20 13:00:15 +02:00
|
|
|
COLUMN_MAKER,
|
2015-10-11 04:44:53 +02:00
|
|
|
COLUMN_FILENAME,
|
2014-06-04 15:54:48 +02:00
|
|
|
COLUMN_ID,
|
2008-12-08 05:46:09 +01:00
|
|
|
COLUMN_COUNTRY,
|
|
|
|
COLUMN_SIZE,
|
|
|
|
COLUMN_EMULATION_STATE,
|
|
|
|
NUMBER_OF_COLUMN
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
std::vector<int> m_FlagImageIndex;
|
2009-05-27 08:41:01 +02:00
|
|
|
std::vector<int> m_PlatformImageIndex;
|
2009-09-25 18:29:00 +02:00
|
|
|
std::vector<int> m_EmuStateImageIndex;
|
2011-03-22 08:27:23 +01:00
|
|
|
std::vector<GameListItem*> m_ISOFiles;
|
2008-12-08 05:46:09 +01:00
|
|
|
|
2011-03-23 05:31:00 +01:00
|
|
|
void ClearIsoFiles()
|
|
|
|
{
|
2014-02-17 05:51:41 +01:00
|
|
|
while (!m_ISOFiles.empty()) // so lazy
|
2011-03-23 05:31:00 +01:00
|
|
|
{
|
|
|
|
delete m_ISOFiles.back();
|
|
|
|
m_ISOFiles.pop_back();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-08 05:46:09 +01:00
|
|
|
int last_column;
|
|
|
|
int last_sort;
|
2009-07-27 06:26:56 +02:00
|
|
|
wxSize lastpos;
|
2009-09-25 18:29:00 +02:00
|
|
|
wxEmuStateTip *toolTip;
|
2008-12-08 05:46:09 +01:00
|
|
|
void InitBitmaps();
|
2015-10-08 15:27:28 +02:00
|
|
|
void UpdateItemAtColumn(long _Index, int column);
|
2008-12-08 05:46:09 +01:00
|
|
|
void InsertItemInReportView(long _Index);
|
|
|
|
void SetBackgroundColor();
|
2009-02-03 16:03:34 +01:00
|
|
|
void ScanForISOs();
|
2013-10-29 06:23:17 +01:00
|
|
|
|
2008-12-08 05:46:09 +01:00
|
|
|
// events
|
2010-01-19 14:43:51 +01:00
|
|
|
void OnLeftClick(wxMouseEvent& event);
|
2008-12-08 05:46:09 +01:00
|
|
|
void OnRightClick(wxMouseEvent& event);
|
2009-09-25 18:29:00 +02:00
|
|
|
void OnMouseMotion(wxMouseEvent& event);
|
2008-12-08 05:46:09 +01:00
|
|
|
void OnColumnClick(wxListEvent& event);
|
|
|
|
void OnColBeginDrag(wxListEvent& event);
|
2009-09-25 18:29:00 +02:00
|
|
|
void OnKeyPress(wxListEvent& event);
|
2008-12-08 05:46:09 +01:00
|
|
|
void OnSize(wxSizeEvent& event);
|
|
|
|
void OnProperties(wxCommandEvent& event);
|
2011-02-26 00:33:11 +01:00
|
|
|
void OnWiki(wxCommandEvent& event);
|
2008-12-08 05:46:09 +01:00
|
|
|
void OnOpenContainingFolder(wxCommandEvent& event);
|
2009-05-02 20:06:42 +02:00
|
|
|
void OnOpenSaveFolder(wxCommandEvent& event);
|
2010-01-14 08:19:10 +01:00
|
|
|
void OnExportSave(wxCommandEvent& event);
|
2014-09-29 01:05:27 +02:00
|
|
|
void OnSetDefaultISO(wxCommandEvent& event);
|
|
|
|
void OnDeleteISO(wxCommandEvent& event);
|
|
|
|
void OnCompressISO(wxCommandEvent& event);
|
|
|
|
void OnMultiCompressISO(wxCommandEvent& event);
|
|
|
|
void OnMultiDecompressISO(wxCommandEvent& event);
|
2014-06-24 06:07:46 +02:00
|
|
|
void OnChangeDisc(wxCommandEvent& event);
|
2008-12-08 05:46:09 +01:00
|
|
|
|
|
|
|
void CompressSelection(bool _compress);
|
|
|
|
void AutomaticColumnWidth();
|
2015-10-08 15:27:28 +02:00
|
|
|
void ShowColumn(int column, int width);
|
|
|
|
void HideColumn(int column);
|
2008-12-08 05:46:09 +01:00
|
|
|
void UnselectAll();
|
|
|
|
|
2014-11-27 16:53:28 +01:00
|
|
|
static bool CompressCB(const std::string& text, float percent, void* arg);
|
|
|
|
static bool MultiCompressCB(const std::string& text, float percent, void* arg);
|
2015-10-31 18:44:45 +01:00
|
|
|
static bool WiiCompressWarning();
|
2008-12-08 05:46:09 +01:00
|
|
|
};
|