See the attached (zipped) LiveCode file.
Here is the card script:
Code: Select all
on closeCard
iphoneControlDelete "testinput"
end closeCard
-----------------------------------------------------------------
on inputCreate pInput_or_Multiline, pAutoCapitalizationValue
put "iOS text edit: " & pAutoCapitalizationValue into field "iOS_Label"
# handle the input creation event
if "testinput" is among the lines of iphoneControls() then
# ensure that only one native text input is open
iphoneControlDelete "testinput"
end if
iphoneControlCreate pInput_or_Multiline, "testinput"
# set the native text input field to the size and position of the graphic input rectangle
iphoneControlSet "testinput", "rect", the rect of graphic "InputRect"
iphoneControlSet "testinput", "visible", true
iphoneControlSet "testinput", "autoCapitalization", pAutoCapitalizationValue
iphoneControlSet "testinput", "text", "control replaced."
iphoneControlSet "testinput", "borderStyle", "rounded"
iphoneControlDo "testinput", "focus"
end inputCreate
The buttons also exercise the 4 values for autoCapitalization: none, words, sentences and all characters.
Here is an example of one of the button scripts:
Code: Select all
on mouseUp
inputCreate "multiline", "words"
end mouseUp
Steven (Colorado, USA)