summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/PatchAddEdit.h
blob: 6d0ebc8db527eb9cce844657721c13275dbb23d6 (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
// Copyright 2008 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#pragma once

#include <vector>
#include <wx/dialog.h>

#include "Core/PatchEngine.h"

class wxButton;
class wxRadioBox;
class wxSpinButton;
class wxSpinEvent;
class wxStaticBoxSizer;
class wxTextCtrl;

class CPatchAddEdit : public wxDialog
{
public:
	CPatchAddEdit(int _selection, std::vector<PatchEngine::Patch>* _onFrame,
		wxWindow* parent,
		wxWindowID id = wxID_ANY,
		const wxString& title = _("Edit Patch"),
		const wxPoint& pos = wxDefaultPosition,
		const wxSize& size = wxDefaultSize,
		long style = wxDEFAULT_DIALOG_STYLE);
	virtual ~CPatchAddEdit();

private:
	wxTextCtrl* EditPatchName;
	wxTextCtrl* EditPatchOffset;
	wxRadioBox* EditPatchType;
	wxTextCtrl* EditPatchValue;
	wxSpinButton* EntrySelection;
	wxButton* EntryAdd;
	wxButton* EntryRemove;
	wxStaticBoxSizer* sbEntry;
	std::vector<PatchEngine::Patch>* onFrame;

	void CreateGUIControls(int selection);
	void ChangeEntry(wxSpinEvent& event);
	void SavePatchData(wxCommandEvent& event);
	void AddEntry(wxCommandEvent& event);
	void RemoveEntry(wxCommandEvent& event);
	void UpdateEntryCtrls(PatchEngine::PatchEntry pE);
	bool UpdateTempEntryData(std::vector<PatchEngine::PatchEntry>::iterator iterEntry);

	int selection, currentItem;
	std::vector<PatchEngine::PatchEntry> tempEntries;
	std::vector<PatchEngine::PatchEntry>::iterator itCurEntry;
};