00001 00011 #ifndef __EDITATIONWINDOWOBJECTAGENT__H__ 00012 #define __EDITATIONWINDOWOBJECTAGENT__H__ 00013 00014 #include <wx/wx.h> 00015 #include <wx/spinctrl.h> 00016 00017 #include "../common.h" 00018 #include "../Conversions.h" 00019 #include "../objects/Object.h" 00020 #include "../objects/ObjectAgent.h" 00021 #include "EditationWindowObject.h" 00022 00023 // A part of the GUI 00024 namespace GUI { 00025 00029 class EditationWindowObjectAgent: public EditationWindowObject { 00030 protected: 00032 enum { 00033 ID_TrailImageFile = 14000, 00034 ID_TrailImageFileText, 00035 ID_TrailDuration, 00036 ID_TrailDurationText, 00037 ID_Script, 00038 ID_ScriptText 00039 }; 00040 00041 public: 00042 // Event handlers 00043 virtual void OnMenuFileSave(wxCommandEvent & event); 00044 virtual void OnOkButton(wxCommandEvent & event); 00045 00046 DECLARE_EVENT_TABLE() 00047 00048 public: 00055 EditationWindowObjectAgent(wxWindow * parent, 00056 ObjectAgent::Config & editedConfig, 00057 const string & windowTitle = "Agent editation window"); 00058 00062 virtual ~EditationWindowObjectAgent(); 00063 00064 protected: 00068 virtual void CreateBasicForm(); 00069 00073 virtual void CreateBehaviorForm(); 00074 00079 virtual bool SaveConfig(); 00080 00084 string GetObjectTrailImageFile() const { 00085 assert(textTrailImageFile != 0); 00086 return Conversions::wxString2string(textTrailImageFile->GetValue()); 00087 } 00088 00092 int GetObjectTrailDuration() const { 00093 assert(durationSpin != 0); 00094 return durationSpin->GetValue(); 00095 } 00096 00100 string GetObjectBehavior() const { 00101 assert(textBehavior != 0); 00102 return Conversions::wxString2string(textBehavior->GetValue()); 00103 } 00104 00105 private: 00107 ObjectAgent::Config & config; 00108 00110 wxTextCtrl * textTrailImageFile; 00112 wxSpinCtrl * durationSpin; 00114 wxTextCtrl * textBehavior; 00115 00116 protected: 00117 // Size constants 00118 static const wxSize BEHAVIOR_BOX_SIZE; 00119 static const wxSize DURATION_SPIN_SIZE; 00120 }; 00121 00122 } /* namespace GUI */ 00123 00124 #endif /* #ifndef __EDITATIONWINDOWOBJECTAGENT__H__ */ 00125 00126 /* End of file EditationWindowObjectAgent.h */