fixed displaying "umlauts" (deutsch umlaute) and hopefully other non ASCII chars...
authorConstantin Wenger <constantin.wenger@googlemail.com>
Fri, 29 Jul 2011 21:33:33 +0000 (23:33 +0200)
committerConstantin Wenger <constantin.wenger@googlemail.com>
Sat, 30 Jul 2011 20:03:25 +0000 (22:03 +0200)
src/guiMainMenu.cpp
src/guiMessageMenu.cpp
src/guiPasswordChange.cpp
src/guiPauseMenu.cpp
src/guiTextInputMenu.cpp

index 1d7f224f614fa3bf3af6be185414f09fbd7f85f5..0365b618ad6e77558df34f4a23fe68191bedca6b 100644 (file)
@@ -164,6 +164,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
        v2s32 topleft_client(40, 0);
        v2s32 size_client = size - v2s32(40, 0);
        
+       setlocale(LC_CTYPE, "");
        {
                core::rect<s32> rect(0, 0, 20, 125);
                rect += topleft_client + v2s32(-15, 60);
@@ -180,6 +181,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
                Environment->addStaticText(chartowchar_t(gettext("Name/Password")), 
                        rect, false, true, this, -1);
        }
+       setlocale(LC_CTYPE, "en_US");
        {
                core::rect<s32> rect(0, 0, 230, 30);
                rect += topleft_client + v2s32(160, 50);
@@ -196,6 +198,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
                e->setPasswordBox(true);
 
        }
+       setlocale(LC_CTYPE, "");
        // Address + port
        {
                core::rect<s32> rect(0, 0, 110, 20);
@@ -203,6 +206,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
                Environment->addStaticText(chartowchar_t(gettext("Address/Port")),
                        rect, false, true, this, -1);
        }
+       setlocale(LC_CTYPE, "en_US");
        {
                core::rect<s32> rect(0, 0, 230, 30);
                rect += topleft_client + v2s32(160, 100);
@@ -217,6 +221,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
                rect += topleft_client + v2s32(size_client.X-60-100, 100);
                Environment->addEditBox(text_port.c_str(), rect, true, this, GUI_ID_PORT_INPUT);
        }
+       setlocale(LC_CTYPE, "");
        {
                core::rect<s32> rect(0, 0, 400, 20);
                rect += topleft_client + v2s32(160, 100+35);
@@ -289,6 +294,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
                Environment->addButton(rect, this, GUI_ID_DELETE_MAP_BUTTON,
                          chartowchar_t(gettext("Delete map")));
        }
+       setlocale(LC_CTYPE, "en_US");
 }
 
 void GUIMainMenu::drawMenu()
index 155be6029c8b0f08174a121e8bb50c4d44617853..b03f87b31f158095312d4a4700d955907e4b66f0 100644 (file)
@@ -85,6 +85,7 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize)
                Environment->addStaticText(m_message_text.c_str(), rect, false,
                                true, this, 256);
        }
+       setlocale(LC_CTYPE, "");
        {
                core::rect<s32> rect(0, 0, 140, 30);
                rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25);
@@ -93,6 +94,7 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize)
                        chartowchar_t(gettext("Proceed")));
                Environment->setFocus(e);
        }
+       setlocale(LC_CTYPE, "en_US");
 }
 
 void GUIMessageMenu::drawMenu()
index fabe7511013d8ccd56394c1626859793b4a19d3e..89a6ce682be3fbc0f5e3d1118fcb41d62479196b 100644 (file)
@@ -96,12 +96,14 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
                Add stuff
        */
        s32 ypos = 50;
+       setlocale(LC_CTYPE, "");
        {
                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);
        }
+       setlocale(LC_CTYPE, "en_US");
        {
                core::rect<s32> rect(0, 0, 230, 30);
                rect += topleft_client + v2s32(160, ypos);
@@ -111,12 +113,14 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
                e->setPasswordBox(true);
        }
        ypos += 50;
+       setlocale(LC_CTYPE, "");
        {
                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);
        }
+       setlocale(LC_CTYPE, "en_US");
        {
                core::rect<s32> rect(0, 0, 230, 30);
                rect += topleft_client + v2s32(160, ypos);
@@ -125,12 +129,14 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
                e->setPasswordBox(true);
        }
        ypos += 50;
+       setlocale(LC_CTYPE, "");
        {
                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);
        }
+       setlocale(LC_CTYPE, "en_US");
        {
                core::rect<s32> rect(0, 0, 230, 30);
                rect += topleft_client + v2s32(160, ypos);
@@ -140,6 +146,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
        }
 
        ypos += 50;
+       setlocale(LC_CTYPE, "");
        {
                core::rect<s32> rect(0, 0, 140, 30);
                rect = rect + v2s32(size.X/2-140/2, ypos);
@@ -156,6 +163,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
                        rect, false, true, this, ID_message);
                e->setVisible(false);
        }
+       setlocale(LC_CTYPE, "en_US");
 
 }
 
index c704cd3fb574148ff36dd071a30894e05f0ee737..3a5d245bcf99f5cf8ba6542db6f39e9632769fb3 100644 (file)
@@ -103,6 +103,7 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
        const s32 btn_gap = 20;\r
        const s32 btn_num = 4;\r
        s32 btn_y = size.Y/2-((btn_num*btn_height+(btn_num-1)*btn_gap))/2;\r
+       setlocale(LC_CTYPE, "");\r
        {\r
                core::rect<s32> rect(0, 0, 140, btn_height);\r
                rect = rect + v2s32(size.X/2-140/2, btn_y);\r
@@ -180,6 +181,7 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
        \r
                Environment->addStaticText(narrow_to_wide(os.str()).c_str(), rect, false, true, this, 259);\r
        }\r
+       setlocale(LC_CTYPE, "en_US");\r
 }\r
 \r
 void GUIPauseMenu::drawMenu()\r
index 252e452f5d30f690c86c24abd2340b51c506c613..8c32490be4f3139bfb3d82e230a7d7fd82b573a9 100644 (file)
@@ -104,12 +104,14 @@ void GUITextInputMenu::regenerateGui(v2u32 screensize)
                Environment->addEditBox(text.c_str(), rect, true, this, 256);
                Environment->setFocus(e);
        }
+       setlocale(LC_CTYPE, "");
        {
                core::rect<s32> rect(0, 0, 140, 30);
                rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25);
                Environment->addButton(rect, this, 257,
                        chartowchar_t(gettext("Proceed")));
        }
+       setlocale(LC_CTYPE, "en_US");
 }
 
 void GUITextInputMenu::drawMenu()