Changeset 387
- Timestamp:
- 09/19/11 13:35:46 (8 months ago)
- Location:
- cafu/trunk/CaWE
- Files:
-
- 4 modified
-
GuiEditor/Windows/EditorWindow.cpp (modified) (2 diffs)
-
GuiEditor/Windows/EditorWindow.hpp (modified) (1 diff)
-
LuaAux.cpp (modified) (1 diff)
-
LuaAux.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cafu/trunk/CaWE/GuiEditor/Windows/EditorWindow.cpp
r368 r387 56 56 57 57 // Note: Since the name of a window comes from an already functional script or is checked when set 58 // by the method below, we assert that the name is already L UAcompatible here.58 // by the method below, we assert that the name is already Lua compatible here. 59 59 wxASSERT(CheckLuaVarCompat(m_Win->Name)); 60 60 } … … 65 65 if (!CheckLuaVarCompat(NewName)) 66 66 { 67 wxMessageBox("Window names must be LUA compatible:\n-Must only consist of letters, digits and underscores\n-Must not begin with digits\n-Must not be a LUA keyword or LUA global variable", "Error: Entity name is not LUA compatible.", wxOK | wxICON_ERROR); 67 wxMessageBox("A window name must be a string of letters, digits, and underscores that is\n" 68 "not beginning with a digit and is not a reserved Lua keyword or global variable.", 69 "Window name is not a valid Lua identifier.", wxOK | wxICON_ERROR); 68 70 return false; 69 71 } -
cafu/trunk/CaWE/GuiEditor/Windows/EditorWindow.hpp
r374 r387 60 60 61 61 /// Sets the name for this window. 62 /// This method checks if the name is valid in the sense of L UAcompatibility63 /// (window name is used as a L UAvariable name for this window) and uniqueness.62 /// This method checks if the name is valid in the sense of Lua compatibility 63 /// (window name is used as a Lua variable name for this window) and uniqueness. 64 64 /// This function should always be called instead of setting the name member 65 65 /// of the window directly. -
cafu/trunk/CaWE/LuaAux.cpp
r285 r387 41 41 if (LuaVarName.Matches(Varname)) 42 42 { 43 // Check if variable name is a reserved L UAkeyword.43 // Check if variable name is a reserved Lua keyword. 44 44 for (int KeywordNr=0; KeywordNr<NrOfKeywords; KeywordNr++) 45 45 if (Varname.c_str()==Keywords_Lua[KeywordNr]) return false; 46 46 47 // Check if variable name matches a L UAglobal variable.47 // Check if variable name matches a Lua global variable. 48 48 wxRegEx LuaGlobals("^[_][A-Z]+$", wxRE_ADVANCED); 49 49 wxASSERT(LuaGlobals.IsValid()); -
cafu/trunk/CaWE/LuaAux.hpp
r285 r387 39 39 40 40 41 /// Checks if a string is a valid L UAvariable name.41 /// Checks if a string is a valid Lua variable name. 42 42 /// @param Varname The variable name to be checked. 43 43 /// @return Whether the string is valid or not. 44 44 bool CheckLuaVarCompat(const wxString& Varname); 45 45 46 /// Converts a string into a valid L UAvariable name by replacing46 /// Converts a string into a valid Lua variable name by replacing 47 47 /// all special invalid characters with underscores and/or adding 48 48 /// underscores to the begining of the name to make it valid. 49 49 /// @param Varname The variable name to convert. 50 /// @return The converted valid L UAvariable name.50 /// @return The converted valid Lua variable name. 51 51 wxString MakeLuaVarName(const wxString& Varname); 52 52
