It is currently Wed May 24, 2017 12:53 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  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: GW_UTILS
Unread postPosted: Sat Dec 03, 2016 2:54 pm 
Offline

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

I just published the third party lib GW_UTILS.bas (version 1.0) to http://laughton.com/basic/programs/html/GW%20(GUI-Web%20lib)/third-party-libs/.

At present it just contains two functions (GW_PAGE_SCALE and GW_MODIFY_VIEWPORT), but the idea is for it to grow to include additional (small) misc utility functions which could be useful to developers using the GW Library.

If you have suggestions for additional functions to be created and included, or functions which you would like to contribute to the lib, please don't hesitate to raise the issue in the forum (if possible in this thread).

Cheers,
Luca


Top
 Profile  
 
 Post subject: Re: GW_UTILS
Unread postPosted: Sat Dec 03, 2016 5:07 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
Congrats Luca ;)

I'll mention this third-party lib in the next version of the demo, along with a small example.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: GW_UTILS 1.1
Unread postPosted: Wed Dec 07, 2016 6:41 am 
Offline

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

GW_UTILS version 1.1 is on ftp://ftp.laughton.com/html/GW%20(GUI-Web%20lib)/third-party-libs/.

Included functions:

- GW_PAGE_SCALE
- GW_MODIFY_VIEWPORT
- GW_GET_WINDOW_WIDTH
- GW_GET_WINDOW_HEIGHT

Luca


Top
 Profile  
 
 Post subject: Re: GW_UTILS
Unread postPosted: Wed Dec 07, 2016 7:12 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
Not CLIENT_WIDTH/HEIGHT anymore?

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: GW_UTILS
Unread postPosted: Wed Dec 07, 2016 8:06 am 
Offline

Joined: Wed Feb 20, 2013 3:25 pm
Posts: 423
Location: Italy
I called them GW_GET_WINDOW_WIDTH and GW_GET_WINDOW_HEIGHT because I thought it was more understandable, but the JS code is anyway document.documentElement.clientWidth.
Do you think we should use CLIENT instead of WINDOW?

Even about the JS code I saw on the net different schools of thought on how to compute width/height:
- document.documentElement.clientWidth --> should not consider scroll bar
- window.innerWidth --> considers scroll bar
- verge.viewportW --> viewport width in pixels (should be similar to window.innerWidth)

Luca


Top
 Profile  
 
 Post subject: Re: GW_UTILS
Unread postPosted: Thu Dec 08, 2016 2:43 am 
Offline

Joined: Wed Feb 20, 2013 3:25 pm
Posts: 423
Location: Italy
So, will it be WINDOW or CLIENT?

/ L


Top
 Profile  
 
 Post subject: Re: GW_UTILS
Unread postPosted: Thu Dec 08, 2016 2:44 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
It already is WINDOW no? :)
which is fine by me, just wanted confirmation! ;)

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: GW_UTILS
Unread postPosted: Fri Dec 09, 2016 7:58 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
I modified 1 line of GW_UTILS.bas to reflect the architecture change in GW V4.5 (to get rid of LISTs):
Code:
LIST.REPLACE 1, ABS(page), new_page$
becomes
Code:
GW_SET_SKEY("page", page, new_page$)

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: GW_UTILS
Unread postPosted: Fri Dec 09, 2016 9:41 am 
Offline

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

I just bumped GW_UTILS version to 1.2 (aligned with GW 4.5).
No code change.

Luca


Top
 Profile  
 
 Post subject: Re: GW_UTILS
Unread postPosted: Fri Dec 09, 2016 10:13 am 
Offline

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

Actually it doesn't seem to me that GW_PAGE _SCALE and GW_MODIFY_VIEWPORT are incompatible with each other.
Have a look at the following demo, it renders a page initially scaled to the screen, but also pinchable to zoom in up to 1.5 times.

Luca

Code:
GW_SILENT_LOAD = 1
INCLUDE "GW_UTILS.bas"
page = GW_NEW_PAGE()
GW_PAGE_SCALE(page, 0.5)
GW_MODIFY_VIEWPORT(page, "width=device-width initial-scale=1.0 maximum-scale=1.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$()


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  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