I have an InputTemplate for entering an IP address. It obviously makes sense to open the keyboard with numbers to enter the IP address.
The problem is that then it only allows 1 decimal point so I have to resort to the normal keyboard and switch to numbers :-(
How can I open the number keypad and accept multiole decimal points for my IP address?
InputDialog for IP address:
InputTemplate.lblTitle.Text = "Enter IP address (0.0.0.0)"
InputTemplate.Text = "0.0.0.0"
InputTemplate.ConfigureForNumbers(True, False)
InputTemplate.RegexPattern = "[0-9]{1,256}\.[0-9]{1,6}\b([0-9.]*)$"
Wait For (Dialog.ShowTemplate(InputTemplate, "OK", "", "CANCEL")) Complete (result As Int)
Sub btn_Click
Dim EditText3 As EditText=InputTemplate.TextField1
IME.SetCustomFilter(EditText3, EditText3.INPUT_TYPE_NUMBERS, "0123456789.") 'need the ime library
InputTemplate.lblTitle.Text = "Enter IP address (0.0.0.0)"
InputTemplate.Text = "0.0.0.0"
InputTemplate.RegexPattern = ("^(\d+)\.(\d+)\.(\d+)\.(\d+)$")
Wait For (Dialog.ShowTemplate(InputTemplate, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = XUI.DialogResponse_Positive Then
Log(InputTemplate.Text)
End If
End Sub