It is currently Tue Apr 25, 2017 7:32 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  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: What about the idea of add a GW_MENU(page, arra$[] ) to GW ?
Unread postPosted: Thu Nov 24, 2016 4:56 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
Hello Nicolas,

have you ever thought of adding this command to GW ?

GW_ADD_MENU (mypage, choice$[])

very close to GW_ADD_SELECTBOX (mypage, "My selectbox", values$[]) but without the "text" and its position always at the top right.

Could be called by a RBUTTON (with its "icon=bars" ;) ) on the TITLEBAR...

To my mind we find this configuration in many APK, so users are accustomed !

What do you think ?

Cheers

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: What about the idea of add a GW_MENU(page, arra$[] ) to
Unread postPosted: Thu Nov 24, 2016 6:54 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5485
Location: Paris, France
Hi Gilles,

GW library is based on jQuery Mobile.

There is no native control of what you call a MENU in jQM.
There is however several replacements, one of them being a PANEL.

What you describe can be done in a few lines of code with a PANEL and a few BUTTONS for options:
Code:
include "GW.bas"
p = GW_NEW_PAGE()

! Create a right-side panel with some options:
GW_USE_THEME_CUSTO_ONCE("icon=plus")
panel$  = GW_ADD_BUTTON$("Add object", "ADD")
GW_USE_THEME_CUSTO_ONCE("icon=edit")
panel$ += GW_ADD_BUTTON$("Edit object", "EDIT")
GW_USE_THEME_CUSTO_ONCE("icon=delete")
panel$ += GW_ADD_BUTTON$("Remove object", "DEL")
GW_USE_THEME_CUSTO_ONCE("style='color:blue'")
panel$ += GW_ADD_BUTTON$("CANCEL", "CLOSE")
GW_USE_THEME_CUSTO_ONCE("position=right")
panel = GW_ADD_PANEL(p, panel$)

! Add a titlebar with a button to open the panel:
GW_USE_THEME_CUSTO_ONCE("notext icon=gear")
rb$ = GW_ADD_BAR_RBUTTON$(">" + GW_SHOW_PANEL$(panel))
GW_ADD_TITLEBAR(p, GW_ADD_BAR_TITLE$("My App") + rb$)

! Rest of the page
GW_ADD_TEXT(p, "List of objects:")
FOR i=1 TO 4
  GW_ADD_TEXTBOX(p, "Object #" + INT$(i))
NEXT

GW_RENDER(p)
DO
  r$ = GW_WAIT_ACTION$()
  POPUP r$
UNTIL r$ = "BACK"


Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: What about the idea of add a GW_MENU(page, arra$[] ) to
Unread postPosted: Wed Nov 30, 2016 4:34 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
Hi Nicolas,

because I don't like very much the 'PUSH' effect of the panel I'd prefer this way :

Code:
include "GW.bas"
array.load menu$[], "MENU", "Catégories", "Chercher", "Ajouter", "Quitter"
p = GW_NEW_PAGE()

! Create a title + menu button:
GW_SHELF OPEN (p)
GW_INJECT_HTML (p, "<style>.ui.body{background-color:EDEDED}</style>")
GW_USE_THEME_CUSTO_ONCE ("style='font-weight:bold ; font-size:110% ; text-align:center'")
GW_ADD_TEXT (p, "Test of MENU button")
GW_SHELF_NEWCELL (p)
lv = GW_ADD_SELECTBOX (p, "", menu$[])
id_lv = GW_ADD_LISTENER (p, "change", "MENU")
GW_SHELF_CLOSE (p)
GW_RENDER(p)
DO
  r$ = GW_WAIT_ACTION$()
  POPUP r$
  if r$ = "MENU"
    act = GW_GET_VALUE (lv)
    GW_MODIFY (lv, "selected", int$(1))
    POPUP menu$[act]
  endif
UNTIL r$ = "BACK" | act = 5

But the link jquerymobile 1.4.5 you give is very instructive ;)
Could you easily keep the "display" panel parameter that can be 'overlay' or 'push' or by default 'reveal' ?

In the web site I also found maybe a way for you to create a titlebar MENU button ? ( All down of the Widgets / Toolbar page )
Attachment:
Image 5.jpg
Image 5.jpg [ 92.18 KiB | Viewed 170 times ]

obviously the selectbox (menubox ;) ) placed at the right side of the title bar :)
What do you think Nicolas ?

Cheers

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: What about the idea of add a GW_MENU(page, arra$[] ) to
Unread postPosted: Wed Nov 30, 2016 5:10 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5485
Location: Paris, France
Cassiope34 wrote:
Could you easily keep the "display" panel parameter that can be 'overlay' or 'push' or by default 'reveal' ?

Please do not forget to read the GW commands reference aka the "cheatsheet" :twisted:

See the command GW_DEFAULT_TRANSITIONS and the table below (or also the command GW_SET_TRANSITION).
Panels have 2 transition effects other than "push": "reveal" (panel is under the page) or "overlay" (panel is on top of the page).
I recommend you use overlay, it is same as used by a menu, except the panel takes all screen height while a menu would be as high as its elements.

SELECTBOX in the TITLE/FOOT BAR: all right :roll: I'll add it to the todo list...

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: What about the idea of add a GW_MENU(page, arra$[] ) to
Unread postPosted: Wed Nov 30, 2016 6:02 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
mougino wrote:
SELECTBOX in the TITLE/FOOT BAR: all right :roll: I'll add it to the todo list...

Nicolas

Yesss !! cool Nicolas :)

mougino wrote:
Please do not forget to read the GW commands reference aka the "cheatsheet" :twisted:.

I'm only doing this right now to try to make the best use of your library :evil: :roll: :)
But sometimes something escapes my vigilance :oops:
I tried the 2 commands GW_DEFAULT_TRANSITIONS ("PANEL=overlay") and GW_SET_TRANSITION(panel, "overlay") on your example upper and I can not make any of them work !?

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: What about the idea of add a GW_MENU(page, arra$[] ) to
Unread postPosted: Wed Nov 30, 2016 6:11 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5485
Location: Paris, France
GW_DEFAULT_TRANSITIONS ("panel=overlay") is to be used before page creation as indicated in the cheatsheet.

GW_SET_TRANSITION(panel, "overlay") of course works if your panel id is 'panel' i.e. you did a panel = GW_ADD_PANEL(..., is that the case?

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: What about the idea of add a GW_MENU(page, arra$[] ) to
Unread postPosted: Wed Nov 30, 2016 7:21 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
Code:
include "GW.bas"
! GW_DEFAULT_TRANSITIONS ("panel=overlay")   % uncomment to try
p = GW_NEW_PAGE()

! Create a right-side panel with some options:
GW_USE_THEME_CUSTO_ONCE("icon=plus")
panel$  = GW_ADD_BUTTON$("Add object", "ADD")
GW_USE_THEME_CUSTO_ONCE("icon=edit")
panel$ += GW_ADD_BUTTON$("Edit object", "EDIT")
GW_USE_THEME_CUSTO_ONCE("icon=delete")
panel$ += GW_ADD_BUTTON$("Remove object", "DEL")
GW_USE_THEME_CUSTO_ONCE("style='color:blue'")
panel$ += GW_ADD_BUTTON$("CANCEL", "CLOSE")
GW_USE_THEME_CUSTO_ONCE("position=right")
panl = GW_ADD_PANEL(p, panel$)
GW_SET_TRANSITION (panl, "overlay")    % seems not working !?    comment if you want to try the upper GW_DEFAULT_TRANSITIONS (...)

! Add a titlebar with a button to open the panel:
GW_USE_THEME_CUSTO_ONCE("notext icon=gear")
rb$ = GW_ADD_BAR_RBUTTON$(">" + GW_SHOW_PANEL$(panl))
GW_ADD_TITLEBAR(p, GW_ADD_BAR_TITLE$("My App") + rb$)

! Rest of the page
GW_ADD_TEXT(p, "List of objects:")
FOR i=1 TO 4
  GW_ADD_TEXTBOX(p, "Object #" + INT$(i))
NEXT

GW_RENDER(p)
DO
  r$ = GW_WAIT_ACTION$()
  POPUP r$
UNTIL r$ = "BACK"


I can not make any of them work.

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: What about the idea of add a GW_MENU(page, arra$[] ) to
Unread postPosted: Wed Nov 30, 2016 8:23 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5485
Location: Paris, France
You're onto something Gilles they seem broken indeed...
I'll need to investigate (and thanks for the snippet btw!)

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: What about the idea of add a GW_MENU(page, arra$[] ) to
Unread postPosted: Thu Dec 01, 2016 12:43 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5485
Location: Paris, France
Panel transitions are fixed in GW v4.4 that will come shortly.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: What about the idea of add a GW_MENU(page, arra$[] ) to
Unread postPosted: Thu Dec 01, 2016 1:57 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
Thanks Nicolas,

and you think the GW v4.4 will come with the able put a SELECTBOX in the TITLE/FOOT BAR too?

Cheers

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  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 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