Cafu Engine
ModifyGui.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_GUIEDITOR_COMMAND_MODIFY_GUI_HPP_INCLUDED
8 #define CAFU_GUIEDITOR_COMMAND_MODIFY_GUI_HPP_INCLUDED
9 
10 #include "../../CommandPattern.hpp"
11 
12 
13 namespace GuiEditor
14 {
15  class GuiDocumentT;
16 
17  class CommandModifyGuiT : public CommandT
18  {
19  public:
20 
21  static CommandModifyGuiT* Create(GuiDocumentT* GuiDocument, const wxString& PropertyName, const wxString& NewValue);
22  static CommandModifyGuiT* Create(GuiDocumentT* GuiDocument, const wxString& PropertyName, int NewValue);
23  static CommandModifyGuiT* Create(GuiDocumentT* GuiDocument, const wxString& PropertyName, long NewValue);
24  static CommandModifyGuiT* Create(GuiDocumentT* GuiDocument, const wxString& PropertyName, float NewValue);
25  static CommandModifyGuiT* Create(GuiDocumentT* GuiDocument, const wxString& PropertyName, bool NewValue);
26  static CommandModifyGuiT* Create(GuiDocumentT* GuiDocument, const wxString& PropertyName, const wxColour& NewValue);
27 
28  // CommandT implementation.
29  bool Do();
30  void Undo();
31  wxString GetName() const;
32 
33 
34  private:
35 
36  CommandModifyGuiT(GuiDocumentT* GuiDocument, const wxString& PropertyName);
37 
38  GuiDocumentT* m_GuiDocument;
39  wxString m_PropertyName;
40 
41  wxString m_NewString;
42  int m_NewInt;
43  long m_NewLong;
44  float m_NewFloat;
45  bool m_NewBool;
46  wxColour m_NewColor;
47 
48  wxString m_OldString;
49  int m_OldInt;
50  long m_OldLong;
51  float m_OldFloat;
52  bool m_OldBool;
53  wxColour m_OldColor;
54  };
55 }
56 
57 #endif
wxString GetName() const
Returns the name (a description) of the command.
Definition: ModifyGui.cpp:138
Definition: GuiDocument.hpp:39
bool Do()
This method executes the command.
Definition: ModifyGui.cpp:76
Definition: ModifyGui.hpp:17
This class represents a general command for implementing modifications to the applications document...
Definition: CommandPattern.hpp:30
void Undo()
This method un-does the command.
Definition: ModifyGui.cpp:115