Skip to content

Commit

Permalink
Registration dialog: Larger text field with scrollbars (#7047)
Browse files Browse the repository at this point in the history
Center text, text area doubled now
  • Loading branch information
SmallJoker committed Feb 23, 2018
1 parent 673f719 commit 5741811
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/gui/guiConfirmRegistration.cpp
Expand Up @@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

#include "guiConfirmRegistration.h"
#include "client.h"
#include "intlGUIEditBox.h"
#include <IGUICheckBox.h>
#include <IGUIEditBox.h>
#include <IGUIButton.h>
Expand Down Expand Up @@ -66,8 +67,8 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
/*
Calculate new sizes and positions
*/
core::rect<s32> rect(screensize.X / 2 - 600 / 2, screensize.Y / 2 - 300 / 2,
screensize.X / 2 + 600 / 2, screensize.Y / 2 + 300 / 2);
core::rect<s32> rect(screensize.X / 2 - 600 / 2, screensize.Y / 2 - 360 / 2,
screensize.X / 2 + 600 / 2, screensize.Y / 2 + 360 / 2);

DesiredRect = rect;
recalculateAbsolutePosition(false);
Expand All @@ -85,7 +86,7 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
std::string address = m_address;
if (address.empty())
address = "localhost";
core::rect<s32> rect(0, 0, 540, 90);
core::rect<s32> rect(0, 0, 540, 180);
rect += topleft_client + v2s32(30, ypos);
static const std::string info_text_template = strgettext(
"You are about to join the server at %1$s with the "
Expand All @@ -98,11 +99,17 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
char info_text_buf[1024];
snprintf(info_text_buf, sizeof(info_text_buf), info_text_template.c_str(),
address.c_str(), m_playername.c_str());
Environment->addStaticText(narrow_to_wide_c(info_text_buf), rect, false,
true, this, -1);

gui::intlGUIEditBox *e = new gui::intlGUIEditBox(
utf8_to_wide_c(info_text_buf), true, Environment, this,
ID_message, rect, false, true);
e->drop();
e->setMultiLine(true);
e->setWordWrap(true);
e->setTextAlignment(gui::EGUIA_UPPERLEFT, gui::EGUIA_CENTER);
}

ypos += 120;
ypos += 210;
{
core::rect<s32> rect(0, 0, 540, 30);
rect += topleft_client + v2s32(30, ypos);
Expand All @@ -111,7 +118,7 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
e->setPasswordBox(true);
}

ypos += 90;
ypos += 60;
{
core::rect<s32> rect(0, 0, 230, 35);
rect = rect + v2s32(size.X / 2 - 220, ypos);
Expand Down

4 comments on commit 5741811

@srifqi
Copy link
Member

@srifqi srifqi commented on 5741811 Mar 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got this message when compiling for Android using stujones11:android-c++11 branch:

jni/../jni/src/gui/guiConfirmRegistration.cpp:103:32: error: allocating an object of abstract class type 'gui::intlGUIEditBox'
                gui::intlGUIEditBox *e = new gui::intlGUIEditBox(
                                             ^
deps/irrlicht/include/IGUIEditBox.h:73:16: note: unimplemented pure virtual method 'isDrawBackgroundEnabled' in 'intlGUIEditBox'
                virtual bool isDrawBackgroundEnabled() const = 0;
                             ^
deps/irrlicht/include/IGUIEditBox.h:81:16: note: unimplemented pure virtual method 'isDrawBorderEnabled' in 'intlGUIEditBox'
                virtual bool isDrawBorderEnabled() const = 0;
                             ^
deps/irrlicht/include/IGUIEditBox.h:139:16: note: unimplemented pure virtual method 'setCursorChar' in 'intlGUIEditBox'
                virtual void setCursorChar(const wchar_t cursorChar) = 0;
                             ^
deps/irrlicht/include/IGUIEditBox.h:142:19: note: unimplemented pure virtual method 'getCursorChar' in 'intlGUIEditBox'
                virtual wchar_t getCursorChar() const = 0;
                                ^
deps/irrlicht/include/IGUIEditBox.h:146:16: note: unimplemented pure virtual method 'setCursorBlinkTime' in 'intlGUIEditBox'
                virtual void setCursorBlinkTime(irr::u32 timeMs) = 0;
                             ^
deps/irrlicht/include/IGUIEditBox.h:149:20: note: unimplemented pure virtual method 'getCursorBlinkTime' in 'intlGUIEditBox'
                virtual irr::u32 getCursorBlinkTime() const = 0;
                                 ^

Any idea, @SmallJoker?

@srifqi
Copy link
Member

@srifqi srifqi commented on 5741811 Mar 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like not just about this file. Maybe gui::intlGUIEditBox is different for Android?

@nerzhul
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue you mentioned is now fixed in master @srifqi

@srifqi
Copy link
Member

@srifqi srifqi commented on 5741811 Mar 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, can confirm.

Please sign in to comment.