|
@@ -495,16 +495,14 @@ static void RegisterMenu(asIScriptEngine* engine)
|
|
|
|
|
|
|
|
static MessageBox* ConstructMessageBox(const String& messageString, const String& titleString, XMLFile* layoutFile, XMLFile* styleFile)
|
|
static MessageBox* ConstructMessageBox(const String& messageString, const String& titleString, XMLFile* layoutFile, XMLFile* styleFile)
|
|
|
{
|
|
{
|
|
|
- SharedPtr<MessageBox> messageBox(new MessageBox(GetScriptContext(), messageString, titleString, layoutFile, styleFile));
|
|
|
|
|
- messageBox->AddRef();
|
|
|
|
|
- return messageBox.Get();
|
|
|
|
|
|
|
+ return new MessageBox(GetScriptContext(), messageString, titleString, layoutFile, styleFile);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void RegisterMessageBox(asIScriptEngine* engine)
|
|
static void RegisterMessageBox(asIScriptEngine* engine)
|
|
|
{
|
|
{
|
|
|
// Do not register default UIElement constructor due to possible ambiguity with the Messagebox parameter constructor
|
|
// Do not register default UIElement constructor due to possible ambiguity with the Messagebox parameter constructor
|
|
|
RegisterUIElement<MessageBox>(engine, "MessageBox", false, false);
|
|
RegisterUIElement<MessageBox>(engine, "MessageBox", false, false);
|
|
|
- engine->RegisterObjectBehaviour("MessageBox", asBEHAVE_FACTORY, "MessageBox@ f(const String&in messageString = String(), const String&in titleString = String(), XMLFile@+ layoutFile = null, XMLFile@+ styleFile = null)", asFUNCTION(ConstructMessageBox), asCALL_CDECL);
|
|
|
|
|
|
|
+ engine->RegisterObjectBehaviour("MessageBox", asBEHAVE_FACTORY, "MessageBox@+ f(const String&in messageString = String(), const String&in titleString = String(), XMLFile@+ layoutFile = null, XMLFile@+ styleFile = null)", asFUNCTION(ConstructMessageBox), asCALL_CDECL);
|
|
|
engine->RegisterObjectMethod("MessageBox", "void set_title(const String&in)", asMETHOD(MessageBox, SetTitle), asCALL_THISCALL);
|
|
engine->RegisterObjectMethod("MessageBox", "void set_title(const String&in)", asMETHOD(MessageBox, SetTitle), asCALL_THISCALL);
|
|
|
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);
|