2013-04-18 03:43:35 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-22 22:36:30 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <wx/dialog.h>
|
|
|
|
#include <wx/event.h>
|
|
|
|
#include <wx/gdicmn.h>
|
|
|
|
#include <wx/string.h>
|
|
|
|
#include <wx/translation.h>
|
|
|
|
#include <wx/windowid.h>
|
2014-02-17 10:18:15 +00:00
|
|
|
|
2014-02-22 22:36:30 +00:00
|
|
|
#include "Core/PatchEngine.h"
|
|
|
|
|
|
|
|
class wxButton;
|
|
|
|
class wxRadioBox;
|
|
|
|
class wxSpinButton;
|
|
|
|
class wxSpinEvent;
|
|
|
|
class wxStaticBoxSizer;
|
|
|
|
class wxTextCtrl;
|
|
|
|
class wxWindow;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
class CPatchAddEdit : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
2008-12-17 04:14:24 +00:00
|
|
|
CPatchAddEdit(int _selection, wxWindow* parent,
|
|
|
|
wxWindowID id = 1,
|
2011-01-05 04:35:46 +00:00
|
|
|
const wxString& title = _("Edit Patch"),
|
2008-12-17 04:14:24 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
2009-01-03 21:55:49 +00:00
|
|
|
const wxSize& size = wxDefaultSize,
|
2008-12-17 04:14:24 +00:00
|
|
|
long style = wxDEFAULT_DIALOG_STYLE);
|
2008-12-08 04:46:09 +00:00
|
|
|
virtual ~CPatchAddEdit();
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE();
|
|
|
|
|
|
|
|
wxTextCtrl *EditPatchName;
|
|
|
|
wxTextCtrl *EditPatchOffset;
|
|
|
|
wxRadioBox *EditPatchType;
|
|
|
|
wxTextCtrl *EditPatchValue;
|
|
|
|
wxSpinButton *EntrySelection;
|
2009-01-03 21:55:49 +00:00
|
|
|
wxButton *EntryRemove;
|
2009-02-20 00:07:35 +00:00
|
|
|
wxStaticBoxSizer* sbEntry;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
enum {
|
|
|
|
ID_EDITPATCH_NAME_TEXT = 4500,
|
|
|
|
ID_EDITPATCH_NAME,
|
|
|
|
ID_EDITPATCH_OFFSET_TEXT,
|
|
|
|
ID_EDITPATCH_OFFSET,
|
|
|
|
ID_ENTRY_SELECT,
|
|
|
|
ID_EDITPATCH_TYPE,
|
|
|
|
ID_EDITPATCH_VALUE_TEXT,
|
2009-01-03 21:55:49 +00:00
|
|
|
ID_EDITPATCH_VALUE,
|
|
|
|
ID_ENTRY_ADD,
|
|
|
|
ID_ENTRY_REMOVE
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void CreateGUIControls(int selection);
|
|
|
|
void ChangeEntry(wxSpinEvent& event);
|
2009-01-03 21:55:49 +00:00
|
|
|
void SavePatchData(wxCommandEvent& event);
|
|
|
|
void AddRemoveEntry(wxCommandEvent& event);
|
|
|
|
void UpdateEntryCtrls(PatchEngine::PatchEntry pE);
|
2011-07-09 21:00:30 +00:00
|
|
|
bool UpdateTempEntryData(std::vector<PatchEngine::PatchEntry>::iterator iterEntry);
|
2009-01-03 23:02:13 +00:00
|
|
|
|
2009-02-20 00:07:35 +00:00
|
|
|
int selection, currentItem;
|
2009-01-03 21:55:49 +00:00
|
|
|
std::vector<PatchEngine::PatchEntry> tempEntries;
|
2009-01-03 23:02:13 +00:00
|
|
|
std::vector<PatchEngine::PatchEntry>::iterator itCurEntry;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
};
|