Hi,
How do you set the scroll position of the edit box without using cursor keys?
(Not after scroll bar usage, just how to set within IGUIEditBox)
Thanks
IGUIEditBox: set scroll pos
Re: IGUIEditBox: set scroll pos
Sorry, you can't set it directly. There is some workaround - you can send key-events to gui-elements by calling their OnEvent function with key-inputs.
For example I sometimes send the following to my edit-boxes when they get the focus:
For example I sometimes send the following to my edit-boxes when they get the focus:
Code: Select all
irr::SEvent markAllEvent;
markAllEvent.EventType = irr::EET_KEY_INPUT_EVENT;
markAllEvent.KeyInput.Control = true;
markAllEvent.KeyInput.PressedDown = true;
markAllEvent.KeyInput.Key = irr::KEY_KEY_A;
static_cast<irr::gui::IGUISpinBox*>(guiEvent.Caller)->OnEvent(markAllEvent);
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: IGUIEditBox: set scroll pos
Very good, I like it, thanks!
Re: IGUIEditBox: set scroll pos
Code: Select all
irr::SEvent evt;
evt.EventType = irr::EET_KEY_INPUT_EVENT;
evt.KeyInput.Control = true;
evt.KeyInput.PressedDown = true;
evt.KeyInput.Key = irr::KEY_END;
eb_log->OnEvent(evt);