MobGUI allows you to switch between the native control theme for iOS and Android or to redefine your own themes.
To
, CC
, and Subject
and the Multiline text control as Body
. You can also add some regular LiveCode Label fields alongside the input fields as an indicator of what to enter. Size the Body field big enough to enter a few lines of text. Also, add some background color to the fields or the card so that the fields are seen properly.Done
and the other Send
. You should have a screenshot like this after this step:mouseUp
handler of the Done button script:on mouseUp focus on nothing end mouseUp
mgText
property. Change the Send button's mouseUp
handler to use this property for each field and also, to call the revMail
function:on mouseUp put the mgText of group "To"" into totext put the mgText of group "CC"" into cctext put the mgText of group "Subject"" into subjecttext put the mgText of group "Body"" into bodytext revMail totext,cctext,subjecttext,bodytext end mouseUp
URL
.Page
.on inputReturnKey mobileControlSet "Page",", "url", the mgText of me end inputReturnKey
We recreated the first two tests from our earlier test bed app, only now, it looks a lot nicer! Also, we made use of MobGUI's ability to get and set data in native iOS controls, in this case, using the mgText
property and mobileControlSet
.
Note that all MobGUI controls show up as groups in the LiveCode Inspector and as Custom controls in the Project Browser. These groups are made of customized LiveCode controls such as buttons, fields, and so on. MobGUI also adds a MobGUI card to the end of your stack. This card includes invisible buttons that have behaviors defined. Behaviors are methods to create common functionality between objects without duplicating the scripts. You can view these behavior scripts by clicking on the script button on the right-hand side of the Project Browser, when you display the MobGUI card. Unless you have a specific need to change these, just leave them alone.
Go ahead and add the other two tests to the stack in the same manner as we did in the Time for action sections earlier in this chapter. For the DatePicker
example, you could examine the Dictionary definition for iPhonePickDate
to see examples of how to use the picked date data in the same manner as the previous sections for example, adjustments for different screen sizes.
So far, we have tested the size using the Portrait orientation with just an iPhone. You may want to use the same stack for iPhone and iPad or perhaps, iPad and an Android tablet, which have quite different aspect ratios.
Even if you just stick with the iPhone, you would still want to take care of Portrait and Landscape. We therefore, have to find ways to arrange the many controls on the card, so that they look their best on each screen size and orientation.
There are several ways to achieve this. First, we'll look at how to use a resize handler.