Lua bindings for TreeItem using "String" instead of "string"

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

User avatar
ErikHjortsberg
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sun Jan 23, 2005 12:45
Location: Sweden
Contact:

Lua bindings for TreeItem using "String" instead of "string"

Postby ErikHjortsberg » Sat May 15, 2010 18:42

The Lua bindings for TreeItem (found in TreeItem.pkg) use the "String" datatype instead of the "string" datatype used in all other bindings. The end result is that Lua will expect a CEGUI::String object instead of the native string used in Lua. I'm guessing this is unintentional.

For some reason I couldn't log in to Mantis and I couldn't find any place in which to either register or request a new password, so I'll post the patch here instead.

Code: Select all

Index: cegui/src/ScriptingModules/LuaScriptModule/package/elements/TreeItem.pkg
===================================================================
--- cegui/src/ScriptingModules/LuaScriptModule/package/elements/TreeItem.pkg   (revision 2519)
+++ cegui/src/ScriptingModules/LuaScriptModule/package/elements/TreeItem.pkg   (arbetskopia)
@@ -6,13 +6,13 @@
     Font* getFont() const;
     ColourRect getTextColours() const;
     void setFont(Font* font);
-    void setFont(const String& font_name);
+    void setFont(const string& font_name);
     void setTextColours(const ColourRect& cols);
     void setTextColours(colour top_left_colour, colour top_right_colour,
                         colour bottom_left_colour, colour bottom_right_colour);
     void setTextColours(colour col);
-    const String &getText() const;
-    const String &getTooltipText() const;
+    const string &getText() const;
+    const string &getTooltipText() const;
     unsigned int getID() const;
     void *getUserData() const;
     bool isSelected() const;
@@ -21,8 +21,8 @@
     const Window *getOwnerWindow();
     ColourRect getSelectionColours() const;
     const Image* getSelectionBrushImage() const;
-    void setText(const String& text);
-    void setTooltipText(const String& text);
+    void setText(const string& text);
+    void setTooltipText(const string& text);
     void setID(unsigned int item_id);
     void setUserData(void* item_data);
     void setSelected(bool setting);
@@ -33,7 +33,7 @@
     void setSelectionColours(colour top_left_colour,colour top_right_colour,colour bottom_left_colour,colour bottom_right_colour);
     void setSelectionColours(colour col);
     void setSelectionBrushImage(const Image* image);
-    void setSelectionBrushImage(const String& imageset, const String& image);
+    void setSelectionBrushImage(const string& imageset, const string& image);
     void setButtonLocation(Rect &buttonOffset);
     Rect &getButtonLocation();
     bool getIsOpen();

Ember, a client for the Worldforge system.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Lua bindings for TreeItem using "String" instead of "string"

Postby CrazyEddie » Sun May 16, 2010 07:35

Thanks for this, you're right that the use of the CEGUI::String there is a mistake.

I'm not sure why mantis did not allow you to log in, I'll investigate that because your same log-in details should work for all parts of the site.

CE.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 19 guests