When a desktop theme manager isn't available, LC reverts to its built-in emulated Motif, hence the odd appearance (which is awesome if you love NeXT, and horribly confusing to literally every newcomer if they're not ancient enough to remember the old Unix UI and know the intricacies of MetaCard's history, or even what MetaCard was).

For mobile, LC suggests hand-scripting a overlay object to handle the user interation and graphical feedback for scrollable controls like fields and groups.

In practice, most devs I know don't type those manually, but have written their own routines that automatically instantiate mobile scrollers by examining controls on preOpenCard and setting up the scrollers as needed.

I do not know why this is impossible for the engine to do, but it's easy enough to work around in a script.

--
 Richard Gaskin
 Fourth World Systems



Mobile Wondering <was Maximum field height?>
Neville Smythe neville.smythe at optusnet.com.au
Mon Apr 6 13:50:27 EDT 2020

    Previous message (by thread): Mobile Wondering <was Maximum field height?>
    Next message (by thread): [ANN] This Week in LiveCode 220
    Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

I had been wondering when the third-class status of mobile platforms in the LC 
world, particularly in relation to scrolling fields and groups, would crop up 
here.

Some time ago I looked at converting an iOS project to LC, and was appalled at 
the crude 1984-style appearance of scroll bars. I presume they look that way to 
inhibit their use, since the scrolling idiom on mobile platforms iOS is quite 
different from the desktop. But I reckon the native-scroller thingy which you 
had to use in its place seemed an awful hack:  its appearance in a different 
layer meant other objects got overwritten in a completely unacceptable way (has 
that changed?); and the separation of the testing regime from the IDE turned 
back the clock on the development process, again to 1984 when you developed on 
the Lisa, tested on the Mac. (Yes, I was there!)

So I developed a custom scrollbar which worked on both desktop and iOS. It is 
doable, with a modicum of fiddly stuff.
You need

1. An installer stack or widget. When you drag a scrollbar template onto a field (or group), it registers the field id with the scrollbar, snaps the scrollbar to fit the field dimensions with the desired vertical or horizontal orientation, and adjusts the thumb to match the field content. It also installs a backscript and frontscript in the stack. 2. The front script captures mouse events/ drag touch gestures intended for the field, filters for scrolling events and diverts those to the appropriate custom scrollbar. For 2-dimensional scrolling I used two separate scrollbars which needed some cross-mediation of gesture directions; a combined double-scrollbar would have been better.
3. The backscript catches changes to the field affecting content, position or 
dimensions which need to be reflected in the scrollbars.

I had it working pretty well, to the point of a mostly complete examples / 
installer stack . You can customise all sorts of things, such as the appearance 
of the thumb and scrollbar background, whether the thumb length should reflect 
field content proportionally or not, visible-on-demand or as-needed or hidden 
thumb, the number of thumb positions - for example you could have a stepper 
with just 5 positions and a custom image as thumb - and even have left side or 
top mounted scrollbars. You could even have a desktop look and feel if you 
wanted, and why not if Apple can flout their own UI guidelines?

The  iOS project lapsed, running the maze of Apple distribution requirements 
became discouraging and I lost interest. But it can be done.

Neville

    Previous message (by thread): Mobile Wondering <was Maximum field height?>
    Next message (by thread): [ANN] This Week in LiveCode 220
    Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

More information about the use-livecode mailing list

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to