PatchAddEdit.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2008 Dolphin Emulator Project
  2. // Licensed under GPLv2+
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <vector>
  6. #include <wx/dialog.h>
  7. #include "Core/PatchEngine.h"
  8. class wxButton;
  9. class wxRadioBox;
  10. class wxSpinButton;
  11. class wxSpinEvent;
  12. class wxStaticBoxSizer;
  13. class wxTextCtrl;
  14. class CPatchAddEdit : public wxDialog
  15. {
  16. public:
  17. CPatchAddEdit(int _selection, std::vector<PatchEngine::Patch>* _onFrame,
  18. wxWindow* parent,
  19. wxWindowID id = wxID_ANY,
  20. const wxString& title = _("Edit Patch"),
  21. const wxPoint& pos = wxDefaultPosition,
  22. const wxSize& size = wxDefaultSize,
  23. long style = wxDEFAULT_DIALOG_STYLE);
  24. virtual ~CPatchAddEdit();
  25. private:
  26. wxTextCtrl* EditPatchName;
  27. wxTextCtrl* EditPatchOffset;
  28. wxRadioBox* EditPatchType;
  29. wxTextCtrl* EditPatchValue;
  30. wxSpinButton* EntrySelection;
  31. wxButton* EntryAdd;
  32. wxButton* EntryRemove;
  33. wxStaticBoxSizer* sbEntry;
  34. std::vector<PatchEngine::Patch>* onFrame;
  35. void CreateGUIControls(int selection);
  36. void ChangeEntry(wxSpinEvent& event);
  37. void SavePatchData(wxCommandEvent& event);
  38. void AddEntry(wxCommandEvent& event);
  39. void RemoveEntry(wxCommandEvent& event);
  40. void UpdateEntryCtrls(PatchEngine::PatchEntry pE);
  41. bool UpdateTempEntryData(std::vector<PatchEngine::PatchEntry>::iterator iterEntry);
  42. int selection, currentItem;
  43. std::vector<PatchEngine::PatchEntry> tempEntries;
  44. std::vector<PatchEngine::PatchEntry>::iterator itCurEntry;
  45. };