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