Filterfieldtext

If you think you've found a bug post it here.

Filterfieldtext

Postby ger21 » Sun Jan 08, 2017 9:19 pm

If I use "0123456789" for my Filterfieldtext, UCCNC still allows a decimal point ".", but appears to block everything else.
I need it to only allow integers.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Filterfieldtext

Postby ger21 » Sun Jan 08, 2017 9:47 pm

Does it matter if it's used for port and pin numbers?
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Filterfieldtext

Postby ger21 » Sun Jan 08, 2017 10:29 pm

Vmax549 wrote:I don't think so as all DROs output as strings.

Not if you use Getfielddouble()?
I should have checked before, so I don't have to change about 300 right now. :cry:
It shouldn't be an issue, but I don't want someone entering 3.7 for a pin number.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Filterfieldtext

Postby ger21 » Sun Jan 08, 2017 10:37 pm

Vmax549 wrote:Ger I just looked and a port/pin dro is a "textfield " , updown type


Actually, every fields Objecttype is "textfield".

UpDown is a type, just like fieldnb and textfieldnb. They are all textfields.

So, I'm duplicating an UpDown, and originally used fieldnb. Let me plugin my breakout board and make sure textfieldnb works fine.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Filterfieldtext

Postby cncdrive » Mon Jan 09, 2017 2:12 am

Gerry,

For the Textfilter to work you have to set the type property of the Textfield to textfield or textfieldnb.
These 2 types are to contain text, all other types are ment to be numeric types, so all other types can contain numbers only and so the textfilter does not work on them.
So, you will have to set the Textfield to one of the types which are made to contain text and then add the filter value of 0123456789 if you want to allow only these values and then it will not accept the . character.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm


Return to Report a bug

Who is online

Users browsing this forum: Bing [Bot] and 13 guests