Browse Source

Fix the wrong return data type for MessageBox::GetWindow().

Yao Wei Tjong 姚伟忠 12 years ago
parent
commit
41add82c6e

+ 2 - 2
Source/Engine/LuaScript/pkgs/UI/MessageBox.pkg

@@ -10,9 +10,9 @@ class MessageBox : public Object
 
 
     const String GetTitle() const;
     const String GetTitle() const;
     const String GetMessage() const;
     const String GetMessage() const;
-    Window* GetWindow() const;
+    UIElement* GetWindow() const;
 
 
     tolua_property__get_set String& title;
     tolua_property__get_set String& title;
     tolua_property__get_set String& message;
     tolua_property__get_set String& message;
-    tolua_readonly tolua_property__get_set Window* window;
+    tolua_readonly tolua_property__get_set UIElement* window;
 };
 };

+ 1 - 1
Source/Engine/Script/UIAPI.cpp

@@ -448,7 +448,7 @@ static void RegisterMessageBox(asIScriptEngine* engine)
     engine->RegisterObjectMethod("MessageBox", "const String& get_title() const", asMETHOD(MessageBox, GetTitle), asCALL_THISCALL);
     engine->RegisterObjectMethod("MessageBox", "const String& get_title() const", asMETHOD(MessageBox, GetTitle), asCALL_THISCALL);
     engine->RegisterObjectMethod("MessageBox", "void set_message(const String&in)", asMETHOD(MessageBox, SetMessage), asCALL_THISCALL);
     engine->RegisterObjectMethod("MessageBox", "void set_message(const String&in)", asMETHOD(MessageBox, SetMessage), asCALL_THISCALL);
     engine->RegisterObjectMethod("MessageBox", "const String& get_message() const", asMETHOD(MessageBox, GetMessage), asCALL_THISCALL);
     engine->RegisterObjectMethod("MessageBox", "const String& get_message() const", asMETHOD(MessageBox, GetMessage), asCALL_THISCALL);
-    engine->RegisterObjectMethod("MessageBox", "Window@+ get_window() const", asMETHOD(MessageBox, GetWindow), asCALL_THISCALL);
+    engine->RegisterObjectMethod("MessageBox", "UIElement@+ get_window() const", asMETHOD(MessageBox, GetWindow), asCALL_THISCALL);
 }
 }
 
 
 static CScriptArray* DropDownListGetItems(DropDownList* ptr)
 static CScriptArray* DropDownListGetItems(DropDownList* ptr)

+ 1 - 1
Source/Engine/UI/MessageBox.h

@@ -55,7 +55,7 @@ public:
     /// Return message text. Return empty string if there is no message text element.
     /// Return message text. Return empty string if there is no message text element.
     const String& GetMessage() const;
     const String& GetMessage() const;
     /// Return dialog window.
     /// Return dialog window.
-    Window* GetWindow() const { return window_; }
+    UIElement* GetWindow() const { return window_; }
 
 
 private:
 private:
     /// Handle events that dismiss the message box.
     /// Handle events that dismiss the message box.