Mobile Text Field

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Posts: 15
Joined: Sat Jul 18, 2015 5:11 pm

Mobile Text Field

Post by RedDeupree » Tue Jul 28, 2015 7:49 pm

In the fly-out menu from Object/New Control, I'd like to see "Mobile Text Field" as something that can be visually placed on a card and whose settings such as position, font, etc can be set from the property inspector.

I wanted an app that could copy and paste like any other app with text fields that has been around since Wang Word processors and the earliest of CRT terminals on mainframes and would be platform independent, but I was told I had to do something like this to make one (only in code)
-- intend to mimic a native text field called "pText"
if the environment is "mobile" then
put the rect of field "pText" into tRect
set the visible of field "pText" to False

mobileControlCreate "multiline", "mText"
mobileControlSet "mText", "visible", true
mobileControlSet "mText", "rect", tRect
mobileControlSet "mText","backgroundColor","white"
mobileControlSet "mText","textAlign","left"
mobileControlSet "mText","borderStyle","line"
mobileControlSet "mText", "fontSize",22
-- ...
end if

That would be a bunch of extra code if there were lots of these fields.

Then later in the app, when you want to actually use these, we once again have to resort to

-- under some button
if the environment is "mobile" then
put mobileControlGet("mText","text") into tText
put doSomething (tText) into tText
mobileControlSet "mText","text",tText
put the text of field "pText" into tText
put doSomething (tText) into tText
set the text of field "pText" to tText
end if

This is not very platform independent when you have to do this, and good luck debugging or running live on the mobile side.

But as a start, it'd be good to at least be able to draw these things with the visual editor used for other card layout.
Mobile text fields should honor the same kinds of properties as regular ones, and I see there seems to be a "mobileControlGet/Set" function for many of the things that are common to text fields on all platforms. Using those "mobileControlGet/Set" functions is very similar to the Microsoft stuff I have grown up with, and does not look at all like the prose form of the LiveCode language, so it is a bit of a eyeball issue too.

Post Reply

Return to “Feature Proposals”