Page 2 of 3
Posted: Mon Sep 12, 2005 9:14 am
by MikeR
I'm getting a page not found error when attempting to download.
Posted: Tue Sep 13, 2005 5:50 am
by MasterD
The link works for me, alternatively you can use
http://www.pltg-blacksun.de/yass/downloads/TextBox.rar
which is a more direct download link.
Posted: Wed Jun 14, 2006 4:24 pm
by sivagiri
gui::IGUIElement::IGUIElement' : no overloaded function takes 4 arguments
this what it writes for error for this
"CGUITextBox::CGUITextBox(irr::gui::IGUIFont * font, const wchar_t * text,
IGUIEnvironment* environment, core::rect<s32> rectangle,
IGUIElement* parent, s32 id)
: IGUIElement(environment, parent, id, rectangle)
{..."
Whats the prob?
Posted: Wed Jun 14, 2006 8:26 pm
by sivagiri
THANKS

Posted: Wed Oct 25, 2006 2:21 am
by jolindien
If you want to
scroll the text in the CGUITextBox
with your mouse wheel, just add this code in the
bool CGUITextBox::OnEvent(SEvent event) of CGUITextBox.cpp.
This code comes from CGUIListBox.cpp.
Code: Select all
switch(event.EventType)
{
case EET_MOUSE_INPUT_EVENT:
{
switch(event.MouseInput.Event)
{
case EMIE_MOUSE_WHEEL:
m_pScrollbar->setPos(m_pScrollbar->getPos() + (s32)event.MouseInput.Wheel*-10);
irr::s32 line = m_pScrollbar->getPos();
setVisibleText(line);
return true;
}
}
break;
}
[/b]
Posted: Thu Oct 26, 2006 2:40 pm
by Yeurl
from sivagiri
Code: Select all
gui::IGUIElement::IGUIElement' : no overloaded function takes 4 arguments
this what it writes for error for this Embarassed
"CGUITextBox::CGUITextBox(irr::gui::IGUIFont * font, const wchar_t * text,
IGUIEnvironment* environment, core::rect<s32> rectangle,
IGUIElement* parent, s32 id)
: IGUIElement(environment, parent, id, rectangle)
{..."
Whats the prob?
I have the same problem, how to do ?
Posted: Wed Nov 08, 2006 9:10 pm
by MasterD
I'm sorry to respond that late, but I lost a bit of the sight to this topic.
The problem is that between Irrlicht 0.11 and 0.12, the API of IGUIElement changed, and I forgot to update the resource on my server.
In 0.12, there is a added first Parameter of the constructor of IGUIElement: EGUI_ELEMENT_TYPE type which needs to be set to EGUIET_ELEMENT because this is a custom Element.
I've updated the resource ->
here and also added the very useful Mousewheel scrolling feature, posted by julindien, thanks to you.
Currently the Irrlicht wiki is down, I will update the code there as soon as I see it online again.
Posted: Sun Dec 09, 2007 2:29 pm
by Namek Kural
I have problems using it in irrlich 1.4, does it work for anyone? How can I solve the problem that I can't scroll the text anymore? I can move the scrollbar but the text doesn't move.

Posted: Mon Dec 31, 2007 3:34 pm
by Namek Kural
Please help! I really need it and I don't know how to fix it

Posted: Mon Dec 31, 2007 8:33 pm
by Luke Dean
I just got it working with 1.4.
Here's what I did.
First, the method declaration for OnEvent didn't match what was in IEventReceiver, so it wasn't even getting called. It should be
not
After making that change in the .h and .cpp, the box started receiving events, but the text still wouldn't scroll. There's some kind of problem in the event handler. I've spent a few days trying to understand Irrlicht's event handler, and much of it still eludes me. What I *think* is happening here is that the first "if" block which handles scroll wheel events is generating a new GUI scrollbar event (or corrupting the current event?) when it does its setPos on the scrollbar. Then the second "if" block picks up that event and tries to do... something....
Anyway, I fixed it by putting an
between the two "if" blocks to ensure that a single pass through OnEvent either handles the mouse event or the GUI event, but not both.
It works now!

I have a couple of questions too.
In the demo program, since the box is created with "new" should it not be dropped explicitly someplace too?
Is it possible to make this box work with IGUIEnvironment->addGUIElement(), and if so, what would that look like? I'm still quite new to Irrlicht and C++.
Thank you everybody for this code!
EDIT:
Whoops. My "else" didn't completely fix it. As soon as the parent received an event, the text scrolling broke again and couldn't be fixed. A better solution is to have each "if" block return "true" as soon as they handle the event, and have OnEvent return "false" at the bottom if it doesn't actually handle an event. I still don't have this working completely right with respect to parent events. The heirarchy of event handling still confuses me.
Posted: Tue Jan 01, 2008 1:27 pm
by Namek Kural
Yeah! I also tried the thing with the OnEvent declaration but as you said this doesn't fix it.
If anybody knows how to fix it completely, please post the solution here
Thanks Luke Dean for your post, I think this will help very much!
Posted: Tue Jan 01, 2008 9:38 pm
by Namek Kural
Hey Luke Dean, I love you!!!
You really did it! For me, the GUITextBox now works perfectly. Which problems do you get now?
The return true/false thing fixed it all for me

Posted: Wed Jan 02, 2008 9:10 pm
by Luke Dean
Namek Kural wrote:
Which problems do you get now?
I think it was just a case of my expectations not matching the author's intentions.

Now that I see how this kind of thing is done, I'm making my own GUI elements that do exactly what I want them to do.
Posted: Sat Apr 05, 2008 8:37 pm
by admgamer
anyone know how to make this scroll to the bottom of the textbox?
Ive created a function that basically does the same as setVisibleText but dont know how to change it so it sets the position of the scroll bar to the bottom of the text box. Thought you might do it with the height of the scrollbar control but to no avail
Posted: Tue Apr 08, 2008 4:12 pm
by ibax
it is very useful, but for me, the textbox isn't scrollable.
how can I fix this?