It is currently Wed Jun 28, 2017 3:50 pm



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Thu Dec 01, 2016 8:22 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5543
Location: Paris, France
This works, but it's quite ugly on my phone (opposite of adaptive...)
Code:
FN.DEF GW_PAGE_SCALE(p, zoom)
  script$ ="$(document).ready(function(){"
  script$+="$('body').css({transform:'scale(" +STR$(zoom)+")'"
  script$+=",transformOrigin:'0 0',width:'" +INT$(100/zoom)+"%'});});"
  GW_INJECT_HTML(p, "<script>" + script$ + "</script>")
FN.END

GW_SILENT_LOAD = 1
INCLUDE "GW.bas"

page = GW_NEW_PAGE()
GW_PAGE_SCALE(page, 0.5)
GW_SHELF_OPEN(page)
GW_SHELF_NEWCELL(page) : GW_ADD_TEXT(page, "Text.....1")
GW_SHELF_NEWCELL(page) : GW_ADD_BUTTON(page, "Button.....1", "1")
GW_SHELF_NEWCELL(page) : GW_ADD_BUTTON(page, "Button.....2", "2")
GW_SHELF_NEWCELL(page) : GW_ADD_BUTTON(page, "Button.....3", "3")
GW_SHELF_NEWCELL(page) : GW_ADD_BUTTON(page, "Button.....4", "4")
GW_SHELF_NEWCELL(page) : GW_ADD_BUTTON(page, "Button.....5", "5")
GW_SHELF_CLOSE(page)
GW_RENDER(page)
GW_WAIT_ACTION$()
END

Image

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Thu Dec 01, 2016 10:31 am 
Offline

Joined: Wed Feb 20, 2013 3:25 pm
Posts: 423
Location: Italy
Hi,

Were there really no mistakes in my French? I doubt that... if so then I was just lucky ;)

I think that GW_PAGE_SCALE() should definitely go into GW 4.4.
GW_SET_VIEWPORT() could still be useful in some cases, for example to make the page zoomable by the user if he should find the controls too minuscule.

For example in the latest demo by Nicolas one could add:
GW_SET_VIEWPORT(page, "width=device-width initial-scale=1.0 maximum-scale=1.5")

Luca


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Thu Dec 01, 2016 12:38 pm 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 866
Location: France
Code:
FN.DEF GW_PAGE_SCALE(p, zoom)
  script$ ="$(document).ready(function(){"
  script$+="$('body').css({transform:'scale("+STR$(zoom)+")'"
  script$+=",transformOrigin:'0 0',width:'"+INT$(100/zoom)+"%'});});"
  GW_INJECT_HTML(p, "<script>" + script$ + "</script>")
FN.END

GW_SILENT_LOAD = 1
INCLUDE "GW.bas"

page = GW_NEW_PAGE()
GW_PAGE_SCALE(page, 0.5)
GW_SHELF_OPEN(page)
GW_SHELF_NEWCELL(page) : GW_ADD_TEXT(page, "Text.....1")
GW_SHELF_NEWCELL(page) : GW_ADD_BUTTON(page, "Button.....1", "1")
GW_SHELF_NEWCELL(page) : GW_ADD_BUTTON(page, "Button.....2", "2")
GW_SHELF_NEWCELL(page) : GW_ADD_BUTTON(page, "Button.....3", "3")
GW_SHELF_NEWCELL(page) : GW_ADD_BUTTON(page, "Button.....4", "4")
GW_SHELF_NEWCELL(page) : GW_ADD_BUTTON(page, "Button.....5", "5")
GW_SHELF_CLOSE(page)
GW_ADD_FOOTBAR (page, "&copy;Paul Laughton's RFO Basic! + &copy;Mougino's GW lib")
GW_RENDER(page)
GW_WAIT_ACTION$()
END


I best understand your remark Nicolas by adding a FOOTBAR ;) :oops: :evil:

Gilles

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Thu Dec 01, 2016 12:43 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5543
Location: Paris, France
Cassiope34 wrote:
I best understand your remark Nicolas by adding a FOOTBAR ;) :oops: :evil:

I agree, it's even more obvious with a footbar.
It is barely usable with a scale of 0.5 but perhaps there's a good compromise, like 0.7 or 0.8 ?

[edit] with a scale of 0.7 and forcing landscape, it looks not so bad on my phone... and it should look almost the same ratio/aspect on a 10" tablet.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Thu Dec 01, 2016 3:41 pm 
Offline

Joined: Wed Feb 20, 2013 3:25 pm
Posts: 423
Location: Italy
Hi Gilles,

By using GW_PAGE_SCALE() do you manage to render your LVP page correctly?
Strange that with GW_SET_VIEWPORT() pinching in didn't work... (maybe a little tap to give the page focus was needed before pinching in). Did you notice at least that controls were not garbled any more?

/ L


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Sat Dec 03, 2016 7:14 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 866
Location: France
Sorry for the answer delay Luca :)
I absolutely don't understand why GW_SET_VIEWPORT() (little tap first or not) don't works with my 'lvp' page and perfectely works with your snippet !?

Anyway, as Nicolas and I said: this is not the solution and I can add : for me and for all those who will develop an APP containing GW and intended to be used on a wide variety of devices.

I'm on the best use I can of the new GW_ADD_BAR_RMENU$ command...

Gilles

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Sat Dec 03, 2016 7:39 am 
Offline

Joined: Wed Feb 20, 2013 3:25 pm
Posts: 423
Location: Italy
And did GW_PAGE_SCALE() work for you?

/ Luca


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Sat Dec 03, 2016 7:42 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5543
Location: Paris, France
I guess so Luca according to this post from Gilles post34335.html#p34335

But I really think our friend Gilles wants to go in another direction than adapting the screen, he prefers to use the new BAR_RMENU$ ;)

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3, 4


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred