/*
-Part of Minetest-c55
-Copyright (C) 2011 celeron55, Perttu Ahola <celeron55@gmail.com>
-Copyright (C) 2011 Ciaran Gultnieks <ciaran@ciarang.com>
+Part of Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
+Copyright (C) 2013 Ciaran Gultnieks <ciaran@ciarang.com>
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
#include "debug.h"
#include "serialization.h"
#include <string>
+#include <IGUICheckBox.h>
+#include <IGUIEditBox.h>
+#include <IGUIButton.h>
+#include <IGUIStaticText.h>
+#include <IGUIFont.h>
#include "gettext.h"
v2s32 size = rect.getSize();
v2s32 topleft_client(40, 0);
- v2s32 size_client = size - v2s32(40, 0);
/*
Add stuff
*/
s32 ypos = 50;
- setlocale(LC_CTYPE, "");
+ changeCtype("");
{
core::rect<s32> rect(0, 0, 110, 20);
rect += topleft_client + v2s32(35, ypos+6);
- Environment->addStaticText(chartowchar_t(gettext("Old Password")),
- rect, false, true, this, -1);
+ wchar_t* text = wgettext("Old Password");
+ Environment->addStaticText(text, rect, false, true, this, -1);
+ delete[] text;
}
- setlocale(LC_CTYPE, "en_US");
+ changeCtype("C");
{
core::rect<s32> rect(0, 0, 230, 30);
rect += topleft_client + v2s32(160, ypos);
e->setPasswordBox(true);
}
ypos += 50;
- setlocale(LC_CTYPE, "");
+ changeCtype("");
{
core::rect<s32> rect(0, 0, 110, 20);
rect += topleft_client + v2s32(35, ypos+6);
- Environment->addStaticText(chartowchar_t(gettext("New Password")),
- rect, false, true, this, -1);
+ wchar_t* text = wgettext("New Password");
+ Environment->addStaticText(text, rect, false, true, this, -1);
+ delete[] text;
}
- setlocale(LC_CTYPE, "en_US");
+ changeCtype("C");
{
core::rect<s32> rect(0, 0, 230, 30);
rect += topleft_client + v2s32(160, ypos);
e->setPasswordBox(true);
}
ypos += 50;
- setlocale(LC_CTYPE, "");
+ changeCtype("");
{
core::rect<s32> rect(0, 0, 110, 20);
rect += topleft_client + v2s32(35, ypos+6);
- Environment->addStaticText(chartowchar_t(gettext("Confirm Password")),
- rect, false, true, this, -1);
+ wchar_t* text = wgettext("Confirm Password");
+ Environment->addStaticText(text, rect, false, true, this, -1);
+ delete[] text;
}
- setlocale(LC_CTYPE, "en_US");
+ changeCtype("C");
{
core::rect<s32> rect(0, 0, 230, 30);
rect += topleft_client + v2s32(160, ypos);
}
ypos += 50;
- setlocale(LC_CTYPE, "");
+ changeCtype("");
{
core::rect<s32> rect(0, 0, 140, 30);
rect = rect + v2s32(size.X/2-140/2, ypos);
- Environment->addButton(rect, this, ID_change, chartowchar_t(gettext("Change")));
+ wchar_t* text = wgettext("Change");
+ Environment->addButton(rect, this, ID_change, text);
+ delete[] text;
}
ypos += 50;
{
core::rect<s32> rect(0, 0, 300, 20);
rect += topleft_client + v2s32(35, ypos);
+ wchar_t* text = wgettext("Passwords do not match!");
IGUIElement *e =
Environment->addStaticText(
- chartowchar_t(gettext("Passwords do not match!")),
+ text,
rect, false, true, this, ID_message);
e->setVisible(false);
+ delete[] text;
}
- setlocale(LC_CTYPE, "en_US");
+ changeCtype("C");
}