Tablet user view style - Any way to get Better looking ? P/L

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by jacque » Tue Feb 27, 2018 8:59 pm

FullScreenMode is a very specific mode only occasionally needed by mobile apps, and very rarely needed on the desktop. I haven't explored fullScreenMode on Windows in a while, but on Linux it has a behavior that sounds somewhat similar to what you describe, but whether it's a bug or not will depend on knowing more about your situation.
FullscreenMode isn't just rarely needed unless you're Richard. :) I use it in every mobile app I've made since it was introduced. It does not cause the problem described.

The "freeze" is more likely due to a problem in the debugger.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by bogs » Tue Feb 27, 2018 9:39 pm

Image Watching these two dance is very educational :mrgreen:
Image

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by jacque » Tue Feb 27, 2018 10:10 pm

We old-timers dance a lot. :) But we love each other.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by bogs » Tue Feb 27, 2018 10:17 pm

OH you yungins an yer weys :D Now get off my lawn :twisted:
Image

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by FourthWorld » Tue Feb 27, 2018 11:19 pm

jacque wrote:
Tue Feb 27, 2018 8:59 pm
FullscreenMode isn't just rarely needed unless you're Richard. :)
I didn't write "rarely desirable", just "rarely needed". If you like what it does, use it.

When I study apps like GMail, YouTube, Evernote, Google Maps, Apple Maps, LinkedIn, Facebook, Twitter, and others, I see that they use dynamic positioning. What those UIs need across all possible screen sizes and orientations is more than scaling one fixed layout can provide.

And on the flipside, when I see Monument Valley I see one of the most beautiful apps ever made, and one for which fullScreenMode is an excellent fit.

There is no single option that is the best for all possible apps. I believe it's helpful to study apps of the sort one aspires to make, and use the options provided for those kinds of apps. Thankfully the documentation for fullScreenMode is as good as for the resizeStack message and related positioning properties, so we can choose among them to do whatever we need for the task at hand.

In this case, the OP's layout has a header and footer of fixed height, with a body region that needs to be adjust dynamically to maintain the header and footer size while filling the space in between.

I would absolutely love a single property setting that could review UI details like that and automatically handle control repositioning for me. But until we get that, we're no worse off than the rest of the world who also nees to handle dynamic positioning in many types of apps like the OPs, using responsive design practices.
I use it in every mobile app I've made since it was introduced.
I've installed a couple of your apps, and I like 'em. Where it works for the types of apps one's making, definitely use it. It's a time saver.

But if your UI could benefit from more precise positioning, fear not. Nearly every desktop app made over the last 20 years has relied on resizeStack handlers to position controls, so it's not like we need to learn much that's new or untested. Besides, LiveCode is a scripting tool; we expect to do some scripting now and then. The most complex layouts I've ever scripted were merely tedious, but not difficult. Most take just a few minutes. These days we have better messaging with groups that can keep layout logic centralized to regions of a card, making the scripting even easier.

And when the specifics of an app's needs allow for the unusual ease of getting exactly what you want with a single property setting, by all means use it.
It does not cause the problem described.
Except on the desktop on non-Mac systems, where he was seeing the problem. What he described with his Windows experience is not entirely consistent with what I've seen here on Windows and Linux, but close enough to a couple bug reports I've submitted that it seemed worth at least temporarily running without fullscreenmode as a quick test.
The "freeze" is more likely due to a problem in the debugger.
If he's running the app while stepping through the debugger, that's a detail I'd overlooked. Yes, stepping through code with the debugger will slow things down tremendously over just letting code run unimpeded. Most definitely repeat the test without the debugger to narrow down possible cause.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

teriibi
Posts: 254
Joined: Mon Nov 13, 2017 3:49 pm
Location: Bolivia

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by teriibi » Wed Feb 28, 2018 12:13 am

Ok,
I posted it on Quality Bug repport too.
Here is the faulty stack bugging under Windows.

...debugger opens, display the problem..and freeezes everything next.

Bug occurs only after adding the number "10" at the end of this line.
(removing it, removes the Freeze problem)

Image

in previous Grouped object test time it also occured with a negativ value..
Image
(could the LOC function be part of the Problem?)
UNFREEZEME.zip
(2.36 KiB) Downloaded 186 times
Attachments
freeze when adding -100  after to me.png
freeze after adding to 10 on line 11 group headbar.png

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by FourthWorld » Wed Feb 28, 2018 2:10 am

Thanks for filing the bug report. Do you have the report ID number or URL? I was unable to find it.

Going forward, please consider pasting code here as text, ideally using the "Code Display" option in the new post form. That makes it much easier to revise code, since we don't have to retype all of it from a screen shot.

One problem I see is the highlighted line from your screen shot. A "loc" or "location" is two items separated by a comma, the first being the horizontal coordinate and the second being the vertical coordinate.

But your code isn't passing a pair of point, just a single integer. The engine won't know whether you mean the horizontal coordinate or the vertical one, so it'll just throw up its hands with an error.

That is, it should report an error. If it's just freezing we have to determine why.

But to make the issue go away, provide a complete point there. If the goal is to set the vertical coordinate, use:

Code: Select all

set the loc of widget 1 to (item 1 of the loc of me),(item 2 of the loc of me - 100)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by FourthWorld » Wed Feb 28, 2018 2:12 am

jacque wrote:
Tue Feb 27, 2018 10:10 pm
We old-timers dance a lot. :) But we love each other.
She's my twin sister from another mother. For decades we've led somewhat parallel lives, at least professionally; not on the same path, but moving in the same direction.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

PBH
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 129
Joined: Sun Feb 20, 2011 4:26 pm
Location: Vancouver Island, BC, Canada. ex.UK
Contact:

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by PBH » Wed Feb 28, 2018 3:31 am

teriibi wrote:
Wed Feb 28, 2018 12:13 am
(could the LOC function be part of the Problem?)
:idea: :idea: :idea:

Yes definitely, that's what I said in the first reply I made. 8)

See the code example both I and Richard supplied, they should help.

The loc of an object has two parameters, for the X and Y coordinates, your code tries to move the loc by one parameter and this is causing the LC engine to go into meltdown!

I tried your stack and it does freeze on Mac too, probably because the error is happening within a resize controls handler. If I try the script outside of the resize handler, it just gives an error, as stated before.

If you check the dictionary for "location" there is a full explanation, but the line that is important to understand is:
"The location of an object is any expression that evaluates to a point --two integers separated by a comma."

Hope this helps.

Paul

teriibi
Posts: 254
Joined: Mon Nov 13, 2017 3:49 pm
Location: Bolivia

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by teriibi » Wed Feb 28, 2018 3:40 am

Yes, I guess I ve learn this by now. Now I m kind of - Glad - it also freezes on other Machines. :lol:

Just to pull the Lion s tale, I added...
Set the Loc of Widget 1 of me to the loc of me 10,A
which obvsiouly was meant to fail with an "A"..and so did it. and Froze again.
Seems to me that not only its fails when its given 1 value but also anyother values.
Its like Debugger is way to sensitive here.

Now how do you do that ? - testing Outside of the resize handler ?
If I try the script outside of the resize handler, it just gives an error, as stated before.

teriibi
Posts: 254
Joined: Mon Nov 13, 2017 3:49 pm
Location: Bolivia

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by teriibi » Wed Feb 28, 2018 3:47 am

Thanks for filing the bug report. Do you have the report ID number or URL?
Its Bug 21017 - Modifying a line :Set the ...of Me with numbers (of me -100) Freezes LC. Windows

PBH
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 129
Joined: Sun Feb 20, 2011 4:26 pm
Location: Vancouver Island, BC, Canada. ex.UK
Contact:

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by PBH » Wed Feb 28, 2018 4:24 am

Set the Loc of Widget 1 of me to the loc of me 10,A
That will just confuse the engine, I'll try to explain.

We'll break this command down to 3 parts:
Part 1 - [Set the Loc of Widget 1 of me] - tells the engine we want to move Widget 1
Part 2 - [to the loc of me] - tells the engine the coordinates for the move, in this case "the loc of me" returns the X and Y coordinates of me! (or the group HeadBar in your example).
Part 3 [10,A] - this doesn't mean anything to the engine as part 2 already contains coordinates, so this is probably causing the freeze.

Simply setting a location would be:
Set the Loc of Widget 1 of me to "10,20"
But, to do a calculation (as previous examples), make each parameter a calculation, so in this example:
Please try this! :D
set the loc of widget 1 to (item 1 of the loc of me + 10),(item 2 of the loc of me)
Would put the widget 10 pixels off centre to the right of the parent group (if that's where the script is).
Now how do you do that ? - testing Outside of the resize handler ?
Just put the line in a different handler, such as mouseUp, then just click on something within the group!

Paul

teriibi
Posts: 254
Joined: Mon Nov 13, 2017 3:49 pm
Location: Bolivia

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by teriibi » Wed Feb 28, 2018 1:22 pm

Yes, it works. Tks for the Guide ref. it has a lil more info in it ! :mrgreen: (never enuf for me :lol: )

As for setting the color of a specific Group Background through code:
Why is this changing colors of "few" of my cards background (but not all...) instead of changing the color from the roundRectangle of my Group named "Mainbody" ?

Code: Select all

  set the backgroundColor of group "MainBody" to "#9f500f"
Line is in the "MainBody" Group Script.
Is mainbody a reserved word ? :roll:

teriibi
Posts: 254
Joined: Mon Nov 13, 2017 3:49 pm
Location: Bolivia

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by teriibi » Wed Feb 28, 2018 1:43 pm

Something is still not clear in my mind talking about : "Widget 1" :!:

Is "Widget 1" refering only to the included "SVG widget","A" ?
..or both Rectangle+SVG ?

When I write:

Code: Select all

 //set the width of widget 1 of me to the width of me * 0.50
   set the width of widget 1 of me to the width of me * 0.20
*see foto below for results after each line is applied.

It seems that what is affected is the RoundRectangle..or the whole group position, and not the "SVG Widget" only.
(as I understand "Widget 1" to refer only to the "SVG Widget")
Is this code tricking me or I dont get what Widget 1 is ?

Image
Attachments
widget 1.png

PBH
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 129
Joined: Sun Feb 20, 2011 4:26 pm
Location: Vancouver Island, BC, Canada. ex.UK
Contact:

Re: Tablet user view style - Any way to get Better looking ? P/L

Post by PBH » Wed Feb 28, 2018 6:55 pm

Please don't take this the wrong way, but I do get the impression that there are quite a few basic LiveCode programming concepts that you don't seem to understand, it appears to me that you are trying to dive in and make an application without first learning about the way LiveCode works. In other words, you seem to be trying to run before you can walk. :?

I did exactly the same many years ago and it led to much frustration, so much so, that I gave up on LiveCode (it was called Revolution then), and moved over to FileMaker. I eventually built a paperless office system for my employer and saved them over £100,000 in the first year it was used, so I know my ideas were good. When I eventually came back to LiveCode I was still a little frustrated with it, but by then LC had started to build a full tutorial system, so I started studying and the difference was huge.

I would recommend that you spend some time over at http://lessons.livecode.com/m/4603
The time you spend learning the basics will be repaid many times over and save you from so much frustration. :shock:

Now to answer your questions:
teriibi wrote:
Wed Feb 28, 2018 1:22 pm
As for setting the color of a specific Group Background through code:
Why is this changing colors of "few" of my cards background (but not all...) instead of changing the color from the roundRectangle of my Group named "Mainbody" ?

Code: Select all

  set the backgroundColor of group "MainBody" to "#9f500f"
Line is in the "MainBody" Group Script.
Is mainbody a reserved word ? :roll:
Quick answer first. "MainBody" is not a reserved word.
Next, setting the background colour of a group will only apply the colour to graphic objects that don't already have a background colour set.
This is where I see your approach may be confusing you, if you want to set the background colour of a specific roundRectangle graphic, then do that, don't try to change it by changing the group. = Confusion :?

Code: Select all

set the backgroundColor of graphic "RectB" to "#9f500f"
Is "Widget 1" refering only to the included "SVG widget","A" ?
..or both Rectangle+SVG ?
Widget 1 is referring just to the Widget. It may help you if you give your controls specific names in the Property Inspector, so I would call the SVG Icon in this case "AmbulanceIcon", then instead of addressing "Widget 1" and not being sure which Widget it is, I could use:

Code: Select all

set the width of widget "AmbulanceIcon" to the width of me * 0.20
= less confusion! :D

From the pictures I can see it looks like the location of the header is changing, so maybe you need to control the location as well as resizing. Sometimes just calculating the size can lead to mathematical rounding errors, so setting the location at the same time can help.

Paul

Post Reply

Return to “Talking LiveCode”