summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/GeckoCodeDiag.h
blob: eb569e74551bee1dcf4b553bb76b0b13556210b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.

#pragma once

#include <string>
#include <vector>
#include <wx/panel.h>

#include "Core/GeckoCode.h"

class IniFile;
class wxButton;
class wxCheckListBox;
class wxCommandEvent;
class wxListBox;
class wxStaticText;
class wxTextCtrl;
class wxWindow;

namespace Gecko
{


class CodeConfigPanel : public wxPanel
{
public:
	CodeConfigPanel(wxWindow* const parent);


	void LoadCodes(const IniFile& globalIni, const IniFile& localIni, const std::string& gameid = "", bool checkRunning = false);
	const std::vector<GeckoCode>& GetCodes() const { return m_gcodes; }

protected:
	void UpdateInfoBox(wxCommandEvent&);
	void ToggleCode(wxCommandEvent& evt);
	void DownloadCodes(wxCommandEvent&);
	//void ApplyChanges(wxCommandEvent&);

	void UpdateCodeList(bool checkRunning = false);

private:
	std::vector<GeckoCode> m_gcodes;

	std::string m_gameid;

	// wxwidgets stuff
	wxCheckListBox* m_listbox_gcodes;
	struct
	{
		wxStaticText* label_name, *label_notes, *label_creator;
		wxTextCtrl*   textctrl_notes;
		wxListBox*    listbox_codes;
	} m_infobox;
	wxButton* btn_download;
};

}