Fullscreen mode won’t scale popup controls, tooltips or an

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

Post Reply
Steve Denney
Posts: 101
Joined: Wed Dec 22, 2010 8:17 pm

Fullscreen mode won’t scale popup controls, tooltips or an

Post by Steve Denney » Fri Jul 31, 2015 3:49 am

Hi, it appears that fullscreen mode doesn’t scale popup controls, tooltips or answer dialogues?
I’m working with touchscreen tablets and desktops/laptops. The tablets have similar screen resolutions to the other computers but are physically much smaller, so text and controls need to be larger.
Fullscreen mode is easier to implement than setting the text and size attributes of every stack and control, but Livecode’s fullscreen-mode scaling doesn’t appear to work with popup buttons, tooltops or answer dialogues. Apps automatically scale up to a readable, usable size but the tooltips etc appear tiny.
I can use script to change the text attributes of popup buttons depending on fullscreen mode, so that’s a usable work-around. Short of creating my own dialogue and tooltip stacks (and using modal stack stackName) is there any way to re-scale these?

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Fullscreen mode won’t scale popup controls, tooltips or

Post by MaxV » Fri Jul 31, 2015 4:00 pm

On mobile it's better to use native controls. For security reasons native control must be created by script during the execution of the app.
Native control are drawn by the OS (Android or iOS) over your app, so read mobileControlCreate.
Moreover on mobile you should use answer instead of popup buttons, example:

Code: Select all

answer "Go ahead?" with "Yes" or "No" or "Maybe"
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Steve Denney
Posts: 101
Joined: Wed Dec 22, 2010 8:17 pm

Re: Fullscreen mode won’t scale popup controls, tooltips or

Post by Steve Denney » Fri Jul 31, 2015 11:32 pm

Thanks for taking the time to answer. Sorry, should've said, these tablets are running Windows 8.1 (same OS as desktops use).
If there's a way to use the operating system's 'native controls' that'd be great (but it's only for Android/IOS)

Livecode's popups, answer dialogues and tooltips are all stacks in their own right (I could be wrong about this and everything else).

So the problem is (I feel) that Livecode does not scale a stack within a window (only full-screen).

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Fullscreen mode won’t scale popup controls, tooltips or

Post by MaxV » Mon Aug 03, 2015 8:42 am

Well, I suggest you to work with the Geometry in the property Inspector. See this: http://livecode.wikia.com/wiki/Geometry_manager
Then you have to:

########CODE#######
set the rect of this stack to the screenRect
put the number of controls in temp
repeat with i=1 to temp
set the textsize of control i to 12 #here you can decide font size depending on the height of the stack
end repeat
#####END OF CODE#####
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Fullscreen mode won’t scale popup controls, tooltips or

Post by jacque » Mon Aug 03, 2015 6:49 pm

The geometry manager will only resize and/or reposition objects you've placed on the card, it won't do anything with dynamic controls like tooltips or popdown buttons. If fullscreenmode isn't working for these things I think I'd submit a bug report. But you might try playing with the pixelScale first to see if that helps.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Steve Denney
Posts: 101
Joined: Wed Dec 22, 2010 8:17 pm

Re: Fullscreen mode won’t scale popup controls, tooltips or

Post by Steve Denney » Mon Aug 03, 2015 11:26 pm

Thank you both for replying.
I don’t feel the geometry manager is up to the task. However, I have achieved acceptable results by manually resizing stacks and saving all their attributes in procedures, i.e. long lists of:
set the rect of fld i to…
set the fontSize of fld i to…
And so forth.
This does the job, however… It’s quite tedious to do. It also means that the supported size is forever fixed. As screens get bigger (more pixels) our apps become proportionally smaller until they become unusable. And it means that anytime you edit your work, i.e. reposition, resize, or in any way change a control, then you have to search through your sizing procedures and change them accordingly for that control (for each and every supported size) – and if you don’t your changes will be undone the next time the sizing code runs.
Enter fullscreen mode. Finally, livecode apps resize in a manner consistent with most other software. Image resizing seems much better too, certainly better than anything I’ve been able to achieve by scripting an image size change.
But it only works for stacks that completely fill the screen. They even cover the operating system taskbar.
I think fullscreen is meant for mobile developers.
I feel certain the developers are aware that popup stacks (tooltips, answer dialogues, menu buttons) will not resize.
Here’s my workarounds to date, some are really quite tedious…
I put a Full screen – Shrink toggle btn in the top right corner of every stack.
Where I can the font size is changed for popups (works for some button styles) depending on screen mode (and screen size/resolution).
My own pop up stacks I generally fix in place in the call stack (meaning the popup becomes a group on a card and can’t be dragged around – one could write code to drag groups around, yes).
I have to write my own answer dialogue stacks, drop down menu buttons and pick font sizes to suit.
Tooltips at various sizes I could write also (would be a popup stack).
I was hoping there’d be a feature I was unaware of (something like set resizingDoneProperly to true). Or workaround suggestions like those above (and I have received some, thankyou).
What’s really needed is proportional resizing within a window. Then our livecode apps would behave like most other software. It must be a big job or they would have done it.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Fullscreen mode won’t scale popup controls, tooltips or

Post by jacque » Tue Aug 04, 2015 1:40 am

Try removing the fullscreenmode command and instead use:

Code: Select all

set the pixelscale to 1.5
See if that works. If so, you can vary the scale fraction if you need to.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Steve Denney
Posts: 101
Joined: Wed Dec 22, 2010 8:17 pm

Re: Fullscreen mode won’t scale popup controls, tooltips or

Post by Steve Denney » Tue Aug 04, 2015 2:17 am

Evidently pixelscale is only mobile devices -- generates msg box error saying cannot be set on this platform
And trying to change screenPixelScale causes livecode to crash (windows 7).
Thanks, worth a shot, sounds like would've been great if had worked (and applied only to single app).

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Fullscreen mode won’t scale popup controls, tooltips or

Post by jacque » Tue Aug 04, 2015 4:33 pm

Oops, sorry, I had the wrong term. Try "scaleFactor":

Code: Select all

set the scaleFactor of stack "myApp" to 1.5
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Steve Denney
Posts: 101
Joined: Wed Dec 22, 2010 8:17 pm

Re: Fullscreen mode won’t scale popup controls, tooltips or

Post by Steve Denney » Wed Aug 05, 2015 2:19 am

set the scaleFactor to… !
Thank you ever so much Jacque. So there is scaling within a window. Well I think that’s a major innovation.
It’s not perfect (yet).
Sometimes text no longer fits in a field (meaning text can be larger than the field that previously contained it).
The loc of a scaled stack is misplaced. Seems the loc doesn’t take into account the increased number of pixels – with a larger stack the loc shifts to the upper left. Since presumably this loc shift is proportional to the scale factor it should be possible to work out the actual stack centre point (or rather where you need to set the loc to put the stack where you want it).
Tooltips and popup buttons are unaffected by scaling.
However clearly one can scale within a window and that’s fantastic news.
Thanks again.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Fullscreen mode won’t scale popup controls, tooltips or

Post by jacque » Wed Aug 05, 2015 8:28 pm

I'd say the lack of scaling on tooltips is a bug and you should report it. It was probably an oversight. I didn't see any problems with text fitting into a field, the field size and text seemed to rescale okay. What scalefactors were you testing with? I'll see if I can reproduce it.

The stack loc is easy to overcome, just store the loc of the stack before rescaling and then reset it to the stored value afterward. It looks to me like the current behavior is setting the loc of the stack to the same percentage as the scale factor. That is, if the factor is 1.5, it offsets both items of the stack's location by 1.5 percent and the stack moves right and down. If the factor is 0.5, the stack moves up and left by half it's previous location.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Steve Denney
Posts: 101
Joined: Wed Dec 22, 2010 8:17 pm

Re: Fullscreen mode won’t scale popup controls, tooltips or

Post by Steve Denney » Thu Aug 06, 2015 12:13 am

Scaling doesn’t seem to work on popups. (I haven’t tested much, charging on, but I’d bet it’s a similar story to fullscreenmode.) Includes (meaning not working on) Option menu buttons (only tested pulldown for scaling, others would be the same). Tooltips. For me Tooltips are the only pressing issue – I’m pretty sure I could write a workaround, be a popup stack (and now that could be scaled!) Probably won’t do this unless made to :) (Would need to position scaled tooltip stack if did – more below).
There is a text issue. Can test using ‘Fit content’ for example it changes from 191 (scale 1) to 212 (1.5) when it should stay the same.
It’s a slight concern for me with my current application since users design their own order forms (can create and resize fields then lockLoc is set to true). It’s a pity when wysiwyg isn’t quite the case but it’s not a huge deal. User experience probably depends on font choice – hey, could always suggest fields be created slightly oversize.
Stack loc has an issue. Scale by 1.5 and setting a stack to the screenloc no longer works. I don’t mind. Can centre the stack with the following script…

Code: Select all

on centreStak stackName
   put (the width of stack stackName * the scaleFactor of stack stackName) div 1 into apparentWidth
   put (the height of stack stackName * the scaleFactor of stack stackName) div 1 into apparentHeight
   put item 3 of the screenRect into screenW
   put item 4 of the screenRect into screenH
   put (screenW - apparentWidth) div 2 into horizGap
   put (screenH - apparentHeight) div 2 into vertGap
   set the left of stack stackName to horizGap
   set the top of stack stackName to vertGap
end centreStak
Could obtain a usable stack loc (for the scaled stack) after centring but don’t need to (at present only used for centring).
I’m going to let users change scale factor by increments of .1 between 1 and 1.5 and also have a fullscreen option.
I think scaling and fullscreen is a giant leap. Could be improved, in need of tweaking but so much better than what came before. Again, thanks for the magic words might well not have found them otherwise.

Post Reply