IGUIEditBox: set scroll pos

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
mistral
Posts: 14
Joined: Mon Jan 23, 2017 9:35 am

IGUIEditBox: set scroll pos

Post by mistral »

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
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: IGUIEditBox: set scroll pos

Post by CuteAlien »

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:

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
mistral
Posts: 14
Joined: Mon Jan 23, 2017 9:35 am

Re: IGUIEditBox: set scroll pos

Post by mistral »

Very good, I like it, thanks!
mistral
Posts: 14
Joined: Mon Jan 23, 2017 9:35 am

Re: IGUIEditBox: set scroll pos

Post by mistral »

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);
 
Post Reply