Jump to content
Sign in to follow this  
tonic-_-

Possible to make edit boxes numeric only? - Dialogs

Recommended Posts

Hello,

Just as the title states, is it possible to set a edit boxes properties to be only numeric values that can be used? or am I going to have to do checks when ever I am calling the value from the edit box to make sure its numeric...

Dialogs are a pain and not a lot of good documentation.

Share this post


Link to post
Share on other sites

How many numerical values would be acetable? less than 5? More than 100? If the input is restricted to certain type then I would reccomend using a text box coupled with buttons that adjust the number displayed. Button up Increases by increament x, button down dereases by increament y, and box only records the value/stroes the value provided you can reffernce the control and idc is defined. An example of what Im talking about is shown here in a HALO script I wrot.:

. May be hard to see, but when selecting the altitude for the halo insertion, you use the buttons next to the text box to control it. Instead of allowing user input like an edit box does.

Share this post


Link to post
Share on other sites
An example of what Im talking about is shown here in a HALO script I wrot.:
. May be hard to see

Private videos are quite hard to see, indeed. :) Maybe make that video public and share the script pretty please? :) Sounds like a lot could be learned from it.

Share this post


Link to post
Share on other sites
Private videos are quite hard to see, indeed. :) Maybe make that video public and share the script pretty please? :) Sounds like a lot could be learned from it.

Did not know that, thought private meant that it could only be linked. Settings have changed to public.

You've been around for a while so check out the video, and id be happy to get you a copy of the script if youd like.

BTW: Love your work

Share this post


Link to post
Share on other sites

Ooh that's an amazing script! I would totally love a copy of that please. Much better than some insert scripts I've seen. :)

Btw, "Unlisted" would be viewable on Youtube but only if you have the URL for it. Won't show on your channel. Private means only you can see it or people you assign I think.

Share this post


Link to post
Share on other sites
Ooh that's an amazing script! I would totally love a copy of that please. Much better than some insert scripts I've seen. :)

Btw, "Unlisted" would be viewable on Youtube but only if you have the URL for it. Won't show on your channel. Private means only you can see it or people you assign I think.

How do want me to get to you?

In the process of looking for a modeler for the bailout masks, and don’t want it out in the public until I’ve done by due diligence.

Share this post


Link to post
Share on other sites

Not possible to make it numeric only. Guess you have to check the entry. The way I do it for coordinate input, is bail out quickly if the number of characters doesn't match 6 or 8, and also bail out if looping over the toArray result have illegal (non numerical) characters in it.

You might be able to setup a keyboard controller to ignore other inputs (or dynamically remove them), but I didn't try this myself.

Share this post


Link to post
Share on other sites

Isn't there an eventhandler of sort that you can add to the dialog's configuration that runs whenever you type in something (I think it's onChar.)? You could just run a script and if the text isn't in [0,1,2,3,4,5,6,7,8,9] then it erases it with setCtrlText.

Share this post


Link to post
Share on other sites

ctrltext.........................

so fxxxing easy

I also spent hours finding this answer

the F word is for the hours and hours that no good answers were found

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×