diff --git a/source/gui/CGUI.cpp b/source/gui/CGUI.cpp index 8e908dc7e9..4d89211f7f 100755 --- a/source/gui/CGUI.cpp +++ b/source/gui/CGUI.cpp @@ -302,7 +302,7 @@ bool CGUI::ObjectExists(const CStr &Name) const //------------------------------------------------------------------- // Report XML Reading Error, should be called from within the -// Xerces_* functions. These will not +// Xerces_* functions. // Input: // str String explaining error //------------------------------------------------------------------- @@ -316,7 +316,7 @@ void CGUI::ReportParseError(const CStr &str, ...) // Important, set ParseError to true ++m_Errors; - +/* MEGA TODO Gee char buffer[512]; va_list args; @@ -324,7 +324,7 @@ void CGUI::ReportParseError(const CStr &str, ...) va_start(args, str); vsprintf(buffer, str.c_str(), args); va_end(args); - +*/ /// g_nemLog(" %s", buffer); } @@ -333,7 +333,7 @@ void CGUI::ReportParseError(const CStr &str, ...) // Input: // Filename XML filename //------------------------------------------------------------------- -void CGUI::LoadXMLFile(const CStr &Filename) +void CGUI::LoadXMLFile(const string &Filename) { // Reset parse error // we can later check if this has increased @@ -365,7 +365,7 @@ void CGUI::LoadXMLFile(const CStr &Filename) /// g_nemLog("*** Xerces XML Parsing Errors"); // Get main node - LocalFileInputSource source( XMLString::transcode(Filename.c_str()) ); + LocalFileInputSource source( XMLString::transcode( Filename.c_str() ) ); // parse parser->parse(source); diff --git a/source/gui/CGUI.h b/source/gui/CGUI.h index 2837136eb0..92aa2ba56c 100755 --- a/source/gui/CGUI.h +++ b/source/gui/CGUI.h @@ -83,7 +83,7 @@ public: bool HandleEvent(const SDL_Event& ev); // Load a GUI XML file - void LoadXMLFile(const CStr &Filename); + void LoadXMLFile(const std::string &Filename); // Checks if object exists and return true or false accordingly bool ObjectExists(const CStr &Name) const; diff --git a/source/gui/CGUIObject.cpp b/source/gui/CGUIObject.cpp index c3e2745151..c9dac13c49 100755 --- a/source/gui/CGUIObject.cpp +++ b/source/gui/CGUIObject.cpp @@ -278,12 +278,12 @@ void CGUIObject::SetSetting(const CStr &Setting, const CStr &Value) // Get setting SGUISetting set = GetSettingsInfo()[Setting]; - if (set.m_Type == "string") + if (set.m_Type == CStr(_T("string"))) { - GUI::SetSetting(this, Setting, Value); + GUI::SetSetting(this, Setting, Value); } else - if (set.m_Type == "float") + if (set.m_Type == CStr(_T("float"))) { // Use the parser to parse the values /* CParser parser; @@ -307,18 +307,21 @@ void CGUIObject::SetSetting(const CStr &Setting, const CStr &Value) // Finally the rectangle values GUI::SetSetting(this, Setting, value); */ - GUI::SetSetting(this, Setting, (float)atof(Value.c_str()) ); + GUI::SetSetting(this, Setting, Value.ToFloat() ); } else - if (set.m_Type == "rect") + if (set.m_Type == CStr(_T("rect"))) { // TEMP - // GUI::SetSetting(this, Setting, CRect(100,100,200,200)); + GUI::SetSetting(this, Setting, CRect(100,100,200,200)); // Use the parser to parse the values - CParser parser; + /* CParser parser; parser.InputTaskType("", "_$value_$value_$value_$value_"); + // TODO Gee string really? + string str = Value; + CParserLine line; line.ParseString(parser, Value); if (!line.m_ParseOK) @@ -339,7 +342,7 @@ void CGUIObject::SetSetting(const CStr &Setting, const CStr &Value) // Finally the rectangle values CRect rect(values[0], values[1], values[2], values[3]); GUI::SetSetting(this, Setting, rect); - } + */} else { throw PS_FAIL; diff --git a/source/gui/CGUIObject.h b/source/gui/CGUIObject.h index 4fc0e99a72..2bbe63f0d8 100755 --- a/source/gui/CGUIObject.h +++ b/source/gui/CGUIObject.h @@ -147,8 +147,8 @@ public: // Get/Set // Name - std::string GetName() const { return m_Name; } - void SetName(const std::string &Name) { m_Name = Name; } + CStr GetName() const { return m_Name; } + void SetName(const CStr &Name) { m_Name = Name; } // Fill a map_pObjects with this object (does not include recursion) void AddToPointersMap(map_pObjects &ObjectMap); diff --git a/source/gui/GUI.h b/source/gui/GUI.h index b24025237f..937eb64b5a 100755 --- a/source/gui/GUI.h +++ b/source/gui/GUI.h @@ -16,6 +16,14 @@ gee@pyro.nu #ifndef GUI_H #define GUI_H +//-------------------------------------------------------- +// Compiler specific +//-------------------------------------------------------- +// Important that we do this before is included +#ifdef _MSC_VER +# pragma warning(disable:4786) +#endif + //-------------------------------------------------------- // Includes //-------------------------------------------------------- @@ -25,6 +33,7 @@ gee@pyro.nu //// janwas: these are very sloppy added, I don't know the etiquette #include "../ps/Prometheus.h" +#include "../ps/CStr.h" #include "types.h" #include "ogl.h" //// This is what I need from these includes diff --git a/source/gui/GUIbase.h b/source/gui/GUIbase.h index 7f683249dd..387a9c6015 100755 --- a/source/gui/GUIbase.h +++ b/source/gui/GUIbase.h @@ -18,13 +18,6 @@ gee@pyro.nu #define GUIbase_H -//-------------------------------------------------------- -// Compiler specific -//-------------------------------------------------------- -#ifdef _MSC_VER -# pragma warning(disable:4786) -#endif - //-------------------------------------------------------- // Includes / Compiler directives //-------------------------------------------------------- @@ -44,7 +37,7 @@ class CGUIObject; // Temp #define CInput nemInput -#define CStr std::string +//#define CStr std::string // Example // GUI_ADD_OFFSET(CButton, SButtonSettings, m_Settings, "frozen", m_Frozen);