[fixed]Edit box problem.

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

[fixed]Edit box problem.

Post by serengeor »

I have this little problem with irrlicht's edit boxes.
I can't find the right words to describe this so I made the screenshot:
Image

When I selected rotation field it got okay, but I would like it to be like that from the start, because I can't see the whole/any text that was set.
Working on game: Marrbles (Currently stopped).
Yoran
Site Admin
Posts: 96
Joined: Fri Oct 07, 2005 8:55 am
Location: The Netherlands
Contact:

Re: Edit box problem.

Post by Yoran »

Sorry i dont see whats wrong?
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Edit box problem.

Post by serengeor »

look at value for rotation, it's "3(0,0,0)". The full text should be "vec3(0,0,0)". I seem to have found the problem, though I can't fix it for constructor.
The code I used before was:

Code: Select all

ebox=GUIEnvironment()->addEditBox(irr::core::stringw(myString().c_str()).c_str(),irr::core::recti(0,0,0,0),true,0,-1);
And when I changed that to:

Code: Select all

ebox=this->m_device->getGUIEnvironment()->addEditBox(L"",irr::core::recti(0,0,0,0),true,0,-1);
ebox->setAutoScroll(false);
ebox->setText(irr::core::stringw(myString().c_str()).c_str());
It works okay. Though I'd prefer to be able to set that from the addEditBox(...) function.
Working on game: Marrbles (Currently stopped).
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Re: Edit box problem.

Post by shadowslair »

I guess he refers to the position and scale editboxes, where the "3" should be vec3, but it`s cut off for some reason.

EDIT: Looks like serengeor was faster =P
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Edit box problem.

Post by CuteAlien »

I recently started changing a few things for editbox. Which Irrlicht version are you using?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Edit box problem.

Post by serengeor »

From SVN revision 3804 I think.
Edit: So I guess I can call this one pretty much solved :)
Working on game: Marrbles (Currently stopped).
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Edit box problem.

Post by CuteAlien »

serengeor wrote:From SVN revision 3804 I think.
Edit: So I guess I can call this one pretty much solved :)
I don't know - I haven't seen that problem so far. I'm irritated by irr::core::recti(0,0,0,0) - that doesn't look like a valid rectangle - but in your screenshots you seem to use other values. Do you have some code which I can use to reproduce the bug exactly? Then I can try if this is fixed or still has to be fixed.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Edit box problem.

Post by serengeor »

CuteAlien wrote:Do you have some code which I can use to reproduce the bug exactly? Then I can try if this is fixed or still has to be fixed.
Here it is:

Code: Select all

#include "irrlicht.h"

int main()
{
    irr::IrrlichtDevice * device = irr::createDevice(irr::video::EDT_OPENGL);
    irr::gui::IGUIEnvironment * env = device->getGUIEnvironment();


    irr::gui::IGUIEditBox * ebox=env->addEditBox(irr::core::stringw("somevalue").c_str(),irr::core::recti(0,0,0,0),true,0,-1);
    irr::gui::IGUIEditBox * ebox2=env->addEditBox(irr::core::stringw("someothervalue").c_str(),irr::core::recti(0,0,0,0),true,0,-1);

    ebox->setRelativePosition(irr::core::recti(0,0,120,20));
    ebox2->setRelativePosition(irr::core::recti(0,0,160,20));

    ebox->setRelativePosition(irr::core::position2di(10,10));
    ebox2->setRelativePosition(irr::core::position2di(10,40));

    while(device->run())
    {
        device->getVideoDriver()->beginScene();
        env->drawAll();
        device->getVideoDriver()->endScene();
    }
}
Working on game: Marrbles (Currently stopped).
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Edit box problem.

Post by CuteAlien »

Ok, thanks - I can reproduce it with this code. The problem is that you have autoscroll enabled and a tiny rect when you set your first text. So it scrolls to the end because that's what autoscroll does. And that is still the scroll-position when you change the rectangle size later on - I suppose it needs to be reset there to 0 probably. I just have to think some more about it if this could cause any troubles (probably not). But will get to it in the evening (or one of the next evenings...).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Edit box problem.

Post by CuteAlien »

Fixed in svn release branch 1.7 in r3873. Will be in trunk soon.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply