Is there a way to change where the "typer" is (where you type) in an IGUIEditBox?
Basically, I want to have some default value displayed, but I want the "typer" to start typing after rather than before the starting text.
Ugh... here is a pseudo-example:
default_val = "foo"
User opens the text field and types "rawr."
Before starting text: "rawrfoo"
After starting text (what I want): "foorawr"
I was hoping for some function like "SetTyperPosition()", but I can't find anything of the sort.
Set text cursor position in edit box
-
- Posts: 39
- Joined: Wed Jun 10, 2009 11:28 pm
- Location: Portland, Oregon
- Contact:
There is a value "CursorPos" in CGUIEditBox but it's not exposed. You'll have to add setter methods to IGUIEditBox and CGUIEditBox in order to change it.
Basically just:
In CGUIEditBox.h:
and
In IGUIEditBox.h:
You may want to add this as a feature request to the tracker as it would be pretty easy to add to the engine.
Basically just:
In CGUIEditBox.h:
Code: Select all
virtual void setCursorPosition(s32 pos) {if(pos < Text.size()) CursorPos = pos;}
In IGUIEditBox.h:
Code: Select all
virtual void setCursorPosition(s32 pos) = 0;
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net