EditationWindowObject.h

Go to the documentation of this file.
00001 
00011 #ifndef __EDITATIONWINDOWOBJECT__H__
00012 #define __EDITATIONWINDOWOBJECT__H__
00013 
00014 #include <wx/wx.h>
00015 
00016 #include "../common.h"
00017 #include "../Conversions.h"
00018 #include "../objects/Object.h"
00019 #include "../gui/EditationWindowBase.h"
00020 
00021 // A part of the GUI
00022 namespace GUI {
00023 
00027 class EditationWindowObject: public EditationWindowBase {
00028 protected:
00030         enum {
00031                 // File menu
00032                 ID_MenuFileSave = wxID_SAVE,
00033                 ID_MenuFileExit = wxID_EXIT,
00034 
00035                 ID_ObjectName = 15000,
00036                 ID_ObjectNameText,
00037                 ID_ObjectDescription,
00038                 ID_ObjectDescriptionText,
00039                 ID_ObjectImage,
00040                 ID_ObjectImageText,
00041         };
00042 
00043 public:
00044         // Event handlers
00045         virtual void OnMenuFileSave(wxCommandEvent & event);
00046         virtual void OnMenuFileExit(wxCommandEvent & event);
00047         virtual void OnOkButton(wxCommandEvent & event);
00048 
00049         DECLARE_EVENT_TABLE()
00050 
00051 public:
00058         EditationWindowObject(wxWindow * parent,
00059                 Object::Config & editedConfig,
00060                 const string & windowTitle = "Editation window");
00061 
00065         virtual ~EditationWindowObject();
00066 
00067 protected:
00071         virtual void CreateMenu();
00072 
00076         virtual void CreateBasicForm();
00077 
00081         virtual void CreateDirectionRadios();
00082 
00087         virtual bool SaveConfig();
00088 
00092         string GetObjectName() const {
00093                 assert(textName != 0);
00094                 return Conversions::wxString2string(textName->GetValue());
00095         }
00096 
00100         string GetObjectDescription() const {
00101                 assert(textDescription != 0);
00102                 return Conversions::wxString2string(textDescription->GetValue());
00103         }
00104 
00108         string GetObjectImageFile() const {
00109                 assert(textImageFile != 0);
00110                 return Conversions::wxString2string(textImageFile->GetValue());
00111         }
00112 
00116         int GetObjectDirection() const {
00117                 assert(directionRadio != 0);
00118                 return directionRadio->GetSelection() + 1;
00119         }
00120 
00124         wxMenuBar * GetMenubar() {
00125                 return menuBar;
00126         }
00127 
00132         string ObjectName2FileName(const string & objectName) const;
00133 
00134 private:
00136         Object::Config & config;
00137 
00139         wxMenuBar * menuBar;
00140 
00142         wxTextCtrl * textName;
00144         wxTextCtrl * textDescription;
00146         wxTextCtrl * textImageFile;
00148         wxRadioBox * directionRadio;
00149 };
00150 
00151 } /* namespace GUI */
00152 
00153 #endif /* #ifndef __EDITATIONWINDOWOBJECT__H__ */
00154 
00155 /* End of file EditationWindowObject.h */

Generated on Sun Apr 29 11:46:10 2007 for IPP/ICP2007 by  doxygen 1.4.7