Option Menu on iPad

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Option Menu on iPad

Post by Mag » Sat May 31, 2014 8:18 pm

I noticed that on an iPad, the Option Menu button displays a balloon with the available choices. It seems to work fine (I tested it only on iOS 7). Is this something you can reliable to? I mean, can you put it in a iPad app and it works? Is, so is there a way to hide it under another control which then you customize to the look and feel of app?
Attachments
IMG_0339.PNG

JacobS
Posts: 58
Joined: Mon Aug 20, 2012 8:41 pm

Re: Option Menu on iPad

Post by JacobS » Tue Jun 03, 2014 2:14 pm

Hi Mag,

From what I've experienced, the Option Menu and picker wheels are very reliable. I usually do not use LC's built-in Option Menu Button but instead use just a regular field with the following code:

Code: Select all

on focusIn
         iphonePick the cText of me,0,cancelDone,picker
         put the result into lineNum
         if lineNum is a number and lineNum > 0 then
               set the text of me to line lineNum of the cText of me
         end if
         focus on nothing
end focusIn
(Where the cText of the field is simply a custom property set somewhere else in code.)

This has worked very reliably for me and I have been able to customize the fields to the look and feel of the app, as you want to do.
Let me know if that helps.

-Jacob

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Option Menu on iPad

Post by Mag » Wed Jun 04, 2014 11:58 am

Thank you so much Jacob, I will try this way, seems very smart!

PS
BTW, in the mean time I found a simple way to hide an Option Menu and let it to work normally: just put a regular button over it and then make it disabled.

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Option Menu on iPad

Post by quailcreek » Tue Jun 24, 2014 2:16 am

You can also create a pickwheel like this. It can be in a button, field or whatever. This one collects all the names of the cards in the stack.

Code: Select all

on mouseUp
   if the environment is "mobile" then
      repeat with x = 1 to the number of cards
         put the short name of card x & cr after tCardList
      end repeat
      
      put tCardList into pickList
      iphonePick pickList ,1,"CancelDone"
      put the result into ItemPicked
      visual effect push left normal
      go cd ItemPicked
   end if
end mouseUp
Tom
MacBook Pro OS Mojave 10.14

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Option Menu on iPad

Post by Mag » Tue Jun 24, 2014 6:24 am

Thank you quailcreek

Post Reply