EditBox events

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

BayerMeister
Just popping in
Just popping in
Posts: 3
Joined: Wed Mar 05, 2008 21:58
Location: CZ

EditBox events

Postby BayerMeister » Thu Mar 06, 2008 13:14

:roll: I hope this is the right place to start a discussion about this

Events of the EditBox widget:

According to http://www.cegui.org.uk/wiki/index.php/EventGalore#Editbox there are no other events than the one, that is fired upon leaving the EditBox or pressing enter or tab. Now THAT is a pity.

I think it deserves more: A "charAccepted" upon each new caracter arrived (pressed) in particular. It is important to make a "mask" on the input.

Lets say I want to accept IPs only. If a character other than [0..9]+"." would arrive, I'd highlight some kinda warning. I can not do this without that event. Or am I mistaken?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Thu Mar 06, 2008 19:32

Hi,

there are some other events specific to the editbox, these can be seen around this part of the API ref for Editbox.

Obviously you can see there is no 'charAccepted' event, although it may be possible to get something like what you want by setting an appropriate validation string (for the IP entry example maybe "[0-9.]*" or something), and responding to EventInvalidEntryAttempted to put up a message or something.

The above regex solution may not be ideal, since it will not enforce a strict IP format for entry, but it does allow you to do what you stated in the original example.

CE.

BayerMeister
Just popping in
Just popping in
Posts: 3
Joined: Wed Mar 05, 2008 21:58
Location: CZ

Postby BayerMeister » Sat Mar 08, 2008 18:15

Thanks, I see there's a lot more offered.

It is a bit off-topic, but I don't understand why EditBoxes don't take input from the numeric keyboard. Is there a reason for this?
I know I could take the sourcecode and observe it from the injection point, but... there are other things, too. Like the default look'n'feel - holding a key down in an EditBox does not start inserting more characters. Especialy the backspace needs this behaviour.
(I know one can select the whole text and delete wit one hit of bkspace, that is of little help though - a lot of BFUs will never know)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sat Mar 08, 2008 23:42

With regards to 'missing' inputs and auto-repeat - both of those issues are dependant upon the input library in use. For example, if the input library does not report the numeric keypad keys, or they are otherwise not injected into CEGUI, then CEGUI can not respond. It's a similar situation with auto-repeat - presently there is no 'built-in' auto repeat for keys, the repeated key strokes must come via your input lib.

CE.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 15 guests