Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

EDIT BOX that recieves only numbers?

For general discussion related FlowStone

EDIT BOX that recieves only numbers?

Postby KG_is_back » Tue Apr 08, 2014 8:11 pm

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).
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: EDIT BOX that recieves only numbers?

Postby chackl » Tue Apr 08, 2014 9:07 pm

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 774 times
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
chackl
 
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Re: EDIT BOX that recieves only numbers?

Postby Nubeat7 » Tue Apr 08, 2014 10:01 pm

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 787 times
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: EDIT BOX that recieves only numbers?

Postby KG_is_back » Tue Apr 08, 2014 10:31 pm

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?
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: EDIT BOX that recieves only numbers?

Postby Nubeat7 » Tue Apr 08, 2014 11:11 pm

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 748 times
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: EDIT BOX that recieves only numbers?

Postby Nubeat7 » Tue Apr 08, 2014 11:20 pm

here using regex to extract floatingpoint from input string
Attachments
editbox_ruby1.fsm
(995 Bytes) Downloaded 771 times
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna


Return to General

Who is online

Users browsing this forum: No registered users and 72 guests