It is currently Thu Jun 29, 2017 9:07 am



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  [ 30 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: GUI layout
Unread postPosted: Wed Dec 07, 2016 3:15 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 867
Location: France
oops Nicolas : how to display d.clientWidth and d.clientHeight after using you JS ?

_________________
"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: GUI layout
Unread postPosted: Wed Dec 07, 2016 3:20 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5545
Location: Paris, France
If you want them in your BASIC! program:
Code:
d$="document.documentElement."
JS("RFO("+d$+"clientWidth)") : vw = VAL(GW_WAIT_ACTION$()) % viewport width
JS("RFO("+d$+"clientHeight)") : vh = VAL(GW_WAIT_ACTION$()) % viewport height

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: GUI layout
Unread postPosted: Wed Dec 07, 2016 3:57 am 
Offline

Joined: Wed Feb 20, 2013 3:25 pm
Posts: 423
Location: Italy
What would you think of these two new functions for GW_UTILS 1.1?

Luca

Code:
FN.DEF GW_GET_CLIENT_WIDTH()
  script$ ="RFO(document.documentElement.clientWidth)"
  JS(script$)
  e$ = GW_WAIT_ACTION$()
  IF IS_NUMBER(e$) THEN FN.RTN VAL(e$) ELSE FN.RTN 0
FN.END

FN.DEF GW_GET_CLIENT_HEIGHT()
  script$ ="RFO(document.documentElement.clientHeight)"
  JS(script$)
  e$ = GW_WAIT_ACTION$()
  IF IS_NUMBER(e$) THEN FN.RTN VAL(e$) ELSE FN.RTN 0
FN.END


Top
 Profile  
 
 Post subject: Re: GUI layout
Unread postPosted: Wed Dec 07, 2016 3:58 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5545
Location: Paris, France
Sure Luca :) go ahead

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: GUI layout
Unread postPosted: Wed Dec 07, 2016 5:16 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 867
Location: France
mougino wrote:
If you want them in your BASIC! program:
Code:
d$="document.documentElement."
JS("RFO("+d$+"clientWidth)") : vw = VAL(GW_WAIT_ACTION$()) % viewport width
JS("RFO("+d$+"clientHeight)") : vh = VAL(GW_WAIT_ACTION$()) % viewport height


Oops ! my fault :oops: typo error :oops:

So 1280 x 800 on my 2560x1600 tablet 8" and 640 x 360 on my 1280x720 Samsung A3 !!!

Very difficult to image a way to get out of this oddness :evil: :?

Gilles

PS: All those dimensions are near to the half of true ones or I dream !?

_________________
"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: GUI layout
Unread postPosted: Wed Dec 07, 2016 6:29 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5545
Location: Paris, France
Yes, that is the goal Gilles. That is why a jQM page looks "bigger" than an old (non-responsive) PC web page opened in your Android browser.
Did you read the great article in French I told you before ? ;)
http://www.alsacreations.com/article/lire/1490-comprendre-le-viewport-dans-le-web-mobile.html

[edit] Taken from this article, the following 2 images are most important. They demonstrate that the viewport makes HTML pages more readable on a smartphone even if it has the same "resolution" as a PC screen, because the resolution may be the same, but the pixels are much smaller (thus the human eye needs a "fake" bigger resolution on smartphone, AKA "the viewport")

Without a "viewport":

Image

And with a "viewport":

Image

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: GUI layout
Unread postPosted: Fri Dec 09, 2016 9:49 am 
Offline

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

Did you make any progress on your ideas for uniform GUI layouts across different screen sizes? (also considering the workarounds suggested on stackoverflow that you mentioned).
Maybe could something be shipped with GW 4.6?

Luca


Top
 Profile  
 
 Post subject: Re: GUI layout
Unread postPosted: Fri Dec 09, 2016 10:32 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5545
Location: Paris, France
I made some progress but still needs more time ;)
Thanks for your patience!

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: GUI layout
Unread postPosted: Mon Dec 12, 2016 5:30 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5545
Location: Paris, France
Guys, what should be the default layout shared by smartphone screens and bigger tablet screens ?
Should the label of INPUT controls (and the like) always stand on their own line ?
Or should they always be inline with their associated control ? (but this could cause some ugly things when you choose a small SELECTBOX item, label and control will be on the same line, but if you choose another longer SELECTBOX item, the control will go to next line, and only at that time...)

Thanks for your feedback!

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: GUI layout
Unread postPosted: Mon Dec 12, 2016 7:11 am 
Offline

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

I think the default should be the label on its own line (this solution is the more robust and should be good bor both small and big screens), but it would also be nice to give the choice to the programmer.
Anyway if that choice cannot be given, with SHELF it would be always possible to have label and control on the same line. If, on the contrary default were label on the same line as the control, then one could not put manually label and control on different lines because the space between those two lines is too big and the thing becomes ugly (and it isn't clear to which control the label refers to).

Luca


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


Who is online

Users browsing this forum: No registered users and 1 guest


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