Need a different MobilePick than the generic LC picker. - Solved

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Need a different MobilePick than the generic LC picker. - Solved

Post by DR White » Sat Mar 06, 2021 5:00 pm

The generic LC picker does not allow me to include enough text for the user to make the proper choice.
I need a picker that would support the following text:

'Run' side of Run/Off/Auto selector switch has bad connection

What are the possible options?

Thanks,

David
Last edited by DR White on Sun Mar 07, 2021 3:13 pm, edited 3 times in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Need a different picker than the generic LC picker.

Post by richmond62 » Sat Mar 06, 2021 5:18 pm

Not quite sure what you are writing about, but suspect your 'problem' may
lie with using slash symbols:
-
SShot 2021-03-06 at 18.16.18.png
-
Note that your line gets cut off at the first '/' while mine

Camels are bad-tempered beasts that have been know to bite people's finger off

does not.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10321
Joined: Wed May 06, 2009 2:28 pm

Re: Need a different picker than the generic LC picker.

Post by dunbarx » Sat Mar 06, 2021 5:24 pm

Hi.

I am with Richmond here. What is a "picker"?

He may be on to something by pointing out the slashes in your string. Is that string used to build a pathname to some external file, perhaps with an "ask file" command?

Craig

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Need a different picker than the generic LC picker.

Post by DR White » Sat Mar 06, 2021 5:25 pm

I should have given more info on the "picker".

I am talking about using:

mobilePick optionList1, initialIndex1 [, optionList2, initialIndex2 ...] [, style ] [, button] [, view]

It does not support multiple lines or smaller text so that the long text of:

'Run' side of Run/Off/Auto selector switch has bad connection

can be selected as a pick on the mobilePick.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Need a different MobilPick than the generic LC picker.

Post by richmond62 » Sat Mar 06, 2021 5:28 pm

Aha.

That is rather different from what I thought you meant. :)

My mistake was zooming in on "generic LC picker".

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10050
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Need a different MobilePick than the generic LC picker.

Post by FourthWorld » Sat Mar 06, 2021 6:17 pm

Dr White, your description was fine. You explicitly noted "MobilePick" in the subject line, quite sufficient to convey context.

IIRC the picker LC provides with MobilePick is derived from the OS. Either way, the amount of text you want to display there is uncommonly long for a mobile picker. In such an ephemeral context it's a lot to ask the user to take in.

Are all the options in your picker that long?

Might there be another, more on-screen way to allow the user to selection that option, such as a custom form of radio control made from groups?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Need a different MobilePick than the generic LC picker.

Post by DR White » Sat Mar 06, 2021 6:28 pm

Yes, I know the given text for the mobilePick is unusually long and really goes beyond what a mobilePick was intended for.

It is for an educational app that I am working on to teach electrical troubleshooting skills. After the user analyzes the circuit, the user
will choose one of the items from the list below:

Overload Tripped
CB 2 Tripped
E Stop Open
FWD Coil Open
REV Coil Open
'Run' side of Run/Off/Auto selector switch has bad connection
'Auto' side of Run/Off/Auto selector switch has bad connection
PLC Output O:01/00 is Bad (open)
PLC Output O:01/00 is Bad (shorted)
PLC Output O:01/01 is Bad (open)
PLC Output O:01/01 is Bad (shorted)
FWD AUX 1 Bad Connection
FWD AUX 2 Bad Connection
REV AUX 1 Bad Connection
REV AUX 2 Bad Connection
-- I Give Up. Please give me the answer. --

I like the behavior of the MobilePick. Radio button seem so outdated for a phone app.
What are some other options?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10050
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Need a different MobilePick than the generic LC picker.

Post by FourthWorld » Sat Mar 06, 2021 6:33 pm

I'm inclined to consider a scrollable grouped set of fields as a custom picker. This would allow not only ample room for long entries, but can even provide subtext below the choice for further clarification, if that would be useful. But even with just the text itself, such a group would give you plenty of room, and in a context where the user can patiently review the options to make the best choice.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Need a different MobilePick than the generic LC picker.

Post by DR White » Sat Mar 06, 2021 6:46 pm

That sounds great!

I had thought about something like that, but in the past I have experienced issues on Android platforms. On Android, when the user goes to scroll a group of selectable items, the item is selected during the scrolling process. With iOS, the selectable item is not able to be selected until the scroller has stopped (same code used in both platforms, just different platforms gives different behaviors to the same control). Have you got a solution for this? Maybe you can give me an example, although right now I am running Xcode 12.4 and LC will not support any of its simulators.

Davidv
Posts: 77
Joined: Sun Apr 09, 2006 1:51 am

Re: Need a different MobilePick than the generic LC picker.

Post by Davidv » Sat Mar 06, 2021 10:39 pm

DR White wrote:
Sat Mar 06, 2021 6:28 pm
....
I like the behavior of the MobilePick. Radio button seem so outdated for a phone app.
What are some other options?
Shorten it? I can knock off 25% without changing essential content or sequence, thus:
'Run’ [Run/Off/Auto selector]: bad connection

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Need a different MobilePick than the generic LC picker.

Post by DR White » Sat Mar 06, 2021 11:47 pm

Davidv,

I don't think "'Run’ [Run/Off/Auto selector]: bad connection" will fit on iOS picker.
However, I will try it when LC supports Xcode 12.4.

Thanks,

David

Davidv
Posts: 77
Joined: Sun Apr 09, 2006 1:51 am

Re: Need a different MobilePick than the generic LC picker.

Post by Davidv » Sun Mar 07, 2021 12:00 am

No problem. I do not know the particular limit, though even my preservationist effort has a few redundant characters. Significant improvement on length may require either making more assumptions about user understanding or placing some information in a header over the picker. I see that your longest other string is 35 chars, presumably an acceptable length compared with my 45 (I can make it 42...).

Davidv

eta: one can drop it to 35 simply by removing " selector" and the colon.

bwmilby
Posts: 462
Joined: Wed Jun 07, 2017 5:37 am
Contact:

Re: Need a different MobilePick than the generic LC picker.

Post by bwmilby » Sun Mar 07, 2021 2:16 am

DR White wrote:
Sat Mar 06, 2021 6:46 pm
On Android, when the user goes to scroll a group of selectable items, the item is selected during the scrolling process. With iOS, the selectable item is not able to be selected until the scroller has stopped (same code used in both platforms, just different platforms gives different behaviors to the same control). Have you got a solution for this?
I think that Jacque has some code that handles this. Essentially you record the touch position on mouseDown and only process the mouseUp as a tap if the position hasn't changed (i.e. is was a tap and not a scroll).

Here's a behavior script that may be helpful for inspiration:
https://github.com/Himalayan-Academy/Si ... codescript

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Need a different MobilePick than the generic LC picker.

Post by DR White » Sun Mar 07, 2021 3:12 pm

Sounds Good!

I will try it when LC releases the update to support Xcode 12.4.

Thanks so much,

David

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Need a different MobilePick than the generic LC picker. - Solved

Post by DR White » Sun Mar 07, 2021 3:48 pm

I have never used "Command".
I have looked in dictionary, but not much description.
How is it different from "On xxx" (ex On OpenCard)?

Post Reply