EDIT BOX that recieves only numbers?

For general discussion related FlowStone
Post Reply
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

EDIT BOX that recieves only numbers?

Post by KG_is_back »

Is it possible to restrict edit box to recieve only numbers as valid data? (like in windows when you enter non-number character it will not get written - instead you get a "ding" sound).
User avatar
chackl
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Re: EDIT BOX that recieves only numbers?

Post by chackl »

The easiest way would be to convert the string to the data you loke to have and then Feedback it to the input string of the editbox ;)
Then you neet to "send Trigger only on finish" to true
And adding a Switch to get also input back ;)

I did an short simple example ;)

Regards
Attachments
edit box mod.fsm
(1016 Bytes) Downloaded 952 times
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: EDIT BOX that recieves only numbers?

Post by Nubeat7 »

i did one once here: viewtopic.php?f=2&t=1421&start=20
it also has some optimizations in using the edit box

and it has a restrictions module inside, where you can set ruby restrictions, this one takes only numbers everything else is gonna be ignored

but this one is only for int values...
Attachments
editbox_nubeat_v2.fsm
(4.66 KiB) Downloaded 940 times
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: EDIT BOX that recieves only numbers?

Post by KG_is_back »

chackl wrote:The easiest way would be to convert the string to the data you loke to have and then Feedback it to the input string of the editbox Then you neet to "send Trigger only on finish" to trueAnd adding a Switch to get also input back

That's how I'm doing it already. I was more looking for something that would not even allow you to write numbers while editing... It's not really biggie... I'm just trying to make my plugin idiot-proof by not allowing to input random stuff.
Is it possible to make edit box within ruby?
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: EDIT BOX that recieves only numbers?

Post by Nubeat7 »

yes you can make a ruby edit box but i know no way of restriction while typing

here it would just 0.0 if you type wrong..
Attachments
editbox_ruby.fsm
(984 Bytes) Downloaded 924 times
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: EDIT BOX that recieves only numbers?

Post by Nubeat7 »

here using regex to extract floatingpoint from input string
Attachments
editbox_ruby1.fsm
(995 Bytes) Downloaded 928 times
Post Reply